コード例 #1
0
ファイル: olivscript.php プロジェクト: nibble-arts/oliv
 public function __construct()
 {
     global $_OSCODE;
     if (olivfile_exists(system::OLIV_OLIVSCRIPT() . "define.xml")) {
         $_OSCODE = olivxml_load_file(system::OLIV_OLIVSCRIPT() . "define.xml");
     } else {
         OLIVError::fire("OLIVScript::construct - olivscript definition not found");
     }
 }
コード例 #2
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;
        }
    }
コード例 #3
0
ファイル: module.php プロジェクト: nibble-arts/oliv
 private function scan($path)
 {
     $modules = array();
     $cnt = 0;
     if ($modDir = olivopendir($path)) {
         while ($file = readdir($modDir)) {
             if (olivis_dir($path . $file) and $file != "." and $file != "..") {
                 $filePath = "{$file}/";
                 // get modules define.xml
                 if (olivfile_exists($path . $filePath)) {
                     // load module information
                     $xml = olivxml_load_file($path . $filePath . "define.xml");
                     //------------------------------------------------------------------------------
                     // check for session directory
                     $sessionDir = system::oliv_module_path() . $filePath;
                     if (sessionfile_exists($sessionDir)) {
                         $contentPath = $xml->content;
                         $templatePath = $xml->template;
                         // write directory permissions to module header
                         $xml->content['permission'] = get_permission(session_path($sessionDir) . $contentPath);
                         $xml->template['permission'] = get_permission(session_path($sessionDir) . $templatePath);
                     } else {
                         // session directory don't exist
                         $xml->status = "NO_SESSION_DIR";
                         $xml->permission = 0;
                     }
                     //------------------------------------------------------------------------------
                     // save module metadata
                     $modules[(string) $xml->name] = $xml;
                     $cnt++;
                 }
             }
         }
         closedir($modDir);
         system::set("modules", $modules);
         return $cnt;
     } else {
         OLIVError::fire("module::scan - directory {$path} not found");
     }
     return FALSE;
 }
コード例 #4
0
ファイル: plugin.php プロジェクト: nibble-arts/oliv
 private static function scan($path)
 {
     global $_PLUGIN;
     //    $_PLUGIN = new simpleXmlElement("<plugin></plugin>");
     $_PLUGIN = new simpleXmlElement("<plugins></plugins>");
     if ($pluginDir = olivopendir($path)) {
         $cnt = 0;
         while ($file = readdir($pluginDir)) {
             if (olivis_dir($path . $file) and $file != "." and $file != "..") {
                 $file .= "/";
                 // get define.xml
                 if (olivfile_exists($path . $file . "define.xml")) {
                     $xml = olivxml_load_file($path . $file . "define.xml");
                     //TODO include plugin script
                     // get type of plugin
                     olivxml_insert($_PLUGIN, $xml, "ALL");
                 }
             }
         }
         closedir($pluginDir);
         return $cnt;
     } else {
         OLIVError::fire("plugin::scan - directory {$path} not found");
     }
     return FALSE;
 }
コード例 #5
0
ファイル: init.php プロジェクト: nibble-arts/oliv
    }
} else {
    die("init.php - session.xml not found");
}
//------------------------------------------------------------------------------
// load session user rights
global $_access;
if (system::OLIV_ACCESS_FILE() == "local") {
    if (sessionfile_exists("access.xml")) {
        $_access = sessionxml_load_file("access.xml");
    } else {
        die("init.php - session access.xml not found");
    }
} else {
    if (olivfile_exists("access.xml")) {
        $_access = olivxml_load_file("access.xml");
    } else {
        die("init.php - session access.xml not found");
    }
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// set page arguments
// insert GET POST messages in argv
foreach ($_GET as $key => $value) {
    argv::set($key, $value);
}
foreach ($_POST as $key => $value) {
    argv::set($key, $value);
}
// set status lang,url,val from argv