Esempio n. 1
0
 /**
  * Run the seeder.
  */
 public function run()
 {
     $repository = new EntryRepository();
     $repository->setModel(new UrlLinkTypeModel());
     $repository->truncate();
     $menu = $this->menus->findBySlug('footer');
     $pyrocms = $repository->create(['en' => ['title' => 'PyroCMS.com'], 'url' => 'http://pyrocms.com/']);
     $documentation = $repository->create(['en' => ['title' => 'Documentation'], 'url' => 'http://pyrocms.com/documentation']);
     $this->links->truncate();
     $this->links->create(['menu' => $menu, 'target' => '_blank', 'entry' => $pyrocms, 'type' => 'anomaly.extension.url_link_type']);
     $this->links->create(['menu' => $menu, 'target' => '_blank', 'entry' => $documentation, 'type' => 'anomaly.extension.url_link_type']);
 }
Esempio n. 2
0
 /**
  * Handle the command.
  *
  * @param MenuRepositoryInterface $menus
  * @return MenuInterface|null
  */
 public function handle(MenuRepositoryInterface $menus)
 {
     if (is_numeric($this->identifier)) {
         return $menus->find($this->identifier);
     }
     if (is_string($this->identifier)) {
         return $menus->findBySlug($this->identifier);
     }
     if ($this->identifier instanceof Presenter) {
         return $this->identifier->getObject();
     }
     if (is_object($this->identifier)) {
         return $this->identifier;
     }
     return null;
 }
 /**
  * Return the modal for choosing a menu.
  *
  * @param MenuRepositoryInterface $menus
  * @return \Illuminate\View\View
  */
 public function choose(MenuRepositoryInterface $menus)
 {
     return view('module::ajax/choose_menu', ['menus' => $menus->all()]);
 }
 /**
  * Return the form for editing an existing link.
  *
  * @param LinkFormBuilder          $link
  * @param EntryFormBuilder         $form
  * @param LinkRepositoryInterface  $links
  * @param MenuRepositoryInterface  $menus
  * @param                          $menu
  * @param                          $id
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function edit(LinkFormBuilder $link, EntryFormBuilder $form, LinkRepositoryInterface $links, MenuRepositoryInterface $menus, $menu, $id)
 {
     /* @var LinkInterface $entry */
     $entry = $links->find($id);
     $type = $entry->getType();
     $form->addForm('type', $type->builder()->setEntry($entry->getEntry()->getId()));
     $form->addForm('link', $link->setEntry($id)->setType($entry->getType())->setMenu($menu = $menus->findBySlug($menu)));
     $this->breadcrumbs->add($menu->getName(), 'admin/navigation/links/' . $menu->getSlug());
     return $form->render();
 }
Esempio n. 5
0
 /**
  * Run the seeder.
  */
 public function run()
 {
     $this->menus->truncate()->create(['en' => ['name' => 'Footer', 'description' => 'This is the footer.'], 'slug' => 'footer']);
 }