[xoops-cvslog 6518] CVS update: xoops2jp/html/modules/legacy/admin/blocks

Back to archive index

NobuNobu nobun****@users*****
2007年 4月 30日 (月) 16:30:51 JST


Index: xoops2jp/html/modules/legacy/admin/blocks/AdminActionSearch.class.php
diff -u /dev/null xoops2jp/html/modules/legacy/admin/blocks/AdminActionSearch.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:30:51 2007
+++ xoops2jp/html/modules/legacy/admin/blocks/AdminActionSearch.class.php	Mon Apr 30 16:30:51 2007
@@ -0,0 +1,64 @@
+<?php
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+/**
+ * This is test menu block for control panel of legacy module.
+ *
+ * [ASSIGN]
+ *  No
+ * 
+ * @package legacy
+ */
+class Legacy_AdminActionSearch extends Legacy_AbstractBlockProcedure
+{
+	function getName()
+	{
+		return "action_search";
+	}
+
+	function getTitle()
+	{
+		return "TEST: AdminActionSearch";
+	}
+
+	function getEntryIndex()
+	{
+		return 0;
+	}
+
+	function isEnableCache()
+	{
+		return false;
+	}
+
+	function execute()
+	{
+		$render =& $this->getRenderTarget();
+		$render->setAttribute('legacy_module', 'legacy');
+		$render->setTemplateName('legacy_admin_block_actionsearch.html');
+		
+		$root =& XCube_Root::getSingleton();
+		$renderSystem =& $root->getRenderSystem($this->getRenderSystemName());
+		
+		$renderSystem->renderBlock($render);
+	}
+
+	function hasResult()
+	{
+		return true;
+	}
+
+	function &getResult()
+	{
+		$dmy = "dummy";
+		return $dmy;
+	}
+
+	function getRenderSystemName()
+	{
+		return 'Legacy_AdminRenderSystem';
+	}
+}
+
+?>
\ No newline at end of file
Index: xoops2jp/html/modules/legacy/admin/blocks/AdminSideMenu.class.php
diff -u /dev/null xoops2jp/html/modules/legacy/admin/blocks/AdminSideMenu.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:30:51 2007
+++ xoops2jp/html/modules/legacy/admin/blocks/AdminSideMenu.class.php	Mon Apr 30 16:30:51 2007
@@ -0,0 +1,112 @@
+<?php
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+/**
+ * This is test menu block for control panel of legacy module.
+ * This loads module objects by a permission of the current user.
+ * Then this load module's adminmenu and module's information.
+ *
+ * [ASSIGN]
+ *  Array of module objects.
+ * 
+ * @package legacy
+ */
+class Legacy_AdminSideMenu extends Legacy_AbstractBlockProcedure
+{
+	var $mModules = array();
+	
+	/**
+	 * protected, but read OK.
+	 * 
+	 * @access protected
+	 */
+	var $mCurrentModule = null;
+
+	function getName()
+	{
+		return "sidemenu";
+	}
+
+	function getTitle()
+	{
+		return "TEST: AdminSideMenu";
+	}
+	
+	function getEntryIndex()
+	{
+		return 0;
+	}
+
+	function isEnableCache()
+	{
+		return false;
+	}
+
+	function execute()
+	{
+		$root =& XCube_Root::getSingleton();
+		
+		// load message catalog of legacy for _AD_LEGACY_LANG_NO_SETTING, even if the current module is not Legacy.
+		$root->mLanguageManager->loadModuleAdminMessageCatalog('legacy'); 
+		
+		$controller =& $root->mController;
+		$user =& $root->mController->mRoot->mContext->mXoopsUser;
+		$render =& $this->getRenderTarget();
+		$render->setAttribute('legacy_module', 'legacy');
+		
+		$this->mCurrentModule =& $controller->mRoot->mContext->mXoopsModule;
+		
+		if ($this->mCurrentModule->get('dirname') == 'legacy') {
+			if (xoops_getrequest('action') == "help") {
+				$moduleHandler =& xoops_gethandler('module');
+				$t_module =& $moduleHandler->getByDirname(xoops_gethandler('dirname'));
+				if (is_object($t_module)) {
+					$this->mCurrentModule =& $t_module;
+				}
+			}
+		}
+		
+		$db=&$controller->getDB();
+
+		$mod = $db->prefix("modules");
+		$perm = $db->prefix("group_permission");
+		$groups = implode(",", $user->getGroups());
+		
+		//
+		// Users who are belong to ADMIN GROUP have every permissions, so we have to prepare two kinds of SQL.
+		//
+		if ($root->mContext->mUser->isInRole('Site.Owner')) {
+			$sql = "SELECT DISTINCT mid FROM ${mod} WHERE isactive=1 AND hasadmin=1 ORDER BY weight, mid";
+		}
+		else {
+	        $sql = "SELECT DISTINCT ${mod}.mid FROM ${mod},${perm} " .
+	               "WHERE ${mod}.isactive=1 AND ${mod}.mid=${perm}.gperm_itemid AND ${perm}.gperm_name='module_admin' AND ${perm}.gperm_groupid IN (${groups}) " .
+	               "AND ${mod}.hasadmin=1 " .
+	               "ORDER BY ${mod}.weight, ${mod}.mid";
+		}
+
+
+		$result=$db->query($sql);
+		
+		$handler =& xoops_gethandler('module');
+		
+		while($row = $db->fetchArray($result)) {
+			$xoopsModule =& $handler->get($row['mid']);
+			$module =& Legacy_Utils::createModule($xoopsModule);
+
+			$this->mModules[] =& $module;
+			unset($module);
+		}
+		
+		$render->setTemplateName('legacy_admin_block_sidemenu.html');
+		$render->setAttribute('modules', $this->mModules);
+		$render->setAttribute('currentModule', $this->mCurrentModule);
+		
+		$renderSystem =& $root->getRenderSystem($this->getRenderSystemName());
+		
+		$renderSystem->renderBlock($render);
+	}
+}
+
+?>
\ No newline at end of file
Index: xoops2jp/html/modules/legacy/admin/blocks/index.html
diff -u /dev/null xoops2jp/html/modules/legacy/admin/blocks/index.html:1.1.4.1
--- /dev/null	Mon Apr 30 16:30:51 2007
+++ xoops2jp/html/modules/legacy/admin/blocks/index.html	Mon Apr 30 16:30:51 2007
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file


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