Ejemplo n.º 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]);
 }
Ejemplo n.º 2
0
 function post()
 {
     $template = Template::find(Request::route('id1'));
     $file = base_path() . "/resources/views/aui/templates/" . $template->filename;
     file_put_contents($file, Input::get('code'));
     return Redirect::to("/admin/templates");
 }
Ejemplo n.º 3
0
 function __construct()
 {
     parent::controllerClass('Sections');
     parent::headerPlural('Sections');
     parent::headerSingular('Section');
     parent::baseRoute('/admin/sections');
     parent::ajaxBaseRoute('/ajax/admin/sections');
     parent::table(new Section());
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Name', 'id' => 'name'], ['title' => 'Template', 'id' => 'template.name'], ['title' => 'Single Post', 'id' => 'single']]);
     parent::inputs(function ($row) {
         return ['name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : ''), 'description' => (new PlainTextAreaBox())->id('description')->label('Description')->defaultValue($row ? $row->description : ''), 'template_id' => (new DropDown())->id('template_id')->nullable(false)->label('Template')->idField('id')->nameField('name')->rows(Template::get())->defaultValue($row ? $row->template_id : ''), 'single' => (new Checkbox())->id('single')->label('Single Post?')->defaultValue($row ? $row->single : '')];
     });
     parent::tableName('section');
 }
Ejemplo n.º 4
0
 function __construct()
 {
     parent::controllerClass('Pages');
     parent::headerPlural('Pages');
     parent::headerSingular('Page');
     parent::baseRoute('/admin/pages');
     parent::ajaxBaseRoute('/ajax/admin/pages');
     parent::table(new Page());
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Name', 'id' => 'name'], ['title' => 'Description', 'id' => 'description'], ['title' => 'URL', 'id' => 'url'], ['title' => 'Template', 'id' => 'template.name'], ['title' => 'Language', 'id' => 'language.name']]);
     parent::inputs(function ($row) {
         return ['name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : ''), 'description' => (new PlainTextAreaBox())->id('description')->label('Description')->defaultValue($row ? $row->description : ''), 'url' => (new TextBox())->id('url')->label('URL')->defaultValue($row ? $row->url : ''), '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 : '')];
     });
     parent::tableName('page');
 }