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


PHP Manager::getModule方法代碼示例

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


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

示例1: checkAccess

 public function checkAccess($transaction, $access, $deny = false)
 {
     //mdump($transaction);
     //mdump('--------------------');
     //mdump($access);
     $module = Manager::getModule();
     $ok = false;
     if (!is_numeric($access)) {
         $access = $this->access[$access];
     }
     if ($this->auth->isLogged()) {
         $login = $this->auth->getLogin();
         // MLogin object
         $transaction = strtoupper($transaction);
         // Transaction name
         $isAdmin = $login->isAdmin();
         // Is administrator?
         $rights = (int) $login->getRights($transaction);
         // user rights
         $rightsInAll = (int) $login->getRights('ALL');
         // user rights in all transactions
         $ok = ($rights & $access) == $access || ($rightsInAll & $access) == $access || $isAdmin;
         if (!$ok && $deny) {
             $msg = _M('Acesso Negado') . "<br><br>\n" . "<center><big><i><font color=red>" . _M('Transação: ') . "{$transaction}</font></i></big></center><br><br>\n" . _M('Informe um login válido para acessar esta página.') . "<br>";
             //$go = Manager::getCurrentURL();
             //$error = MPrompt::error($msg, $go, $caption, '');
             //Manager::prompt($error, $deny);
             throw new ESecurityException($msg);
         }
     } else {
         if ($deny) {
             $currentUrl = urlencode(Manager::getCurrentURL());
             $module = Manager::getConf('login.module');
             $url = Manager::getURL("{$module}/main.login", array('return_to' => $currentUrl));
             Manager::getPage()->redirect($url);
         }
     }
     return $ok;
 }
開發者ID:joshuacoddingyou,項目名稱:php,代碼行數:39,代碼來源:mperms.php

示例2: getService

 public function getService($service, $module = '')
 {
     $controller = $this->getController();
     $service = Manager::getService(Manager::getApp(), $module == '' ? Manager::getModule() : $module, $service);
     $service->setData();
     return $service;
 }
開發者ID:joshuacoddingyou,項目名稱:php,代碼行數:7,代碼來源:mcomponent.php

示例3: buildURL

 public function buildURL($action = '', $parameters = array())
 {
     //mtrace('buildURL = ' . $action);
     //mtrace($parameters);
     $app = Manager::getApp();
     $module = Manager::getModule();
     if ($action[0] == '@') {
         $url = Manager::getAppURL($app);
         $action = substr($action, 1);
     } elseif ($action[0] == '>') {
         $url = Manager::getAppURL($app);
         $action = substr($action, 1);
     } elseif ($action[0] == '#') {
         $url = Manager::getStaticURL();
         $action = substr($action, 1);
     } else {
         $url = Manager::getAppURL($app);
     }
     //mtrace('url = '. $url);
     $path = '';
     //mtrace("============== buildURL ============");
     //mtrace('*action = ' . $action);
     if ($p = strpos($action, '/')) {
         $index = substr($action, 0, $p);
         $action = substr($action, $p + 1);
     } else {
         $index = $module != '' ? $module : $app;
     }
     //    mtrace('index = ' . $index);
     //    mtrace('action = ' . $action);
     //$action = str_replace('.','/', $action);
     $path = '/' . $action;
     // mtrace('*index = ' . $index);
     //    mtrace('app = ' . $app);
     if ($index != $app) {
         $path = '/' . $index . $path;
     }
     //mtrace('*path = ' . $path);
     if (count($parameters)) {
         $query = http_build_query($parameters);
         $path .= (strpos($path, '?') === false ? '?' : '') . $query;
     }
     $url .= $path;
     //mtrace('url = ' . $url);
     //mtrace("============ end getURL ============");
     return $url;
 }
開發者ID:joshuacoddingyou,項目名稱:php,代碼行數:47,代碼來源:mcontext.php

示例4: dispatch

 public function dispatch($handler, $data)
 {
     //mdump("Handler:dispatch: [$handler]");
     $this->theme = new MTheme();
     $this->manager = Manager::getInstance();
     $module = Manager::getModule();
     //mdump("Handler:dispatch: [$module][$handler]");
     $this->invokeHandler($module, $handler);
     if (!$this->getResult()) {
         $this->renderHandler();
     }
 }
開發者ID:joshuacoddingyou,項目名稱:php,代碼行數:12,代碼來源:mhandler.php

示例5: handlerService

 public function handlerService()
 {
     if ($this->controllerAction == '') {
         $this->controllerAction = $this->context->getService() . '.' . $this->context->getAction();
     }
     mtrace('handler serviceAction=' . $this->controllerAction);
     $this->invokeService(Manager::getApp(), Manager::getModule(), $this->controllerAction);
 }
開發者ID:joshuacoddingyou,項目名稱:php,代碼行數:8,代碼來源:mfrontcontroller.php


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