Beispiel #1
0
 function definition($def = [])
 {
     $is = [];
     $row = null;
     $is = ['name' => (new TextBox())->id('name')->label('Page Name')->defaultValue($row ? $row->name : ''), 'description' => (new PlainTextAreaBox())->id('description')->label('Page Description')->defaultValue($row ? $row->description : ''), 'url' => (new TextBox())->id('url')->label('URL')->defaultValue($row ? $row->url : "/" . substr(md5(rand()), 0, 6)), 'template_id' => (new DropDown())->id('template_id')->nullable(false)->label('Template')->idField('id')->nameField('name')->rows(Template::get())->defaultValue($row ? $row->template_id : ''), 'language_id' => (new DropDown())->id('language_id')->nullable(false)->label('Language')->idField('id')->nameField('name')->rows(Language::get())->defaultValue($row ? $row->language_id : '')];
     return parent::definition(['Form ID' => $this->getHeader() . "-form", 'Submit Button Text' => 'Save', 'Inputs' => $is]);
 }
 function definition($def = [])
 {
     $is = [];
     $row = Template::find(Request::route('id1'));
     $is[] = (new CodeInput())->id('code')->label('Code')->isRow(true)->lgCols(12)->defaultValue($row ? file_get_contents(base_path() . "/resources/views/aui/templates/" . $row->filename) : '');
     return parent::definition(['Form ID' => $this->getHeader() . "-form", 'Submit Button Text' => 'Save', 'Inputs' => $is]);
 }
Beispiel #3
0
 function definition($def = [])
 {
     $is = [];
     $is[] = (new TextBox())->id('name')->label('New Page Name');
     $is[] = (new PlainTextAreaBox())->id('description')->label('New Page description');
     $is[] = (new TextBox())->id('url')->label('New Page URL')->defaultValue("/" . substr(md5(rand()), 0, 6));
     return parent::definition(['Form ID' => $this->getHeader() . "-form", 'Submit Button Text' => 'Save', 'Inputs' => $is]);
 }
Beispiel #4
0
 function definition($def = [])
 {
     $is = [];
     $sectionId = Post::find(Request::route('id2'))->section()->first()->id;
     foreach (Item::where('section_id', '=', $sectionId)->get() as $item) {
         $content = $item->content()->where('post_id', '=', Request::route('id2'))->get()->first();
         $is = $item->render($is, $content);
     }
     return parent::definition(['Form ID' => $this->getHeader() . "-form", 'Submit Button Text' => 'Save', 'Inputs' => $is]);
 }
 function definition($def = [])
 {
     return parent::definition(['Form ID' => $this->getHeader() . "-form", 'Submit Button Text' => 'Save', 'Inputs' => $this->inputs()]);
 }
 function definition($def = [])
 {
     return parent::definition(['Form ID' => $this->getHeader() . "-form", 'Submit Button Text' => 'Save', 'Inputs' => $this->inputs(Post::find(Request::route('id2')))]);
 }
 function definition($def = [])
 {
     return parent::definition(['Form ID' => $this->getHeader() . "-form", 'Submit Button Text' => 'Save', 'Inputs' => $this->inputs($this->currentPost(), $this->currentAttachment())]);
 }