本文整理汇总了PHP中system::OLIV_BASE方法的典型用法代码示例。如果您正苦于以下问题:PHP system::OLIV_BASE方法的具体用法?PHP system::OLIV_BASE怎么用?PHP system::OLIV_BASE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system
的用法示例。
在下文中一共展示了system::OLIV_BASE方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($header)
{
//TODO use https when loggin in
// use ssh for login
// $host = "https://" . OLIV_SSH_HOST . "/" . OLIV_BASE . "index.php";
$host = "http://" . system::OLIV_SSH_HOST() . "/" . system::OLIV_BASE() . "index.php";
// load login content xml
$this->content = OLIVModule::load_content($header);
// select template for logged of not logged
if (status::OLIV_USER()) {
$header->param->template = "logged";
$this->content->username = OLIVUser::getName(status::OLIV_USER());
if (status::OLIV_SU()) {
$this->content->su = status::OLIV_SU();
} else {
$this->content->user_groups = OLIVUser::getGroupName(status::OLIV_USER());
}
} else {
// check if wrong login
if (argv::action() == "login") {
$header->param->template = "incorrect";
}
}
// load correct template
$this->template = OLIVModule::load_template($header);
}
示例2: header
public function header()
{
$base = system::OLIV_PROTOCOL() . system::OLIV_HOST() . system::OLIV_BASE();
$o = "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>";
// set page to utf-8
$o .= "<base href='{$base}'>";
// link base referenz
$o .= "<title>" . status::oliv_page() . "</title>";
// page title in browser
$o .= "<link href='" . OLIVImage::_(system::OLIV_ICON()) . "' type='image/x-icon' rel='shortcut icon'>";
// icon in browser
return $o;
}
示例3: explode
//DEBUG
//echoall($_SERVER[HTTPS]);
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// set document root path
$pathArray = explode("/", $_SERVER['SCRIPT_FILENAME']);
system::set('OLIV_SCRIPT_NAME', array_pop($pathArray));
system::set('OLIV_DOCUMENT_ROOT', implode("/", $pathArray) . "/");
$pathArray = explode("/", $_SERVER['SCRIPT_NAME']);
array_pop($pathArray);
if (!$pathArray[0]) {
array_shift($pathArray);
}
system::set('OLIV_BASE', implode("/", $pathArray) . "/");
// clear / if base is root directory
if (system::OLIV_BASE() == "/") {
system::set('OLIV_BASE', "");
}
system::set('OLIV_HOST', $_SERVER['HTTP_HOST'] . "/");
//------------------------------------------------------------------------------
// set http / https protocol
if (isset($_SERVER['HTTPS'])) {
system::set('OLIV_PROTOCOL', "https://");
} else {
system::set('OLIV_PROTOCOL', "http://");
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// load system definitions
if (file_exists(system::OLIV_CORE_PATH() . "system.xml")) {
$coreXml = simplexml_load_file(system::OLIV_CORE_PATH() . "system.xml");
示例4: makeUrl
public static function makeUrl($lang, $url)
{
$valArray = array();
if ($url) {
$routeArray = array(system::OLIV_PROTOCOL() . system::OLIV_HOST() . system::OLIV_BASE() . system::OLIV_SCRIPT_NAME());
if ($lang) {
array_push($routeArray, $lang);
} else {
$lang = status::lang();
}
// use friendly name for url
$path = OLIVRoute::makePath($url);
// tranlsate and combine path
foreach ($path as $entry) {
array_push($valArray, OLIVRoute::translateFriendlyName($lang, $entry));
}
$val = implode("/", $valArray);
if ($val) {
array_push($routeArray, $val);
}
return implode("/", $routeArray);
}
}