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

Back to archive index

Minahito minah****@users*****
2005年 12月 25日 (日) 19:48:33 JST


Index: xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderDefaultAction.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderDefaultAction.class.php:1.1.2.1 xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderDefaultAction.class.php:1.1.2.2
--- xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderDefaultAction.class.php:1.1.2.1	Fri Nov 25 19:28:15 2005
+++ xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderDefaultAction.class.php	Sun Dec 25 19:48:33 2005
@@ -10,23 +10,39 @@
 	var $mConfig;
 	var $mThemes;
 	
-	function getDefaultView(&$controller,&$xoopsUser)
+	function getDefaultView(&$controller, &$xoopsUser)
 	{
-		$themeHandler=new LegacyThemeHandler();
-		$this->mThemes=&$themeHandler->enumAll();
+		$themeHandler =& new LegacyThemeHandler();
+		$this->mThemes =& $themeHandler->enumAll();
 
 		return LEGACY_RENDER_FRAME_VIEW_INDEX;
 	}
 	
-	function execute(&$controller,&$xoopsUser)
+	function execute(&$controller, &$xoopsUser)
 	{
-		return LEGACY_RENDER_FRAME_VIEW_NONE;
+		$configHandler =& xoops_gethandler('config');
+
+		$criteria =& new CriteriaCompo();
+		$criteria->add(new Criteria('conf_name', 'theme_set'));
+		$criteria->add(new Criteria('conf_catid', XOOPS_CONF));
+		
+		$configs =& $configHandler->getConfigs($criteria);
+
+		if (count($configs)>0 && is_object($configs[0])) {
+			$configs[0]->setVar('conf_value', $_POST['theme_name']);
+			if ($configHandler->insertConfig($configs[0])) {
+				$controller->mRoot->setThemeName($_POST['theme_name']);
+			}
+		}
+
+		return $this->getDefaultView($controller, $xoopsUser);
 	}
 	
-	function executeViewIndex(&$controller,&$xoopsUser,&$renderSystem)
+	function executeViewIndex(&$controller, &$xoopsUser, &$render)
 	{
-		$renderSystem->setTemplateName("legacy_render_theme_list.html");
-		$renderSystem->setAttribute("themes",$this->mThemes);
+		$render->setTemplateName("theme_list.html");
+		$render->setAttribute("themes", $this->mThemes);
+		$render->setAttribute("currentThemeName", $controller->mRoot->getThemeName());
 	}
 }
 


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