[xoops-cvslog 1737] CVS update: xoops2jp/html/modules/legacyRender/admin/actions

Back to archive index

Minahito minah****@users*****
2006年 1月 14日 (土) 16:22:37 JST


Index: xoops2jp/html/modules/legacyRender/admin/actions/DefaultAction.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/actions/DefaultAction.class.php:1.1.2.3 xoops2jp/html/modules/legacyRender/admin/actions/DefaultAction.class.php:1.1.2.4
--- xoops2jp/html/modules/legacyRender/admin/actions/DefaultAction.class.php:1.1.2.3	Sat Jan 14 14:27:12 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/DefaultAction.class.php	Sat Jan 14 16:22:37 2006
@@ -9,11 +9,11 @@
 class LegacyRender_DefaultAction extends LegacyRender_Action
 {
 	var $mConfig;
-	var $mObject = null;
+	var $mThemes = null;
 	var $mObjectHandler = null;
 	var $mActionForm=null;
 
-	function _setupObject(&$controller)
+	function _setupObject()
 	{
 		if ($this->mThemes == null) {
 			$this->mObjectHandler =& xoops_getmodulehandler('theme');
@@ -33,8 +33,8 @@
 	
 	function getDefaultView(&$controller, &$xoopsUser)
 	{
-		$this->setupActionForm();
-		$this->loadThemes();
+		$this->_setupObject();
+		$this->_setupActionForm();
 
 		$this->mActionForm->load($this->mThemes);
 
@@ -43,8 +43,8 @@
 	
 	function execute(&$controller, &$xoopsUser)
 	{
-		$this->setupActionForm();
-		$this->loadThemes();
+		$this->_setupObject();
+		$this->_setupActionForm();
 
 		$this->mActionForm->fetch();
 		$this->mActionForm->validate();
@@ -66,19 +66,21 @@
 		//
 		// save selected theme.
 		//
-
-		$configHandler =& xoops_gethandler('config');
-
-		$criteria =& new CriteriaCompo();
-		$criteria->add(new Criteria('conf_name', 'theme_set'));
-		$criteria->add(new Criteria('conf_catid', XOOPS_CONF));
+		$themeName = $this->mActionForm->getChooseTheme();
 		
-		$configs =& $configHandler->getConfigs($criteria);
+		if ($themeName != null) {
+			$configHandler =& xoops_gethandler('config');
 
-		$configs[0]->setVar('conf_value', $theme_name);
-		if ($configHandler->insertConfig($configs[0])) {
-			$controller->mRoot->setThemeName($this->mActionForm->getChooseTheme());
-			break;
+			$criteria =& new CriteriaCompo();
+			$criteria->add(new Criteria('conf_name', 'theme_set'));
+			$criteria->add(new Criteria('conf_catid', XOOPS_CONF));
+			
+			$configs =& $configHandler->getConfigs($criteria);
+
+			$configs[0]->setVar('conf_value', $themeName);
+			if ($configHandler->insertConfig($configs[0])) {
+				$controller->mRoot->setThemeName($this->mActionForm->getChooseTheme());
+			}
 		}
 
 		return $this->getDefaultView($controller, $xoopsUser);


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