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

Back to archive index

Minahito minah****@users*****
2005年 12月 26日 (月) 18:16:58 JST


Index: xoops2jp/html/modules/base/class/Base_Controller.class.php
diff -u xoops2jp/html/modules/base/class/Base_Controller.class.php:1.1.2.20 xoops2jp/html/modules/base/class/Base_Controller.class.php:removed
--- xoops2jp/html/modules/base/class/Base_Controller.class.php:1.1.2.20	Thu Nov 24 01:31:15 2005
+++ xoops2jp/html/modules/base/class/Base_Controller.class.php	Mon Dec 26 18:16:57 2005
@@ -1,485 +0,0 @@
-<?php
-
-define("LEGACY_CONTROLLER_STATE_PUBLIC",1);
-define("LEGACY_CONTROLLER_STATE_ADMIN",2);
-
-class Base_Controller extends XCube_Controller
-{
-	var $mXoopsUser;
-
-	var $_mAdminModeFlag=false;
-	var $_mControllerState=null;
-	
-	function Base_Controller(&$root)
-	{
-		parent::XCube_Controller($root);
-		set_magic_quotes_runtime(0);	// ^^;
-		
-
-		//
-		// Decide status. [TEST]
-		//
-		$urlInfo=$this->_parseUrl();
-		$adminStateFlag=false;
-
-		if(count($urlInfo)>=3) {
-			if(strtolower($urlInfo[0])=="modules" && strtolower($urlInfo[2])=="admin"){
-				$adminStateFlag=true;
-			}
-		}
-
-		$this->_mControllerState= $adminStateFlag ?  new BaseControllerAdminState() : new BaseControllerPublicState();
-	}
-
-	function _setupEnvironment()
-	{
-		parent::_setupEnvironment();
-		
-		require_once XOOPS_ROOT_PATH."/settings/definition.inc.php";
-		define("XOOPS_BASE_PATH",XOOPS_MODULE_PATH."/".XOOPS_BASE_PROC_NAME);
-
-		require_once XOOPS_ROOT_PATH.'/include/functions.php';
-
-		require_once XOOPS_ROOT_PATH.'/kernel/object.php';
-		require_once XOOPS_ROOT_PATH.'/class/criteria.php';
-		require_once XOOPS_ROOT_PATH.'/class/token.php';
-		require_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php";
-		require_once XOOPS_ROOT_PATH."/class/XCube_Utils.class.php";	// ToDo
-
-		require_once XOOPS_ROOT_PATH.'/class/xoopssecurity.php';
-		$_GLOBALS['xoopsSecurity'] = new XoopsSecurity();
-
-		require_once XOOPS_ROOT_PATH."/include/version.php";
-	}
-
-	function _setupFilterChain()
-	{
-		require_once XOOPS_ROOT_PATH."/modules/base/preload/protectorLE/protectorLE.class.php";
-		$protector=new protectorLE_Filter($this);
-		$this->addActionFilter($protector);
-
-		require_once XOOPS_ROOT_PATH."/modules/base/preload/IPbanning/IPbanning.class.php";
-		$ipban=new IPbanning_Filter($this);
-		$this->addActionFilter($ipban);
-
-		require_once XOOPS_ROOT_PATH."/modules/base/preload/SiteClose/SiteClose.class.php";
-		$siteclose = new SiteClose_Filter($this);
-		$this->addActionFilter($siteclose);
-
-		require_once XOOPS_ROOT_PATH."/modules/base/preload/ThemeSelect/ThemeSelect.class.php";
-		$themeselect = new ThemeSelect_Filter($this);
-		$this->addActionFilter($themeselect);
-
-		//
-		// Auto pre-loading.
-		//
-		if($this->mRoot->getSiteConfig('Legacy','AutoPreload')==1) {
-			$dir=XOOPS_ROOT_PATH."/preload/";
-			if(is_dir($dir)) {
-				if($handler=opendir($dir)) {
-					while(($file=readdir($handler))!==false) {
-						if(preg_match("/(\w+)\.class\.php$/",$file,$matches)) {
-							require_once $dir.$file;
-							$className=$matches[1];
-							if(class_exists($className)) {
-								$instance=new $className($this);
-								$this->addActionFilter($instance);
-							}
-						}
-					}
-					closedir($handler);
-				}
-			}
-		}
-	}
-
-	function _setupBlock()
-	{
-		$this->_mControllerState->setupBlock($this);
-	}
-
-	function _processBlock()
-	{
-		$i=0;
-		foreach($this->mBlockChain as $blockProcedure) {
-			$blockProcedure->execute($this,$this->getXoopsUser());
-			if($blockProcedure->hasResult()) {
-				$this->mRenderSystem->renderBlock($blockProcedure);
-			}
-			unset($blockProcedure);
-		}
-	}
-
-	function _parseUrl()
-	{
-		$ret = array();
-		
-		$nakedRootPath=substr(strstr(XOOPS_URL,$_SERVER['HTTP_HOST']),strlen($_SERVER['HTTP_HOST'])) . "/";
-		$subPath=substr($_SERVER['REQUEST_URI'],strlen($nakedRootPath));
-
-		return explode("/",$subPath);
-	}
-
-	function _setupModuleController()
-	{
-		$this->_mControllerState->setupModuleController($this);
-	}
-
-	function _processModuleController()
-	{
-		if(parent::_processModuleController()) {
-			$GLOBALS['xoopsModule']=&$this->mModuleController->mModuleObject;			// TODO
-			$GLOBALS['xoopsModuleConfig']=$this->mModuleController->getConfig();
-		}
-	}
-
-	function _processHostAbstractLayer()
-	{
-		if ( !isset($_SERVER['PATH_TRANSLATED']) && isset($_SERVER['SCRIPT_FILENAME']) ) {
-			// There is this setting for CGI mode. @todo We have to confirm this.
-			$_SERVER['PATH_TRANSLATED'] =& $_SERVER['SCRIPT_FILENAME'];
-		} elseif ( isset($_SERVER['PATH_TRANSLATED']) && !isset($_SERVER['SCRIPT_FILENAME']) ) {
-			// There is this setting for IIS Win2K. Really?
-			$_SERVER['SCRIPT_FILENAME'] =& $_SERVER['PATH_TRANSLATED'];
-		}
-
-		// IIS does not set REQUEST_URI. This system defines it. But...
-		if (empty($_SERVER['REQUEST_URI'])) {
-			if ( !( $_SERVER[ 'REQUEST_URI' ] = @$_SERVER['PHP_SELF'] ) ) {
-				$_SERVER[ 'REQUEST_URI' ] = $_SERVER['SCRIPT_NAME'];
-			}
-			if ( isset( $_SERVER[ 'QUERY_STRING' ] ) ) {
-				$_SERVER[ 'REQUEST_URI' ] .= '?' . $_SERVER[ 'QUERY_STRING' ];
-			}
-		    
-			// Guard for XSS string of PHP_SELF
-			// @todo I must move this logic to preload plugin.
-			if(preg_match("/[\<\>\"\'\(\)]/",$_SERVER['REQUEST_URI']))
-				die();
-		}
-
-		// What is this!? But, old system depends this setting. We have to confirm it and modify!
-		$GLOBALS['xoopsRequestUri'] = $_SERVER[ 'REQUEST_URI' ];
-	}
-
-	function _setupUser()
-	{
-		$eventManager=&$this->mRoot->getEventManager();
-		if($eventManager!=null) {
-			$eventArgs= new LoginEventArgs();
-			$eventManager->raiseEvent("Site.Login",$this,$eventArgs);
-
-			if($eventArgs->hasXoopsUser())
-				$this->mXoopsUser=&$eventArgs->getXoopsUser();
-		}
-
-		// Set instance to global variable for compatiblity with XOOPS 2.0.x
-		$GLOBALS['xoopsUser']=&$this->mXoopsUser;
-		$GLOBALS['xoopsUserIsAdmin'] = is_object($this->mXoopsUser) ? $this->mXoopsUser->isAdmin(1) : false;	//@todo Remove '1'
-	}
-	
-	function _setupErrorHandler()
-	{
-		parent::_setupErrorHandler();
-		$GLOBALS['xoopsErrorHandler']=&$this->mErrorHandler;
-	}
-
-	function _setupLogger()
-	{
-		parent::_setupLogger();
-		$GLOBALS['xoopsLogger']=&$this->mLogger;
-	}
-
-	/**
-	 * Create the instance of DataBase class, and set it to member property.
-	 * @access protected
-	 */
-	function _setupDB()
-	{
-		parent::_setupDB();
-		$GLOBALS['xoopsDB']=&$this->mDB;
-	}
-	
-	function _setupConfig()
-	{
-		parent::_setupConfig();
-		$GLOBALS['xoopsConfig']=&$this->mConfig;
-	}
-
-	/**
-	 * Set debbuger object to member property.
-	 * @return void
-	 */
-	function _setupDebugger()
-	{
-		parent::_setupDebugger();
-		$GLOBALS['xoopsDebugger']=&$this->mDebugger;
-	}
-	
-	function &_createLanguageManager()
-	{
-		global $xoopsOption;
-
-		require_once XOOPS_BASE_PATH."/class/Base_LegacyLanguageManager.class.php";
-		
-		$languageManager = new Base_LegacyLanguageManager($this->mConfig['language']);
-		$languageManager->loadMainLanguage();
-		
-		// If you use special page, load message catalog for it.
-		if (isset($xoopsOption['pagetype']))
-			$languageManager->loadSpecialTypeLanguage($xoopsOption['pagetype']);
-
-		return $languageManager;
-	}
-	
-	function _setupRenderSystem()
-	{
-		$this->_mControllerState->setupRenderSystem($this);
-	}
-	
-	function executeHeader()
-	{
-		parent::executeHeader();
-		$this->mRenderSystem->_processStartPage();
-	}
-	
-	function executeView()
-	{
-		$this->mRenderSystem->display();
-
-		$isAdmin=false;
-		if(is_object($this->mXoopsUser)) {
-			if($this->mModuleController->isModuleProcess() && $this->mModuleController->isActive()) {
-				// @todo I depend on Legacy Module Controller.
-				$mid=$this->mModuleController->mModuleObject->getVar('mid');
-			}
-			else
-				$mid=1;	///< @todo Do not use literal directly!
-
-			$isAdmin = $this->mXoopsUser->isAdmin($mid);
-		}
-
-		// Debug Process
-		if ($this->mConfig['debug_mode'] == XOOPS_DEBUG_MYSQL && $isAdmin) {
-			$xoopsDebugger->displayLog();
-		}
-	}
-	
-
-	function &_createEventManager()
-	{
-		$manager=&parent::_createEventManager();
-
-		require_once XOOPS_ROOT_PATH."/modules/user/kernel/UserEventProxyRegister.class.php";
-		$manager->addProxyRegister(new UserEventProxyRegister());
-		$manager->add("Site.Login",new XCube_Delegate("UserCommonEventFunction","Login"));	// TODO
-
-		require_once XOOPS_ROOT_PATH."/modules/pm/kernel/PmEventProxyRegister.class.php";
-		$manager->addProxyRegister(new PmEventProxyRegister());
-
-		$manager->setAnchorDelegate("Site.CheckLogin",new XCube_InstanceDelegate($this,"eventCheckLogin"));
-		$manager->setAnchorDelegate("Site.Logout",new XCube_InstanceDelegate($this,"eventLogout"));
-
-		return $manager;
-	}
-
-	function &_createServiceManager()
-	{
-		$manager=&parent::_createServiceManager();
-		
-		//
-		// TODO : Now, we register services we specified. However, this process should be customized by user.
-		//
-
-		require_once XOOPS_ROOT_PATH."/modules/pm/service/LegacyPmService.class.php";
-		$service=new LegacyPmService();
-		$manager->addXCubeService("PrivateMessage",$service);
-
-		require_once XOOPS_ROOT_PATH."/modules/comment/service/LegacyCommentService.class.php";
-		$service=new LegacyCommentService();
-		$manager->addXCubeService("Comment",$service);
-
-		return $manager;
-	}
-
-	function eventCheckLogin(&$sender,&$eventArgs)
-	{
-		if($eventArgs->isSuccess()) {
-			// RMV-NOTIFY
-			// Perform some maintenance of notification records
-			// $notification_handler =& xoops_gethandler('notification');
-			// $notification_handler->doLoginMaintenance($user->getVar('uid'));
-
-			$successEventArgs=array();
-			$successEventArgs['user']=&$eventArgs->getUser();
-			$successEventArgs['xoopsUser']=&$eventArgs->getXoopsUser();
-
-			$this->mRoot->mEventManager->raiseEvent("Site.CheckLogin.Success",$this,$successEventArgs);
-
-			$xoopsUser=&$eventArgs->getXoopsUser();
-			if($xoopsUser!=null) {
-				$message=sprintf(_US_LOGGINGU,$xoopsUser->getVar('uname'));
-			}
-			XCube_Utils::redirectHeader($eventArgs->getRedirectUrl(),1,$message);
-		}
-		else {
-			XCube_Utils::redirectHeader($eventArgs->getRedirectUrl(),1,$eventArgs->getRedirectMessage());
-		}
-	}
-	
-	function eventLogout(&$sender,&$eventArgs)
-	{
-		if($eventArgs['successFlag']) {
-			//
-			// TODO : We depends on a message catalog of user module, yet.
-			//
-			XCube_Utils::redirectHeader(XOOPS_URL,1,_US_LOGGEDOUT.'<br />'._US_THANKYOUFORVISIT);
-		}
-	}
-
-	/**
-	 * CAUTION!!
-	 * This method has a special mission.
-	 * Because this method changes state after executeCommon, this resets now property.
-	 * It depends on XCube_Controller steps.
-	 *
-	 * @param $state BaseControllerState*
-	 */
-	function switchStateCompulsory($state)
-	{
-		if($state->mStatusFlag != $this->_mControllerState->mStatusFlag) {
-			unset($this->mRenderSystem);
-			$this->_mControllerState=&$state;
-			
-			//
-			// The following line depends on XCube_Controller process of executeCommon.
-			// But, There is no other method.
-			//
-			$this->_setupModuleController();
-			$this->_setupRenderSystem();
-			$this->_processModuleController();
-		}
-	}
-
-	function &getXoopsUser()
-	{
-		return $this->mXoopsUser;
-	}
-}
-
-class BaseControllerState
-{
-	var $mStatusFlag;
-
-	function setupModuleController(&$controller)
-	{
-	}
-
-	function setupRenderSystem(&$controller)
-	{
-	}
-	
-	function setupBlock(&$controller)
-	{
-	}
-}
-
-class BaseControllerPublicState extends BaseControllerState
-{
-	var $mStatusFlag=LEGACY_CONTROLLER_STATE_PUBLIC;
-
-	function setupModuleController(&$controller)
-	{
-		require_once XOOPS_BASE_PATH."/class/Base_LegacyModuleController.class.php";
-		$controller->mModuleController=new Base_LegacyModuleController($controller);
-	}
-
-	function setupRenderSystem(&$controller)
-	{
-		require_once XOOPS_BASE_PATH."/class/Base_LegacyRenderSystem.class.php";
-		$controller->mRenderSystem=new Base_LegacyRenderSystem($controller);
-		$controller->mRenderSystem->prepare();
-	}
-	
-	function setupBlock(&$controller)
-	{
-		require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
-
-		$showFlag =0;
-		$mid=0;
-
-		if($controller->mModuleController->isModuleProcess()) {
-			$showFlag = (preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) && $controller->mConfig['startpage'] == $controller->mModuleController->mModuleObject->getVar('dirname'));
-			$mid=$controller->mModuleController->mModuleObject->getVar('mid');
-		}
-		else {
-			$showFlag = !empty($_GLOBALS['xoopsOption']['show_cblock']);
-		}
-
-		$groups = is_object($controller->mXoopsUser) ? $controller->mXoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
-
-		$xoopsblock = new XoopsBlock();
-		$blockObjects=&$xoopsblock->getAllByGroupModule($groups, $mid, $showFlag, XOOPS_BLOCK_VISIBLE);
-
-		foreach($blockObjects as $blockObject) {
-			$controller->mBlockChain[]=new XCube_LegacyAdaptBlockProcedure($blockObject);
-			unset($blockObject);
-		}
-	}
-}
-
-class BaseControllerAdminState extends BaseControllerState
-{
-	var $mStatusFlag=LEGACY_CONTROLLER_STATE_ADMIN;
-
-	function setupModuleController(&$controller)
-	{
-		require_once XOOPS_BASE_PATH."/class/Legacy_AdminModuleController.class.php";
-		$controller->mModuleController=new Legacy_AdminModuleController($controller);
-	}
-
-	function setupRenderSystem(&$controller)
-	{
-		require_once XOOPS_BASE_PATH."/class/Legacy_AdminRenderSystem.class.php";
-		$controller->mRenderSystem=new Legacy_AdminRenderSystem($controller);
-		$controller->mRenderSystem->prepare();
-	}
-	
-	function setupBlock(&$controller)
-	{
-		require_once XOOPS_BASE_PATH."/admin/blocks/AdminActionSearch.class.php";
-		require_once XOOPS_BASE_PATH."/admin/blocks/AdminSideMenu.class.php";
-		$controller->mBlockChain[]=new Legacy_AdminActionSearch();
-		$controller->mBlockChain[]=new Legacy_AdminSideMenu();
-	}
-}
-
-
-/**
- * TEST
- */
-class XCube_AdminBlockProcedure extends XCube_BlockProcedure
-{
-	function getTitle()
-	{
-		return "TEST BLOCK!";
-	}
-
-	function enableCached()
-	{
-		return false;
-	}
-
-	function hasResult()
-	{
-		return true;
-	}
-
-	function &getResult()
-	{
-		$ret['comment']="hello,world!";
-		return $ret;
-	}
-}
-
-?>
\ No newline at end of file
Index: xoops2jp/html/modules/base/class/Base_LegacyRenderSystem.class.php
diff -u xoops2jp/html/modules/base/class/Base_LegacyRenderSystem.class.php:1.1.2.9 xoops2jp/html/modules/base/class/Base_LegacyRenderSystem.class.php:removed
--- xoops2jp/html/modules/base/class/Base_LegacyRenderSystem.class.php:1.1.2.9	Fri Nov 25 00:05:13 2005
+++ xoops2jp/html/modules/base/class/Base_LegacyRenderSystem.class.php	Mon Dec 26 18:16:57 2005
@@ -1,353 +0,0 @@
-<?php
-
-/**
- * Compatible render system with XOOPS 2 Themes & Templates.
- */
-class Base_LegacyRenderSystem extends XCube_RenderSystem
-{
-	var $mController;
-	var $mXoopsTpl;
-
-	var $mBlockShowFlags;
-	var $mBlockContents;
-	
-	var $_mContentsData=null;
-
-	function Base_LegacyRenderSystem(&$controller)
-	{
-		parent::XCube_RenderSystem($controller);
-		$this->mBlockContents=array();
-	}
-	
-	function prepare()
-	{
-		require_once XOOPS_ROOT_PATH."/class/template.php";
-
-		// XoopsTpl default setup
-		$this->mXoopsTpl=new XoopsTpl();
-		
-		// compatible
-		$GLOBALS['xoopsTpl']=&$this->mXoopsTpl;
-		
-		$this->mXoopsTpl->xoops_setCaching(2);
-
-		$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($this->mController->mDebugger->isDebugRenderSystem())
-			$this->mXoopsTpl->xoops_setDebugging(true);
-		
-   		$this->mXoopsTpl->assign(array('xoops_theme' => $this->mController->mConfig['theme_set'],
-							'xoops_imageurl' => XOOPS_THEME_URL.'/'.$this->mController->mConfig['theme_set'].'/',
-							'xoops_themecss'=> xoops_getcss($this->mController->mConfig['theme_set']),
-							'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES),	//@todo ?????????????
-							'xoops_sitename' => htmlspecialchars($this->mController->mConfig['sitename'], ENT_QUOTES),
-							'xoops_slogan' => htmlspecialchars($this->mController->mConfig['slogan'], ENT_QUOTES),
-							// 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 this site has the setting of banner.
-		// TODO this process depends on XOOPS 2.0.x.
-		//
-		if($this->mController->mConfig['banners']==1)
-			$this->mXoopsTpl->assign('xoops_banner',xoops_getbanner());
-		else
-			$this->mXoopsTpl->assign('xoops_banner','&nbsp;');
-
-		// --------------------------------------
-		// Meta tags
-		// --------------------------------------
-		$configHandler=&xoops_gethandler('config');
-		$configs =& $configHandler->getConfigsByCat(0,XOOPS_CONF_METAFOOTER);
-		foreach ($configs as $config) {
-		    // prefix each tag with 'xoops_'
-			if(is_object($config))
-				$this->mXoopsTpl->assign('xoops_'.$config->getVar('conf_name'),	$config->getConfValueForOutput());
-	    }
-
-		// --------------------------------------
-		// Add User
-		// --------------------------------------
-		$arr=null;
-		if(is_object($this->mController->mXoopsUser)) {
-			$arr = array(
-				'xoops_isuser' => true,
-				'xoops_userid' => $this->mController->mXoopsUser->getVar('uid'),
-				'xoops_uname' => $this->mController->mXoopsUser->getVar('uname'),
-				'xoops_isadmin' => $this->mController->mXoopsUser->isAdmin());
-		}
-		else {
-			$arr = array(
-				'xoops_isuser' => false,
-				'xoops_isadmin' => false);
-		}
-
-		$this->mXoopsTpl->assign($arr);
-	}
-	
-	function setAttribute($key,$value)
-	{
-		$this->mXoopsTpl->assign($key,$value);
-	}
-	
-	function getAttribute($key)
-	{
-		$this->mXoopsTpl->get_template_vars($key);
-	}
-	
-	function renderBlock(&$blockProcedure)
-	{
-		$cacheTime = $blockProcedure->getCacheTime();
-		if(!$cacheTime) {
-			$this->mXoopsTpl->xoops_setCaching(0);
-		}
-		else {
-            $this->mXoopsTpl->xoops_setCaching(2);
-            $this->mXoopsTpl->xoops_setCacheTime($bcachetime);
-		}
-
-		$templateName=$blockProcedure->getTemplateName();
-	
-		$this->mXoopsTpl->assign_by_ref("block",$blockProcedure->getResult());
-
-		$renderResult=&$this->mXoopsTpl->fetchBlock($templateName,$blockProcedure->getId());
-		
-		$this->mXoopsTpl->clear_assign('block');
-
-		$this->mBlockShowFlags[$blockProcedure->getEntryIndex()] = true;
-		$this->mBlockContents[$blockProcedure->getEntryIndex()][] = array(
-								'title'=>$blockProcedure->getTitle(),
-								'content'=>$renderResult,
-								'weight'=>$blockProcedure->getWeight());
-	}
-	
-	function sendHeader()
-	{
-		header('Content-Type:text/html; charset='._CHARSET);
-		header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
-		header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
-		header('Cache-Control: no-store, no-cache, must-revalidate');
-		header('Cache-Control: post-check=0, pre-check=0', false);
-		header('Pragma: no-cache');
-	}
-	
-	function display()
-	{
-		$this->sendHeader();
-
-		$this->_processLegacyTemplate();
-		
-
-		//
-		// Dialog mode does not display the columns of theme.
-		//
-		if($this->isDialogRenderMode()) {
-			$this->_renderHeader();
-			print $this->_mContentsData;
-			$this->_renderFooter();
-			return;
-		}
-
-
-		//
-		// Assign module informations.
-		//
-		if($this->mController->mModuleController->isModuleProcess()) {	// The process of module
-			$xoopsModule=&$this->mController->mModuleController->mModuleObject;
-			$this->mXoopsTpl->assign(array('xoops_pagetitle' => $xoopsModule->getVar('name'),
-			                               'xoops_modulename' => $xoopsModule->getVar('name'),
-			                               'xoops_dirname' => $xoopsModule->getVar('dirname')));
-		}
-		else {
-			$this->mXoopsTpl->assign('xoops_pagetitle', htmlspecialchars($this->mController->mConfig['slogan'], ENT_QUOTES));
-		}
-
-
-		// assing
-		/// @todo I must move these to somewhere.
-		$assignNameMap = array(
-				XOOPS_SIDEBLOCK_LEFT=>array('showflag'=>'xoops_showllock','block'=>'xoops_lblocks'),
-				XOOPS_CENTERBLOCK_LEFT=>array('showflag'=>'xoops_showcblock','block'=>'xoops_clblocks'),
-				XOOPS_CENTERBLOCK_RIGHT=>array('showflag'=>'xoops_showcblock','block'=>'xoops_crblocks'),
-				XOOPS_CENTERBLOCK_CENTER=>array('showflag'=>'xoops_showcblock','block'=>'xoops_ccblocks'),
-				XOOPS_SIDEBLOCK_RIGHT=>array('showflag'=>'xoops_showrblock','block'=>'xoops_rblocks')
-			);
-
-		foreach($assignNameMap as $key=>$val) {
-			$this->mXoopsTpl->assign($val['showflag'],(isset($this->mBlockShowFlags[$key])&&$this->mBlockShowFlags[$key]) ? 1 : 0);
-			if(isset($this->mBlockContents[$key])) {
-				foreach($this->mBlockContents[$key] as $result) {
-					$this->mXoopsTpl->append($val['block'],$result);
-				}
-			}
-		}
-
-		$this->mXoopsTpl->xoops_setCaching(0);
-		
-		$themeSet = $this->mController->mConfig['theme_set'];
-		
-		$this->mXoopsTpl->display($themeSet."/theme.html");	//< test
-
-		$this->mController->mDebugger->displayLog();
-	}
-	
-	/**
-	 *
-	 */
-	function _processStartPage()
-	{
-		$this->mTemplateName = isset($GLOBALS['xoopsOption']['template_main']) ? $GLOBALS['xoopsOption']['template_main'] : null;
-
-		if(!$this->mTemplateName) {
-			require_once XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
-			$GLOBALS['xoopsTheme']['thename'] = $GLOBALS['xoopsConfig']['theme_set'];
-			ob_start();
-		}
-    }
-
-	function _processLegacyTemplate()
-	{
-		if(!$this->mTemplateName)
-			$this->mTemplateName = isset($GLOBALS['xoopsOption']['template_main']) ? $GLOBALS['xoopsOption']['template_main'] : null;
-		
-		$contents=null;
-
-		$cachedTemplateId = isset($GLOBLAS['xoopsCachedTemplateId']) ? $GLOBLAS['xoopsCachedTemplateId'] : null;
-
-		if ($this->mTemplateName) {
-		    if ($cachedTemplateId!==null) {
-		        $contents=$this->mXoopsTpl->fetch('db:'.$this->mTemplateName, $xoopsCachedTemplateId);
-		    } else {
-		        $contents=$this->mXoopsTpl->fetch('db:'.$this->mTemplateName);
-		    }
-		} else {
-		    if ($cachedTemplateId!==null) {
-		        $this->mXoopsTpl->assign('dummy_content', ob_get_contents());
-		        $contents=$this->mXoopsTpl->fetch($GLOBALS['xoopsCachedTemplate'], $xoopsCachedTemplateId);
-		    } else {
-		        $contents=ob_get_contents();
-		    }
-		    ob_end_clean();
-		}
-
-		if($this->isDialogRenderMode()) {
-			$this->_mContentsData=$contents;
-		}
-		else {
-			$this->mXoopsTpl->assign('xoops_contents',$contents);
-		}
-	}
-
-	function renderMessageBox(&$messageBox)
-	{
-		$ret="";
-		$class = ($messageBox->getType()==XCUBE_MESSAGEBOX_RESULT) ? "resultMsg" : "errorMsg";
-		$ret ="<div class='$class'>";
-		if($messageBox->getTitle()!=null)
-			$ret.=@sprintf("<h4>%s</h4>",htmlspecialchars($messageBox->getTitle()));
-			
-		if(is_array($messageBox->getMessage())) {
-			foreach($messageBox->getMessage() as $msg) {
-				$ret.=htmlspecialchars($msg)."<br/>";
-			}
-		}
-		else {
-			$ret.=htmlspecialchars($messageBox->getMessage());
-		}
-		
-		$ret.="</div>";
-
-		return $ret;
-	}
-
-	function renderConfirmMessageBox(&$messageBox)
-	{
-		$ret=@sprintf("<div class='confirmMsg'><h4>%s</h4>",$messageBox->getTitle());
-		$ret.=@sprintf("<form method='post' action='%s'>",$messageBox->getAction());
-
-		foreach($messageBox->getAttributes() as $key=>$value) {
-			if(is_array($value))
-				foreach($value as $radioName=>$radioValue) {
-				$ret.=@sprintf("<input type='radio' name='%s' value='%s' /> %s<br />",$key,htmlspecialchars($radioValue),htmlspecialchars($radioName));
-			}
-			else {
-				$ret.=@sprintf("<input type='hidden' name='%s' value='%s' />",$key,htmlspecialchars($value));
-			}
-		}
-		
-		$submitText=$messageBox->getSubmitText();
-		if($submitText==null)
-			$submitText=_SUBMIT;
-
-		$ret.=@sprintf("<input type='submit' name='confirm_submit' value='%s' /><input type='button' name='confirm_back' value='%s'  onclick='javascript:history.go(-1);' />",
-		                htmlspecialchars($submitText),_CANCEL);
-
-		$ret.="</form></div>";
-
-		return $ret;
-	}
-
-	function showXoopsHeader($closeHead=true)
-	{
-		global $xoopsConfig;
-		$myts =& MyTextSanitizer::getInstance();
-		if ($xoopsConfig['gzip_compression'] == 1) {
-			ob_start("ob_gzhandler");
-		} else {
-			ob_start();
-		}
-
-		$this->sendHeader();
-		$this->_renderHeader($closeHead);
-	}
-	
-	// TODO never direct putput
-	function _renderHeader($closehead=true)
-	{
-		global $xoopsConfig, $xoopsTheme, $xoopsConfigMetaFooter;
-
-		echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
-
-		echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'._LANGCODE.'" lang="'._LANGCODE.'">
-		<head>
-		<meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />
-		<meta http-equiv="content-language" content="'._LANGCODE.'" />
-		<meta name="robots" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_robots']).'" />
-		<meta name="keywords" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']).'" />
-		<meta name="description" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_desc']).'" />
-		<meta name="rating" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_rating']).'" />
-		<meta name="author" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_author']).'" />
-		<meta name="copyright" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_copyright']).'" />
-		<meta name="generator" content="XOOPS" />
-		<title>'.htmlspecialchars($xoopsConfig['sitename']).'</title>
-		<script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script>
-		';
-		$themecss = getcss($xoopsConfig['theme_set']);
-		echo '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/xoops.css" />';
-		if ($themecss) {
-			echo '<link rel="stylesheet" type="text/css" media="all" href="'.$themecss.'" />';
-			//echo '<style type="text/css" media="all"><!-- @import url('.$themecss.'); --></style>';
-		}
-		if ($closehead) {
-			echo '</head><body>';
-		}
-	}
-	
-	function _renderFooter()
-	{
-		echo '</body></html>';
-	    ob_end_flush();
-	}
-	
-	function showXoopsFooter()
-	{
-		$this->_renderFooter();
-	}
-}
-
-?>
\ No newline at end of file
Index: xoops2jp/html/modules/base/class/Base_LegacyLanguageManager.class.php
diff -u xoops2jp/html/modules/base/class/Base_LegacyLanguageManager.class.php:1.1.2.4 xoops2jp/html/modules/base/class/Base_LegacyLanguageManager.class.php:removed
--- xoops2jp/html/modules/base/class/Base_LegacyLanguageManager.class.php:1.1.2.4	Sat Dec 24 23:49:15 2005
+++ xoops2jp/html/modules/base/class/Base_LegacyLanguageManager.class.php	Mon Dec 26 18:16:57 2005
@@ -1,115 +0,0 @@
-<?php
-// $Id: Base_LegacyLanguageManager.class.php,v 1.1.2.4 2005/12/24 14:49:15 minahito Exp $
-//  ------------------------------------------------------------------------ //
-//                XOOPS - PHP Content Management System                      //
-//                    Copyright (c) 2000 XOOPS.org                           //
-//                       <http://www.xoops.org/>                             //
-//  ------------------------------------------------------------------------ //
-//  This program is free software; you can redistribute it and/or modify     //
-//  it under the terms of the GNU General Public License as published by     //
-//  the Free Software Foundation; either version 2 of the License, or        //
-//  (at your option) any later version.                                      //
-//                                                                           //
-//  You may not change or alter any portion of this comment or credits       //
-//  of supporting developers from this source code or any supporting         //
-//  source code which is considered copyrighted (c) material of the          //
-//  original comment or credit authors.                                      //
-//                                                                           //
-//  This program is distributed in the hope that it will be useful,          //
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
-//  GNU General Public License for more details.                             //
-//                                                                           //
-//  You should have received a copy of the GNU General Public License        //
-//  along with this program; if not, write to the Free Software              //
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
-//  ------------------------------------------------------------------------ //
-
-require_once XOOPS_ROOT_PATH."/class/XCube_LanguageManager.class.php";
-
-class Base_LegacyLanguageManager extends XCube_LanguageManager
-{
-	var $mLanguageName;
-
-	function loadMainLanguage()
-	{
-		if(file_exists(XOOPS_ROOT_PATH."/language/".$this->mLanguageName."/global.php"))
-			require_once XOOPS_ROOT_PATH."/language/".$this->mLanguageName."/global.php";
-		else
-			require_once XOOPS_ROOT_PATH."/language/english/global.php";
-
-		// Now, if XOOPS_USE_MULTIBYTES isn't defined, set zero to it.
-		if ( !defined("XOOPS_USE_MULTIBYTES") ) {
-			define("XOOPS_USE_MULTIBYTES",0);
-		}
-	}
-	
-
-	function loadSpecialTypeLanguage($type)
-	{
-		if (strpos($type,'.') ===false) {
-			$filename = XOOPS_ROOT_PATH."/language/".$this->mLanguageName."/".$type.".php";
-			if ($this->_loadFile($filename)) {
-				require_once $filename;
-			} else {
-				$filename=XOOPS_ROOT_PATH."/language/english/".$type.".php";
-				$this->_loadFile($filename);
-			}
-		}
-	}
-
-	/**
-	 Load language for module controller.
-	 @param $dirname module directory name
-	 */
-	function loadModuleLanguage($dirname)
-	{
-		$this->_loadLanguage($dirname,"main");
-	}
-
-	function loadModuleAdminLanguage($dirname)
-	{
-		$this->_loadLanguage($dirname,"admin");
-	}
-
-	function loadBlockLanguage($dirname)
-	{
-		$this->_loadLanguage($dirname,"blocks");
-	}
-
-	function loadManifestoLanguage($dirname)
-	{
-		$this->_loadLanguage($dirname,"modinfo");
-	}
-
-	/**
-	 * @access private
-	 * @param $dirname module directory name
-	 * @param $fileBodyName language file body name
-	 */
-	function _loadLanguage($dirname,$fileBodyName)
-	{
-		$fileName=XOOPS_MODULE_PATH."/".$dirname."/language/".$this->mLanguageName."/".$fileBodyName.".php";
-		if (!$this->_loadFile($fileName)) {
-			$fileName=XOOPS_ROOT_PATH."/".$dirname."/language/english/".$fileBodyName.".php";
-			$this->_loadFile($fileName);
-		}
-	}
-
-
-	/**
-	 * @access private
-	 */
-	function _loadFile($filename)
-	{
-		if ( file_exists($filename) ) {
-			require_once $filename;
-			return true;
-		}
-
-		return false;
-	}
-}
-
-
-?>
\ No newline at end of file


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