public function renderFilter() { $action = htmlentities($this->grid->getCompleteRequest()->getBaseUrl() . $this->grid->getCompleteRequest()->getPathInfo(), ENT_QUOTES, 'UTF-8'); $title = $this->getTitle(); $vars = $this->getAllButFilterVars(); $hiddenInputs = Am_Controller::renderArrayAsInputHiddens($vars); $inputs = $this->renderInputs(); $button = $this->renderButton(); return <<<CUT <div class="filter-wrap"> <form class="filter" method="get" action="{$action}"> <span class="filter-title">{$title}</span> {$hiddenInputs} {$inputs} {$button} </form> </div> CUT; }
protected function initForm($form) { $form->setDataSources(array($this->grid->getCompleteRequest())); $vars = array(); foreach ($this->grid->getVariablesList() as $k) { $vars[$this->grid->getId() . '_' . $k] = $this->grid->getRequest()->get($k, ""); } $form->addHtml('hidden')->setHtml(Am_Controller::renderArrayAsInputHiddens($vars)); }
public function renderStatic(&$out, Am_Grid_Editable $grid) { $hidden = Am_Controller::renderArrayAsInputHiddens($grid->getFilter()->getAllButFilterVars()); $out .= "<!-- start of advanced search box -->\n" . $grid->getDataSource()->renderForm($hidden) . "\n"; "<!-- end of advanced search box -->\n"; }
public function renderConfirmationForm($btn = null, $page = null, $addHtml = null) { if (empty($btn)) { $btn = ___("Yes, continue"); } $vars = $this->grid->getCompleteRequest()->toArray(); $vars[$this->grid->getId() . '_confirm'] = 'yes'; if ($page !== null) { $vars[$this->grid->getId() . '_group_page'] = (int) $page; } $hidden = Am_Controller::renderArrayAsInputHiddens($vars); $btn = $this->grid->escape($btn); $url_yes = $this->grid->makeUrl(null); return <<<CUT <form method="post" action="{$url_yes}" style="margin: 10px; display: inline;"> {$hidden} {$addHtml} <input type="submit" value="{$btn}" /> </form> CUT; }
public function renderContinueForm($btn = null, $context = null) { if (empty($btn)) { $btn = ___("Yes, continue"); } $vars = $this->grid->getCompleteRequest()->toArray(); $vars[$this->grid->getId() . '_confirm'] = 'yes'; if ($context !== null) { $vars[$this->grid->getId() . '_group_context'] = $context; } $hidden = Am_Controller::renderArrayAsInputHiddens($vars); $btn = $this->grid->escape($btn); $url_yes = $this->grid->makeUrl(null); return <<<CUT <form method="post" action="{$url_yes}" style="display: inline;"> {$hidden} <input type="submit" value="{$btn}" id='group-action-continue' /> </form> CUT; }