|
|
@@ -25,18 +25,19 @@ class BxDolStudioDashboard extends BxTemplStudioPage
|
|
|
);
|
|
|
|
|
|
$this->aItemsCache = array (
|
|
|
- array('name' => 'all'),
|
|
|
- array('name' => 'db'),
|
|
|
- array('name' => 'template'),
|
|
|
- array('name' => 'css'),
|
|
|
- array('name' => 'js')
|
|
|
- );
|
|
|
-
|
|
|
- $this->aItemsHTools = array (
|
|
|
- 'PHP' => 'requirementsPHP',
|
|
|
- 'MySQL' => 'requirementsMySQL',
|
|
|
- 'Web Server' => 'requirementsWebServer',
|
|
|
- );
|
|
|
+ array('name' => 'all'),
|
|
|
+ array('name' => 'db'),
|
|
|
+ array('name' => 'template'),
|
|
|
+ array('name' => 'css'),
|
|
|
+ array('name' => 'js'),
|
|
|
+ array('name' => 'custom')
|
|
|
+ );
|
|
|
+
|
|
|
+ $this->aItemsHTools = array (
|
|
|
+ 'PHP' => 'requirementsPHP',
|
|
|
+ 'MySQL' => 'requirementsMySQL',
|
|
|
+ 'Web Server' => 'requirementsWebServer',
|
|
|
+ );
|
|
|
|
|
|
//--- Check actions ---//
|
|
|
if(($sAction = bx_get('dbd_action')) !== false) {
|
|
|
@@ -71,51 +72,57 @@ class BxDolStudioDashboard extends BxTemplStudioPage
|
|
|
$aResult = array('code' => 0, 'message' => _t('_adm_dbd_msg_upgrade_started', BX_DOL_URL_STUDIO));
|
|
|
break;
|
|
|
|
|
|
- case 'clear_cache':
|
|
|
- $sValue = bx_get('dbd_value');
|
|
|
- if($sValue === false)
|
|
|
- break;
|
|
|
-
|
|
|
- $sValue = bx_process_input($sValue);
|
|
|
-
|
|
|
- $oCacheUtilities = BxDolCacheUtilities::getInstance();
|
|
|
-
|
|
|
- switch ($sValue) {
|
|
|
- case 'all':
|
|
|
- $aResult = false;
|
|
|
- foreach($this->aItemsCache as $aItem) {
|
|
|
- if($aItem['name'] == 'all')
|
|
|
- continue;
|
|
|
-
|
|
|
- $aResultClear = $oCacheUtilities->clear($aItem['name']);
|
|
|
- if($aResultClear === false)
|
|
|
- continue;
|
|
|
-
|
|
|
- $aResult = $aResultClear;
|
|
|
- if(isset($aResult['code']) && $aResult['code'] != 0)
|
|
|
- break;
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- case 'db':
|
|
|
- case 'template':
|
|
|
- case 'css':
|
|
|
- case 'js':
|
|
|
- $aResult = $oCacheUtilities->clear($sValue);
|
|
|
- break;
|
|
|
-
|
|
|
- default:
|
|
|
- $aResult = array('code' => 1, 'message' => _t('_Error Occured'));
|
|
|
- }
|
|
|
-
|
|
|
- if($aResult === false)
|
|
|
- $aResult['data'] = MsgBox(_t('_adm_dbd_msg_c_all_disabled'));
|
|
|
- else if(isset($aResult['code']) && $aResult['code'] == 0)
|
|
|
- $aResult['data'] = $this->getCacheChartData(false);
|
|
|
-
|
|
|
- break;
|
|
|
-
|
|
|
- case 'permissions':
|
|
|
+ case 'clear_cache':
|
|
|
+ $sValue = bx_get('dbd_value');
|
|
|
+ if($sValue === false)
|
|
|
+ break;
|
|
|
+
|
|
|
+ $sValue = bx_process_input($sValue);
|
|
|
+
|
|
|
+ $oCacheUtilities = BxDolCacheUtilities::getInstance();
|
|
|
+
|
|
|
+ switch ($sValue) {
|
|
|
+ case 'all':
|
|
|
+ $aResult = false;
|
|
|
+ foreach($this->aItemsCache as $aItem) {
|
|
|
+ if($aItem['name'] == 'all')
|
|
|
+ continue;
|
|
|
+
|
|
|
+ $aResultClear = $oCacheUtilities->clear($aItem['name']);
|
|
|
+ if($aResultClear === false)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ $aResult = $aResultClear;
|
|
|
+ if(isset($aResult['code']) && $aResult['code'] != 0)
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'db':
|
|
|
+ case 'template':
|
|
|
+ case 'css':
|
|
|
+ case 'js':
|
|
|
+ $aResult = $oCacheUtilities->clear($sValue);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'custom':
|
|
|
+ $aResult = array('code' => 0);
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ $aResult = array('code' => 1, 'message' => _t('_Error Occured'));
|
|
|
+ }
|
|
|
+
|
|
|
+ if($aResult === false)
|
|
|
+ $aResult['data'] = MsgBox(_t('_adm_dbd_msg_c_all_disabled'));
|
|
|
+ else if(isset($aResult['code']) && $aResult['code'] == 0) {
|
|
|
+ bx_alert('system', 'clear_cache', 0, 0, array('type' => $sValue));
|
|
|
+
|
|
|
+ $aResult['data'] = $this->getCacheChartData(false);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'permissions':
|
|
|
$oAdmTools = new BxDolStudioTools();
|
|
|
|
|
|
header( 'Content-type: text/html; charset=utf-8' );
|
|
|
@@ -172,18 +179,18 @@ class BxDolStudioDashboard extends BxTemplStudioPage
|
|
|
|
|
|
protected function getCacheChartData($bAsString = true)
|
|
|
{
|
|
|
- $oCacheUtilities = BxDolCacheUtilities::getInstance();
|
|
|
+ $oCacheUtilities = BxDolCacheUtilities::getInstance();
|
|
|
|
|
|
$aChartData = array();
|
|
|
foreach($this->aItemsCache as $aItem) {
|
|
|
- if($aItem['name'] == 'all')
|
|
|
- continue;
|
|
|
+ if($aItem['name'] == 'all')
|
|
|
+ continue;
|
|
|
|
|
|
- $iSize = $oCacheUtilities->size($aItem['name']);
|
|
|
- if($iSize === false)
|
|
|
- continue;
|
|
|
+ $iSize = $oCacheUtilities->size($aItem['name']);
|
|
|
+ if($iSize === false)
|
|
|
+ continue;
|
|
|
|
|
|
- $aChartData[] = array(bx_js_string(_t('_adm_dbd_txt_c_' . $aItem['name']), BX_ESCAPE_STR_APOS), array('v' => $iSize, 'f' => bx_js_string(_t_format_size($iSize))));
|
|
|
+ $aChartData[] = array(bx_js_string(_t('_adm_dbd_txt_c_' . $aItem['name']), BX_ESCAPE_STR_APOS), array('v' => $iSize, 'f' => bx_js_string(_t_format_size($iSize))));
|
|
|
}
|
|
|
|
|
|
if(empty($aChartData))
|