Example #1
0
 function __construct()
 {
     parent::controllerClass('StoreProducts');
     parent::headerPlural('Store Products');
     parent::headerSingular('Store Product');
     parent::baseRoute('/admin/store-products');
     parent::ajaxBaseRoute('/ajax/admin/store-products');
     parent::table(new StoreProduct());
     parent::tableName('store_product');
     parent::attributes([['title' => 'Order', 'id' => 'sort'], ['title' => 'Name', 'id' => 'name'], ['title' => 'Pricing Type', 'id' => 'store_type.name'], ['title' => 'Short Description', 'id' => 'short_description']]);
     parent::inputs(function ($row) {
         return ['name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : ''), 'short_description' => (new PlainTextAreaBox())->id('short_description')->label('Short Description')->defaultValue($row ? $row->short_description : ''), 'description' => (new PlainTextAreaBox())->id('description')->label('Description')->defaultValue($row ? $row->description : ''), 'image' => (new ElfinderImageInput())->id('image')->label('Image')->defaultValue($row ? $row->image : ''), 'store_type_id' => (new DropDown())->id('store_type_id')->nullable(true)->label('Pricing Type')->idField('id')->nameField('name')->rows(StoreType::all())->defaultValue($row ? $row->store_type_id : ''), 'store_select_id' => (new DropDown())->id('store_select_id')->nullable(true)->label('Select Options')->idField('id')->nameField('name')->rows(StoreSelect::all())->defaultValue($row ? $row->store_select_id : ''), 'price' => (new NumberInput())->id('price')->label('Price (for single price only)')->defaultValue($row ? $row->price : '0')];
     });
 }
Example #2
0
 function __construct()
 {
     parent::controllerClass('StoreTypes');
     parent::headerPlural('Store Types');
     parent::headerSingular('Store Type');
     parent::baseRoute('/admin/store-types');
     parent::ajaxBaseRoute('/ajax/admin/store-types');
     parent::table(new StoreType());
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Name', 'id' => 'name'], ['title' => 'Description', 'id' => 'description']]);
     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 : '')];
     });
     parent::tableName('store_type');
 }
Example #3
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');
 }
Example #4
0
 function __construct()
 {
     parent::controllerClass('Users');
     parent::headerPlural('Users');
     parent::headerSingular('User');
     parent::baseRoute('/admin/users');
     parent::ajaxBaseRoute('/ajax/admin/users');
     parent::table(new User());
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Username', 'id' => 'username']]);
     parent::inputs(function ($row) {
         return ['username' => (new TextBox())->id('username')->label('Username')->defaultValue($row ? $row->username : '')];
     });
     parent::tableName('user');
 }
Example #5
0
 function __construct()
 {
     parent::controllerClass('StoreOrders');
     parent::headerPlural('Store Orders');
     parent::headerSingular('Store Order');
     parent::baseRoute('/admin/store-orders');
     parent::ajaxBaseRoute('/ajax/admin/store-orders');
     parent::table(new StoreOrder());
     parent::tableName('store_order');
     parent::attributes([['title' => 'Finished', 'id' => 'finished'], ['title' => 'Created', 'id' => 'created_at'], ['title' => 'First Name', 'id' => 'first_name'], ['title' => 'Last Name', 'id' => 'last_name'], ['title' => 'Total', 'id' => 'total']]);
     parent::inputs(function ($row) {
         return ['email' => (new TextBox())->id('email')->label('email')->defaultValue($row ? $row->email : ''), 'payer_id' => (new TextBox())->id('payer_id')->label('payer_id')->defaultValue($row ? $row->payer_id : ''), 'payer_status' => (new TextBox())->id('payer_status')->label('payer_status')->defaultValue($row ? $row->payer_status : ''), 'first_name' => (new TextBox())->id('first_name')->label('first_name')->defaultValue($row ? $row->first_name : ''), 'last_name' => (new TextBox())->id('last_name')->label('last_name')->defaultValue($row ? $row->last_name : ''), 'country_code' => (new TextBox())->id('country_code')->label('country_code')->defaultValue($row ? $row->country_code : ''), 'ship_to_name' => (new TextBox())->id('ship_to_name')->label('ship_to_name')->defaultValue($row ? $row->ship_to_name : ''), 'ship_to_street' => (new TextBox())->id('ship_to_street')->label('ship_to_street')->defaultValue($row ? $row->ship_to_street : ''), 'ship_to_city' => (new TextBox())->id('ship_to_city')->label('ship_to_city')->defaultValue($row ? $row->ship_to_city : ''), 'ship_to_state' => (new TextBox())->id('ship_to_state')->label('ship_to_state')->defaultValue($row ? $row->ship_to_state : ''), 'ship_to_zip' => (new TextBox())->id('ship_to_zip')->label('ship_to_zip')->defaultValue($row ? $row->ship_to_zip : ''), 'ship_to_country' => (new TextBox())->id('ship_to_country')->label('ship_to_country')->defaultValue($row ? $row->ship_to_country : ''), 'currecncy_code' => (new TextBox())->id('currecncy_code')->label('currecncy_code')->defaultValue($row ? $row->currecncy_code : ''), 'note' => (new TextBox())->id('note')->label('note')->defaultValue($row ? $row->note : ''), 'shipping' => (new TextBox())->id('shipping')->label('Shipping Included')->defaultValue($row ? $row->shipping : ''), 'total' => (new TextBox())->id('total')->label('Total')->defaultValue($row ? $row->total : ''), 'finished' => (new Checkbox())->id('Finished')->label('finished')->defaultValue($row ? $row->finished : '')];
     });
 }
