Example #1
0
 /**
  *
  * @param string $name
  * @return string 
  */
 public static function getIcon($name)
 {
     $res = Settings::getInstance()->get("host");
     if (file_exists("../system/skins/" . SkinController::getCurrentSkinName() . "/icons/" . strtolower($name) . ".png")) {
         $res .= "system/skins/" . SkinController::getCurrentSkinName() . "/icons/" . strtolower($name) . ".png";
     } else {
         $res .= "system/images/icons/" . Settings::getInstance()->get("iconset") . "/" . strtolower($name) . ".png";
     }
     return $res;
 }
Example #2
0
 /**
  *
  * @param string $name
  * @return string 
  */
 public function getTemplatePath($name)
 {
     $namespaces = explode("_", strtolower($name));
     $res = Settings::getInstance()->get("root");
     $skin = SkinController::getCurrentSkinName();
     $imported = false;
     if (sizeOf($namespaces) == 3) {
         if ($namespaces[0] == "plugin") {
             if (file_exists(Settings::getInstance()->get("root") . "/system/skins/" . $skin . "/templates/plugins/" . $namespaces[1] . "/" . $namespaces[2] . ".html")) {
                 $res .= "/system/skins/" . $skin . "/templates/plugins/" . $namespaces[1] . "/" . $namespaces[2] . ".html";
             } else {
                 $res .= "/system/plugins/" . $namespaces[1] . "/templates/" . $namespaces[2] . ".html";
             }
             $imported = true;
         }
     } else {
         if (sizeOf($namespaces) == 2) {
             if ($namespaces[0] == "form") {
                 if (file_exists(Settings::getInstance()->get("root") . "/system/skins/" . $skin . "/templates/forms/" . $namespaces[1] . ".html")) {
                     $res .= "/system/skins/" . $skin . "/templates/forms/" . $namespaces[1] . ".html";
                 } else {
                     $res .= "/system/templates/forms/" . $namespaces[1] . ".html";
                 }
                 $imported = true;
             } else {
                 if ($namespaces[0] == "control") {
                     if (file_exists(Settings::getInstance()->get("root") . "/system/skins/" . $skin . "/templates/controls/" . $namespaces[1] . ".html")) {
                         $res .= "/system/skins/" . $skin . "/templates/controls/" . $namespaces[1] . ".html";
                     } else {
                         $res .= "/system/templates/controls/" . $namespaces[1] . ".html";
                     }
                     $imported = true;
                 } else {
                     if ($namespaces[0] == "widget") {
                         if (file_exists(Settings::getInstance()->get("root") . "/system/skins/" . $skin . "/templates/widgets/" . $namespaces[1] . ".html")) {
                             $res .= "/system/skins/" . $skin . "/templates/widgets/" . $namespaces[1] . ".html";
                         } else {
                             $res .= "/system/templates/widgets/" . $namespaces[1] . ".html";
                         }
                         $imported = true;
                     }
                 }
             }
         }
     }
     if (!$imported) {
         if (file_exists(Settings::getInstance()->get("root") . "/system/skins/" . $skin . "/templates/" . $name . ".html")) {
             $res .= "/system/skins/" . $skin . "/templates/" . $name . ".html";
         } else {
             $res .= "/system/templates/" . $name . ".html";
         }
     }
     return $res;
 }
Example #3
0
 /**
  *
  * @return string
  */
 public function getCode()
 {
     $template = new Template();
     $template->load("control_skinselector");
     $template->assign_var("NAME", $this->name);
     $template->assign_var("SELECTORNAME", $this->type);
     $template->assign_var("VALUE", $this->value);
     $template->assign_var("HOST", Settings::getValue("host"));
     $template->assign_var("CURRENTSKINNAME", SkinController::getSkinName($this->value));
     $i = 0;
     foreach (SkinController::getInstalledSkins() as $skin) {
         $index = $template->add_loop_item("SKINS");
         $template->assign_loop_var("SKINS", $index, "SELECTORNAME", $this->type);
         $template->assign_loop_var("SKINS", $index, "INDEX", $i);
         $template->assign_loop_var("SKINS", $index, "SKINID", $skin->id);
         $template->assign_loop_var("SKINS", $index, "SKINNAME", $skin->name);
         $i++;
     }
     return $template->getCode();
 }
Example #4
0
 /**
  *
  * @return string
  */
 public static function getCurrentSkinPath()
 {
     return "system/skins/" . SkinController::getCurrentSkinName();
 }
Example #5
0
<?php

include 'const.php';
include 'autoload.php';
if (!DEVELOPMENT) {
    error_reporting(0);
    ini_set('display_errors', 0);
} else {
    error_reporting(-1);
    ini_set('display_errors', 1);
}
session_start();
sys::parseGetParams();
//Unescape backslashes in $_POST
array_walk_recursive($_POST, create_function('&$val', '$val = stripslashes($val);'));
if (!isset($_GET['include'])) {
    $_GET['include'] = '';
}
Page::Current()->ExecuteHttpHeader();
EventManager::RaiseEvent("pre_page_load", null);
if (file_exists(Settings::getInstance()->get("root") . $_GET['include'] . ".htm")) {
    include Settings::getInstance()->get("root") . $_GET['include'] . ".htm";
} else {
    SkinController::displayCurrent();
}
Scheduler::runTasks();
Example #6
0
 /**
  *
  * @return string
  */
 static function getFullSkinPath()
 {
     return Settings::getInstance()->get("host") . SkinController::getCurrentSkinPath() . "/";
 }