[xoops-cvslog 6610] CVS update: xoops2jp/html/modules/user/admin/preload

Back to archive index

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


Index: xoops2jp/html/modules/user/admin/preload/AdminPreload.class.php
diff -u /dev/null xoops2jp/html/modules/user/admin/preload/AdminPreload.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:32 2007
+++ xoops2jp/html/modules/user/admin/preload/AdminPreload.class.php	Mon Apr 30 16:38:32 2007
@@ -0,0 +1,36 @@
+<?php
+/**
+ * @package user
+ * @version $Id: AdminPreload.class.php,v 1.1.4.1 2007/04/30 07:38:32 nobunobu Exp $
+ */
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+class User_AdminPreload extends XCube_ActionFilter
+{
+	function preBlockFilter()
+	{
+		$this->mRoot->mDelegateManager->add('Legacy.Event.ThemeSettingChanged', 'User_AdminPreload::doThemeSettingChanged');
+	}
+	
+	function doThemeSettingChanged($mainTheme, $selectableThemes)
+	{
+		$root =& XCube_Root::getSingleton();
+		$db =& $root->mController->mDB;
+		$table = $db->prefix('users');
+		
+		$mainTheme = $db->quoteString($mainTheme);
+		
+		$t_conds = array();
+		$t_conds[] = "theme <> " . $db->quoteString('');
+		foreach ($selectableThemes as $theme) {
+			$t_conds[] = "theme <> " . $db->quoteString($theme);
+		}
+		
+		$sql = "UPDATE ${table} SET theme=${mainTheme} WHERE " . join(' AND ' , $t_conds);
+
+		$db->query($sql);
+	}
+}
+
+?>
\ No newline at end of file
Index: xoops2jp/html/modules/user/admin/preload/index.html
diff -u /dev/null xoops2jp/html/modules/user/admin/preload/index.html:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:32 2007
+++ xoops2jp/html/modules/user/admin/preload/index.html	Mon Apr 30 16:38:32 2007
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file


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