_t = $table; } protected function html_content() { $title = $this->_t->getTitle(); if (!empty($title)) { $titleclass = $this->_t->getTitleClass(); echo '

', htmlspecialchars($title), '

'; } foreach ($this->_subtemplates as $template) $template->html_main(); // Showing an inline form? $pager = $this->_t->getPageIndex(); if (!empty($pager) || isset($this->_t->form_above)) { echo '
'; // Page index? if (!empty($pager)) PageIndexWidget::paginate($pager); // Form controls? if (isset($this->_t->form_above)) $this->showForm($this->_t->form_above); echo '
'; } $tableClass = $this->_t->getTableClass(); if ($tableClass) echo '
'; // Build the table! echo ' '; // Show all headers in their full glory! $header = $this->_t->getHeader(); foreach ($header as $th) { echo ' 1 ? ' colspan="' . $th['colspan'] . '"' : ''), ' scope="', $th['scope'], '">', $th['href'] ? '' . $th['label'] . '' : $th['label']; if ($th['sort_mode']) echo ' '; echo ''; } echo ' '; // The body is what we came to see! $body = $this->_t->getBody(); if (is_array($body)) { foreach ($body as $tr) { echo ' '; foreach ($tr['cells'] as $td) { echo ' '; if (!empty($td['class'])) echo '', $td['value'], ''; else echo $td['value']; echo ''; } echo ' '; } } // !!! Sum colspan! else echo ' '; echo '
', $body, '
'; if ($tableClass) echo '
'; // Showing an inline form? if (!empty($pager) || isset($this->_t->form_below)) { echo '
'; // Page index? if (!empty($pager)) PageIndexWidget::paginate($pager); // Form controls? if (isset($this->_t->form_below)) $this->showForm($this->_t->form_below); echo '
'; } if (!empty($title)) echo '
'; } protected function showForm($form) { if (!isset($form['is_embed'])) echo '
'; else echo '
'; if (!empty($form['is_group'])) echo '
'; if (!empty($form['fields'])) { foreach ($form['fields'] as $name => $field) { if ($field['type'] === 'select') { echo ' '; } else echo ' '; if (isset($field['html_after'])) echo $field['html_after']; } } echo ' '; if (!empty($form['buttons'])) foreach ($form['buttons'] as $name => $button) { echo ' '; if (isset($button['html_after'])) echo $button['html_after']; } if (!empty($form['is_group'])) echo '
'; if (!isset($form['is_embed'])) echo ' '; else echo '
'; } }