本文整理汇总了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'))));
}
}
示例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')));
}
}
示例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')));
}
}
示例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)));
}
}
示例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'] : '')));
}
}
}
}
示例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'] : '')));
}
}
}
}