Example #6
0
 function __construct()
 {
     parent::controllerClass('StoreCategories');
     parent::headerPlural('Store Categories');
     parent::headerSingular('Store Category');
     parent::baseRoute('/admin/store-categories');
     parent::ajaxBaseRoute('/ajax/admin/store-categories');
     parent::table(new StoreCategory());
     parent::tableName('store_category');
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Name', 'id' => 'name']]);
     parent::inputs(function ($row) {
         return ['name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : '')];
     });
 }
Example #7
0
 function __construct()
 {
     parent::controllerClass('Files');
     parent::headerPlural('Files');
     parent::headerSingular('File');
     parent::baseRoute('/admin/files');
     parent::ajaxBaseRoute('/ajax/admin/files');
     parent::table(new File());
     $this->level = 2;
     parent::tableName('file');
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'User', 'id' => 'user.username'], ['title' => 'Filename', 'id' => 'filename'], ['title' => 'URI', 'id' => 'value']]);
     parent::inputs(function ($row) {
         return ['user_id' => (new MetaItem())->id('user_id')->defaultValue(Auth::user()->id), (new FileInput())->id('filename')->valueField('value')->filenameField('filename')->label('File ' . ($row ? '- ' . $row->filename : ''))->filename($row ? $row->value : '')->defaultValue($row ? $row->value : '')];
     });
 }
Example #8
0
 function __construct()
 {
     parent::controllerClass('UserRoles');
     parent::headerPlural('User Roles');
     parent::headerSingular('User Role');
     parent::baseRoute('/admin/users/{id1}/roles');
     parent::ajaxBaseRoute('/ajax/admin/users/{id1}/roles');
     parent::table(new RoleUser());
     $this->level = 2;
     parent::attributes([['title' => 'User', 'id' => 'user.username'], ['title' => 'Role', 'id' => 'role.name']]);
     parent::inputs(function ($row) {
         $parentId = Request::route("id" . ($this->level - 1));
         return ['user_id' => (new MetaItem())->id('user_id')->defaultValue($parentId), 'role' => (new DropDown())->id('role_id')->nullable(false)->idField('id')->nameField('name')->defaultValue($row ? $row->role_id : '')->label('Role')->rows(Role::get())];
     });
     $this->parentHeader = 'User';
     parent::tableName('role_user');
 }
 function __construct()
 {
     parent::controllerClass('StoreProductSubcategories');
     parent::headerPlural('Store Product Sub-Categories');
     parent::headerSingular('Store Product Sub-Category');
     parent::baseRoute('/admin/store-products/{id1}/subcategories');
     parent::ajaxBaseRoute('/ajax/admin/store-products/{id1}/subcategories');
     parent::table(new StoreProductSubcategory());
     parent::tableName('store_product_subcategory');
     $this->level = 2;
     $this->parentHeader = 'Store Product';
     $this->foreignKeyField = 'store_product_id';
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Sub-category', 'id' => 'store_subcategory.name']]);
     parent::inputs(function ($row) {
         return ['store_product_id' => (new MetaItem())->id('store_product_id')->defaultValue(Request::route('id1')), 'store_subcategory_id' => (new DropDown())->id('store_subcategory_id')->nullable(false)->label('Sub-category')->idField('id')->nameField('name')->rows(StoreSubcategory::all())->defaultValue($row ? $row->store_subcategory_id : '')];
     });
 }
 function __construct()
 {
     parent::controllerClass('TemplateSectionItemValues');
     parent::headerPlural('Template Section Item Values');
     parent::headerSingular('Template Section Item Value');
     parent::baseRoute('/admin/templates/{id1}/sections/{id2}/items/{id3}/values');
     parent::ajaxBaseRoute('/ajax/admin/templates/{id1}/sections/{id2}/items/{id3}/values');
     parent::table(new ItemValue());
     $this->level = 4;
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Value', 'id' => 'value']]);
     parent::inputs(function ($row) {
         $parentId = Request::route("id" . ($this->level - 1));
         return ['item_id' => (new MetaItem())->id('item_id')->defaultValue($parentId), 'value' => (new TextBox())->id('value')->label('value')->defaultValue($row ? $row->value : '')];
     });
     $this->parentHeader = 'Template Section Items';
     parent::tableName('item_value');
 }
