?> <?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
/** * 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; }