Beispiel #1
0
if (@file_exists($module['file']['language'])) {
    require $module['file']['language'];
}
if (@file_exists($module['file']['library'])) {
    require $module['file']['library'];
}
if (@file_exists($module['file']['template'])) {
    require $module['file']['template'];
}
// Create unique template, library and language dictionary
$language = isset($module['language']) ? array_merge($console['language'], $module['language']) : $console['language'];
$tpl = isset($module['template']) ? array_merge($console['template'], $module['template']) : $console['template'];
// Load module config
$module['config']['module']['@']['defaction'] = 'main';
if (sumo_verify_file($module['file']['config'])) {
    $module['config'] = sumo_xmlize(file_get_contents($module['file']['config']));
}
// Get action from user session
// if not exist try to get it from module.xml
$action = $_SESSION['action'] ? $_SESSION['action'] : $module['config']['module']['@']['defaction'];
$_SESSION['action'] = $action;
// Create Menu' tabs
$menus = $module['config']['module']['#']['menu'];
for ($m = 0; $m < sizeof($menus); $m++) {
    $menu_name = $menus[$m]['@']['name'] ? $menus[$m]['@']['name'] : $action;
    $tabs = $menus[$m]['#']['tab'];
    if ($tabs) {
        for ($l = 0; $l < sizeof($tabs); $l++) {
            $menu_query = isset($tabs[$l]['@']['query']) ? $tabs[$l]['@']['query'] : "";
            $menu_module = isset($tabs[$l]['@']['module']) ? $tabs[$l]['@']['module'] : "";
            $menu[$menu_name][$l] = array('name' => $language[$tabs[$l]['@']['name']], 'module' => $menu_module, 'action' => $tabs[$l]['@']['action'], 'actions' => explode(",", $tabs[$l]['@']['actions']), 'query' => $menu_query);
Beispiel #2
0
// Desktop
$desktop['template'] = implode('', file($desktop['file']['template']));
$desktop['settings'] = sumo_get_console_settings();
$tpl = $console['template'];
$tpl['GET:Flags'] = sumo_get_flags();
$tpl['GET:ModulesWindows'] = "<!-- WINDOWS -->\n";
/**
 * Define windows for all modules
 */
$num_modules = count($modules);
for ($m = 0; $m < $num_modules; $m++) {
    $m_name = $modules[$m];
    $m_icon = $SUMO['page']['web_path'] . '/themes/' . $SUMO['page']['theme'] . '/images/modules/' . $m_name . '/icon.desktop.png';
    $m_conf = SUMO_PATH . '/modules/' . $m_name . '/module.xml';
    // Load module config
    $config[$m_name] = sumo_xmlize(file_get_contents($m_conf));
    // Verify permissions
    $_level[$m_name] = $config[$m_name]['module']['@']['level'] ? $config[$m_name]['module']['@']['level'] : 0;
    $_group[$m_name] = $config[$m_name]['module']['@']['group'] ? $config[$m_name]['module']['@']['group'] : $SUMO['user']['group'];
    $_user[$m_name] = $config[$m_name]['module']['@']['user'] ? $config[$m_name]['module']['@']['user'] : $SUMO['user']['user'];
    if (sumo_verify_permissions($_level[$m_name], $_group[$m_name], $_user[$m_name])) {
        // Icon
        $tpl['GET:ModuleIcon' . ucfirst($m_name)] = sumo_get_module_icon($m_name, '', $console['language'][$m_name]);
        // Window position
        if (isset($desktop['settings'][$m_name]['xw'])) {
            $sm[$m_name] = $desktop['settings'][$m_name]['s'];
            $xw[$m_name] = $desktop['settings'][$m_name]['xw'];
            $yw[$m_name] = $desktop['settings'][$m_name]['yw'];
        } else {
            $sm[$m_name] = 0;
            $xw[$m_name] = isset($xws) ? $xws + 10 : 100;