当前位置: 首页>>代码示例>>PHP>>正文


PHP aTools::addGlobalButtons方法代码示例

本文整理汇总了PHP中aTools::addGlobalButtons方法的典型用法代码示例。如果您正苦于以下问题:PHP aTools::addGlobalButtons方法的具体用法?PHP aTools::addGlobalButtons怎么用?PHP aTools::addGlobalButtons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aTools的用法示例。


在下文中一共展示了aTools::addGlobalButtons方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getGlobalButtons

 public static function getGlobalButtons()
 {
     $user = sfContext::getInstance()->getUser();
     if ($user->hasCredential('blog_author') || $user->hasCredential('blog_admin')) {
         aTools::addGlobalButtons(array(new aGlobalButton('blog', 'Blog', '@a_blog_admin', 'a-blog-btn'), new aGlobalButton('events', 'Events', '@a_event_admin', 'a-events day-' . date('j'))));
     }
 }
开发者ID:existanze,项目名称:apostropheBlogPlugin,代码行数:7,代码来源:apostropheBlogPluginConfiguration.class.php

示例2: getGlobalButtons

 /**
  * You too can do this in a plugin dependent on a, see the provided stylesheet
  * for how to correctly specify an icon to go with your button. See the
  * apostrophePluginConfiguration class for the registration of the event listener.
  */
 public static function getGlobalButtons()
 {
     // Only if we have suitable credentials
     if (aMediaTools::userHasUploadPrivilege()) {
         aTools::addGlobalButtons(array(new aGlobalButton('media', 'Media', 'aMedia/index', 'a-media', '/admin/media', 'aMedia')));
     }
 }
开发者ID:hashir,项目名称:UoA,代码行数:12,代码来源:aMediaCMSSlotsTools.class.php

示例3: getGlobalButtons

 public static function getGlobalButtons()
 {
     $user = sfContext::getInstance()->getUser();
     if ($user->hasCredential('admin')) {
         aTools::addGlobalButtons(array(new aGlobalButton('polls', 'Polls', '@a_poll_poll_admin', 'a-poll')));
     }
 }
开发者ID:rbolliger,项目名称:apostrophePollPlugin,代码行数:7,代码来源:apostrophePollPluginConfiguration.class.php

示例4: getGlobalButtons

 public static function getGlobalButtons()
 {
     $mediaEnginePage = aPageTable::retrieveBySlug('/admin/media');
     // Only if we have suitable credentials
     $user = sfContext::getInstance()->getUser();
     if ($user->hasCredential('media_admin') || $user->hasCredential('media_upload')) {
         aTools::addGlobalButtons(array(new aGlobalButton('media', 'Media', 'aMedia/index', 'a-media', $mediaEnginePage)));
     }
 }
开发者ID:verenate,项目名称:gri,代码行数:9,代码来源:aMediaCMSSlotsTools.class.php

示例5: getGlobalButtonsInternal

 public static function getGlobalButtonsInternal(sfEvent $event)
 {
     // If we needed a context object we could get it from $event->getSubject(),
     // but this is a simple static thing
     // Add the users button only if the user has the admin credential.
     // This is typically only given to admins and superadmins.
     // TODO: there is also the cms_admin credential, should I differentiate here?
     $user = sfContext::getInstance()->getUser();
     if ($user->hasCredential('admin')) {
         $extraAdminButtons = sfConfig::get('app_a_extra_admin_buttons', array('users' => array('label' => 'Users', 'action' => 'aUserAdmin/index', 'class' => 'a-users'), 'reorganize' => array('label' => 'Reorganize', 'action' => 'a/reorganize', 'class' => 'a-reorganize')));
         // Eventually this one too. Reorganize will probably get moved into it
         // ('Settings', 'a/globalSettings', 'a-settings')
         if (is_array($extraAdminButtons)) {
             foreach ($extraAdminButtons as $name => $data) {
                 aTools::addGlobalButtons(array(new aGlobalButton($name, $data['label'], $data['action'], isset($data['class']) ? $data['class'] : '')));
             }
         }
     }
 }
开发者ID:verenate,项目名称:gri,代码行数:19,代码来源:aTools.php

示例6: getGlobalButtonsInternal

 /**
  * DOCUMENT ME
  * @param sfEvent $event
  */
 public static function getGlobalButtonsInternal(sfEvent $event)
 {
     // If we needed a context object we could get it from $event->getSubject(),
     // but this is a simple static thing
     // Add the users button only if the user has the admin credential.
     // This is typically only given to admins and superadmins.
     $user = sfContext::getInstance()->getUser();
     if ($user->hasCredential('admin')) {
         $extraAdminButtons = sfConfig::get('app_a_extra_admin_buttons', array('users' => array('label' => 'Users', 'action' => 'aUserAdmin/index', 'class' => 'a-users'), 'categories' => array('label' => 'Categories', 'action' => 'aCategoryAdmin/index', 'class' => 'a-categories'), 'tags' => array('label' => 'Tags', 'action' => 'aTagAdmin/index', 'class' => 'a-tags'), 'reorganize' => array('label' => 'Reorganize', 'action' => 'a/reorganize', 'class' => 'a-reorganize')));
         if (is_array($extraAdminButtons)) {
             foreach ($extraAdminButtons as $name => $data) {
                 aTools::addGlobalButtons(array(new aGlobalButton($name, $data['label'], $data['action'], isset($data['class']) ? $data['class'] : '')));
             }
         }
     }
 }
开发者ID:hashir,项目名称:UoA,代码行数:20,代码来源:BaseaTools.class.php


注:本文中的aTools::addGlobalButtons方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。