示例#1
0
 public static function get()
 {
     if (!\Current_User::isLogged()) {
         return;
     }
     $modlist = PHPWS_Core::getModuleNames();
     $tpl['MINIADMIN_TITLE'] = dgettext('miniadmin', 'MiniAdmin');
     $tpl['MINIADMIN_TITLE_ALT'] = dgettext('miniadmin', 'Administrate');
     if (isset($GLOBALS['MiniAdmin'])) {
         foreach ($GLOBALS['MiniAdmin'] as $module => $links) {
             $mod_title = $modlist[$module];
             if (isset($links['title_link'])) {
                 $mod_title = sprintf('<a href="%s">%s</a>', $links['title_link'], $mod_title);
             }
             $module_links[$mod_title] = $links;
         }
         $tpl['module_links'] = $module_links;
     }
     $template = new \Template($tpl);
     $template->setModuleTemplate('miniadmin', MINIADMIN_TEMPLATE);
     $content = $template->get();
     Layout::set($content, 'miniadmin', 'mini_admin');
 }
示例#2
0
 public function getTplTags()
 {
     $module_names = PHPWS_Core::getModuleNames();
     $tpl['ID'] = $this->id;
     $tpl['MODULE'] = $module_names[$this->module];
     $tpl['ITEM_ID'] = $this->item_id;
     $tpl['TITLE'] = $this->title;
     $tpl['URL'] = $this->getUrl();
     $tpl['SUMMARY'] = $this->summary;
     $tpl['CREATOR'] = $this->creator;
     $tpl['UPDATER'] = $this->updater;
     $tpl['CREATE_DATE'] = $this->getCreateDate();
     $tpl['UPDATE_DATE'] = $this->getUpdateDate();
     return $tpl;
 }
示例#3
0
 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;
 }