当前位置: 首页>>代码示例>>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;未经允许,请勿转载。