function indexAction() { $reports = Am_Report_Abstract::getAvailableReports(); $defaults = @$this->getSession()->reportDefaults; if ($defaults) { foreach ($reports as $r) { $r->getForm()->setDataSources(array(new HTML_QuickForm2_DataSource_Array($defaults))); } } $this->view->assign('reports', $reports); $this->view->display('admin/report.phtml'); }
function getformAction() { $id = $this->getParam('id'); foreach (Am_Report_Abstract::getAvailableReports() as $r) { if ($r->getId() == $id) { $title = $this->escape($r->getTitle()); $form = $r->getForm(); echo <<<CUT <h2>{$title}</h2> {$form} CUT; throw new Am_Exception_Redirect(); } } throw new Am_Exception_InputError(sprintf('Can not find report with id [%s]', $id)); }