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