• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

XOOPS Cube Legacy base repository


Commit MetaInfo

修订版6ebaff06c1a7ca7e27d028c51a495e5b11275724 (tree)
时间2011-11-21 23:06:39
作者nbuy <nbuy@704c...>
Commiternbuy

Log Message

add Module config loading flag for speedup

git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1060 704cf05f-ae62-4b0e-a484-234ee0250e75

更改概述

差异

--- a/html/modules/legacy/admin/blocks/AdminSideMenu.class.php
+++ b/html/modules/legacy/admin/blocks/AdminSideMenu.class.php
@@ -101,9 +101,9 @@ class Legacy_AdminSideMenu extends Legacy_AbstractBlockProcedure
101101
102102 $handler =& xoops_gethandler('module');
103103
104- while($row = $db->fetchArray($result)) {
105- $xoopsModule =& $handler->get($row['mid']);
106- $module =& Legacy_Utils::createModule($xoopsModule);
104+ while(list($mid) = $db->fetchRow($result)) {
105+ $xoopsModule = & $handler->get($mid);
106+ $module =& Legacy_Utils::createModule($xoopsModule, false);
107107
108108 $this->mModules[] =& $module;
109109 unset($module);
--- a/html/modules/legacy/class/Legacy_Utils.class.php
+++ b/html/modules/legacy/class/Legacy_Utils.class.php
@@ -54,14 +54,14 @@ class Legacy_Utils
5454 * @param XoopsModule $module
5555 * @return Legacy_Module
5656 */
57- function &createModule($module)
57+ function &createModule($module, $loadConfig=true)
5858 {
5959 $instance = null;
6060
6161 //
6262 // TODO need cache here?
6363 //
64- XCube_DelegateUtils::call('Legacy_Utils.CreateModule', new XCube_Ref($instance), $module);
64+ XCube_DelegateUtils::call('Legacy_Utils.CreateModule', new XCube_Ref($instance), $module, $loadConfig);
6565
6666 if (is_object($instance) && is_a($instance, 'Legacy_AbstractModule')) {
6767 return $instance;
@@ -81,10 +81,10 @@ class Legacy_Utils
8181 }
8282
8383 if (XC_CLASS_EXISTS($className)) {
84- $instance = new $className($module);
84+ $instance = new $className($module, $loadConfig);
8585 }
8686 else {
87- $instance = new Legacy_ModuleAdapter($module);
87+ $instance = new Legacy_ModuleAdapter($module, $loadConfig);
8888 }
8989
9090 return $instance;
--- a/html/modules/legacy/kernel/Legacy_Module.class.php
+++ b/html/modules/legacy/kernel/Legacy_Module.class.php
@@ -71,11 +71,11 @@ class Legacy_AbstractModule
7171 * Basically, only Legacy_Controller and its utility functions should call the
7272 * constructor.
7373 */
74- function Legacy_AbstractModule(&$module)
74+ function Legacy_AbstractModule(&$module, $loadConfig=true)
7575 {
7676 $this->setXoopsModule($module);
7777
78- if ($module->get('hasconfig') == 1 || $module->get('hascomments') == 1 || $module->get('hasnotification') == 1) {
78+ if ($loadConfig && ($module->get('hasconfig') == 1 || $module->get('hascomments') == 1 || $module->get('hasnotification') == 1)) {
7979 $handler =& xoops_gethandler('config');
8080 $this->setModuleConfig($handler->getConfigsByCat(0, $module->get('mid')));
8181 }
@@ -399,9 +399,9 @@ class Legacy_ModuleAdapter extends Legacy_AbstractModule
399399 */
400400 var $mAdminMenu = null;
401401
402- function Legacy_ModuleAdapter($module)
402+ function Legacy_ModuleAdapter($module, $loadConfig=true)
403403 {
404- parent::Legacy_AbstractModule($module);
404+ parent::Legacy_AbstractModule($module, $loadConfig);
405405 }
406406
407407 /**
@@ -606,7 +606,7 @@ class Legacy_ModuleAdapter extends Legacy_AbstractModule
606606 return $this->mAdminMenu;
607607 }
608608
609- $dmy =& $this->mXoopsModule->getInfo();
609+ $info =& $this->mXoopsModule->getInfo();
610610 $root =& XCube_Root::getSingleton();
611611
612612 //
@@ -614,8 +614,8 @@ class Legacy_ModuleAdapter extends Legacy_AbstractModule
614614 //
615615 $this->mXoopsModule->loadAdminMenu();
616616 if ($this->mXoopsModule->get('hasnotification')
617- || ($this->mXoopsModule->getInfo('config') && is_array($this->mXoopsModule->getInfo('config')))
618- || ($this->mXoopsModule->getInfo('comments') && is_array($this->mXoopsModule->getInfo('comments')))) {
617+ || ($info['config'] && is_array($info['config']))
618+ || ($info['comments'] && is_array($info['comments']))) {
619619 $this->mXoopsModule->adminmenu[] = array(
620620 'link' => $root->mController->getPreferenceEditUrl($this->mXoopsModule),
621621 'title' => _PREFERENCES,
@@ -631,9 +631,10 @@ class Legacy_ModuleAdapter extends Legacy_AbstractModule
631631 $this->_mAdminMenuLoadedFlag = true;
632632
633633 if ($this->mXoopsModule->adminmenu) {
634+ $dirname = $this->mXoopsModule->get('dirname');
634635 foreach ($this->mXoopsModule->adminmenu as $menu) {
635636 if (!isset($menu['absolute']) || (isset($menu['absolute']) && $menu['absolute'] != true)) {
636- $menu['link'] = XOOPS_MODULE_URL . '/' . $this->mXoopsModule->get('dirname') . '/' . $menu['link'];
637+ $menu['link'] = XOOPS_MODULE_URL . '/' . $dirname . '/' . $menu['link'];
637638 }
638639 $this->mAdminMenu[] = $menu;
639640 }