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


PHP Current_User::popupPermission方法代码示例

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


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

示例1: getTpl

 public function getTpl()
 {
     $vars['block_id'] = $this->getId();
     if (Current_User::allow('block', 'edit_block', $this->id)) {
         $vars['action'] = 'edit';
         $links[] = PHPWS_Text::secureLink(Icon::show('edit', dgettext('block', 'Edit')), 'block', $vars);
         if ($this->allPinned()) {
             $vars['action'] = 'remove';
             $links[] = PHPWS_Text::secureLink("<i class='fa fa-flag' title='" . dgettext('block', 'Remove block from all pages') . "'></i>", 'block', $vars);
         } else {
             $vars['action'] = 'pin_all';
             $links[] = PHPWS_Text::secureLink("<i class='fa fa-flag-o' title='" . dgettext('block', 'Display block on all pages') . "'></i>", 'block', $vars);
         }
         if (Current_User::isUnrestricted('block')) {
             $links[] = Current_User::popupPermission($this->key_id, null, 'icon');
         }
     }
     if (Current_User::allow('block', 'delete_block')) {
         $vars['action'] = 'delete';
         $confirm_vars['QUESTION'] = dgettext('block', 'Are you sure you want to permanently delete this block?');
         $confirm_vars['ADDRESS'] = PHPWS_Text::linkAddress('block', $vars, TRUE);
         $confirm_vars['LINK'] = '<i class="fa fa-trash-o" title="' . dgettext('block', 'Delete') . '"></i>';
         $links[] = javascript('confirm', $confirm_vars);
     }
     if (!empty($links)) {
         $template['ACTION'] = implode('', $links);
     } else {
         $template['ACTION'] = ' ';
     }
     if (empty($this->title)) {
         $template['TITLE'] = '<em>' . dgettext('block', 'Untitled') . '</em>';
     }
     if (empty($this->content)) {
         $template['CONTENT'] = '<em>' . dgettext('block', 'Empty') . '</em>';
     } else {
         $template['CONTENT'] = $this->summarize();
     }
     return $template;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:39,代码来源:Block_Item.php

示例2: rowTags

 public function rowTags()
 {
     PHPWS_Core::requireConfig('filecabinet', 'config.php');
     if (FC_ICON_PAGER_LINKS) {
         $mode = 'icon';
         $spacer = '';
     } else {
         $mode = null;
         $spacer = ' | ';
     }
     //$icon = sprintf('<img src="%s" />', $this->icon);
     $vars['aop'] = 'view_folder';
     $vars['folder_id'] = $this->id;
     $tpl['TITLE'] = PHPWS_Text::moduleLink($this->title, 'filecabinet', $vars);
     $tpl['ITEMS'] = $this->tallyItems();
     if (Current_User::allow('filecabinet', 'edit_folders', $this->id, 'folder')) {
         $links[] = $this->editLink('image');
         $links[] = $this->uploadLink('icon');
     }
     if (Current_User::allow('filecabinet', 'edit_folders', $this->id, 'folder', true)) {
         if ($this->key_id) {
             $links[] = Current_User::popupPermission($this->key_id, null, $mode);
         }
     }
     if (Current_User::allow('filecabinet', 'delete_folders', null, null, true)) {
         $links[] = $this->deleteLink('image');
     }
     $mods = PHPWS_Core::getModuleNames();
     if ($this->module_created && isset($mods[$this->module_created])) {
         $tpl['MODULE_CREATED'] = $mods[$this->module_created];
     } else {
         $tpl['MODULE_CREATED'] = dgettext('filecabinet', 'General');
     }
     $tpl['PUBLIC'] = $this->getPublic();
     if (@$links) {
         $tpl['LINKS'] = implode($spacer, $links);
     }
     return $tpl;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:39,代码来源:Folder.php

示例3: rowTag

 public function rowTag()
 {
     $vars['sheet_id'] = $this->id;
     if (Current_User::allow('signup', 'edit_sheet', $this->id, 'sheet')) {
         if (Current_User::isUnrestricted('signup')) {
             $vars['aop'] = 'edit_sheet';
             $links[] = PHPWS_Text::secureLink(\Icon::show('edit', dgettext('signup', 'Edit')), 'signup', $vars);
         }
         $vars['aop'] = 'edit_slots';
         $links[] = PHPWS_Text::secureLink(\Icon::show('th-list', dgettext('signup', 'Slots')), 'signup', $vars);
         if (Current_User::isUnrestricted('signup')) {
             $links[] = Current_User::popupPermission($this->key_id, null, 'icon');
         }
     }
     $vars['aop'] = 'report';
     $links[] = PHPWS_Text::secureLink(\Icon::show('file-text', dgettext('signup', 'Report')), 'signup', $vars);
     if (Current_User::isUnrestricted('signup')) {
         $vars['aop'] = 'delete_sheet';
         $js['ADDRESS'] = PHPWS_Text::linkAddress('signup', $vars, true);
         $js['QUESTION'] = dgettext('signup', 'Are you sure you want to delete this sheet?\\nAll slots and signup information will be permanently removed.');
         $js['LINK'] = \Icon::show('delete');
         $links[] = javascript('confirm', $js);
     }
     $tpl['START_TIME'] = strftime("%D %R", $this->start_time);
     // MM/DD/YY hh:mm 24-hour time format
     $tpl['END_TIME'] = strftime("%D %R", $this->end_time);
     // MM/DD/YY hh:mm 24-hour time format
     $tpl['TITLE'] = $this->viewLink();
     $tpl['ACTION'] = implode('&nbsp;', $links);
     return $tpl;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:31,代码来源:Sheet.php

示例4: permissionMenu

 public static function permissionMenu()
 {
     $key = Key::getCurrent();
     if (empty($key) || $key->isDummy() || empty($key->edit_permission)) {
         return;
     }
     if (Current_User::isUnrestricted($key->module) && Current_User::allow($key->module, $key->edit_permission)) {
         if (!javascriptEnabled()) {
             $tpl = User_Form::permissionMenu($key);
             $content = PHPWS_Template::process($tpl, 'users', 'forms/permission_menu.tpl');
             Layout::add($content, 'users', 'permissions');
         } else {
             $links[] = Current_User::popupPermission($key->id, sprintf(dgettext('users', 'Set permissions'), $key->title));
             MiniAdmin::add('users', $links);
         }
     }
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:17,代码来源:Current_User.php


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