/** * Initialize the skin. * * @param ETController $sender The page controller. * @return void */ public function handler_init($sender) { // source link $sender->addToMenu('statistics', 'myswitch', '<a href="https://github.com/davchezt/MySwitch">MySwitch</a> Skin by DaVchezt'); $sender->addCSSFile((C("esoTalk.https") ? "https" : "http") . "://fonts.googleapis.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); }
/** * 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"); } }
/** * 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"); } }
/** * 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"); } }
/** * Construct and process the settings form for this skin, and return the path to the view that should be * rendered. * * @param ETController $sender The page controller. * @return string The path to the settings view to render. */ public function settings($sender) { // Set up the settings form. $form = ETFactory::make("form"); $form->action = URL("admin/appearance"); $form->setValue("headerColor", C("skin.Default.headerColor")); $form->setValue("bodyColor", C("skin.Default.bodyColor")); $form->setValue("noRepeat", (bool) C("skin.Default.noRepeat")); $form->setValue("bodyImage", (bool) C("skin.Default.bodyImage")); // If the form was submitted... if ($form->validPostBack("save")) { // Construct an array of config options to write. $config = array(); $config["skin.Default.headerColor"] = $form->getValue("headerColor"); $config["skin.Default.bodyColor"] = $form->getValue("bodyColor"); // Upload a body bg image if necessary. if ($form->getValue("bodyImage") and !empty($_FILES["bodyImageFile"]["tmp_name"])) { $config["skin.Default.bodyImage"] = $this->uploadBackgroundImage($form); } elseif (!$form->getValue("bodyImage")) { $config["skin.Default.bodyImage"] = false; } $config["skin.Default.noRepeat"] = (bool) $form->getValue("noRepeat"); if (!$form->errorCount()) { // Write the config file. ET::writeConfig($config); $sender->message(T("message.changesSaved"), "success"); $sender->redirect(URL("admin/appearance")); } } $sender->data("skinSettingsForm", $form); $sender->addCSSFile("core/js/lib/farbtastic/farbtastic.css"); $sender->addJSFile("core/js/lib/farbtastic/farbtastic.js"); return $this->getView("settings"); }