Changeset 132 for branches/2.0singleton/services
- Timestamp:
- May 30, 2006 10:05:54 PM (18 years ago)
- Location:
- branches/2.0singleton/services
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0singleton/services/admins.php
r130 r132 29 29 // The object to validate form input. 30 30 $fv = new FormValidator(); 31 32 $cache =& SessionCache::getInstance(); 31 33 32 34 // Instantiate a sorting object with the default sort and order. Add SQL for each column. … … 69 71 if (getFormData('break_list_cache', false)) { 70 72 // Break the cache because we are changing the list data. 71 SessionCache::breakCache($_SERVER['PHP_SELF']);73 $cache->breakCache($_SERVER['PHP_SELF']); 72 74 } 73 75 … … 317 319 $app =& App::getInstance(); 318 320 $db =& DB::getInstance(); 321 $cache =& SessionCache::getInstance(); 319 322 320 323 $lock->select('admin_tbl', 'admin_id', $id); … … 324 327 325 328 // Break the cache because we are changing the list data. 326 SessionCache::breakCache($_SERVER['PHP_SELF']);329 $cache->breakCache($_SERVER['PHP_SELF']); 327 330 328 331 // Get the information for this object. … … 364 367 $app =& App::getInstance(); 365 368 $db =& DB::getInstance(); 369 $cache =& SessionCache::getInstance(); 366 370 367 371 // Break the cache because we are changing the list data. 368 SessionCache::breakCache($_SERVER['PHP_SELF']);372 $cache->breakCache($_SERVER['PHP_SELF']); 369 373 370 374 // Insert record data. … … 407 411 $app =& App::getInstance(); 408 412 $db =& DB::getInstance(); 413 $cache =& SessionCache::getInstance(); 409 414 410 415 $lock->select('admin_tbl', 'admin_id', $frm['admin_id']); … … 414 419 415 420 // Break the cache because we are changing the list data. 416 SessionCache::breakCache($_SERVER['PHP_SELF']);421 $cache->breakCache($_SERVER['PHP_SELF']); 417 422 418 423 // If the userpass is left blank or with the filler **** characters, we don't want to update it. … … 450 455 global $so; 451 456 $db =& DB::getInstance(); 457 $prefs =& Prefs::getInstance(); 458 $cache =& SessionCache::getInstance(); 452 459 453 454 460 $where_clause = ''; 455 461 … … 501 507 // without knowing the hash. 502 508 $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) { 509 515 // Get the cached results. 510 $list = SessionCache::getCache($_SERVER['PHP_SELF']);516 $list = $cache->getCache($_SERVER['PHP_SELF']); 511 517 } else { 512 518 // If the list is not already cached, query now. … … 519 525 if (isset($list) && !empty($list)) { 520 526 // Cache the results. 521 SessionCache::putCache($list, $_SERVER['PHP_SELF']);527 $cache->putCache($list, $_SERVER['PHP_SELF']); 522 528 } 523 529 } -
branches/2.0singleton/services/logs.php
r129 r132 39 39 40 40 // 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'); 43 44 44 45 // 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'); 46 47 47 48 /****************************************************************************** … … 56 57 case 'delete' : 57 58 // $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'); 60 61 if ($app->validBoomerangURL('app_log')) { 61 62 // Display boomerang page. … … 68 69 case 'clear' : 69 70 // $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET); 70 clearLog( Prefs::getValue('log_file', 'logs_module'));71 clearLog($prefs->getValue('log_file', 'logs_module')); 71 72 if ($app->validBoomerangURL('app_log')) { 72 73 // Display boomerang page. … … 79 80 case 'archive' : 80 81 // $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'))) { 82 83 // Now flush current log. 83 84 $app->dieURL($_SERVER['PHP_SELF'] . '?op=clear'); … … 97 98 case 'download' : 98 99 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')); 101 102 die; 102 103 break; 103 104 104 105 default : 105 $list =& getLog( Prefs::getValue('log_file', 'logs_module'), getFormData('search_query'));106 $list =& getLog($prefs->getValue('log_file', 'logs_module'), getFormData('search_query')); 106 107 $main_template = 'log_list.ihtml'; 107 108 break; … … 125 126 include 'header.ihtml'; 126 127 if ('output' == $main_template) { 127 printLog( Prefs::getValue('log_file', 'logs_module'));128 printLog($prefs->getValue('log_file', 'logs_module')); 128 129 } else { 129 130 include 'codebase/services/templates/' . $main_template; -
branches/2.0singleton/services/templates/log_list.ihtml
r131 r132 10 10 <tr class="commandtext"> 11 11 <td> 12 <?php if ($l['filename'] == Prefs::getValue('log_file', 'logs_module')) { ?>12 <?php if ($l['filename'] == $prefs->getValue('log_file', 'logs_module')) { ?> 13 13 <span class="commanditem"><strong><?php echo sprintf(_("%s"), $l['filename']); ?></strong></span> 14 14 <?php } else { ?>
Note: See TracChangeset
for help on using the changeset viewer.