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

アーカイブの一覧に戻る

Minahito minah****@users*****
2006年 7月 12日 (水) 16:16:44 JST


Index: xoops2jp/html/modules/legacyRender/admin/actions/ThemeListAction.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/actions/ThemeListAction.class.php:1.1.2.5 xoops2jp/html/modules/legacyRender/admin/actions/ThemeListAction.class.php:1.1.2.6
--- xoops2jp/html/modules/legacyRender/admin/actions/ThemeListAction.class.php:1.1.2.5	Tue Jul 11 12:06:32 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/ThemeListAction.class.php	Wed Jul 12 16:16:44 2006
@@ -1,4 +1,8 @@
 <?php
+/**
+ * @package legacyRender
+ * @version $Id: ThemeListAction.class.php,v 1.1.2.6 2006/07/12 07:16:44 minahito Exp $
+ */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
 
@@ -7,14 +11,25 @@
 
 /**
  * This action shows the list of selectable themes to user.
+ * 
+ * [Notice]
+ * In XOOPS Cube Legacy which can have many themes with different render-
+ * systems, that one render-system has the control to change themes is wrong,
+ * because this action can't list up themes of other render-systems.
+ * The action to change themes should be in Legacy. And, each render-systems
+ * should send theme informations through delegate-mechanism.
+ * 
+ * Therefore, we may move this action to Legacy module after the discussion.
+ * If you want to check the concept of this strategy, see ThemeSelect preload
+ * in Legacy module.
  */
 class LegacyRender_ThemeListAction extends LegacyRender_Action
 {
 	var $mThemes = null;
 	var $mObjectHandler = null;
-	var $mActionForm=null;
+	var $mActionForm = null;
 
-	function prepare(&$controller, &$xoopsUser)
+	function prepare(&$controller, &$xoopsUser, $moduleConfig)
 	{
 		$this->_setupObject();
 		$this->_setupActionForm();
@@ -22,20 +37,16 @@
 	
 	function _setupObject()
 	{
-		if ($this->mThemes == null) {
-			$this->mObjectHandler =& xoops_getmodulehandler('theme');
-			$this->mObjectHandler->updateThemeList();
+		$this->mObjectHandler =& xoops_getmodulehandler('theme');
+		$this->mObjectHandler->updateThemeList();
 
-			$this->mThemes =& $this->mObjectHandler->getObjects();
-		}
+		$this->mThemes =& $this->mObjectHandler->getObjects();
 	}
 
 	function _setupActionForm()
 	{
-		if ($this->mActionForm == null) {
-			$this->mActionForm = new ThemeSelectForm();
-			$this->mActionForm->prepare();
-		}
+		$this->mActionForm =& new LegacyRender_ThemeSelectForm();
+		$this->mActionForm->prepare();
 	}
 	
 	function getDefaultView(&$controller, &$xoopsUser)
@@ -62,7 +73,6 @@
 		foreach ($this->mThemes as $theme) {
 			$this->mObjectHandler->insert($theme);
 		}
-		
 
 		//
 		// save selected theme.
@@ -96,7 +106,9 @@
 		$render->setTemplateName("theme_list.html");
 		$render->setAttribute("themes", $this->mThemes);
 		$render->setAttribute("actionForm", $this->mActionForm);
-		$render->setAttribute("currentThemeName", $controller->mRoot->getThemeName());
+		
+		$mainTheme =& $controller->getMainTheme();
+		$render->setAttribute("currentThemeName", $mainTheme);
 	}
 }
 


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