[xoops-cvslog 5722] CVS update: xoops2jp/html/modules/legacy/kernel

Back to archive index

Minahito minah****@users*****
2006年 11月 9日 (木) 14:46:39 JST


Index: xoops2jp/html/modules/legacy/kernel/Legacy_Module.class.php
diff -u xoops2jp/html/modules/legacy/kernel/Legacy_Module.class.php:1.1.2.9 xoops2jp/html/modules/legacy/kernel/Legacy_Module.class.php:1.1.2.10
--- xoops2jp/html/modules/legacy/kernel/Legacy_Module.class.php:1.1.2.9	Thu Nov  2 18:57:44 2006
+++ xoops2jp/html/modules/legacy/kernel/Legacy_Module.class.php	Thu Nov  9 14:46:39 2006
@@ -337,28 +337,40 @@
 		// Search preference
 		//
 		if(isset($this->mXoopsModule->modinfo['config'])&&count($this->mXoopsModule->modinfo['config'])>0) {
-			$configInfos=array();
-			foreach($this->mXoopsModule->modinfo['config'] as $config) {
-				if(isset($config['title']))
-					$configInfos[]=@constant($config['title']);
-				if(isset($config['description']))
-					$configInfos[]=@constant($config['description']);
-				if(isset($config['options'])&&count($config['options'])>0) {
-					foreach($config['options'] as $key=>$val) {
-						$configInfos[]=$key;
-					}
-				}
-			}
-
-			$findFlag=true;
+			$findFlag = false;
 			foreach($searchArgs->getKeywords() as $word) {
-				$findFlag&=(stristr(implode(" ",$configInfos),$word)!==false);
+				if (stristr(_PREFERENCES, $word) !== false) {
+					$root =& XCube_Root::getSingleton();
+					$searchArgs->addRecord($this->mXoopsModule->getVar('name'), $root->mController->getPreferenceEditUrl($this->mXoopsModule), _PREFERENCES);
+					$findFlag = true;
+					break;
+				}
 			}
-				
-			if($findFlag) {
-				$searchArgs->addRecord($this->mXoopsModule->getVar('name'),
-				                  XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id='.$this->mXoopsModule->getVar('mid'),
-				                  _PREFERENCES );
+			
+			if ($findFlag) {
+				$configInfos=array();
+				foreach($this->mXoopsModule->modinfo['config'] as $config) {
+					if(isset($config['title']))
+						$configInfos[]=@constant($config['title']);
+					if(isset($config['description']))
+						$configInfos[]=@constant($config['description']);
+					if(isset($config['options'])&&count($config['options'])>0) {
+						foreach($config['options'] as $key=>$val) {
+							$configInfos[]=$key;
+						}
+					}
+				}
+	
+				$findFlag=true;
+				foreach($searchArgs->getKeywords() as $word) {
+					$findFlag&=(stristr(implode(" ",$configInfos),$word)!==false);
+				}
+					
+				if($findFlag) {
+					$searchArgs->addRecord($this->mXoopsModule->getVar('name'),
+					                  XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id='.$this->mXoopsModule->getVar('mid'),
+					                  _PREFERENCES );
+				}
 			}
 		}
 		
@@ -405,24 +417,37 @@
 		// Search help
 		//
 		if ($this->mXoopsModule->hasHelp()) {
-			$root =& XCube_Root::getSingleton();
-			$language = $root->mContext->getXoopsConfig('language');
-			$helpfile = $this->mXoopsModule->getHelp();
-			$dir = XOOPS_MODULE_PATH . "/" . $this->mXoopsModule->getVar('dirname') . "/language/" . $language;
-
-			if (!file_exists($dir . "/" . $helpfile)) {
-				$dir = XOOPS_MODULE_PATH . "/" . $this->mXoopsModule->getVar('dirname') . "/language/" . $language;
-					if (!file_exists($dir . "/" . $helpfile)) {
-						return;
-					}
+			$findFlag = false;
+			
+			foreach($searchArgs->getKeywords() as $word) {
+				if (stristr(_HELP, $word) !== false) {
+					$root =& XCube_Root::getSingleton();
+					$searchArgs->addRecord($this->mXoopsModule->getVar('name'), $root->mController->getHelpViewUrl($this->mXoopsModule), _HELP);
+					$findFlag = true;
+					break;
+				}
 			}
-			$lines = file($dir . "/" . $helpfile);
-			foreach ($lines as $line) {
-				foreach($searchArgs->getKeywords() as $word) {
-					if (stristr($line, $word) !== false) {
-						$url = XOOPS_MODULE_URL . "/legacy/admin/index.php?action=Help&dirname=" . $this->mXoopsModule->getVar('dirname');
-						$searchArgs->addRecord($this->mXoopsModule->getVar('name'), $url, _HELP);
-						return;
+			
+			if (!$findFlag) {
+				$root =& XCube_Root::getSingleton();
+				$language = $root->mContext->getXoopsConfig('language');
+				$helpfile = $this->mXoopsModule->getHelp();
+				$dir = XOOPS_MODULE_PATH . "/" . $this->mXoopsModule->getVar('dirname') . "/language/" . $language;
+	
+				if (!file_exists($dir . "/" . $helpfile)) {
+					$dir = XOOPS_MODULE_PATH . "/" . $this->mXoopsModule->getVar('dirname') . "/language/" . $language;
+						if (!file_exists($dir . "/" . $helpfile)) {
+							return;
+						}
+				}
+				$lines = file($dir . "/" . $helpfile);
+				foreach ($lines as $line) {
+					foreach($searchArgs->getKeywords() as $word) {
+						if (stristr($line, $word) !== false) {
+							$url = XOOPS_MODULE_URL . "/legacy/admin/index.php?action=Help&dirname=" . $this->mXoopsModule->getVar('dirname');
+							$searchArgs->addRecord($this->mXoopsModule->getVar('name'), $url, _HELP);
+							return;
+						}
 					}
 				}
 			}


xoops-cvslog メーリングリストの案内
Back to archive index