[xoops-cvslog 6604] CVS update: xoops2jp/html/modules/stdCache/preload

Back to archive index

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


Index: xoops2jp/html/modules/stdCache/preload/Initialize.class.php
diff -u /dev/null xoops2jp/html/modules/stdCache/preload/Initialize.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:37:51 2007
+++ xoops2jp/html/modules/stdCache/preload/Initialize.class.php	Mon Apr 30 16:37:51 2007
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package stdCache
+ * @version $Id: Initialize.class.php,v 1.1.4.1 2007/04/30 07:37:51 nobunobu Exp $
+ */
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+ 
+class StdCache_Initialize extends XCube_ActionFilter
+{
+	function preBlockFilter()
+	{
+		$this->mController->mSetBlockCachePolicy->add(array(&$this, 'setForBlock'), XCUBE_DELEGATE_PRIORITY_FIRST + 10);
+		$this->mController->mSetModuleCachePolicy->add(array(&$this, 'setForModule'), XCUBE_DELEGATE_PRIORITY_FIRST + 10);
+	}
+	
+	function setForBlock(&$cacheInfo)
+	{
+		$user =& $this->mRoot->mContext->mXoopsUser;
+		if (is_object($user)) {
+			$cacheInfo->mGroupArr = $user->getGroups();
+			$cacheInfo->setEnableCache(!in_array(XOOPS_GROUP_ADMIN, $user->getGroups()));
+		}
+		else {
+			$cacheInfo->mGroupArr = array(XOOPS_GROUP_ANONYMOUS);
+			$cacheInfo->setEnableCache(true);
+		}
+	}
+
+	function setForModule(&$cacheInfo)
+	{
+		$user =& $this->mRoot->mContext->mXoopsUser;
+		if (is_object($user)) {
+			$cacheInfo->mGroupArr = $user->getGroups();
+			$cacheInfo->setEnableCache(!in_array(XOOPS_GROUP_ADMIN, $user->getGroups()));
+		}
+		else {
+			$cacheInfo->mGroupArr = array(XOOPS_GROUP_ANONYMOUS);
+			$cacheInfo->setEnableCache(true);
+		}
+	}
+}
+
+?>
\ No newline at end of file
Index: xoops2jp/html/modules/stdCache/preload/index.html
diff -u /dev/null xoops2jp/html/modules/stdCache/preload/index.html:1.1.4.1
--- /dev/null	Mon Apr 30 16:37:51 2007
+++ xoops2jp/html/modules/stdCache/preload/index.html	Mon Apr 30 16:37:51 2007
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file


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