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

Back to archive index

Minahito minah****@users*****
2005年 12月 14日 (水) 17:34:40 JST


Index: xoops2jp/html/modules/base/class/Legacy_AdminRenderSystem.class.php
diff -u xoops2jp/html/modules/base/class/Legacy_AdminRenderSystem.class.php:1.1.2.6 xoops2jp/html/modules/base/class/Legacy_AdminRenderSystem.class.php:1.1.2.7
--- xoops2jp/html/modules/base/class/Legacy_AdminRenderSystem.class.php:1.1.2.6	Wed Nov 30 01:01:24 2005
+++ xoops2jp/html/modules/base/class/Legacy_AdminRenderSystem.class.php	Wed Dec 14 17:34:40 2005
@@ -1,60 +1,62 @@
-<?php
-
-//
-// TODO
-//
-require_once XOOPS_ROOT_PATH."/modules/legacyRender/kernel/Legacy_RenderSystem.class.php";
-
-define("LEGACY_ADMIN_RENDER_TEMPLATE_DIRNAME","templates");
-
-/**
- * [TODO]
- * We depends on Legacy_RenderSystem that a add-in module defines. We must stop
- * this situation.
- */
-class Legacy_AdminRenderSystem extends Legacy_RenderSystem
-{
-	var $mSmarty;
-	
-	function prepare()
-	{
-		require_once XOOPS_ROOT_PATH."/class/smarty/Smarty.class.php";
-		
-		$this->mSmarty=new Smarty();
-		$this->mSmarty->compile_dir=XOOPS_COMPILE_PATH;
-		$this->mSmarty->left_delimiter="<{";
-		$this->mSmarty->right_delimiter="}>";
-
-		$this->mSmarty->assign(array("xoops_url"=>XOOPS_URL,
-		                              "xoops_rootpath"=>XOOPS_ROOT_PATH,
-		                              "xoops_langcode"=>_LANGCODE,
-		                              "xoops_charset"=>_CHARSET,
-		                              "xoops_version"=>XOOPS_VERSION,
-		                              "xoops_upload_url"=>XOOPS_UPLOAD_URL));
-	}
-	
-	function renderBlock(&$target)
-	{
-		$this->mSmarty->template_dir=XOOPS_ROOT_PATH."/modules/base/admin/templates/blocks";
-
-		foreach($target->getAttributes() as $key=>$value) {
-			$this->mSmarty->assign($key,$value);
-		}
-		
-		$result=&$this->mSmarty->fetch($target->getTemplateName());
-		$target->setResult($result);
-		
-		//
-		// Reset
-		//
-		foreach($target->getAttributes() as $key=>$value) {
-			$this->mSmarty->clear_assign($key);
-		}
-	}
-	
+<?php
+
+//
+// TODO
+//
+require_once XOOPS_ROOT_PATH."/modules/legacyRender/kernel/Legacy_RenderSystem.class.php";
+
+define("LEGACY_ADMIN_RENDER_TEMPLATE_DIRNAME","templates");
+
+/**
+ * [TODO]
+ * We depends on Legacy_RenderSystem that a add-in module defines. We must stop
+ * this situation.
+ */
+class Legacy_AdminRenderSystem extends Legacy_RenderSystem
+{
+	var $mSmarty;
+	
+	function prepare()
+	{
+		require_once XOOPS_ROOT_PATH."/class/smarty/Smarty.class.php";
+		
+		$this->mSmarty=new Smarty();
+		$this->mSmarty->compile_dir=XOOPS_COMPILE_PATH;
+		$this->mSmarty->left_delimiter="<{";
+		$this->mSmarty->right_delimiter="}>";
+
+		$this->mSmarty->assign(array("xoops_url"=>XOOPS_URL,
+		                              "xoops_rootpath"=>XOOPS_ROOT_PATH,
+		                              "xoops_langcode"=>_LANGCODE,
+		                              "xoops_charset"=>_CHARSET,
+		                              "xoops_version"=>XOOPS_VERSION,
+		                              "xoops_upload_url"=>XOOPS_UPLOAD_URL));
+
+		$this->mSmarty->register_modifier("theme","Legacy_modifier_theme");
+	}
+	
+	function renderBlock(&$target)
+	{
+		$this->mSmarty->template_dir=XOOPS_ROOT_PATH."/modules/base/admin/templates/blocks";
+
+		foreach($target->getAttributes() as $key=>$value) {
+			$this->mSmarty->assign($key,$value);
+		}
+		
+		$result=&$this->mSmarty->fetch($target->getTemplateName());
+		$target->setResult($result);
+		
+		//
+		// Reset
+		//
+		foreach($target->getAttributes() as $key=>$value) {
+			$this->mSmarty->clear_assign($key);
+		}
+	}
+	
 	function renderTheme(&$target)
 	{
-		$this->mController->mDebugger->displayLog();
+		$this->mController->mDebugger->displayLog();
 
 		//
 		// Assign from attributes of the render-target.
@@ -62,42 +64,53 @@
 		foreach($target->getAttributes() as $key=>$value) {
 			$this->mSmarty->assign($key,$value);
 		}
-
-		$this->mSmarty->assign("currentModule",$this->mController->mModuleController->mModuleObject);
 
-		//
-		// Theme rendering
-		//
-		foreach($this->mBlockContents[0] as $result) {
-			$this->mSmarty->append('xoops_lblocks',$result);
-		}
+		$this->mSmarty->assign("currentModule",$this->mController->mModuleController->mModuleObject);
 
-		$this->mSmarty->template_dir=XOOPS_ROOT_PATH."/themes/admin/";
-		$result=$this->mSmarty->fetch("file:admin_theme.html");
+		//
+		// Theme rendering
+		//
+		foreach($this->mBlockContents[0] as $result) {
+			$this->mSmarty->append('xoops_lblocks',$result);
+		}
+
+		$this->mSmarty->template_dir=XOOPS_ROOT_PATH."/themes/admin/";
+		$result=$this->mSmarty->fetch("file:admin_theme.html");
+
+		$target->setResult($result);
+	}
+
+	function renderMain(&$target)
+	{
+		//
+		// Assign from attributes of the render-target.
+		//
+		foreach($target->getAttributes() as $key=>$value) {
+			$this->mSmarty->assign($key,$value);
+		}
 
+		$result=null;
+		if($target->getTemplateName()) {
+			$this->mSmarty->template_dir=$this->mController->mModuleController->getModuleDir() . "/". LEGACY_ADMIN_RENDER_TEMPLATE_DIRNAME;
+			$result=$this->mSmarty->fetch("file:".$this->mTemplateName);
+		}
+		else {
+			$result=$target->getAttribute("stdout_buffer");
+		}
+		
 		$target->setResult($result);
 	}
-
-	function renderMain(&$target)
-	{
-		//
-		// Assign from attributes of the render-target.
-		//
-		foreach($target->getAttributes() as $key=>$value) {
-			$this->mSmarty->assign($key,$value);
-		}
-
-		$result=null;
-		if($target->getTemplateName()) {
-			$this->mSmarty->template_dir=$this->mController->mModuleController->getModuleDir() . "/". LEGACY_ADMIN_RENDER_TEMPLATE_DIRNAME;
-			$result=$this->mSmarty->fetch("file:".$this->mTemplateName);
-		}
-		else {
-			$result=$target->getAttribute("stdout_buffer");
-		}
-		
-		$target->setResult($result);
-	}
-}
-
+}
+
+/**
+ * Return URL string by "overriding" rule
+ * (Now, test implement)
+ */
+function Legacy_modifier_theme($string)
+{
+	// TEST
+	// I will modify this function to oveeride system.
+	return XOOPS_THEME_URL."/admin/".$string;
+}
+
 ?>
\ No newline at end of file


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