当前位置: 首页>>代码示例>>PHP>>正文


PHP system::OLIV_TEMPLATE方法代码示例

本文整理汇总了PHP中system::OLIV_TEMPLATE方法的典型用法代码示例。如果您正苦于以下问题:PHP system::OLIV_TEMPLATE方法的具体用法?PHP system::OLIV_TEMPLATE怎么用?PHP system::OLIV_TEMPLATE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在system的用法示例。


在下文中一共展示了system::OLIV_TEMPLATE方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __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

示例2: getImagePath

 public static function getImagePath($name)
 {
     $modules = system::modules();
     if ($modules[$name]) {
         $path = system::OLIV_MODULE_PATH() . $name . "/template/" . system::OLIV_TEMPLATE() . "/images/";
         if ($path) {
             // image found in template
             return $path;
         } else {
             $path = system::OLIV_MODULE_PATH() . $name . "/template/default/images/";
             if ($path) {
                 // image found in default template
                 return $path;
             }
         }
     } else {
         OLIVError::fire("module '{$name}' not found");
     }
 }
开发者ID:nibble-arts,项目名称:oliv,代码行数:19,代码来源:module.php

示例3: init

 public function init($session)
 {
     // ------------------------------------------------------------------------------
     // set session
     if ($session) {
         system::set('OLIV_SESSION', $session . "/");
     } else {
         die("***FATAL ERROR: init.php - no session defined");
     }
     // core path for multisession defined
     if (!system::OLIV_CORE_PATH()) {
         die("Core path not defined");
     }
     // ------------------------------------------------------------------------------
     // ------------------------------------------------------------------------------
     // load basic system methods
     OLIVCore::loadScript("library/init.php");
     if (!system::OLIVENV()) {
         die("Environment not set");
     }
     // ------------------------------------------------------------------------------
     // ------------------------------------------------------------------------------
     // ------------------------------------------------------------------------------
     // load system language
     if (!system::OLIVTEXT()) {
         die("INIT: OLIVTEXT not found");
     }
     OLIVText::load(system::OLIV_LANGUAGE_PATH(), system::OLIV_CORE_TEXT());
     // ------------------------------------------------------------------------------
     // initialice main components
     // ------------------------------------------------------------------------------
     // connect to database
     // $this->daba = new OLIVDatabase($this->coreXml->_("core.database"));
     // initialise router
     $this->route = new OLIVRoute();
     // initialise html
     $this->html = new OLIVHtml();
     // load module metadata
     $this->module = new OLIVModule();
     // load plugin metadata
     $this->plugin = new OLIVPlugin();
     // load site template
     $this->template = new OLIVTemplate(system::OLIV_TEMPLATE_PATH() . system::OLIV_TEMPLATE() . "/", system::OLIV_TEMPLATE());
     // initialise page
     $this->page = new OLIVPage();
     // initialise preprocessor
     $this->processor = new OLIVProcessor();
     // initialise renderer
     $this->render = new OLIVRender();
     // ------------------------------------------------------------------------------
     // set core status
     // ------------------------------------------------------------------------------
     // extract command and value
     if (status::val()) {
         // extract cmd and param
         $cmdArray = explode("/", cut_slash(status::val()));
         // TODO define commands in system section ???
         // search for command and retranslate
         if (count($cmdArray)) {
             $cmd = OLIVText::getId($cmdArray[0]);
             status::set('command', $cmd);
             // save command
         }
         // if command found, extract command from val
         if (count($cmdArray) > 1 and $cmd) {
             array_shift($cmdArray);
             // remove command from val
             status::set('val', implode("/", $cmdArray));
             // save val
         }
     }
     // ------------------------------------------------------------------------------
     // initialize clipboard
     // get content from clipboard parameter
     if ($clipboard = argv::clipboard()) {
         OLIVClipboard::_($clipboard);
     }
     // get clipboard from cut/copy command
     $command = status::command();
     if ($command) {
         OLIVClipboard::$command(status::val());
     }
 }
开发者ID:nibble-arts,项目名称:oliv,代码行数:83,代码来源:core.php


注:本文中的system::OLIV_TEMPLATE方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。