protected function displayEngines() { $tpl = $this->createTemplate('engines.tpl'); $autoclean_period = array('never' => $this->l('Never', 'AdminStatsTab'), 'week' => $this->l('Week', 'AdminStatsTab'), 'month' => $this->l('Month', 'AdminStatsTab'), 'year' => $this->l('Year', 'AdminStatsTab')); $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_auto_clean' => $autoclean_period)); return $tpl->fetch(); }
protected function displayEngines() { global $currentIndex, $cookie; $graphEngine = Configuration::get('PS_STATS_RENDER'); $gridEngine = Configuration::get('PS_STATS_GRID_RENDER'); $arrayGraphEngines = ModuleGraphEngine::getGraphEngines(); $arrayGridEngines = ModuleGridEngine::getGridEngines(); echo ' <form action="' . $_SERVER['REQUEST_URI'] . '" method="post"> <fieldset style="width: 200px;"><legend><img src="../img/admin/tab-preferences.gif" />' . $this->l('Settings', 'AdminStatsTab') . '</legend>'; echo '<p><strong>' . $this->l('Graph engine', 'AdminStatsTab') . ' </strong><br />'; if (sizeof($arrayGraphEngines)) { echo '<select name="PS_STATS_RENDER">'; foreach ($arrayGraphEngines as $k => $value) { echo '<option value="' . $k . '"' . ($k == $graphEngine ? ' selected="selected"' : '') . '>' . $value[0] . '</option>'; } echo '</select><p>'; } else { echo $this->l('No graph engine module installed', 'AdminStatsTab'); } echo '<p><strong>' . $this->l('Grid engine', 'AdminStatsTab') . ' </strong><br />'; if (sizeof($arrayGridEngines)) { echo '<select name="PS_STATS_GRID_RENDER">'; foreach ($arrayGridEngines as $k => $value) { echo '<option value="' . $k . '"' . ($k == $gridEngine ? ' selected="selected"' : '') . '>' . $value[0] . '</option>'; } echo '</select></p>'; } else { echo $this->l('No grid engine module installed', 'AdminStatsTab'); } echo '<p><input type="submit" value="' . $this->l(' Save ', 'AdminStatsTab') . '" name="submitSettings" class="button" /></p> </fieldset> </form><div class="clear space"> </div>'; }
public function display() { global $currentIndex, $cookie; $graphEngine = Configuration::get('PS_STATS_RENDER'); $gridEngine = Configuration::get('PS_STATS_GRID_RENDER'); $autoclean = Configuration::get('PS_STATS_OLD_CONNECT_AUTO_CLEAN'); $arrayGraphEngines = ModuleGraphEngine::getGraphEngines(); $arrayGridEngines = ModuleGridEngine::getGridEngines(); $autocleanPeriod = array('never' => $this->l('Never'), 'week' => $this->l('Week'), 'month' => $this->l('Month'), 'year' => $this->l('Year')); echo '<form action="' . $currentIndex . '&token=' . $this->token . '&submitSettings=1" method="post"> <fieldset><legend><img src="../img/admin/tab-preferences.gif" />' . $this->l('Settings') . '</legend>'; #Graph Engines echo '<label class="clear">' . $this->l('Graph engine') . ': </label><div class="margin-form">'; if (sizeof($arrayGraphEngines)) { foreach ($arrayGraphEngines as $k => $value) { echo '<div id="sgraphcontent_' . $k . '">' . $value[1] . '</div><script language="javascript">getE(\'sgraphcontent_' . $k . '\').style.display = \'none\';</script>'; } echo '<div style="float: left"><select name="PS_STATS_RENDER">'; foreach ($arrayGraphEngines as $k => $value) { echo '<option value="' . $k . '"' . ($k == $graphEngine ? ' selected="selected"' : '') . ' onclick="getE(\'render_graph_content\').innerHTML = getE(\'sgraphcontent_' . $k . '\').innerHTML;">' . $value[0] . '</option>'; } echo '</select></div> <div id="render_graph_content" style="float:left;margin-left:20px;width:400px;">' . $arrayGraphEngines[$graphEngine][1] . '</div> <div class="clear"></div>'; } else { echo $this->l('No graph engine module installed'); } echo '</div>'; #Grid Engines echo '<label class="clear">' . $this->l('Grid engine') . ': </label><div class="margin-form">'; if (sizeof($arrayGridEngines)) { foreach ($arrayGridEngines as $k => $value) { echo '<div id="sgridcontent_' . $k . '">' . $value[1] . ' </div><script language="javascript">getE(\'sgridcontent_' . $k . '\').style.display = \'none\';</script>'; } echo '<div style="float: left"><select name="PS_STATS_GRID_RENDER">'; foreach ($arrayGridEngines as $k => $value) { echo '<option value="' . $k . '"' . ($k == $gridEngine ? ' selected="selected"' : '') . ' onclick="getE(\'render_grid_content\').innerHTML = getE(\'sgridcontent_' . $k . '\').innerHTML;">' . $value[0] . '</option>'; } echo '</select></div> <div id="render_grid_content" style="float:left;margin-left:20px;width:400px;">' . $arrayGridEngines[$gridEngine][1] . '</div> <div class="clear"></div>'; } else { echo $this->l('No grid engine module installed'); } echo '</div>'; echo '<label class="clear">' . $this->l('Clean automatically') . ': </label> <div class="margin-form"> <select id="PS_STATS_OLD_CONNECT_AUTO_CLEAN" name="PS_STATS_OLD_CONNECT_AUTO_CLEAN">'; foreach ($autocleanPeriod as $k => $value) { echo ' <option value="' . $k . '"' . ($k == $autoclean ? ' selected="selected"' : '') . '>' . $value . ' </option>'; } echo ' </select> </div>'; #End Of Form echo '<input type="submit" value="' . $this->l(' Save ') . '" name="submitSettings" class="button" /> </fieldset> </form>'; }