[xoops-cvslog 3207] CVS update: xoops2jp/html/modules/base/actions

アーカイブの一覧に戻る

Minahito minah****@users*****
2006年 5月 28日 (日) 14:07:29 JST


Index: xoops2jp/html/modules/base/actions/SearchShowallbyuserAction.class.php
diff -u xoops2jp/html/modules/base/actions/SearchShowallbyuserAction.class.php:1.1.2.1 xoops2jp/html/modules/base/actions/SearchShowallbyuserAction.class.php:1.1.2.2
--- xoops2jp/html/modules/base/actions/SearchShowallbyuserAction.class.php:1.1.2.1	Sat May 27 22:06:25 2006
+++ xoops2jp/html/modules/base/actions/SearchShowallbyuserAction.class.php	Sun May 28 14:07:29 2006
@@ -9,7 +9,7 @@
 {
 	function _setupActionForm()
 	{
-		$this->mActionForm =& new Legacy_SearchShowallbyuserForm();
+		$this->mActionForm =& new Legacy_SearchShowallbyuserForm($this->mConfig['keyword_min']);
 		$this->mActionForm->prepare();
 	}
 	
Index: xoops2jp/html/modules/base/actions/SearchShowallAction.class.php
diff -u xoops2jp/html/modules/base/actions/SearchShowallAction.class.php:1.1.2.1 xoops2jp/html/modules/base/actions/SearchShowallAction.class.php:1.1.2.2
--- xoops2jp/html/modules/base/actions/SearchShowallAction.class.php:1.1.2.1	Sat May 27 22:06:25 2006
+++ xoops2jp/html/modules/base/actions/SearchShowallAction.class.php	Sun May 28 14:07:29 2006
@@ -9,7 +9,7 @@
 {
 	function _setupActionForm()
 	{
-		$this->mActionForm =& new Legacy_SearchShowallForm();
+		$this->mActionForm =& new Legacy_SearchShowallForm($this->mConfig['keyword_min']);
 		$this->mActionForm->prepare();
 	}
 	
Index: xoops2jp/html/modules/base/actions/SearchResultsAction.class.php
diff -u xoops2jp/html/modules/base/actions/SearchResultsAction.class.php:1.1.2.1 xoops2jp/html/modules/base/actions/SearchResultsAction.class.php:1.1.2.2
--- xoops2jp/html/modules/base/actions/SearchResultsAction.class.php:1.1.2.1	Sat May 27 22:06:25 2006
+++ xoops2jp/html/modules/base/actions/SearchResultsAction.class.php	Sun May 28 14:07:29 2006
@@ -10,29 +10,46 @@
 	var $mSearchResults = array();
 	var $mModules = array();
 	
+	var $mConfig = array();
+	
 	function prepare(&$controller, &$xoopsUser)
 	{
 		$root =& $controller->mRoot;
 		$root->mLanguageManager->loadModuleLanguage('base');
 		
+		$handler =& xoops_gethandler('config');
+		$this->mConfig =& $handler->getConfigsByCat(XOOPS_CONF_SEARCH);
+		
 		$this->_setupActionForm();
 	}
 	
 	function _setupActionForm()
 	{
-		$this->mActionForm =& new Legacy_SearchResultsForm();
+		$this->mActionForm =& new Legacy_SearchResultsForm($this->mConfig['keyword_min']);
 		$this->mActionForm->prepare();
 	}
 	
+	function hasPerm(&$controller, &$xoopsUser)
+	{
+		if ($this->mConfig['enable_search'] != 1) {
+			XCube_Utils::redirectHeader(XOOPS_URL, 3, _MD_BASE_ERROR_SEARCH_NOT_ENABLED);
+			return false;
+		}
+		return true;
+	}
+	
 	function getDefaultView(&$controller, &$xoopsUser)
 	{
 		$this->mActionForm->fetch();
 		$this->mActionForm->validate();
+		
+		if ($this->mActionForm->hasError()) {
+			return LEGACY_FRAME_VIEW_INDEX;
+		}
 
 		//
 		// TODO ErrorHandling
 		//
-				
 		$root =& $controller->mRoot;
 		$service =& $root->mServiceManager->searchXCubeService("LegacySearch");
 		if ($service) {
@@ -68,6 +85,11 @@
 		return LEGACY_FRAME_VIEW_INDEX;
 	}
 	
+	function execute(&$controller, &$xoopsUser)
+	{
+		return $this->getDefaultView($controller, $xoopsUser);
+	}
+	
 	function executeViewIndex(&$controller, &$xoopsUser, &$render)
 	{
 		$render->setTemplateName($this->_getTemplateName());
@@ -82,6 +104,7 @@
 		// setAttribute $mid or $this->mModules.
 		//		
 		$render->setAttribute('selectedMidArr', $this->_getSelectedMids());
+		$render->setAttribute('searchRuleMessage', @sprintf(_SR_KEYTOOSHORT, $this->mConfig['keyword_min']));
 	}
 	
 	function _getTemplateName()
@@ -103,7 +126,7 @@
 
 	function executeViewError(&$controller, &$xoopsUser, &$render)
 	{
-	//	$controller->executeForward("./index.php?Action=ImageList");
+		$controller->executeForward(XOOPS_URL);
 	}
 }
 


xoops-cvslog メーリングリストの案内
アーカイブの一覧に戻る