/** * * @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; }
/** * * @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; }
/** * * @return string */ public static function getCurrentSkinPath() { return "system/skins/" . SkinController::getCurrentSkinName(); }