1010use NotFound \Layout \Elements \LayoutButton ;
1111use NotFound \Layout \Elements \LayoutForm ;
1212use NotFound \Layout \Elements \LayoutPage ;
13+ use NotFound \Layout \Elements \LayoutText ;
1314use NotFound \Layout \Elements \LayoutWidget ;
14- use NotFound \Layout \Elements \Table \LayoutTable ;
15- use NotFound \Layout \Elements \Table \LayoutTableColumn ;
16- use NotFound \Layout \Elements \Table \LayoutTableHeader ;
17- use NotFound \Layout \Elements \Table \LayoutTableRow ;
1815use NotFound \Layout \Helpers \LayoutWidgetHelper ;
1916use NotFound \Layout \Inputs \LayoutInputCheckbox ;
2017use NotFound \Layout \Inputs \LayoutInputDropdown ;
@@ -39,40 +36,10 @@ public function index()
3936
4037 $ widget1 = new LayoutWidget ('CMS Menu ' , 12 );
4138
42- $ table = new LayoutTable (delete: true , edit: true , create: true , sort: true );
43- $ table ->addHeader (new LayoutTableHeader ('Name ' , 'table ' ));
44- $ table ->addHeader (new LayoutTableHeader ('Level ' , 'level ' ));
45- $ table ->addHeader (new LayoutTableHeader ('Icon ' , 'icon ' ));
46- $ table ->addHeader (new LayoutTableHeader ('Rights ' , 'rights ' ));
47- $ table ->addHeader (new LayoutTableHeader ('Enabled ' , 'enabled ' ));
48- $ tables = CmsMenu::orderBy ('order ' )->get ();
49-
50- foreach ($ tables as $ cmsTable ) {
51- $ row = new LayoutTableRow ($ cmsTable ->id , '/app/editor/menu/ ' .$ cmsTable ->id );
52- $ row ->addColumn (new LayoutTableColumn ($ cmsTable ->level == 1 ? '- ' .$ cmsTable ->title : $ cmsTable ->title , 'table ' ));
53- $ row ->addColumn (new LayoutTableColumn ($ cmsTable ->level , 'level ' ));
54- $ row ->addColumn (new LayoutTableColumn ($ cmsTable ->icon , 'icon ' ));
55- $ row ->addColumn (new LayoutTableColumn ($ cmsTable ->rights , 'rights ' ));
56- $ row ->addColumn (new LayoutTableColumn ($ cmsTable ->enabled , 'enabled ' ));
57- $ table ->addRow ($ row );
58- }
59- $ widget1 ->addTable ($ table );
60- $ widget1 ->noPadding ();
39+ $ widget1 ->addText (new LayoutText ('Menu is editable in the file resources/siteboss/menu.json ' ));
6140
6241 $ page ->addWidget ($ widget1 );
6342
64- $ widget2 = new LayoutWidget ('Add new item ' , 12 );
65-
66- $ newFieldForm = new LayoutForm ('/app/editor/menu/ ' );
67-
68- $ newFieldForm ->addInput ((new LayoutInputText ('name ' , 'Display name ' ))->setRequired ());
69- $ newFieldForm ->addInput ((new LayoutInputText ('to ' , 'Target Path ' ))->setRequired ());
70- $ newFieldForm ->addButton (new LayoutButton ('Add menuitem ' ));
71-
72- $ widget2 ->addForm ($ newFieldForm );
73-
74- $ page ->addWidget ($ widget2 );
75-
7643 $ response ->addUIElement ($ page );
7744
7845 return $ response ->build ();
0 commit comments