Пример #1
0
 public function __construct(Page $page, array $attrs, $slotname)
 {
     parent::__construct($page, $attrs, $slotname);
     if (isset($this->attrs['target_page_id'])) {
         $this->targetPage = PageFacade::find($this->attrs['target_page_id']);
     }
 }
Пример #2
0
 public function __construct(Request $request)
 {
     $this->request = $request;
     $this->page = $request->route()->getParameter('page');
     $this->authorize('edit', $this->page);
     $this->related = Page::find($this->request->input('related_page_id'));
 }
Пример #3
0
 /**
  * Displays the CMS interface with buttons for add page, settings, etc.
  * Called from an iframe when logged into the CMS.
  * The ID of the page which is being viewed is given as a URL paramater (e.g. /boomscms/editor/toolbar/<page ID>).
  */
 public function getToolbar()
 {
     $page = Page::find($this->request->input('page_id'));
     $toolbarFilename = $this->editor->isEnabled() ? 'toolbar' : 'toolbar_preview';
     View::share(['page' => $page, 'editor' => $this->editor, 'auth' => auth(), 'person' => auth()->user()]);
     return view("boomcms::editor.{$toolbarFilename}");
 }
Пример #4
0
 /**
  * @param Site $site
  * @param Page $page
  *
  * @return Page
  */
 public function postAdd(Page $page)
 {
     $this->authorize('add', $page);
     $parent = $page->getAddPageParent();
     $newPage = $this->dispatch(new CreatePage($parent));
     return PageFacade::find($newPage->getId());
 }
Пример #5
0
 protected function reassignURLs()
 {
     $redirectTo = PageFacade::find($this->options['redirectTo']);
     if ($redirectTo !== null) {
         foreach ($this->page->getUrls() as $url) {
             Bus::dispatch(new ReassignURL($url, $redirectTo));
         }
     }
 }
Пример #6
0
 /**
  * Displays the CMS interface with buttons for add page, settings, etc.
  * Called from an iframe when logged into the CMS.
  * The ID of the page which is being viewed is given as a URL paramater (e.g. /cms/editor/toolbar/<page ID>).
  */
 public function getToolbar()
 {
     $page = Page::find($this->request->input('page_id'));
     $this->editor->setActivePage($page);
     View::share('page', $page);
     View::share('editor', $this->editor);
     $toolbarFilename = $this->editor->isEnabled() ? 'toolbar' : 'toolbar_preview';
     return view("boomcms::editor.{$toolbarFilename}");
 }
Пример #7
0
 /**
  * Displays the CMS interface with buttons for add page, settings, etc.
  * Called from an iframe when logged into the CMS.
  */
 public function getToolbar(EditorObject $editor, Request $request)
 {
     $page = PageFacade::find($request->input('page_id'));
     View::share(['page' => $page, 'editor' => $editor, 'auth' => auth(), 'person' => auth()->user()]);
     if ($editor->isHistory()) {
         return view('boomcms::editor.toolbar.history', ['previous' => $page->getCurrentVersion()->getPrevious(), 'next' => $page->getCurrentVersion()->getNext(), 'version' => $page->getCurrentVersion(), 'diff' => new Diff()]);
     }
     $toolbarFilename = $editor->isEnabled() ? 'edit' : 'preview';
     return view("boomcms::editor.toolbar.{$toolbarFilename}");
 }
Пример #8
0
 public function navigation()
 {
     parent::navigation();
     if ($this->allowAdvanced) {
         $parent = Page::find($this->request->input('parent_id'));
         if ($parent) {
             $this->page->setParent($parent);
         }
     }
     $this->page->setVisibleInNav($this->request->input('visible_in_nav'))->setVisibleInCmsNav($this->request->input('visible_in_nav_cms'));
     Page::save($this->page);
 }
Пример #9
0
 public function __construct($link)
 {
     parent::__construct($link);
     if (is_numeric($link)) {
         $this->page = Page::find($link);
     } else {
         // Extract the query string and fragement
         $this->queryString = parse_url($link, PHP_URL_QUERY);
         $this->urlFragment = parse_url($link, PHP_URL_FRAGMENT);
         $path = URL::getInternalPath($link);
         $this->page = Page::findByUri($path);
     }
 }
Пример #10
0
 public function __construct($link)
 {
     if (is_int($link) || ctype_digit($link)) {
         $this->page = Page::find($link);
     } else {
         $location = $link === '/' ? $link : ltrim($link, '/');
         // Extract the query string and fragement
         $this->queryString = parse_url($link, PHP_URL_QUERY);
         $this->urlFragment = parse_url($link, PHP_URL_FRAGMENT);
         // Only get the path of the URL to ensure that if there's a query string it's ignored.
         $this->page = Page::findByUri(parse_url($location, PHP_URL_PATH));
     }
 }
Пример #11
0
 public function handle()
 {
     DB::transaction(function () {
         foreach ($this->sequences as $sequence => $pageId) {
             $page = PageFacade::find($pageId);
             // Only update the sequence of pages which are children of this page.
             if ($this->parent->isParentOf($page)) {
                 $page->setSequence($sequence);
                 PageFacade::save($page);
             }
         }
     });
 }
Пример #12
0
 public function __construct($page)
 {
     $this->page = $page instanceof Page ? $page : PageFacade::find($page);
 }
Пример #13
0
 public function __construct($parent)
 {
     $this->parent = $parent instanceof Page ? $parent : PageFacade::find($parent);
 }