mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 05:07:27 +02:00
Code cleanup on usertheme_menu. Very outdated.
This commit is contained in:
@@ -2,16 +2,10 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/user_menu/usertheme_menu.php,v $
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
@@ -31,7 +25,7 @@ if ((USER == TRUE) && check_class(varset($pref['allow_theme_select'],FALSE)))
|
|||||||
{
|
{
|
||||||
if ($file != "." && $file != ".." && $file != "templates" && $file != "" && $file != "CVS")
|
if ($file != "." && $file != ".." && $file != "templates" && $file != "" && $file != "CVS")
|
||||||
{
|
{
|
||||||
if (is_readable(e_THEME.$file."/theme.php") && is_readable(e_THEME.$file."/style.css") && ($allThemes || in_Array($file, $themeList)))
|
if (is_readable(e_THEME.$file."/theme.php") /*&& is_readable(e_THEME.$file."/style.css")*/ && ($allThemes || in_Array($file, $themeList)))
|
||||||
{
|
{
|
||||||
$themelist[] = $file;
|
$themelist[] = $file;
|
||||||
$themecount[$file] = 0;
|
$themecount[$file] = 0;
|
||||||
@@ -45,16 +39,16 @@ if ((USER == TRUE) && check_class(varset($pref['allow_theme_select'],FALSE)))
|
|||||||
$defaulttheme = $pref['sitetheme'];
|
$defaulttheme = $pref['sitetheme'];
|
||||||
$count = 0;
|
$count = 0;
|
||||||
|
|
||||||
$totalct = $sql->db_Select("user", "user_prefs", "user_prefs REGEXP('sitetheme') ");
|
$totalct = $sql->select("user", "user_prefs", "user_prefs REGEXP('sitetheme') ");
|
||||||
|
|
||||||
while ($row = $sql->db_Fetch())
|
while ($row = $sql->fetch())
|
||||||
{
|
{
|
||||||
$up = (substr($row['user_prefs'],0,5) == "array") ? $eArrayStorage->ReadArray($row['user_prefs']) : unserialize($row['user_prefs']);
|
$up = (substr($row['user_prefs'],0,5) == "array") ? $eArrayStorage->ReadArray($row['user_prefs']) : unserialize($row['user_prefs']);
|
||||||
|
|
||||||
if (isset($themecount[$up['sitetheme']])) { $themecount[$up['sitetheme']]++; }
|
if (isset($themecount[$up['sitetheme']])) { $themecount[$up['sitetheme']]++; }
|
||||||
}
|
}
|
||||||
|
|
||||||
$defaultusers = $sql->db_Count("user") - $totalct;
|
$defaultusers = $sql->count("user") - $totalct;
|
||||||
$themecount[$defaulttheme] += $defaultusers;
|
$themecount[$defaulttheme] += $defaultusers;
|
||||||
|
|
||||||
$text = "<form method='post' action='".e_SELF."'>
|
$text = "<form method='post' action='".e_SELF."'>
|
||||||
|
@@ -2,16 +2,10 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/user_menu/usertheme_menu_config.php,v $
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$eplug_admin = TRUE;
|
$eplug_admin = TRUE;
|
||||||
@@ -30,13 +24,15 @@ if (!getperms("2")) // Same permissions as menu configuration
|
|||||||
|
|
||||||
require_once(e_ADMIN."auth.php");
|
require_once(e_ADMIN."auth.php");
|
||||||
|
|
||||||
|
$frm = e107::getForm();
|
||||||
|
|
||||||
// Get the list of available themes
|
// Get the list of available themes
|
||||||
$handle = opendir(e_THEME);
|
$handle = opendir(e_THEME);
|
||||||
while ($file = readdir($handle))
|
while ($file = readdir($handle))
|
||||||
{
|
{
|
||||||
if ($file != "." && $file != ".." && $file != "templates" && $file != "" && $file != "CVS")
|
if ($file != "." && $file != ".." && $file != "templates" && $file != "" && $file != "CVS")
|
||||||
{
|
{
|
||||||
if (is_readable(e_THEME.$file."/theme.php") && is_readable(e_THEME.$file."/style.css"))
|
if (is_readable(e_THEME.$file."/theme.php") /*&& is_readable(e_THEME.$file."/style.css")*/)
|
||||||
{
|
{
|
||||||
$themeOptions[] = $file;
|
$themeOptions[] = $file;
|
||||||
$themeCount[$file] = 0;
|
$themeCount[$file] = 0;
|
||||||
@@ -80,15 +76,14 @@ $text = "
|
|||||||
<form method='post' action='".e_SELF."' id='menu_conf_form'>
|
<form method='post' action='".e_SELF."' id='menu_conf_form'>
|
||||||
<fieldset id='core-user_menu-usertheme'>
|
<fieldset id='core-user_menu-usertheme'>
|
||||||
<legend class='e-hideme'>".LAN_UMENU_THEME_6."</legend>
|
<legend class='e-hideme'>".LAN_UMENU_THEME_6."</legend>
|
||||||
<table cellpadding='0' cellspacing='0' class='adminlist'>
|
<table class='table adminlist'>
|
||||||
|
|
||||||
<colgroup span='2'>
|
<colgroup span='2'>
|
||||||
<col style='width: 50%' />
|
<col style='width: 50%' />
|
||||||
<col style='width: 50%' />
|
<col style='width: 50%' />
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan='2' class='forumheader2'>".LAN_UMENU_THEME_4."</th>
|
<th colspan='2'>".LAN_UMENU_THEME_4."</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>";
|
<tbody>";
|
||||||
@@ -98,23 +93,22 @@ $text = "
|
|||||||
$ch = (in_array($th, $themeList) ? " checked='checked'" : '');
|
$ch = (in_array($th, $themeList) ? " checked='checked'" : '');
|
||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader3'>{$th}</td>
|
<td>{$th}</td>
|
||||||
<td class='forumheader3'><input class='tbox' type='checkbox' name='theme_{$th}' value='{$th}' {$ch} /></td>
|
<td><input class='tbox' type='checkbox' name='theme_{$th}' value='{$th}' {$ch} /></td>
|
||||||
</tr>";
|
</tr>";
|
||||||
}
|
}
|
||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader3'>".LAN_UMENU_THEME_7."</td>
|
<td>".LAN_UMENU_THEME_7."</td>
|
||||||
<td class='forumheader3'>".$e_userclass->uc_dropdown("themeeditclass", $themeeditclass, "main,member,admin,classes,matchclass,nobody")."</td>
|
<td>".$e_userclass->uc_dropdown("themeeditclass", $themeeditclass, "main,member,admin,classes,matchclass,nobody")."</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
|
||||||
<td colspan='2' class='forumheader' style='text-align:center'><input class='btn button' type='submit' name='update_theme' value='".LAN_UMENU_THEME_5."' /></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div class='buttons-bar center'>
|
||||||
|
".$frm->admin_button('update_theme', LAN_UPDATE, 'update')."
|
||||||
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
";
|
";
|
||||||
@@ -124,11 +118,12 @@ $ns->tablerender(LAN_UMENU_THEME_6,$mes->render().$text);
|
|||||||
|
|
||||||
require_once(e_ADMIN."footer.php");
|
require_once(e_ADMIN."footer.php");
|
||||||
|
|
||||||
|
/*
|
||||||
function headerjs()
|
function headerjs()
|
||||||
{
|
{
|
||||||
return "<script type='text/javascript' src='".e_FILE_ABS."jslib/core/admin.js'></script>";
|
return "<script type='text/javascript' src='".e_FILE_ABS."jslib/core/admin.js'></script>";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user