Files
@ c7d7e38b2269
Branch filter:
Location: hot67beta/administrator/components/com_cache/admin.cache.php - annotation
c7d7e38b2269
3.3 KiB
text/x-php
Initial import of the site.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 | <?php
/**
* @version $Id: admin.cache.php 11403 2009-01-06 06:19:31Z ian $
* @package Joomla
* @subpackage Cache
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
/*
* Make sure the user is authorized to view this page
*/
$user =& JFactory::getUser();
if (!$user->authorize( 'com_cache', 'manage' )) {
$mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );
}
// Load the html output class and the model class
require_once (JApplicationHelper::getPath('admin_html'));
require_once (JApplicationHelper::getPath('class'));
$cid = JRequest::getVar( 'cid', array(0), 'post', 'array' );
/*
* This is our main control structure for the component
*
* Each view is determined by the $task variable
*/
switch ( JRequest::getVar( 'task' ) )
{
case 'delete':
CacheController::deleteCache($cid);
CacheController::showCache();
break;
case 'purgeadmin':
CacheController::showPurgeCache();
break;
case 'purge':
CacheController::purgeCache();
break;
default :
CacheController::showCache();
break;
}
/**
* Static class to hold controller functions for the Cache component
*
* @static
* @package Joomla
* @subpackage Weblinks
* @since 1.5
*/
class CacheController
{
/**
* Show the cache
*
* @since 1.5
*/
function showCache()
{
global $mainframe, $option;
$submenu = JRequest::getVar('client', '0', '', 'int');
$client =& JApplicationHelper::getClientInfo($submenu);
if ($submenu == 1) {
JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_cache&client=0');
JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_cache&client=1', true);
} else {
JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_cache&client=0', true);
JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_cache&client=1');
}
$limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'));
$limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0 );
$cmData = new CacheData($client->path.DS.'cache');
jimport('joomla.html.pagination');
$pageNav = new JPagination( $cmData->getGroupCount(), $limitstart, $limit );
CacheView::displayCache( $cmData->getRows( $limitstart, $limit ), $client, $pageNav );
}
function deleteCache($cid)
{
// Check for request forgeries
JRequest::checkToken() or jexit( 'Invalid Token' );
$client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
$cmData = new CacheData($client->path.DS.'cache');
$cmData->cleanCacheList( $cid );
}
function showPurgeCache()
{
// Check for request forgeries
CacheView::showPurgeExecute();
}
function purgeCache()
{
// Check for request forgeries
JRequest::checkToken() or jexit( 'Invalid Token' );
$cache =& JFactory::getCache('');
$cache->gc();
CacheView::purgeSuccess();
}
}
|