|
@@ -188,7 +188,7 @@ function ThemeList()
|
|
|
checkSession();
|
|
|
validateToken('admin-tl');
|
|
|
|
|
|
- $themes = get_all_themes();
|
|
|
+ $themes = get_all_themes(false);
|
|
|
|
|
|
$setValues = array();
|
|
|
foreach ($themes as $id => $theme)
|
|
@@ -226,7 +226,7 @@ function ThemeList()
|
|
|
loadTemplate('Themes');
|
|
|
|
|
|
|
|
|
- get_all_themes();
|
|
|
+ get_all_themes(false);
|
|
|
|
|
|
$context['reset_dir'] = realpath($boarddir . '/Themes');
|
|
|
$context['reset_url'] = $boardurl . '/Themes';
|
|
@@ -831,29 +831,30 @@ function RemoveTheme()
|
|
|
|
|
|
function EnableTheme()
|
|
|
{
|
|
|
+ global $modSettings, $context;
|
|
|
+
|
|
|
checkSession('get');
|
|
|
|
|
|
isAllowedTo('admin_forum');
|
|
|
validateToken('admin-tre', 'request');
|
|
|
|
|
|
-
|
|
|
- $themeID = isset($_GET['th']) ? (int) $_GET['th'] : (int) $_GET['id'];
|
|
|
+
|
|
|
+ $themeID = isset($_GET['th']) ? (string) trim($_GET['th']) : (string) trim($_GET['id']);
|
|
|
|
|
|
|
|
|
- $enable = explode(',', $modSettings['enableThemes']);
|
|
|
+ $enableThemes = explode(',', $modSettings['enableThemes']);
|
|
|
|
|
|
|
|
|
if (isset($_GET['disabled']))
|
|
|
- {
|
|
|
- for ($i = 0, $n = count($enable); $i < $n; $i++)
|
|
|
- if ($enable[$i] == $themeID)
|
|
|
- unset($enable[$i]);
|
|
|
-
|
|
|
- updateSettings(array('knownThemes' => $enable));
|
|
|
- }
|
|
|
+ $enableThemes = array_diff($enableThemes, array($themeID));
|
|
|
|
|
|
|
|
|
- updateSettings(array('enableThemes' => strtr($modSettings['enableThemes'] . ',' . $themeID, array(',,' => ','))));
|
|
|
+ else
|
|
|
+ $enableThemes[] = (string) $themeID;
|
|
|
+
|
|
|
+
|
|
|
+ $enableThemes = strtr(implode(',', $enableThemes), array(',,' => ','));
|
|
|
+ updateSettings(array('enableThemes' => $enableThemes));
|
|
|
|
|
|
|
|
|
redirectexit('action=admin;area=theme;sa=list;' . $context['session_var'] . '=' . $context['session_id']);
|
|
@@ -898,7 +899,7 @@ function PickTheme()
|
|
|
$_GET['vrt'] = $_POST['vrt'][$k];
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
if (isset($_GET['th']))
|
|
|
{
|
|
|
checkSession('get');
|