X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ftheme-manager.php;h=f87b68fd319130d505ca122256bd7490eb3d0a92;hp=44b82d17ddaae68eac654c5f3efdb598ce073d55;hb=3b85bd5030ad591b0c5cb038ca534a7b50e1b319;hpb=6c763653e88b9d10627e651ca59c7201d4b7d62b diff --git a/inc/theme-manager.php b/inc/theme-manager.php index 44b82d17dd..f87b68fd31 100644 --- a/inc/theme-manager.php +++ b/inc/theme-manager.php @@ -1,288 +1,3 @@ = "0.1.4")) { - //die("
".print_r($cacheArray['themes'], true)."
"); - // Get theme from cookie - $ret = get_session('mxchange_theme'); - - // Is it valid? - if (THEME_GET_ID($ret) == 0) { - // Fix it to default - $ret = "default"; - } // END - if - } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) { - // Prepare FQFN for checking - $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_GET['theme'])); - - // Installation mode active - if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) { - // Set cookie from URL data - set_session("mxchange_theme", $_GET['theme']); - } elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])))) { - // Set cookie from posted data - set_session("mxchange_theme", $_POST['theme']); - } - - // Set return value - $ret = get_session('mxchange_theme'); - } else { - // Invalid design, reset cookie - set_session("mxchange_theme", $ret); - } - - // Add (maybe) found theme.php file to inclusion list - $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($ret)); - - // Try to load the requested include file - if (FILE_READABLE($theme)) $INC_POOL[] = $theme; - - // Return theme value - return $ret; -} - -function THEME_SELECTION_BOX($mod, $act, $wht, $result) { - // Construction URL - $FORM = URL."/modules.php?module=".$mod; - if (!empty($act)) $FORM .= "&action=".$act; - if (!empty($wht)) $FORM .= "&what=".$wht; - define('__FORM_VALUE', $FORM); - - // Initialize array - $THEMES = array( - 'theme_unix' => array(), // Unix name from filesystem - 'theme_name' => array() // Title - ); - - // Load all themes - while(list($theme) = SQL_FETCHROW($result)) { - // Load it's theme.php file - $INC = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($theme)); - if (FILE_READABLE($INC)) { - // And save all data in array - require($INC); - $THEMES['theme_unix'][] = $theme; - $THEMES['theme_name'][] = $THEME_NAME; - } // END - if - } // END - while - - // Sort whole array by title - array_pk_sort($THEMES, array("theme_name")); - - // Construct selection form for the box template - $OUT = ""; - foreach ($THEMES['theme_unix'] as $key => $theme) { - $OUT .= "