本文整理汇总了PHP中Layout::getExtraStyles方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::getExtraStyles方法的具体用法?PHP Layout::getExtraStyles怎么用?PHP Layout::getExtraStyles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::getExtraStyles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jsStyleChange
public function jsStyleChange()
{
$styles = Layout::getExtraStyles();
if (empty($styles) || !isset($_REQUEST['key_id'])) {
return false;
}
$styles[0] = dgettext('layout', '-- Use default style --');
ksort($styles, SORT_NUMERIC);
$key_id = (int) $_REQUEST['key_id'];
$current_style = Layout::getKeyStyle($key_id);
if (empty($current_style)) {
$current_style = 0;
}
$form = new PHPWS_Form('change_styles');
$form->addHidden('module', 'layout');
$form->addHidden('action', 'admin');
$form->addHidden('command', 'post_style_change');
$form->addHidden('key_id', $key_id);
$form->addSelect('style', $styles);
$form->setLabel('style', dgettext('layout', 'Style sheet'));
$form->setMatch('style', $current_style);
$form->addSubmit(dgettext('layout', 'Save'));
$form->addButton('cancel', dgettext('layout', 'Cancel'));
$form->setExtra('cancel', 'onclick="window.close()"');
$template = $form->getTemplate();
$template['TITLE'] = dgettext('layout', 'Change CSS');
return PHPWS_Template::process($template, 'layout', 'style_change.tpl');
}
示例2: extraStyle
public static function extraStyle($filename)
{
$styles = Layout::getExtraStyles();
if (!isset($styles[$filename])) {
return;
}
$link['file'] = Layout::getThemeDir() . $filename;
$GLOBALS['Extra_Style'] = $link;
}
示例3: miniLinks
public static function miniLinks()
{
$vars['action'] = 'admin';
if (Layout::isMoveBox()) {
$vars['command'] = 'turn_off_box_move';
$links[] = PHPWS_Text::moduleLink('<i class="fa fa-toggle-on"></i> ' . dgettext('layout', 'Turn box move off'), 'layout', $vars);
} else {
$vars['command'] = 'move_boxes_on';
$links[] = PHPWS_Text::secureLink('<i class="fa fa-toggle-off"></i> ' . dgettext('layout', 'Turn box move on'), 'layout', $vars);
}
unset($vars['command']);
$vars['tab'] = 'meta';
$links[] = PHPWS_Text::secureLink('<i class="fa fa-edit"></i> ' . dgettext('layout', 'Change Website Title'), 'layout', $vars);
$key = Key::getCurrent();
if (javascriptEnabled() && Layout::getExtraStyles() && Key::checkKey($key)) {
$js_vars['width'] = 400;
$js_vars['height'] = 200;
$vars['key_id'] = $key->id;
$vars['action'] = 'admin';
$js_vars['label'] = '<i class="fa fa-paint-brush"></i> ' . dgettext('layout', 'Change style');
$vars['command'] = 'js_style_change';
$js_vars['address'] = PHPWS_Text::linkAddress('layout', $vars, TRUE);
$links[] = javascript('open_window', $js_vars);
if (!$key->isHomeKey()) {
$js_vars['height'] = 400;
$js_vars['label'] = dgettext('layout', 'Meta tags');
$vars['command'] = 'page_meta_tags';
$js_vars['address'] = PHPWS_Text::linkAddress('layout', $vars, TRUE);
$links[] = javascript('open_window', $js_vars);
}
}
if (!isset($links)) {
return;
}
MiniAdmin::add('layout', $links);
// MiniAdmin runs get before layout and runtime won't work
// with flagged keys
MiniAdmin::get();
}