示例#1
0
function updateModule()
{
    global $Config, $Parser;
    // get Parser object
    $ModuleHandler = new ts_ModuleHandler();
    $modules_all = $ModuleHandler->getModules(true);
    $Parser = new ts_Parser($Config->get('prefix'), $modules_all, $Config->get('debug_mode'));
    // get id__module
    $id__module = (isset($_GET['id']) and is_numeric($_GET['id'])) ? $_GET['id'] : 0;
    if (empty($id__module)) {
        return true;
    }
    // get module-object
    $Module = new ts_Module($id__module);
    // update
    if (!$Module->updateModule()) {
        // error
        $_SESSION['admin_error'] = 'ERROR__UPDATEMODULE';
        return false;
    }
    $_SESSION['admin_info'] = 'INFO__UPDATEMODULE';
    return true;
}
示例#2
0
     $TemplateEngine->activate('showResetAll');
     break;
 case 'resetAll':
     include_once 'functions/resetAll.func.php';
     resetAll();
     header('Location:?');
     exit;
 case 'showModules':
     // init database?
     include_once 'functions/initDatabase.func.php';
     if (!initDatabase()) {
         header('Location:?event=showInitDatabase');
     }
     // start ModuleHandler
     global $ModuleHandler;
     $ModuleHandler = new ts_ModuleHandler();
     $Modules = $ModuleHandler->getModules();
     $TemplateEngine->setData('html', array('title' => 'SHOWMODULES__TITLE'));
     $TemplateEngine->activate('showModules');
     break;
 case 'setModules':
     // start ModuleHandler
     global $ModuleHandler;
     $ModuleHandler = new ts_ModuleHandler();
     include_once 'functions/setModules.func.php';
     if (setModules() and isset($_POST['submit_build'])) {
         include_once 'functions/parseAll.func.php';
         parseAll();
     }
     header('Location:?event=showModules');
     exit;