* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
// Initialize array
$themesArray = array(
- 'theme_unix' => array(), // Unix name from filesystem
- 'theme_name' => array() // Title
+ 'theme_unix' => [], // Unix name from filesystem
+ 'theme_name' => [] // Title
);
// Only activated themes for the user
// Load all themes
while ($row = sqlFetchArray($result)) {
- // Construct relative include file name
- $inc = sprintf("theme/%s/theme.php", secureString($row['theme_path']));
-
// Load it's theme.php file if found
- if (isIncludeReadable($inc)) {
+ if (isThemeReadable($row['theme_path'])) {
// And save all data in array
- loadInclude($inc);
+ loadInclude(sprintf('theme/%s/theme.php', secureString($row['theme_path'])));
array_push($themesArray['theme_unix'], $row['theme_path']);
array_push($themesArray['theme_name'], $row['theme_name']);
} // END - if
// Checks whether a theme is found in db
function ifThemeExists ($name) {
// Get theme and is it not nul?
- return (((isExtensionActive('theme')) || (getModule() == 'admin')) && (getThemeId($name) > 0));
+ return (((isExtensionActive('theme')) || (getModule() == 'admin')) && (isValidId(getThemeId($name))));
}
// Checks if a theme is active
// Set default theme
setMailerTheme($ret);
} elseif ((isMailerThemeSet()) && (isExtensionInstalledAndNewer('sql_patches', '0.1.4'))) {
- //die("<pre>".print_r($GLOBALS['cache_array']['themes'], TRUE)."</pre>");
+ //* DEBUG-DIE: */ die("<pre>".print_r($GLOBALS['cache_array']['themes'], TRUE)."</pre>");
// Get theme from cookie
$ret = getSession('mailer_theme');
} // END - if
} elseif ((!isInstalled()) && ((isInstalling()) || (isHtmlOutputMode())) && ((isGetRequestElementSet('theme')) || (isPostRequestElementSet('theme')))) {
// Prepare filename for checking
- $themeFile = sprintf("theme/%s/theme.php", getRequestElement('theme'));
+ $themeFile = sprintf('theme/%s/theme.php', getRequestElement('theme'));
// Installation mode active
- if ((isGetRequestElementSet('theme')) && (isIncludeReadable($theme))) {
+ if ((isGetRequestElementSet('theme')) && (isThemeReadable(getRequestElement('theme')))) {
// Set cookie from URL data
setMailerTheme(getRequestElement('theme'));
- } elseif (isIncludeReadable(sprintf("theme/%s/theme.php", postRequestElement('theme')))) {
+ } elseif ((isPostRequestElementSet('theme')) && (isThemeReadable(postRequestElement('theme')))) {
// Set cookie from posted data
setMailerTheme(postRequestElement('theme'));
}