/** * Renders the summary of given home_pages * @param bean $model The home_pages summary model */ private function renderSummary($model) { global $logger; $logger->debug(get_class($this) . '::summary()'); $data = $model->getHomePages(); $tmpl = $this->createPatTemplate(); $tmpl->readTemplatesFromInput('home_page_summary.pat.tpl'); $tmpl->addVar('home_page_summary', 'total', count($data)); // Add the objects to the nested templates for ($i = 0; $i < count($data); $i++) { $home_page = $data[$i]; $logger->debug("Class of home_page: " . get_class($home_page)); $tmpl->addVar('home_page', 'iter', $i); $tmpl->addVar('home_page', 'index', $i + 1); // Render the primary form fields $tmpl->addVars('home_page', BeanUtil::beanToArray($home_page, true)); // scalars only $pubwidget = $this->getPubControls($home_page->getPubState()); $tmpl->addVars('home_page', $pubwidget); $tmpl->parseTemplate('home_page', "a"); } $tmpl->displayParsedTemplate('home_page_summary'); }