<?php use thom855j\PHPI18n\I18n, thom855j\PHPHtml\Form, thom855j\PHPHttp\Input; ?> <h2 class="sub-header"><?php i18n::output('POST_CREATE', $this->controller); ?> </h2> <?php Form::start($this->project_url, 'post', true); Form::label('title', i18n::get('POST_TITLE', $this->controller), "class='control-label'"); Form::input('text', 'title', Input::exists(Input::get('title')), "class='form-control' required"); Form::label('start_date', i18n::get('POST_START', $this->controller), "class='control-label'"); Form::input('text', 'start_date', date($this->date_format), "class='form-control' required"); Form::label('end_date', i18n::get('POST_END', $this->controller), "class='control-label'"); Form::input('text', 'end_date', null, "class='form-control' required"); Form::label('body', i18n::get('POST_CONTENT', $this->controller), "class='control-label'"); Form::textarea('body', " class='form-control'", Input::exists(Input::get('body'))); foreach ($this->results->categories as $cat) { if ($cat->Parent_ID == 0 || $cat->ID == $cat->Parent_ID) { $options[] = Form::options($cat->ID, '-' . $cat->Label); } else { $options[] = Form::options($cat->ID, $cat->Label); } } if (isset($this->results->uploads)) { $path = $this->project_url . '/public/uploads/thumbs/'; foreach ($this->results->uploads as $upload) { $selected = ''; $thumb = ''; foreach ($this->results->upload_item as $upload_item) {
<?php use thom855j\PHPI18n\I18n, thom855j\PHPHtml\Form; ?> <h2 class="sub-header"><?php i18n::output('POST_UPDATE', $this->controller); ?> </h2> <?php foreach ($this->results->data as $view) { Form::start($this->current_url, "post", true); Form::label('title', i18n::get('POST_TITLE', $this->controller), "class='control-label'"); Form::input('text', 'title', $view->Title, "class='form-control'"); Form::label('start_date', i18n::get('POST_START', $this->controller), "class='control-label'"); Form::input('text', 'start_date', date($this->date_format, $view->Start_date), "class='form-control'"); Form::label('end_date', i18n::get('POST_END', $this->controller), "class='control-label'"); Form::input('text', 'end_date', date($this->date_format, $view->End_date), "class='form-control'"); Form::label('body', i18n::get('POST_CONTENT', $this->controller), "class='control-label'"); Form::textarea('body', " class='form-control'", $view->Body); foreach ($this->results->categories as $cat) { if (isset($this->results->post_cat)) { $extra = ''; foreach ($this->results->post_cat as $post_cat) { if ($post_cat->Cat_ID === $cat->ID) { $extra = "selected"; } } } if ($cat->Parent_ID == 0 || $cat->ID == $cat->Parent_ID) { $options[] = Form::options($cat->ID, '-' . $cat->Label, $extra); } else {
} $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(); ?> </div> <p>Sider:</p> <?php for ($x = 1; $x <= $this->results->total; $x++) { ?> <a class="btn btn-default" href="<?php echo $this->project_url . "admin/read/post/{$this->type}/" . $x; ?> "><?php echo $x; ?> </a> <?php } } else { ?> <p><?php i18n::output('POST_EMPTY', 'post'); ?> </p> <?php }
</label> <input type="text" name="username" id="inputEmail" class="form-control" placeholder="<?php i18n::output('VIEW_USERNAME', 'users'); ?> " required="" autofocus=""> <label for="inputPassword" class="control-label"><?php i18n::output('VIEW_PASSWORD', 'auth'); ?> </label> <input type="password" name="password" id="inputPassword" class="form-control" placeholder="<?php i18n::output('VIEW_PASSWORD', 'auth'); ?> " required=""> <div class="checkbox"> <label> <input type="checkbox" class="control-label" name="remember-me"> <?php i18n::output('REM_ME', 'auth'); ?> </label> </div> <button class="btn btn-lg btn-primary btn-block" type="submit"><?php i18n::output('VIEW_LOGIN', 'auth'); ?> </button><br> <a href="<?php echo URL . '../'; ?> ">Tilbage til hjemmeside</a> </form> </div> <!-- /container -->