Beispiel #1
0
    die('You should not access this file directly.');
}
// @todo    remove database query
// check permissions
$perms =& $AppUI->acl();
$canEdit = canEdit('system');
$canRead = canView('system');
if (!$canRead) {
    $AppUI->redirect(ACCESS_DENIED);
}
$module = new w2p_System_Module();
$hidden_modules = array('public', 'install');
$modules = __extract_from_modules_index($hidden_modules);
// get the modules actually installed on the file system
$loader = new w2p_FileSystem_Loader();
$modFiles = $loader->readDirs('modules');
$titleBlock = new w2p_Theme_TitleBlock('Modules', 'power-management.png', $m);
$titleBlock->addCrumb('?m=system', 'System Admin');
$titleBlock->show();
$fieldList = array('mod_name', 'mod_active', 'mod_customize', 'mod_type', 'mod_version', 'mod_ui_name', 'mod_ui_icon', 'mod_ui_active', 'mod_ui_order');
$fieldNames = array('Module', 'Status', 'Customize', 'Type', 'Version', 'Menu Text', 'Menu Icon', 'Menu Status', 'Order');
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
?>

<table class="tbl list modules">
    <?php 
echo '<tr><th></th>';
foreach ($fieldNames as $index => $name) {
    echo '<th>' . $AppUI->_($fieldNames[$index]) . '</th>';
}
echo '</tr>';
 /**
  * Load the known language codes for loaded locales
  *
  */
 public function loadLanguages()
 {
     if (isset($_SESSION['LANGUAGES'])) {
         $LANGUAGES =& $_SESSION['LANGUAGES'];
     } else {
         $LANGUAGES = array();
         $loader = new w2p_FileSystem_Loader();
         $langs = $loader->readDirs('locales');
         foreach ($langs as $lang) {
             if (file_exists(W2P_BASE_DIR . '/locales/' . $lang . '/lang.php')) {
                 include W2P_BASE_DIR . '/locales/' . $lang . '/lang.php';
             }
         }
         $_SESSION['LANGUAGES'] =& $LANGUAGES;
     }
     return $LANGUAGES;
 }
Beispiel #3
0
<?php

if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
// check permissions
$perms =& $AppUI->acl();
if (!canEdit('system')) {
    $AppUI->redirect(ACCESS_DENIED);
}
$module = w2PgetParam($_REQUEST, 'module', 'admin');
$lang = w2PgetParam($_REQUEST, 'lang', $AppUI->user_locale);
// read the installed modules
$loader = new w2p_FileSystem_Loader();
$modules = arrayMerge($loader->readDirs('modules'), array('common' => 'common', 'styles' => 'styles'));
asort($modules);
// read the installed languages
$locales = $loader->readDirs('locales');
ob_start();
// read language files from module's locale directory preferably
$localeFile = W2P_BASE_DIR . '/modules/' . $modules[$module] . '/locales/en/' . $modules[$module] . '.inc';
if (file_exists($localeFile)) {
    readfile($localeFile);
} else {
    $localeFile = W2P_BASE_DIR . '/locales/en/' . $modules[$module] . '.inc';
    if (file_exists($localeFile)) {
        readfile($localeFile);
    }
}
eval("\$english=array(" . ob_get_contents() . "\n'0');");
ob_end_clean();