コード例 #1
0
ファイル: context.php プロジェクト: nibble-arts/oliv
    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;
        }
    }
コード例 #2
0
ファイル: plugin.php プロジェクト: nibble-arts/oliv
 private static function parse_methods($page, $methods, $type)
 {
     // loop over plugin node names
     foreach ($methods as $plugin) {
         // load plugin definition
         $class = $plugin->XPath("../class");
         if (count($class)) {
             $class = (string) array_pop($class);
         } else {
             $class = "";
         }
         /*			$editclass = $plugin->XPath("../editclass");
         			if (count($editclass))
         				$editclass = (string)array_pop($editclass);
         			else
         				$editclass = "";
         */
         // loop over plugin methods
         foreach ($plugin as $method) {
             $name = $method->getName();
             $classMethod = (string) $method;
             // load plugin script
             OLIVCore::loadScript($class . ".php", system::OLIV_PLUGIN_PATH() . $class . "/");
             //------------------------------------------------------------------------------
             // permission to display
             //TODO use class or editclass, depending on rights
             // call plugin
             if (class_exists($class)) {
                 $class::$classMethod($page, $name, $type);
             } else {
                 OLIVError::fire("postprocessor.php::process - class {$class} not found");
             }
         }
     }
     return $page;
 }
コード例 #3
0
ファイル: module.php プロジェクト: nibble-arts/oliv
 public static function load_js($header, $path, $name)
 {
     $filePath = system::OLIV_MODULE_PATH() . (string) $header->name . "/" . $path;
     // load file
     if (OLIVCore::loadScript($name, $filePath, session_path(""))) {
         return TRUE;
     }
     return FALSE;
 }
コード例 #4
0
ファイル: core.php プロジェクト: nibble-arts/oliv
 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());
     }
 }
コード例 #5
0
ファイル: init.php プロジェクト: nibble-arts/oliv
//------------------------------------------------------------------------------
// 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
    $part = $coreXml->xpath("includes");
    if (count($part[0]->children())) {
        foreach ($part[0]->children() as $entry) {
            OLIVCore::loadScript($entry, system::OLIV_INCLUDE_PATH());
        }
    } else {
        die("init.php - no include definitions found");
    }
    //------------------------------------------------------------------------------
    // country definitions
    if (count($coreXml->country)) {
        system::set('country', $coreXml->country);
    }
    //------------------------------------------------------------------------------
    // imagepath definitions
    if (count($coreXml->imagepath)) {
        system::set('imagepath', $coreXml->imagepath);
    }
} else {