/** * Builds the content view */ public function __viewIndex() { $title = $this->_tables[$this->_curColor]; $this->setPageType('table'); $this->setTitle(sprintf('%1$s: %2$s – %3$s', extension_anti_brute_force::EXT_NAME, $title, __('Symphony'))); $this->addStylesheetToHead(URL . '/extensions/anti_brute_force/assets/content.abf.css', 'screen', time() + 10); $this->appendSubheading(__($title)); $cols = $this->getCurrentCols(); // build header table $aTableHead = ViewFactory::buildTableHeader($cols); // build body table $aTableBody = ViewFactory::buildTableBody($cols, $this->getData()); // build data table $table = Widget::Table(Widget::TableHead($aTableHead), NULL, Widget::TableBody($aTableBody), 'selectable', null, array('role' => 'directory', 'aria-labelledby' => 'symphony-subheading', 'data-interactive' => 'data-interactive')); // build the color select box $this->Context->appendChild(ViewFactory::buildSubMenu($this->_tables, $this->_curColor, 'switch')); // append table $this->Form->appendChild($table); // insert form $insertLine = $this->buildInsertForm(); // append actions $insertLine->appendChild(ViewFactory::buildActions($this->_hasData)); // append the insert line $this->Form->appendChild($insertLine); }
/** * Builds the content view */ public function __viewIndex() { // Get data $this->_data = ABF::instance()->getFailures('IP ASC'); $this->_hasData = is_array($this->_data) && count($this->_data) > 0; // Build the page $title = __('Banned IPs'); $this->setPageType('table'); $this->setTitle(__('%1$s – %2$s', array(__('Symphony'), $title))); $this->appendSubheading(__($title)); // build header table $aTableHead = ViewFactory::buildTableHeader($this->_cols); // build body table $aTableBody = ViewFactory::buildTableBody($this->_cols, $this->_data); // build data table $table = Widget::Table(Widget::TableHead($aTableHead), NULL, Widget::TableBody($aTableBody), 'selectable', null, array('role' => 'directory', 'aria-labelledby' => 'symphony-subheading', 'data-interactive' => 'data-interactive')); $this->Form->appendChild($table); $this->Form->appendChild(ViewFactory::buildActions($this->_hasData)); }