當前位置: 首頁>>代碼示例>>PHP>>正文


PHP system::OLIV_CORE_PATH方法代碼示例

本文整理匯總了PHP中system::OLIV_CORE_PATH方法的典型用法代碼示例。如果您正苦於以下問題:PHP system::OLIV_CORE_PATH方法的具體用法?PHP system::OLIV_CORE_PATH怎麽用?PHP system::OLIV_CORE_PATH使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在system的用法示例。


在下文中一共展示了system::OLIV_CORE_PATH方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: olivxml_load_file

function olivxml_load_file($file)
{
    return simplexml_load_file(system::OLIV_CORE_PATH() . $file);
    //	$xml = @simplexml_load_file(system::OLIV_CORE_PATH() . $file);
    //	if ($xml) return $xml;
    //		die ("olivxml_load_file in file.php - fatal error: xml parse error in $file");
}
開發者ID:nibble-arts,項目名稱:oliv,代碼行數:7,代碼來源:file.php

示例2: __construct

    public function __construct($menuName, $name, $value = "")
    {
        if ($menuName and $name) {
            // load javascripts
            OLIVCore::loadScript("jquery-1.7.1.js", system::OLIV_JAVASCRIPT_PATH());
            OLIVCore::loadScript("jquery.contextMenu.js", system::OLIV_JAVASCRIPT_PATH());
            // load css
            OLIVTemplate::link_css(system::OLIV_TEMPLATE_PATH() . system::OLIV_TEMPLATE() . "/", "jquery.contextMenu.css");
            // load menu item definition
            $this->context = olivxml_load_file(system::OLIV_CONTEXT_PATH() . "{$menuName}.xml", system::OLIV_CORE_PATH());
            //------------------------------------------------------------------------------
            // load context menu plugin script
            OLIVCore::loadScript("{$menuName}.contextMenu.js", system::OLIV_JAVASCRIPT_PATH());
            // set javascript action for context display
            ?>
	<script language='javascript'>
// get function name and parameters
			menuFunc="<?php 
            echo $menuName;
            ?>
_contextMenu";
			menuParam = "<?php 
            echo $name;
            ?>
";

// call contextMenu script
			window[menuFunc](menuParam);
	</script>

<?php 
            //------------------------------------------------------------------------------
            // set context menu name
            $this->context->addAttribute('name', $name);
            if ($value) {
                $this->context->addAttribute('value', $value);
            }
            // disable paste
            if (!OLIVClipboard::_()) {
                $this->disable("paste");
            }
        } else {
            return FALSE;
        }
    }
開發者ID:nibble-arts,項目名稱:oliv,代碼行數:45,代碼來源:context.php

示例3: loadScript

 public static function loadScript($file, $path = "")
 {
     $path = system::OLIV_CORE_PATH() . $path;
     // redirect to core root directory
     if (file_exists($path . $file)) {
         // check for filetype
         $fileInfo = pathInfo($file);
         // debug
         // print_r("load script " . $path . $file . "<br>");
         switch ($fileInfo['extension']) {
             case 'php':
                 include_once $path . $file;
                 break;
             case 'js':
                 echo "<script type='text/javascript' src='{$path}{$file}'></script >";
                 break;
             default:
                 OLIVError::fire("core::loadScript - script {$path}{$file} unknown filetype");
                 return FALSE;
         }
         return $file;
     } else {
         OLIVError::fire("core::loadScript - script {$path}{$file} not found");
     }
     return FALSE;
 }
開發者ID:nibble-arts,項目名稱:oliv,代碼行數:26,代碼來源:core.php

示例4: simplexml_load_file

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");
} else {
    die("init.php - system.xml not found");
}
//------------------------------------------------------------------------------
// set system constants
if ($coreXml) {
    if ($coreXml->system->children()) {
        foreach ($coreXml->system->children() as $key => $value) {
            system::set($key, (string) $value);
        }
    } else {
        die("init.php - no constant definitions found");
    }
    //------------------------------------------------------------------------------
    // system includes
開發者ID:nibble-arts,項目名稱:oliv,代碼行數:31,代碼來源:init.php


注:本文中的system::OLIV_CORE_PATH方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。