* @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(); } }