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:
<?php
namespace AnalyseModule;
class AnalysePresenter extends \BaseModule\BasePresenter {
protected $dbService;
public function renderDefault() {
$searches = array();
foreach ($this->getHttpRequest()->getCookies() as $name => $cookie) {
if (substr($name, 0, 7) == 'search_') {
$searches[substr($name, 7)] = $cookie;
}
}
krsort($searches);
if (!empty($searches)) {
$this->template->latestSearch = $this->dbService->getBasicInfoForAccessions(json_decode(array_values($searches)[0], true));
} else {
$this->template->latestSearch = null;
}
$this->template->searches = $searches;
reset($searches);
$this->template->cookieId = key($searches);
$this->template->jsFiles = \Nette\Utils\Finder::findFiles('*.js')->in(APP_DIR . 'www' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'Views' . DIRECTORY_SEPARATOR . 'Analyse');
}
protected function createComponentAnalyseForm() {
$form = new \BaseModule\Form;
$form->addSubmit('compare', 'Conservancy comparison');
return $form;
}
}