Beispiel #1
0
 /**
  * Initialize the skin.
  * 
  * @param ETController $sender The page controller.
  * @return void
  */
 public function handler_init($sender)
 {
     $sender->addCSSFile((C("esoTalk.https") ? "https" : "http") . "://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700");
     $sender->addCSSFile("core/skin/base.css", true);
     $sender->addCSSFile($this->getResource("styles.css"), true);
     // If we're viewing from a mobile browser, add the mobile CSS and change the master view.
     if ($isMobile = isMobileBrowser()) {
         $sender->addCSSFile($this->getResource("mobile.css"), true);
         $sender->masterView = "mobile.master";
         $sender->addToHead("<meta name='viewport' content='width=device-width; initial-scale=1.0; maximum-scale=1.0;'>");
     }
     // If custom colors have been set in this skin's settings, add some CSS to the page.
     $styles = array();
     // If a custom header color has been set...
     if ($c = C("skin.Default.headerColor")) {
         $styles[] = "#hdr {background-color:{$c}}";
         // If the header color is in the top half of the lightness spectrum, add the "lightHdr" class to the body.
         $rgb = colorUnpack($c, true);
         $hsl = rgb2hsl($rgb);
         if ($hsl[2] >= 0.5) {
             $sender->bodyClass .= " lightHdr";
         }
     }
     // If a custom body color has been set...
     if ($c = C("skin.Default.bodyColor")) {
         $styles[] = "body, .scrubberMore {background-color:{$c} !important}";
         // If the body color is in the bottom half of the lightness spectrum, add the "darkBody" class to the body.
         $rgb = colorUnpack($c, true);
         $hsl = rgb2hsl($rgb);
         if ($hsl[2] < 0.5) {
             $sender->bodyClass .= " darkBody";
         }
         // Slightly darken the body color and set it as the border color for the body content area.
         $hsl[2] = max(0, $hsl[2] - 0.1);
         $hsl[1] = min($hsl[1], 0.5);
         $b = colorPack(hsl2rgb($hsl), true);
         $styles[] = "#body-content {border-color:{$b}}";
     }
     // If a custom body background image has been set...
     if ($img = C("skin.Default.bodyImage") and !$isMobile) {
         $styles[] = "body {background-image:url(" . getWebPath($img) . "); background-position:top center; background-attachment:fixed}";
     }
     // Do we want this background image to not repeat?
     if ($img and C("skin.Default.noRepeat")) {
         $styles[] = "body {background-repeat:no-repeat}";
     }
     // If we have any custom styles at all, add them to the page head.
     if (count($styles)) {
         $sender->addToHead("<style type='text/css'>\n" . implode("\n", $styles) . "\n</style>");
     }
 }
Beispiel #2
0
 /**
  * Initialize the skin.
  * 
  * @param ETController $sender The page controller.
  * @return void
  */
 public function handler_init($sender)
 {
     $sender->addCSSFile("core/skin/base.css", true);
     $sender->addCSSFile("core/skin/font-awesome.css", true);
     $sender->addCSSFile($this->resource("styles.css"), true);
     // If we're viewing from a mobile browser, add the mobile CSS and change the master view.
     if ($isMobile = isMobileBrowser()) {
         $sender->addCSSFile($this->resource("mobile.css"), true);
         $sender->masterView = "mobile.master";
         $sender->addToHead("<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'>");
     }
     $sender->addCSSFile("config/colors.css", true);
     if (!C("skin.Default.primaryColor")) {
         $this->writeColors("#364159");
     }
 }
Beispiel #3
0
 /**
  * Initialize the skin.
  * 
  * @param ETController $sender The page controller.
  * @return void
  */
 public function handler_init($sender)
 {
     $sender->addCSSFile((C("esoTalk.https") ? "https" : "http") . "://fonts.useso.com/css?family=Open+Sans:400,600");
     $sender->addCSSFile("core/skin/base.css", true);
     $sender->addCSSFile("core/skin/font-awesome.css", true);
     $sender->addCSSFile($this->resource("styles.css"), true);
     // If we're viewing from a mobile browser, add the mobile CSS and change the master view.
     if ($isMobile = isMobileBrowser()) {
         $sender->addCSSFile($this->resource("mobile.css"), true);
         $sender->masterView = "mobile.master";
         $sender->addToHead("<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'>");
     }
     $sender->addCSSFile(C("esoTalk.aggregateCSS") ? PATH_CONFIG . "/colors.css" : "config/colors.css", true);
     if (!C("skin.Default.primaryColor")) {
         $this->writeColors("#364159");
     }
 }
