Beispiel #1
0
<?php

// No direct access.
defined('_JEXEC') or die;
$TemplateStyle = $Default_TemplateStyle;
$mainurl = $_SERVER['PHP_SELF'] . rebuildQueryString($ice_temp);
foreach ($ice_temp as $tprop) {
    $ice_session = JFactory::getSession();
    if ($ice_session->get($cookie_prefix . $tprop)) {
        ${$tprop} = $ice_session->get($cookie_prefix . $tprop);
    } elseif (isset($_COOKIE[$cookie_prefix . $tprop])) {
        ${$tprop} = JRequest::getVar($cookie_prefix . $tprop, '', 'COOKIE', 'STRING');
    }
}
function rebuildQueryString($ice_temp)
{
    if (!empty($_SERVER['QUERY_STRING'])) {
        $parts = explode("&", $_SERVER['QUERY_STRING']);
        $newParts = array();
        foreach ($parts as $val) {
            $val_parts = explode("=", $val);
            if (!in_array($val_parts[0], $ice_temp)) {
                array_push($newParts, $val);
            }
        }
        if (count($newParts) != 0) {
            $qs = implode("&amp;", $newParts);
        } else {
            return "?";
        }
        return "?" . $qs . "&amp;";
<?php

defined('_JEXEC') or die('Restricted index access');
//$fontstyle = "f-" . $default_font;
$mtype = $menu_type;
$cookie_prefix = "nbus-";
$session =& JFactory::getSession();
//load menu type
if ($session->get($cookie_prefix . 'mtype')) {
    $mtype = $session->get($cookie_prefix . 'mtype');
} elseif (isset($_COOKIE[$cookie_prefix . 'mtype'])) {
    $mtype = htmlentities(JRequest::getVar($cookie_prefix . 'mtype', '', 'COOKIE', 'STRING'));
}
$menu_type = $mtype;
$thisurl = $_SERVER['PHP_SELF'] . rebuildQueryString();
function rebuildQueryString()
{
    $ignores = array("contraststyle", "fontstyle", "widthstyle");
    if (!empty($_SERVER['QUERY_STRING'])) {
        $parts = explode("&", $_SERVER['QUERY_STRING']);
        $newParts = array();
        foreach ($parts as $val) {
            $val_parts = explode("=", $val);
            if (!in_array($val_parts[0], $ignores)) {
                array_push($newParts, $val);
            }
        }
        if (count($newParts) != 0) {
            $qs = implode("&amp;", $newParts);
        } else {
            return "?";
<?php

defined('_JEXEC') or die('Restricted index access');
// set default vars
$fontstyle = "f-" . $default_font;
$fontfamily = $font_family;
$tstyle = $preset_style;
$mtype = $menu_type;
$thisurl = $this->base . rebuildQueryString($template_properties);
$my_session = JFactory::getSession();
//array of properties to look for and store
foreach ($template_properties as $tprop) {
    if (isset($_REQUEST['reset-settings'])) {
        $my_session->set($cookie_prefix . $tprop, "");
        setcookie($cookie_prefix . $tprop, "", $cookie_time, '/', false);
    } elseif ($my_session->get($cookie_prefix . $tprop)) {
        ${$tprop} = $my_session->get($cookie_prefix . $tprop);
    } elseif (isset($_COOKIE[$cookie_prefix . $tprop])) {
        ${$tprop} = JRequest::getVar($cookie_prefix . $tprop, '', 'COOKIE', 'STRING');
    }
}
if ($preset_style != $tstyle) {
    rebuildColorParams($this, $tstyle);
}
// rebuild color params from preset array
function rebuildColorParams(&$template, &$tstyle)
{
    global $stylesList, $header_style, $body_style, $bg_style, $footer_style, $primary_color;
    $style = $stylesList[$tstyle];
    $header_style = $style[0];
    $body_style = $style[1];