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

', $title, '

'; // Showing a page index? parent::html_content(); // Maybe even a small form? if (isset($this->_t->form_above)) $this->showForm($this->_t->form_above); // Build the table! echo ' '; // Show the table's headers. foreach ($this->_t->getHeader() as $th) { echo ' 1 ? ' colspan="' . $th['colspan'] . '"' : ''), ' scope="', $th['scope'], '">', $th['href'] ? '' . $th['label'] . '' : $th['label']; if ($th['sort_mode'] ) echo ' ', $th['sort_mode'] == 'up' ? '↑' : '↓'; echo ''; } echo ' '; // Show the table's body. $body = $this->_t->getBody(); if (is_array($body)) { foreach ($body as $tr) { echo ' '; foreach ($tr['cells'] as $td) echo ' ', $td['value'], ''; echo ' '; } } else echo ' '; echo '
', $body, '
'; // Maybe another small form? if (isset($this->_t->form_below)) $this->showForm($this->_t->form_below); // Showing a page index? parent::html_content(); echo '
'; } protected function showForm($form) { echo '
'; if (!empty($form['fields'])) foreach ($form['fields'] as $name => $field) echo ' '; if (!empty($form['buttons'])) foreach ($form['buttons'] as $name => $button) echo ' '; echo '
'; } }