本文整理汇总了PHP中aTools::getGlobalButtonsByName方法的典型用法代码示例。如果您正苦于以下问题:PHP aTools::getGlobalButtonsByName方法的具体用法?PHP aTools::getGlobalButtonsByName怎么用?PHP aTools::getGlobalButtonsByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aTools
的用法示例。
在下文中一共展示了aTools::getGlobalButtonsByName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: include_partial
?>
<?php
if ($sf_user->isAuthenticated() || sfConfig::get('app_a_persistent_global_toolbar', true)) {
?>
<div class="a-ui a-global-toolbar clearfix">
<ul class="a-ui a-controls">
<?php
include_partial('a/apostrophe');
?>
<?php
$buttons = aTools::getGlobalButtonsByName();
?>
<?php
if ($cmsAdmin || count($buttons) || $pageEdit) {
?>
<?php
include_partial('a/globalButtons', array('pageSettings' => $pageSettings, 'addPage' => $addPage));
?>
<?php
}
?>
<li class="a-login">
<?php
示例2: getGlobalButtons
/**
* Returns global buttons as a flat array, either in alpha order or, if app_a_global_button_order is
* specified, in that order. This is used to implement the default behavior. However see also
* aTools::getGlobalButtonsByName() which is much nicer if you want to aggressively customize
* the admin bar
* @return mixed
*/
public static function getGlobalButtons()
{
$buttonsByName = aTools::getGlobalButtonsByName();
$buttonsOrder = sfConfig::get('app_a_global_button_order', false);
if ($buttonsOrder === false) {
ksort($buttonsByName);
$orderedButtons = array_values($buttonsByName);
} else {
$orderedButtons = array();
foreach ($buttonsOrder as $name) {
if (isset($buttonsByName[$name])) {
$orderedButtons[] = $buttonsByName[$name];
}
}
}
return $orderedButtons;
}