Example #11
0
 function __construct()
 {
     parent::controllerClass('StoreSubcategories');
     parent::headerPlural('Store Sub-Categories');
     parent::headerSingular('Store Sub-Category');
     parent::baseRoute('/admin/store-categories/{id1}');
     parent::ajaxBaseRoute('/ajax/admin/store-categories/{id1}');
     parent::table(new StoreSubcategory());
     parent::tableName('store_subcategory');
     $this->level = 2;
     $this->parentHeader = 'Store Category';
     $this->foreignKeyField = 'store_category_id';
     parent::attributes([['title' => 'Order', 'id' => 'sort'], ['title' => 'Name', 'id' => 'name']]);
     parent::inputs(function ($row) {
         return ['store_category_id' => (new MetaItem())->id('store_category_id')->defaultValue(Request::route('id1')), 'name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : ''), 'description' => (new TextAreaBox())->id('description')->label('description')->defaultValue($row ? $row->description : '')];
     });
 }
Example #12
0
 function __construct()
 {
     parent::controllerClass('StoreTypePrices');
     parent::headerPlural('Store Type Prices');
     parent::headerSingular('Store Type Price');
     parent::baseRoute('/admin/store-types/{id1}/price');
     parent::ajaxBaseRoute('/ajax/admin/users/{id1}/price');
     $this->level = 2;
     $this->parentHeader = 'Store Type';
     $this->foreignKeyField = 'store_type_id';
     parent::table(new StoreTypePrice());
     parent::tableName('store_type_price');
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Name', 'id' => 'name'], ['title' => 'Price', 'id' => 'price']]);
     parent::inputs(function ($row) {
         return ['store_type_id' => (new MetaItem())->id('store_type_id')->defaultValue(Request::route('id1')), 'name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : ''), 'price' => (new NumberInput())->id('price')->label('Default Price')->defaultValue($row ? $row->price : '')];
     });
 }
Example #13
0
 function __construct()
 {
     parent::controllerClass('TemplateSectionItems');
     parent::headerPlural('Template Section Items');
     parent::headerSingular('Template Section Items');
     parent::baseRoute('/admin/templates/{id1}/sections/{id2}/items');
     parent::ajaxBaseRoute('/ajax/admin/templates/{id1}/sections/{id2}/items');
     parent::table(new Item());
     $this->level = 3;
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Name', 'id' => 'name'], ['title' => 'Type', 'id' => 'item_type.name']]);
     parent::inputs(function ($row) {
         $parentId = Request::route("id" . ($this->level - 1));
         return ['section_id' => (new MetaItem())->id('section_id')->defaultValue($parentId), 'name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : ''), 'item_type_id' => (new DropDown())->id('item_type_id')->nullable(false)->label('Type')->idField('id')->nameField('name')->rows(ItemType::get())->defaultValue($row ? $row->item_type_id : '')];
     });
     $this->parentHeader = 'Template Section';
     parent::tableName('item');
 }
Example #14
0
 function __construct()
 {
     parent::controllerClass('StoreSelectItems');
     parent::headerPlural('Store Selection Items');
     parent::headerSingular('Store Selection Item');
     parent::baseRoute('/admin/store-selections/{id1}');
     parent::ajaxBaseRoute('/ajax/admin/store-selections/{id1}');
     parent::table(new StoreSelectItem());
     parent::tableName('store_select_item');
     $this->level = 2;
     $this->parentHeader = 'Store Selection';
     $this->foreignKeyField = 'store_select_id';
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Name', 'id' => 'name']]);
     parent::inputs(function ($row) {
         return ['store_select_id' => (new MetaItem())->id('store_select_id')->defaultValue(Request::route('id1')), 'name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : '')];
     });
 }
Example #15
0
 function __construct()
 {
     parent::controllerClass('TemplateSections');
     parent::headerPlural('Template Sections');
     parent::headerSingular('Template Section');
     parent::baseRoute('/admin/templates/{id1}/sections');
     parent::ajaxBaseRoute('/ajax/admin/templates/{id1}/sections');
     parent::table(new Section());
     $this->level = 2;
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Name', 'id' => 'name'], ['title' => 'Single Post?', 'id' => 'single_formatted'], ['title' => 'Has Attachments?', 'id' => 'has_attachments_formatted']]);
     parent::inputs(function ($row) {
         $parentId = Request::route("id" . ($this->level - 1));
         return ['template_id' => (new MetaItem())->id('template_id')->defaultValue($parentId), 'name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : ''), 'description' => (new PlainTextAreaBox())->id('description')->label('Description')->defaultValue($row ? $row->description : ''), 'single' => (new Checkbox())->id('single')->label('Single Post?')->defaultValue($row ? $row->single : ''), 'has_attachments' => (new Checkbox())->id('has_attachments')->label('Has Attachments?')->defaultValue($row ? $row->has_attachments : '')];
     });
     $this->parentHeader = 'Template';
     $this->foreignKeyField = "template_id";
     parent::tableName('section');
 }
Example #16
0
 function __construct()
 {
     parent::controllerClass('StoreOrderProducts');
     parent::headerPlural('Store Order Products');
     parent::headerSingular('Store Order Product');
     parent::baseRoute('/admin/store-orders/{id1}/products');
     parent::ajaxBaseRoute('/ajax/admin/store-orders/{id1}/products');
     parent::table(new StoreOrderProduct());
     parent::tableName('store_order_product');
     $this->level = 2;
     $this->parentHeader = 'Store Order';
     $this->foreignKeyField = 'store_order_id';
     $this->useDeleteButton = false;
     parent::attributes([['title' => 'Option', 'id' => 'select'], ['title' => 'Product', 'id' => 'product'], ['title' => 'Type', 'id' => 'type_price'], ['title' => 'Quantity', 'id' => 'quantity'], ['title' => 'Total', 'id' => 'price']]);
     parent::inputs(function ($row) {
         return [];
     });
 }
Example #17
0
 function __construct()
 {
     parent::controllerClass('EditPagesPosts');
     parent::headerPlural('Page Posts');
     parent::headerSingular('Page Post');
     parent::baseRoute('/admin/edit-pages/{id1}/posts');
     parent::ajaxBaseRoute('/ajax/admin/edit-pages/{id1}/posts');
     parent::table(new Post());
     $this->level = 2;
     $this->useEditButton = false;
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Post Name', 'id' => 'name'], ['title' => 'Category', 'id' => 'section.name']]);
     parent::inputs(function ($row) {
         $parentId = Request::route("id" . ($this->level - 1));
         $page = Page::find($parentId);
         return ['page_id' => (new MetaItem())->id('page_id')->defaultValue($parentId), 'name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : ''), 'description' => (new PlainTextAreaBox())->id('description')->label('Description')->defaultValue($row ? $row->description : ''), 'section_id' => (new DropDown())->id('section_id')->nullable(false)->label('Category')->idField('id')->nameField('name')->rows(Section::where('single', '=', 0)->where('template_id', '=', $page->template()->first()->id)->get())->defaultValue($row ? $row->section_id : '')];
     });
     $this->parentHeader = 'Edit Page';
     parent::tableName('post-section');
 }
Example #18
0
 function __construct()
 {
     parent::controllerClass('Templates');
     parent::headerPlural('Templates');
     parent::headerSingular('Template');
     parent::baseRoute('/admin/templates');
     parent::ajaxBaseRoute('/ajax/admin/templates');
     parent::table(new Template());
     parent::attributes([['title' => 'ID', 'id' => 'id'], ['title' => 'Name', 'id' => 'name'], ['title' => 'File', 'id' => 'filename']]);
     parent::inputs(function ($row) {
         $path = base_path() . '/resources/views/aui/templates';
         $fs = scandir($path);
         $fs = array_filter($fs, function ($fn) {
             return ends_with($fn, '.blade.php');
         });
         $fs = array_map(function ($fn) {
             return ['filename' => $fn];
         }, $fs);
         //            Log::info($fs);
         return ['name' => (new TextBox())->id('name')->label('Name')->defaultValue($row ? $row->name : ''), 'description' => (new PlainTextAreaBox())->id('description')->label('Description')->defaultValue($row ? $row->description : ''), 'file' => (new DropDown())->id('filename')->nullable(true)->label('Filename')->idField('filename')->nameField('filename')->rows($fs)->defaultValue($row ? $row->filename : '')];
     });
     parent::tableName('template');
 }
Example #19
0
 function routes()
 {
     Route::get($this->getBaseRoute() . "/{id2}/download", ["as" => "Download Attachment", "uses" => "EditPagesAttachments@download"]);
     parent::routes();
 }
Example #20
0
 function routes()
 {
     parent::routes();
     Route::get("{$this->baseRoute}/{id{$this->level}}/open", "Feeds@openPage");
 }