[xoops-cvslog 5963] CVS update: xoops2jp/html/modules/legacyRender/kernel

Back to archive index

NobuNobu nobun****@users*****
2006年 12月 3日 (日) 00:48:30 JST


Index: xoops2jp/html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php
diff -u xoops2jp/html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php:1.1.2.30.2.15 xoops2jp/html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php:1.1.2.30.2.16
--- xoops2jp/html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php:1.1.2.30.2.15	Sat Nov 25 19:01:30 2006
+++ xoops2jp/html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php	Sun Dec  3 00:48:30 2006
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version $Id: Legacy_RenderSystem.class.php,v 1.1.2.30.2.15 2006/11/25 10:01:30 minahito Exp $
+ * @version $Id: Legacy_RenderSystem.class.php,v 1.1.2.30.2.16 2006/12/02 15:48:30 nobunobu Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -118,6 +118,10 @@
 	{
 		parent::prepare($controller);
 		
+		$root =& $this->mController->mRoot;
+		$context =& $root->getContext();
+		$textFilter =& $root->getTextFilter();
+		
 		// XoopsTpl default setup
 		$this->mXoopsTpl =& new Legacy_XoopsTpl();
 		$this->mXoopsTpl->register_function("legacy_notifications_select", "LegacyRender_smartyfunction_notifications_select");
@@ -128,11 +132,6 @@
 		
 		$this->mXoopsTpl->xoops_setCaching(0);
 
-		$this->mXoopsTpl->assign(array('xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES),	//@todo ?????????????
-									// set JavaScript /Weird, but need extra <script> tags for 2.0.x themes
-									'xoops_js' => '//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript"><!--'
-								));
-
 		// If debugger request debugging to me, send debug mode signal by any methods.
 		if ($controller->mDebugger->isDebugRenderSystem()) {
 			$this->mXoopsTpl->xoops_setDebugging(true);
@@ -142,10 +141,9 @@
 							// set JavaScript/Weird, but need extra <script> tags for 2.0.x themes
 							'xoops_js' => '//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript"><!--'
 						));
-						
-		$this->mXoopsTpl->assign('xoops_sitename', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_sitename'), ENT_QUOTES));
-		$this->mXoopsTpl->assign('xoops_pagetitle', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_pagetitle'), ENT_QUOTES));
-		$this->mXoopsTpl->assign('xoops_slogan', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_slogan'), ENT_QUOTES));
+		$this->mXoopsTpl->assign('xoops_sitename', $textFilter->ToShow($context->getAttribute('legacy_sitename')));
+		$this->mXoopsTpl->assign('xoops_pagetitle', $textFilter->ToShow($context->getAttribute('legacy_pagetitle')));
+		$this->mXoopsTpl->assign('xoops_slogan', $textFilter->ToShow($context->getAttribute('legacy_slogan')));
 
 		// --------------------------------------
 		// Meta tags
@@ -157,13 +155,13 @@
 			$configHandler =& xoops_gethandler('config');
 			$configs =& $configHandler->getConfigsByCat(0, $legacyRender->get('mid'));
 			
-			$this->mXoopsTpl->assign('xoops_meta_keywords', $configs['meta_keywords']);
-			$this->mXoopsTpl->assign('xoops_meta_description', $configs['meta_description']);
-			$this->mXoopsTpl->assign('xoops_meta_robots', $configs['meta_robots']);
-			$this->mXoopsTpl->assign('xoops_meta_rating', $configs['meta_rating']);
-			$this->mXoopsTpl->assign('xoops_meta_author', $configs['meta_author']);
-			$this->mXoopsTpl->assign('xoops_meta_copyright', $configs['meta_copyright']);
-			$this->mXoopsTpl->assign('xoops_footer', $configs['footer']);
+			$this->mXoopsTpl->assign('xoops_meta_keywords', $textFilter->ToShow($configs['meta_keywords']));
+			$this->mXoopsTpl->assign('xoops_meta_description', $textFilter->ToShow($configs['meta_description']));
+			$this->mXoopsTpl->assign('xoops_meta_robots', $textFilter->ToShow($configs['meta_robots']));
+			$this->mXoopsTpl->assign('xoops_meta_rating', $textFilter->ToShow($configs['meta_rating']));
+			$this->mXoopsTpl->assign('xoops_meta_author', $textFilter->ToShow($configs['meta_author']));
+			$this->mXoopsTpl->assign('xoops_meta_copyright', $textFilter->ToShow($configs['meta_copyright']));
+			$this->mXoopsTpl->assign('xoops_footer', $configs['footer']); // footer may be raw HTML text.
 			
 			//
 			// If this site has the setting of banner.
@@ -184,11 +182,11 @@
 		// Add User
 		// --------------------------------------
 		$arr = null;
-		if (is_object($this->mController->mRoot->mContext->mXoopsUser)) {
+		if (is_object($context->mXoopsUser)) {
 			$arr = array(
 				'xoops_isuser' => true,
-				'xoops_userid' => $this->mController->mRoot->mContext->mXoopsUser->getShow('uid'),
-				'xoops_uname' => $this->mController->mRoot->mContext->mXoopsUser->getShow('uname')
+				'xoops_userid' => $context->mXoopsUser->getShow('uid'),
+				'xoops_uname' => $context->mXoopsUser->getShow('uname')
 			);
 		}
 		else {
@@ -216,20 +214,24 @@
 	 */
 	function _commonPrepareRender()
 	{
-		$themeName = $this->mController->mRoot->mContext->getThemeName();
+		$root =& $this->mController->mRoot;
+		$context =& $root->getContext();
+		$textFilter =& $root->getTextFilter();
+
+		$themeName = $context->getThemeName();
    		$this->mXoopsTpl->assign('xoops_theme', $themeName);
    		$this->mXoopsTpl->assign('xoops_imageurl', XOOPS_THEME_URL . "/${themeName}/");
    		$this->mXoopsTpl->assign('xoops_themecss', xoops_getcss($themeName));
 
-		$this->mXoopsTpl->assign('xoops_sitename', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_sitename'), ENT_QUOTES));
-		$this->mXoopsTpl->assign('xoops_pagetitle', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_pagetitle'), ENT_QUOTES));
-		$this->mXoopsTpl->assign('xoops_slogan', htmlspecialchars($this->mController->mRoot->mContext->getAttribute('legacy_slogan'), ENT_QUOTES));
+		$this->mXoopsTpl->assign('xoops_sitename', $textFilter->ToShow($context->getAttribute('legacy_sitename')));
+		$this->mXoopsTpl->assign('xoops_pagetitle', $textFilter->ToShow($context->getAttribute('legacy_pagetitle')));
+		$this->mXoopsTpl->assign('xoops_slogan', $textFilter->ToShow($context->getAttribute('legacy_slogan')));
 
 		//
 		// Assign module informations.
 		//
-		if($this->mController->mRoot->mContext->mModule != null) {	// The process of module
-			$xoopsModule =& $this->mController->mRoot->mContext->mXoopsModule;
+		if($context->mModule != null) {	// The process of module
+			$xoopsModule =& $context->mXoopsModule;
 			$this->mXoopsTpl->assign(array('xoops_modulename' => $xoopsModule->getShow('name'),
 			                               'xoops_dirname' => $xoopsModule->getShow('dirname')));
 		}


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