Esempio n. 1
0
 function get()
 {
     $pages = null;
     if (Auth::user()->userPages()->count() === 0) {
         $pages = Page::orderBy('sort', 'ASC')->orderBy('id', 'ASC')->get();
     } else {
         $pages = Page::whereIn('id', Auth::user()->userPages()->lists('page_id'))->orderBy('sort', 'ASC')->orderBy('id', 'ASC')->get();
     }
     return ViewUtils::page([ViewUtils::box('Sort Pages', [\View::make('punto-cms::sort')->with('actionUrl', '/admin/sort-pages')->with('items', $pages)->with('key', 'name')])]);
 }
Esempio n. 2
0
 function getCrumbs()
 {
     $views = [];
     if (Config::get('punto-cms.editor-new-page') == true) {
         $views[] = (new ButtonItem())->label('New')->defaultValue('/admin/new-page');
     }
     if (Config::get('punto-cms.editor-sort-pages') == true) {
         $views[] = (new ButtonItem())->label('Sort')->defaultValue('/admin/sort-pages');
     }
     return ViewUtils::plain($views);
 }
 function showView($views)
 {
     $att = Attachment::find(Request::route('id3'));
     $pageId = Request::route('id1');
     $buttons = [];
     $buttons[] = ["submit" => true, "label" => "Delete Attachment", "type" => " bg-purple"];
     $buttons[] = ["submit" => false, "href" => "/admin/manage-pages/{$pageId}/content", "label" => "Cancel", "type" => "default"];
     $allViews = [];
     $allViews[] = ViewUtils::modal("Deleting Post: {$att->name}", "Are you sure you want to delete post \"{$att->name}\" ?", $buttons, $this->getUrl());
     if ($this->plainPage === true) {
         return ViewUtils::plainPage($allViews);
     } else {
         return ViewUtils::page($allViews);
     }
 }
Esempio n. 4
0
 function show()
 {
     $page = Page::find(Request::route('id1'));
     $views = [];
     $views[] = (new HeadingItem())->label($page->name)->views([(new ButtonItem())->target('_blank')->label("Open Page")->defaultValue($page->url)]);
     foreach ($page->template()->first()->sections()->get() as $sec) {
         $secViews = [];
         $header = "{$sec->name}";
         $secButtons = [];
         $icon = null;
         foreach ($page->posts()->where('section_id', '=', $sec->id)->orderBy('sort', 'ASC')->orderBy('id', 'ASC')->get() as $post) {
             $buttons = [];
             $buttons[] = ["label" => 'Edit', "href" => "/admin/manage-pages/" . $page->id . "/posts/" . $post->id . "/edit"];
             $buttons[] = ["label" => 'Delete', "href" => "/admin/manage-pages/" . $page->id . "/posts/" . $post->id . "/delete"];
             if ($sec->single == 0) {
                 $secViews[] = ViewUtils::box($post->name_formatted, (new PageSummaryPostsForm())->postViews($post->id), null, null, true, $buttons, 'fa-angle-double-right');
             } else {
                 $header = $post->section()->first()->name;
                 //$post->name_formatted." - ".
                 $secViews[] = ViewUtils::plain((new PageSummaryPostsForm())->postViews($post->id));
                 $secButtons[] = ["label" => 'Edit', "href" => "/admin/manage-pages/" . $page->id . "/posts/" . $post->id . "/edit"];
                 //                    $secButtons[] = ["label"=>'Delete', "href"=>"/admin/manage-pages/".$page->id."/posts/".$post->id."/delete"];
                 $icon = 'fa-angle-double-right';
             }
         }
         if ($sec->single == 0) {
             $secButtons[] = ["label" => 'Add Post', "href" => "/admin/manage-pages/" . $page->id . "/section/{$sec->id}/add-post"];
             $secButtons[] = ["label" => 'Sort', "href" => "/admin/manage-pages/" . $page->id . "/section/{$sec->id}/sort"];
             $icon = 'fa-bars';
         } else {
             if (count($secViews) === 0) {
                 $secButtons[] = ["label" => 'Create', "href" => "/admin/manage-pages/" . $page->id . "/section/{$sec->id}/add-post"];
             }
         }
         $views[] = ViewUtils::box($header, $secViews, null, null, false, $secButtons, $icon);
     }
     //        dd($page->posts()->first()->name);
     return ViewUtils::page($views);
 }
 function getCrumbs()
 {
     return ViewUtils::blank();
 }
Esempio n. 6
0
 function get()
 {
     return ViewUtils::page([ViewUtils::box('Sort Pages', [\View::make('punto-cms::sort')->with('actionUrl', '/admin/edit-pages/sort')->with('items', Page::orderBy('sort', 'ASC')->orderBy('id', 'ASC')->get())])]);
 }
Esempio n. 7
0
 function show()
 {
     return ViewUtils::page([(new HeaderItem())->label('Files/Images'), View::make('punto-cms::files')], 'Files/Images');
 }
 function getCrumbs($header, $ps = null)
 {
     return ViewUtils::blank();
 }
Esempio n. 9
0
 function get()
 {
     return ViewUtils::page([ViewUtils::box('Sort Products', [\View::make('punto-cms::sort')->with('actionUrl', '/admin/store-products/sort')->with('items', StoreProduct::orderBy('sort', 'ASC')->orderBy('id', 'ASC')->get())])]);
 }
Esempio n. 10
0
 function get()
 {
     return ViewUtils::page([ViewUtils::box('Sort Subcategories', [\View::make('punto-cms::sort')->with('actionUrl', '/admin/store-categories/' . Request::route('id1') . '/sort')->with('items', StoreSubcategory::where('store_category_id', '=', Request::route('id1'))->orderBy('sort', 'ASC')->orderBy('id', 'ASC')->get())])]);
 }
Esempio n. 11
0
 function get()
 {
     return ViewUtils::page([ViewUtils::box('Sort Posts', [\View::make('punto-cms::sort')->with('actionUrl', '/admin/manage-pages/' . Request::route('id1') . '/section/' . Request::route('id2') . '/sort')->with('items', Post::where('page_id', '=', Request::route('id1'))->where('section_id', '=', Request::route('id2'))->orderBy('sort', 'ASC')->orderBy('id', 'ASC')->get())->with('key', 'name_formatted')])]);
 }