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


PHP ipsRegistry::current_module方法代碼示例

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


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

示例1: _finalizeAppData


//.........這裏部分代碼省略.........
     self::$vn_build_date = $b;
     self::$vn_build_reason = $r;
     # Figure out default modules, etc
     $_module = IPSText::alphanumericalClean(ipsRegistry::$request['module']);
     $_first = '';
     //-----------------------------------------
     // Set up some defaults
     //-----------------------------------------
     ipsRegistry::$current_application = IPS_APP_COMPONENT;
     if (IPS_AREA == 'admin') {
         //-----------------------------------------
         // Application: Do we have permission?
         //-----------------------------------------
         if (ipsRegistry::$request['module'] != 'login') {
             ipsRegistry::getClass('class_permissions')->return = 0;
             ipsRegistry::getClass('class_permissions')->checkForAppAccess(IPS_APP_COMPONENT);
             ipsRegistry::getClass('class_permissions')->return = 1;
         }
         //-----------------------------------------
         // Got a module
         //-----------------------------------------
         if (ipsRegistry::$request['module'] == 'ajax') {
             $_module = 'ajax';
         } else {
             $fakeApps = ipsRegistry::getClass('output')->fetchFakeApps();
             foreach (ipsRegistry::$modules as $app => $items) {
                 if (is_array($items)) {
                     foreach ($items as $data) {
                         if ($data['sys_module_admin'] and $data['sys_module_application'] == ipsRegistry::$current_application) {
                             if (!$_first) {
                                 # Got permission for this one?
                                 ipsRegistry::getClass('class_permissions')->return = 1;
                                 if (ipsRegistry::getClass('class_permissions')->checkForModuleAccess($data['sys_module_application'], $data['sys_module_key']) === TRUE) {
                                     if (is_dir(IPSLib::getAppDir($data['sys_module_application']) . "/modules_admin/{$data['sys_module_key']}") === TRUE) {
                                         $isFakeApp = false;
                                         foreach ($fakeApps as $tab => $apps) {
                                             foreach ($apps as $thisApp) {
                                                 if ($thisApp['app'] == $app and $thisApp['module'] == $data['sys_module_key']) {
                                                     $isFakeApp = true;
                                                 }
                                             }
                                         }
                                         if (!$isFakeApp) {
                                             $_first = $data['sys_module_key'];
                                         }
                                     }
                                 }
                                 ipsRegistry::getClass('class_permissions')->return = 0;
                             }
                             if (ipsRegistry::$request['module'] == $data['sys_module_key']) {
                                 $_module = $data['sys_module_key'];
                                 break;
                             }
                         }
                     }
                 }
             }
         }
     } else {
         //-----------------------------------------
         // Got a module?
         //-----------------------------------------
         if ($_module == 'ajax') {
             $_module = 'ajax';
         } else {
             foreach (ipsRegistry::$modules as $app => $items) {
                 if (is_array($items)) {
                     foreach ($items as $data) {
                         if (!$data['sys_module_admin'] and $data['sys_module_application'] == ipsRegistry::$current_application) {
                             if (!$_first) {
                                 $_first = $data['sys_module_key'];
                             }
                             if ($_module == $data['sys_module_key']) {
                                 $_module = $data['sys_module_key'];
                                 break;
                             }
                         }
                     }
                 }
             }
         }
     }
     //-----------------------------------------
     // Finish off...
     //-----------------------------------------
     ipsRegistry::$current_module = $_module ? $_module : $_first;
     ipsRegistry::$current_section = ipsRegistry::$request['section'] ? ipsRegistry::$request['section'] : '';
     /* Clean */
     ipsRegistry::$current_module = IPSText::alphanumericalClean(ipsRegistry::$current_module);
     ipsRegistry::$current_section = IPSText::alphanumericalClean(ipsRegistry::$current_section);
     IPSDebug::addMessage("Setting current module to: " . ipsRegistry::$current_module . " and current section to: " . ipsRegistry::$current_section);
     if (IPS_AREA == 'admin') {
         //-----------------------------------------
         // Module: Do we have permission?
         //-----------------------------------------
         ipsRegistry::getClass('class_permissions')->return = 0;
         ipsRegistry::getClass('class_permissions')->checkForModuleAccess(ipsRegistry::$current_application, ipsRegistry::$current_module);
         ipsRegistry::getClass('class_permissions')->return = 1;
     }
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:101,代碼來源:ipsRegistry.php


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