<?php use thom855j\PHPI18n\I18n, thom855j\PHPHtml\Table; ?> <h2 class="sub-header"><?php I18n::output('POST_SUB_HEADER', $this->controller); ?> </h2> <?php if (!empty($this->results)) { ?> <div class="table-responsive"> <?php Table::start("class='table table-striped'"); Table::head(array('ID', i18n::get('POST_TITLE', $this->controller), i18n::get('POST_CREATED', $this->controller), i18n::get('POST_UPDATED', $this->controller), i18n::get('POST_AUTHOR', $this->controller), i18n::get('POST_ACTIONS', $this->controller))); foreach ($this->results->data as $view) { // Check dates $updated = ""; $created = ""; if ($view->Updated < 0) { $updated = date($this->date_format, $view->Updated); } if ($view->Created > 0) { $created = date($this->date_format, $view->Created); } $form = "<form action='" . $this->project_url . "admin/delete/post/" . $this->type . "' method='post' onsubmit=\"return confirm('Er du sikker?')\"><input type='hidden' name='id' value='" . $view->ID . "'>" . "<input type='submit' value='" . i18n::get('POST_DELETE', $this->controller) . "' class='btn btn-danger'></form>"; Table::data(array("#" . $view->ID, $view->Title . " <small>(" . $view->Slug . ")</small>", $created, $updated, " <small>(" . $view->Username . ")</small>", "<a class='btn btn-success' href='" . $this->project_url . 'admin/update/post/' . $this->type . '/' . $view->ID . "'>" . i18n::get('POST_UPDATE', $this->controller) . "</a>", $form)); } Table::end(); ?>