Beispiel #4
0
 /**
  * Initialize the skin.
  * 
  * @param ETController $sender The page controller.
  * @return void
  */
 public function handler_init($sender)
 {
     $sender->addToHead("<link rel='shortcut icon' href='" . getWebPath($this->resource("favicon.ico")) . "'>");
     $sender->addCSSFile((C("esoTalk.https") ? "https" : "http") . "://fonts.googleapis.com/css?family=Open+Sans:400,600|Roboto|TitilliumWeb");
     $sender->addCSSFile("core/skin/base.css", true);
     $sender->addCSSFile("core/skin/font-awesome.css", true);
     $sender->addCSSFile($this->resource("styles.css"), true);
     // If we're viewing from a mobile browser, add the mobile CSS and change the master view.
     if ($isMobile = isMobileBrowser()) {
         $sender->addCSSFile($this->resource("mobile.css"), true);
         $sender->masterView = "mobile.master";
         $sender->addToHead("<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'>");
     }
     $sender->addCSSFile("config/colors.css", true);
     if (!C("skin.Doragon.primaryColor")) {
         $this->writeColors("#364159");
     }
 }
Beispiel #5
0
}
// We need to work out what the URL to this exact page is and set it to the controller later.
// If we didn't work it out above, set it to $request and append any GET variables.
if (empty($selfURL)) {
    $selfURL = $request;
    if (!empty($_GET)) {
        $selfURL .= "?" . http_build_query($_GET);
    }
}
$requestParts = explode("/", $request);
//***** 8. SET UP SKIN
if (C("esoTalk.installed")) {
    // If the user is an administrator and we're in the admin section, use the admin skin.
    if (ET::$session->isAdmin() and $requestParts[0] == "admin") {
        $skinName = C("esoTalk.adminSkin");
    } elseif (isMobileBrowser()) {
        $skinName = C("esoTalk.mobileSkin");
    } else {
        $skinName = C("esoTalk.skin");
    }
    // Include the skin file and instantiate its class.
    ET::$skinName = $skinName;
    if (file_exists($file = PATH_SKINS . "/{$skinName}/skin.php")) {
        include_once $file;
    }
    $skinClass = "ETSkin_" . $skinName;
    if (class_exists($skinClass)) {
        ET::$skin = new $skinClass("addons/skins/" . $skinName);
    }
}
// If we haven't got a working skin, just use the base class. It'll be ugly, but it'll do.
Beispiel #6
0
    $tpl->assign('username', Session::getUser()->getUsername());
    $tpl->assign('userId', Session::getUser()->getId());
} else {
    $tpl->assign('avatar', 'resources/images/defaultAvatar.png');
    $tpl->assign('username', 'Guest');
}
// We don't output all the naviagion and whatnot if there has been some sort of error.
if (isset($_GET['error']) || basename($_SERVER['PHP_SELF']) == 'error.php') {
    return;
}
$sql = 'SELECT i.title, i.url FROM additional_menu_items i ';
$stmt = $db->query($sql);
$ll = new HtmlLinksCollection();
foreach ($stmt->fetchAll() as $link) {
    $ll->add($link['url'], $link['title']);
}
if (!empty($_SESSION['userHidden'])) {
    $tpl->assign('userHidden', $_SESSION['userHidden']->getUsername());
}
$tpl->assign('promo', 'resources/themes/westlan.ng/images/logo.png');
$tpl->assign('IS_LOGGED_IN', Session::isLoggedIn());
$tpl->assign('additionalLinks', $ll);
$tpl->assign('globalAnnouncement', getSiteSetting('globalAnnouncement'));
$tpl->assign('newsFeatureEnabled', getSiteSetting('newsFeature'));
$tpl->assign('galleryFeatureEnabled', getSiteSetting('galleryFeature'));
$tpl->assign('notification', SessionBasedNotifications::getInstance()->pop());
$tpl->assign('isMobileBrowser', isMobileBrowser());
$tpl->assign('theme', getThemeDirectory());
$tpl->assign('siteTitle', getSiteSetting('siteTitle'));
$tpl->assign('siteDescription', getSiteSetting('siteDescription'));
$tpl->display('header.tpl');