public function delete($type)
 {
     var_dump($this);
     die;
     CategoryItemModel::load()->delete('Post_ID', Input::get('id'));
     UploadItemModel::load()->delete('Post_ID', Input::get('id'));
     PostModel::load($type)->delete('ID', Input::get('id'));
     Session::set('SUCCESS', i18n::get('FEEDBACK_SUCCESS', 'system'));
     Redirect::to($this->project_url . "admin/read/post/{$type}/");
 }
Beispiel #2
0
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) {
            $thumb = $path . $upload->Slug;
            if ($upload_item->Upload_ID == $upload->ID) {