Exemplo n.º 1
0
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) {
                $selected = "selected ";
            }
        }
        $uploads[] = Form::options($upload->ID, $upload->Slug, $selected . "data-img-src='{$thumb}'");
    }
}
Form::label('category', i18n::get('POST_CAT', $this->controller), "class='control-label'");
Form::select('category[]', $options, "multiple class='form-control'");
if (isset($uploads)) {
    Form::label('upload', i18n::get('POST_IMAGE', $this->controller), "class='control-label'");
    Form::select('upload[]', $uploads, "id='upload'  multiple class='form-control'");
}
Form::space(1);
Form::submit('submit', i18n::get('POST_SAVE', $this->controller), "class='form-control btn-success'");
Form::end();