[xoops-cvslog 3777] CVS update: xoops2jp/html/modules/base/class

Zurück zum Archiv-Index

Minahito minah****@users*****
2006年 7月 31日 (月) 19:32:24 JST


Index: xoops2jp/html/modules/base/class/Legacy_ModuleAdapter.class.php
diff -u xoops2jp/html/modules/base/class/Legacy_ModuleAdapter.class.php:1.1.2.7 xoops2jp/html/modules/base/class/Legacy_ModuleAdapter.class.php:1.1.2.8
--- xoops2jp/html/modules/base/class/Legacy_ModuleAdapter.class.php:1.1.2.7	Fri May 12 19:21:11 2006
+++ xoops2jp/html/modules/base/class/Legacy_ModuleAdapter.class.php	Mon Jul 31 19:32:24 2006
@@ -10,25 +10,32 @@
 class Legacy_ModuleAdapter extends XCube_Module
 {
 	var $mAdaptee;
+	
+	/**
+	 * @var XCube_NewDelegate
+	 */
+	var $mSearchAction = null;
 
 	function Legacy_ModuleAdapter(&$xoopsModule)
 	{
-		$this->mAdaptee=&$xoopsModule;
+		$this->mAdaptee =& $xoopsModule;
+		$this->mSearchAction =& new XCube_NewDelegate();
+		$this->mSearchAction->register('Legacy_ModuleAdapter.SearchAction');
 	}
 
 	function prepareAdmin(&$controller)
 	{
 		$this->mAdaptee->loadAdminMenu();
 		if(count($this->mAdaptee->adminmenu)>0 || isset($this->mAdaptee->modinfo['config']) ) {
-			$delegate=new XCube_InstanceDelegate($this,"callbackSearchAction");
-			$controller->mRoot->mEventManager->add("Module.Admin.ActionSearch",$delegate);
+			$controller->mRoot->mDelegateManager->add('Legacy_ActSearchAction.SearchAction', array(&$this, 'callbackSearchAction'));
 		}
 	}
 
-	function callbackSearchAction(&$sender,&$eventArgs)
+	function callbackSearchAction(&$searchArgs)
 	{
-		if(!is_object($eventArgs))
+		if(!is_object($searchArgs)) {
 			return;
+		}
 			
 		//
 		// Search preference
@@ -48,12 +55,12 @@
 			}
 
 			$findFlag=true;
-			foreach($eventArgs->getKeywords() as $word) {
+			foreach($searchArgs->getKeywords() as $word) {
 				$findFlag&=(stristr(implode(" ",$configInfos),$word)!==false);
 			}
 				
 			if($findFlag) {
-				$eventArgs->addRecord($this->mAdaptee->getVar('name'),
+				$searchArgs->addRecord($this->mAdaptee->getVar('name'),
 				                  XOOPS_URL.'/modules/base/admin/index.php?action=PreferenceEdit&confmod_id='.$this->mAdaptee->getVar('mid'),
 				                  _PREFERENCES );
 			}
@@ -65,7 +72,7 @@
 		if(count($this->mAdaptee->adminmenu)>0) {
 			foreach($this->mAdaptee->adminmenu as $menu) {
 				$findFlag=true;
-				foreach($eventArgs->getKeywords() as $word) {
+				foreach($searchArgs->getKeywords() as $word) {
 					$tmpFlag=false;
 					$tmpFlag|=(stristr($menu['title'],$word)!==false);
 
@@ -93,7 +100,7 @@
 					//
 					// Add record
 					//
-					$eventArgs->addRecord($this->mAdaptee->getVar('name'),$url,$menu['title']);
+					$searchArgs->addRecord($this->mAdaptee->getVar('name'),$url,$menu['title']);
 				}
 			}
 		}
@@ -115,10 +122,10 @@
 			}
 			$lines = file($dir . "/" . $helpfile);
 			foreach ($lines as $line) {
-				foreach($eventArgs->getKeywords() as $word) {
+				foreach($searchArgs->getKeywords() as $word) {
 					if (stristr($line, $word) !== false) {
 						$url = XOOPS_MODULE_URL . "/base/admin/index.php?action=Help&dirname=" . $this->mAdaptee->getVar('dirname');
-						$eventArgs->addRecord($this->mAdaptee->getVar('name'), $url, _HELP);
+						$searchArgs->addRecord($this->mAdaptee->getVar('name'), $url, _HELP);
 						return;
 					}
 				}


xoops-cvslog メーリングリストの案内
Zurück zum Archiv-Index