當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PHPWS_Core::getModules方法代碼示例

本文整理匯總了PHP中PHPWS_Core::getModules方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHPWS_Core::getModules方法的具體用法?PHP PHPWS_Core::getModules怎麽用?PHP PHPWS_Core::getModules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PHPWS_Core的用法示例。


在下文中一共展示了PHPWS_Core::getModules方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: forwardInfo

 private static function forwardInfo()
 {
     $url = PHPWS_Core::getCurrentUrl();
     if ($url == 'index.php' || $url == '') {
         return;
     }
     if (UTF8_MODE) {
         $preg = '/[^\\w\\-\\pL]/u';
     } else {
         $preg = '/[^\\w\\-]/';
     }
     // Should ignore the ? and everything after it
     $qpos = strpos($url, '?');
     if ($qpos !== FALSE) {
         $url = substr($url, 0, $qpos);
     }
     $aUrl = explode('/', preg_replace('|/+$|', '', $url));
     $module = array_shift($aUrl);
     $mods = PHPWS_Core::getModules(true, true);
     if (!in_array($module, $mods)) {
         $GLOBALS['Forward'] = $module;
         return;
     }
     if (preg_match('/[^\\w\\-]/', $module)) {
         return;
     }
     $_REQUEST['module'] = $_GET['module'] =& $module;
     $count = 1;
     $continue = 1;
     $i = 0;
     // Try and save some old links references
     if (count($aUrl) == 1) {
         $_GET['id'] = $_REQUEST['id'] = $aUrl[0];
         return;
     }
     while (isset($aUrl[$i])) {
         $key = $aUrl[$i];
         if (!$i && is_numeric($key)) {
             $_GET['id'] = $key;
             return;
         }
         $i++;
         if (isset($aUrl[$i])) {
             $value = $aUrl[$i];
             if (preg_match('/&/', $value)) {
                 $remain = explode('&', $value);
                 $j = 1;
                 $value = $remain[0];
                 while (isset($remain[$j])) {
                     $sub = explode('=', $remain[$j]);
                     $_REQUEST[$sub[0]] = $_GET[$sub[0]] = $sub[1];
                     $j++;
                 }
             }
             $_GET[$key] = $_REQUEST[$key] = $value;
         }
         $i++;
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:59,代碼來源:Server.php

示例2: removeAssociations

 /**
  * Looks for the user.php in an installed module's inc folder.
  * If found, it runs the public function within.
  */
 public function removeAssociations()
 {
     $modules = PHPWS_Core::getModules(true, true);
     foreach ($modules as $mod) {
         $file = sprintf('%smod/%s/inc/remove_user.php', PHPWS_SOURCE_DIR, $mod);
         if (is_file($file)) {
             require_once $file;
             $function_name = $mod . '_remove_user';
             if (function_exists($function_name)) {
                 $function_name($this->id);
             }
         }
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:18,代碼來源:Users.php

示例3: setPermissions

 public static function setPermissions($id)
 {
     $group = new PHPWS_Group($id, FALSE);
     $modules = PHPWS_Core::getModules();
     foreach ($modules as $mod) {
         $preorder[$mod['title']] = $mod;
     }
     ksort($preorder);
     $modules = $preorder;
     $tpl = new PHPWS_Template('users');
     $tpl->setFile('forms/permissions.tpl');
     $group->loadPermissions(FALSE);
     foreach ($modules as $mod) {
         $mod_template = User_Form::modulePermission($mod, $group);
         if ($mod_template == false) {
             continue;
         }
         $tpl->setCurrentBlock('module');
         $tpl->setData($mod_template);
         $tpl->parseCurrentBlock('module');
     }
     $form = new PHPWS_Form();
     $form->addHidden('module', 'users');
     $form->addHidden('action', 'admin');
     $form->addHidden('command', 'postPermission');
     $form->addHidden('group_id', $id);
     $form->addSubmit('update', dgettext('users', 'Update'));
     $form->addCssClass('update', 'btn btn-primary');
     $template = $form->getTemplate();
     $vars['action'] = 'admin';
     if (!$group->user_id) {
         $vars['group_id'] = $group->id;
         $vars['command'] = 'manageMembers';
         $links[] = PHPWS_Text::secureLink(dgettext('users', 'Members'), 'users', $vars);
         $vars['command'] = 'edit_group';
         $links[] = PHPWS_Text::secureLink(dgettext('users', 'Edit'), 'users', $vars);
     } else {
         $vars['user_id'] = $group->user_id;
         $vars['command'] = 'editUser';
         $links[] = PHPWS_Text::secureLink('<i class="fa fa-edit"></i> ' . dgettext('users', 'Edit'), 'users', $vars, null, dgettext('users', 'Edit user'), 'btn btn-success');
     }
     $template['LINKS'] = implode(' ', $links);
     $template['CHECK_ALL'] = javascriptMod('users', 'check_all', $vars);
     $tpl->setData($template);
     $content = $tpl->get();
     return $content;
 }
開發者ID:par-orillonsoft,項目名稱:phpwebsite,代碼行數:47,代碼來源:User_Form.php

示例4: dropPermissions

 public function dropPermissions()
 {
     $modules = PHPWS_Core::getModules(true, true);
     if (empty($modules)) {
         return false;
     }
     foreach ($modules as $mod) {
         $permTable = Users_Permission::getPermissionTableName($mod);
         $db = new PHPWS_DB($permTable);
         if (!$db->isTable($permTable)) {
             continue;
         }
         $db->addWhere('group_id', $this->id);
         PHPWS_Error::logIfError($db->delete());
         $db = new PHPWS_DB('phpws_key_edit');
         $db->addWhere('group_id', $this->id);
         PHPWS_Error::logIfError($db->delete());
         $db = new PHPWS_DB('phpws_key_view');
         $db->addWhere('group_id', $this->id);
         PHPWS_Error::logIfError($db->delete());
     }
     return true;
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:23,代碼來源:Group.php


注:本文中的PHPWS_Core::getModules方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。