Example #1
0
 /**
  * Effectue l'affichage du SearchForm et du Grid.
  * Note : les méthodes sont séparées pour une éventuelle
  * personalisation.
  *
  * @param string $title titre du grid
  * @return void
  */
 public function render($title = false, $template = false)
 {
     $this->includeSessionRequirements();
     $this->session = Session::singleton();
     unset($_SESSION['_' . $this->clsname . '_']);
     $this->auth();
     $title = !$title ? $this->title : $title;
     $template = !$template ? $this->htmlTemplate : $template;
     if ($this->_withSearhForm) {
         $this->buildSearchForm();
         $this->searchForm->setDisplayForm(!$this->forceGridDisplay);
         if ($this->searchForm->displayGrid($this->forceGridDisplay)) {
             if (!empty($this->_checkboxes)) {
                 SearchTools::cleanCheckBoxDataSession($this->_checkboxes);
             }
             $filter = $this->getGridFilter();
             if (!is_array($filter)) {
                 $filter = array($filter);
             }
             // mettre 1 pour préserver les checkbox coché ici empêche de
             // décoché des checkbox lors que l'on fait plusieurs rechreche
             // à la suite
             $filter = array_merge($filter, $this->searchForm->BuildFilterComponentArray($this->preserveGridItems));
             $filter = SearchTools::FilterAssembler($filter);
             $this->buildGrid();
             $order = $this->getGridSortOrder();
             $this->searchForm->displayResult($this->grid, true, $filter, $order, $title, $this->jsRequirements, $this->additionalContent, 'page');
         } else {
             $content = '';
             if (isset($this->additionalContent['beforeForm'])) {
                 $content = $this->additionalContent['beforeForm'];
             }
             $content .= $this->searchForm->render() . '</form>';
             if (isset($this->additionalContent['between'])) {
                 $content = $this->additionalContent['between'];
             }
             Template::page($title, $content, $this->jsRequirements, $this->cssRequirements, $template);
         }
     } else {
         $this->buildGrid();
         $filter = $this->getGridFilter();
         $order = $this->getGridSortOrder();
         Template::pageWithGrid($this->grid, $this->clsname, $title, $filter, $order, $template);
     }
 }
Example #2
0
 public function go_error() {
     Template::$menu = 'Error';
     Template::$page = 'error';
     Template::flush($this);
 }