// Remove AdminStatsConf controller (conf is already in AdminStatsTab)

This commit is contained in:
rMalie
2011-12-08 09:25:10 +00:00
parent 3260412f3c
commit b0561c5277
5 changed files with 40 additions and 180 deletions
@@ -1,105 +0,0 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 6844 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class AdminStatsConfControllerCore extends AdminPreferencesControllerCore
{
public function __construct()
{
$autoclean_period = array(
array('value' => 'never', 'name' => $this->l('Never')),
array('value' => 'week', 'name' => $this->l('Week')),
array('value' => 'month', 'name' => $this->l('Month')),
array('value' => 'year', 'name' => $this->l('Year')),
);
$list_engine_description_stats = array();
$list_select_stats = array();
foreach (ModuleGraphEngine::getGraphEngines() as $k => $engine)
{
$list_select_stats[] = array(
'name' => $engine[0],
'value' => $k,
);
$list_engine_description_stats[$k] = $engine[1];
}
$list_engine_description_grid = array();
$list_select_grid = array();
foreach (ModuleGridEngine::getGridEngines() as $k => $engine)
{
$list_select_grid[] = array(
'name' => $engine[0],
'value' => $k,
);
$list_engine_description_grid[$k] = $engine[1];
}
$this->options = array(
'general' => array(
'title' => $this->l('General'),
'icon' => 'tab-preferences',
'fields' => array(
'PS_STATS_RENDER' => array(
'title' => $this->l('Graph engine'),
'validation' => 'isGenericName',
'cast' => 'strval',
'type' => 'selectEngine',
'list' => $list_select_stats,
'identifier' => 'value',
'js' => '$(\'#render_engine_description\').html(engineDescriptions[$(this).val()])'
),
'PS_STATS_GRID_RENDER' => array(
'title' => $this->l('Grid engine'),
'validation' => 'isGenericName',
'cast' => 'strval',
'type' => 'selectGrid',
'list' => $list_select_grid,
'identifier' => 'value',
'js' => '$(\'#render_engine_description\').html(engineDescriptions[$(this).val()])'
),
'PS_STATS_OLD_CONNECT_AUTO_CLEAN' => array(
'title' => $this->l('Auto-clean period'),
'validation' => 'isGenericName',
'type' => 'select',
'list' => $autoclean_period,
'identifier' => 'value'
)
),
'submit' => array()
)
);
$this->tpl_option_vars = array (
'list_engine_description_stats_js' => Tools::jsonEncode($list_engine_description_stats),
'list_engine_description_stats' => $list_engine_description_stats,
'list_engine_description_grid_js' => Tools::jsonEncode($list_engine_description_grid),
'list_engine_description_grid' => $list_engine_description_grid
);
parent::__construct();
}
}
+11 -1
View File
@@ -97,13 +97,22 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
{
$tpl = $this->context->smarty->createTemplate('stats/engines.tpl');
$autoclean_period = array(
'never' => $this->l('Never'),
'week' => $this->l('Week'),
'month' => $this->l('Month'),
'year' => $this->l('Year'),
);
$tpl->assign(array(
'current' => self::$currentIndex,
'token' => $this->token,
'graph_engine' => Configuration::get('PS_STATS_RENDER'),
'grid_engine' => Configuration::get('PS_STATS_GRID_RENDER'),
'auto_clean' => Configuration::get('PS_STATS_OLD_CONNECT_AUTO_CLEAN'),
'array_graph_engines' => ModuleGraphEngine::getGraphEngines(),
'array_grid_engines' => ModuleGridEngine::getGridEngines()
'array_grid_engines' => ModuleGridEngine::getGridEngines(),
'array_auto_clean' => $autoclean_period,
));
return $tpl->fetch();
@@ -223,6 +232,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
self::$currentIndex .= '&module='.Tools::getValue('module');
Configuration::updateValue('PS_STATS_RENDER', Tools::getValue('PS_STATS_RENDER', Configuration::get('PS_STATS_RENDER')));
Configuration::updateValue('PS_STATS_GRID_RENDER', Tools::getValue('PS_STATS_GRID_RENDER', Configuration::get('PS_STATS_GRID_RENDER')));
Configuration::updateValue('PS_STATS_OLD_CONNECT_AUTO_CLEAN', Tools::getValue('PS_STATS_OLD_CONNECT_AUTO_CLEAN', Configuration::get('PS_STATS_OLD_CONNECT_AUTO_CLEAN')));
}
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');