Ignore:
Timestamp:
May 30, 2006 10:05:54 PM (18 years ago)
Author:
scdev
Message:

updated Prefs:: and SessionCache::

Location:
branches/2.0singleton/services
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0singleton/services/admins.php

    r130 r132  
    2929// The object to validate form input.
    3030$fv = new FormValidator();
     31
     32$cache =& SessionCache::getInstance();
    3133
    3234// Instantiate a sorting object with the default sort and order. Add SQL for each column.
     
    6971if (getFormData('break_list_cache', false)) {
    7072    // Break the cache because we are changing the list data.
    71     SessionCache::breakCache($_SERVER['PHP_SELF']);
     73    $cache->breakCache($_SERVER['PHP_SELF']);
    7274}
    7375
     
    317319    $app =& App::getInstance();
    318320    $db =& DB::getInstance();
     321    $cache =& SessionCache::getInstance();
    319322   
    320323    $lock->select('admin_tbl', 'admin_id', $id);
     
    324327
    325328    // Break the cache because we are changing the list data.
    326     SessionCache::breakCache($_SERVER['PHP_SELF']);
     329    $cache->breakCache($_SERVER['PHP_SELF']);
    327330
    328331    // Get the information for this object.
     
    364367    $app =& App::getInstance();
    365368    $db =& DB::getInstance();
     369    $cache =& SessionCache::getInstance();
    366370   
    367371    // Break the cache because we are changing the list data.
    368     SessionCache::breakCache($_SERVER['PHP_SELF']);
     372    $cache->breakCache($_SERVER['PHP_SELF']);
    369373
    370374    // Insert record data.
     
    407411    $app =& App::getInstance();
    408412    $db =& DB::getInstance();
     413    $cache =& SessionCache::getInstance();
    409414   
    410415    $lock->select('admin_tbl', 'admin_id', $frm['admin_id']);
     
    414419
    415420    // Break the cache because we are changing the list data.
    416     SessionCache::breakCache($_SERVER['PHP_SELF']);
     421    $cache->breakCache($_SERVER['PHP_SELF']);
    417422
    418423    // If the userpass is left blank or with the filler **** characters, we don't want to update it.
     
    450455    global $so;
    451456    $db =& DB::getInstance();
     457    $prefs =& Prefs::getInstance();
     458    $cache =& SessionCache::getInstance();
    452459   
    453 
    454460    $where_clause = '';
    455461
     
    501507    // without knowing the hash.
    502508    $cache_hash = md5($sql . '|' . $page->total_items);
    503     if (Prefs::getValue('cache_hash', $_SERVER['PHP_SELF']) != $cache_hash) {
    504         SessionCache::breakCache($_SERVER['PHP_SELF']);
    505         Prefs::setValue('cache_hash', $cache_hash, $_SERVER['PHP_SELF']);
    506     }
    507 
    508     if (SessionCache::isCached($_SERVER['PHP_SELF']) && false) {
     509    if ($prefs->getValue('cache_hash', $_SERVER['PHP_SELF']) != $cache_hash) {
     510        $cache->breakCache($_SERVER['PHP_SELF']);
     511        $prefs->setValue('cache_hash', $cache_hash, $_SERVER['PHP_SELF']);
     512    }
     513
     514    if ($cache->isCached($_SERVER['PHP_SELF']) && false) {
    509515        // Get the cached results.
    510         $list = SessionCache::getCache($_SERVER['PHP_SELF']);
     516        $list = $cache->getCache($_SERVER['PHP_SELF']);
    511517    } else {
    512518        // If the list is not already cached, query now.
     
    519525        if (isset($list) && !empty($list)) {
    520526            // Cache the results.
    521             SessionCache::putCache($list, $_SERVER['PHP_SELF']);
     527            $cache->putCache($list, $_SERVER['PHP_SELF']);
    522528        }
    523529    }
  • branches/2.0singleton/services/logs.php

    r129 r132  
    3939
    4040// Set the defaults and catch incoming settings.
    41 Prefs::setDefault('log_file', $app->getParam('log_filename'), 'logs_module');
    42 Prefs::setValue('log_file', getFormData('log'), 'logs_module');
     41$prefs =& Prefs::getInstance();
     42$prefs->setDefault('log_file', $app->getParam('log_filename'), 'logs_module');
     43$prefs->setValue('log_file', getFormData('log'), 'logs_module');
    4344
    4445// Titles and navigation header.
    45 $nav->addPage(sprintf(_("Viewing log: <em>%s</em>"), Prefs::getValue('log_file', 'logs_module')), '/admin/logs.php');
     46$nav->addPage(sprintf(_("Viewing log: <em>%s</em>"), $prefs->getValue('log_file', 'logs_module')), '/admin/logs.php');
    4647
    4748/******************************************************************************
     
    5657case 'delete' :
    5758//     $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);
    58     deleteLog(Prefs::getValue('log_file', 'logs_module'));
    59     Prefs::setValue('log_file', $app->getParam('log_filename'), 'logs_module');
     59    deleteLog($prefs->getValue('log_file', 'logs_module'));
     60    $prefs->setValue('log_file', $app->getParam('log_filename'), 'logs_module');
    6061    if ($app->validBoomerangURL('app_log')) {
    6162        // Display boomerang page.
     
    6869case 'clear' :
    6970//     $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);
    70     clearLog(Prefs::getValue('log_file', 'logs_module'));
     71    clearLog($prefs->getValue('log_file', 'logs_module'));
    7172    if ($app->validBoomerangURL('app_log')) {
    7273        // Display boomerang page.
     
    7980case 'archive' :
    8081//     $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);
    81     if (archiveLog(Prefs::getValue('log_file', 'logs_module'))) {
     82    if (archiveLog($prefs->getValue('log_file', 'logs_module'))) {
    8283        // Now flush current log.
    8384        $app->dieURL($_SERVER['PHP_SELF'] . '?op=clear');
     
    9798case 'download' :
    9899    header('Content-Type: application/octet-stream');
    99     header(sprintf('Content-Disposition: attachment; filename=%s.txt', Prefs::getValue('log_file', 'logs_module')));
    100     printLog(Prefs::getValue('log_file', 'logs_module'));
     100    header(sprintf('Content-Disposition: attachment; filename=%s.txt', $prefs->getValue('log_file', 'logs_module')));
     101    printLog($prefs->getValue('log_file', 'logs_module'));
    101102    die;
    102103    break;
    103104
    104105default :
    105     $list =& getLog(Prefs::getValue('log_file', 'logs_module'), getFormData('search_query'));
     106    $list =& getLog($prefs->getValue('log_file', 'logs_module'), getFormData('search_query'));
    106107    $main_template = 'log_list.ihtml';
    107108    break;
     
    125126include 'header.ihtml';
    126127if ('output' == $main_template) {
    127     printLog(Prefs::getValue('log_file', 'logs_module'));
     128    printLog($prefs->getValue('log_file', 'logs_module'));
    128129} else {
    129130    include 'codebase/services/templates/' . $main_template;
  • branches/2.0singleton/services/templates/log_list.ihtml

    r131 r132  
    1010        <tr class="commandtext">
    1111            <td>
    12                 <?php if ($l['filename'] == Prefs::getValue('log_file', 'logs_module')) { ?>
     12                <?php if ($l['filename'] == $prefs->getValue('log_file', 'logs_module')) { ?>
    1313                    <span class="commanditem"><strong><?php echo sprintf(_("%s"), $l['filename']); ?></strong></span>
    1414                <?php } else { ?>
Note: See TracChangeset for help on using the changeset viewer.