Example #1
0
 public function edit($id, $extra = array())
 {
     $category = \App\Category::find($id);
     $extra['parents'] = array_filter($this->getParents($category));
     $extra['selectedParentId'] = $id;
     return parent::edit($id, $extra);
 }
Example #2
0
 public function edit($id, $extra = array())
 {
     $vara = \App\Product::find($id);
     $flokkar = array_merge([0 => ' - Veldu flokk - '] + \App\Category::lists('title', 'id')->toArray());
     $extra['flokkar'] = $flokkar;
     $extra['selectedFlokkurId'] = $vara->{$vara->parent_key} ?: 0;
     return parent::edit($id, $extra);
 }
Example #3
0
 public function edit($id, $extra = array())
 {
     $news = \App\News::find($id);
     $extra['types'] = array('news' => 'Frétt');
     $extra['images'] = ['' => ' - Veldu mynd - '];
     if ($news->img()->exists()) {
         foreach ($news->img()->all() as $k => $img) {
             $extra['images'][$img['name']] = $img['name'];
         }
     }
     return parent::edit($id, $extra);
 }
Example #4
0
 public function edit($id, $extra = array())
 {
     $vara = \App\Product::find($id);
     $flokkar = \App\Category::lists('title', 'id')->toArray();
     $flokkar[0] = ' - Enginn flokkur - ';
     $extra['flokkar'] = $flokkar;
     $extra['selectedFlokkurId'] = $vara->{$vara->parent_key} ?: 0;
     if (!$extra['selectedFlokkurId']) {
         $extra['selectedFlokkurId'] = \Request::has('parent_id') ? \Request::get('parent_id') : 0;
     }
     return parent::edit($id, $extra);
 }
Example #5
0
 public function edit($id, $extra = array())
 {
     $page = \App\Page::find($id);
     $extra['parents'] = array_filter($this->getParents($page));
     $extra['selectedParentId'] = $id;
     $extra['images'] = [];
     $extra['images'] = ['' => ' - Veldu mynd - '];
     if ($page->img()->exists()) {
         foreach ($page->img()->all() as $k => $img) {
             $extra['images'][$img['name']] = $img['name'];
         }
     }
     return parent::edit($id, $extra);
 }
Example #6
0
 public function edit($id, $extra = array())
 {
     $ret = $this->getCategoryList();
     $vara = \App\Product::find($id);
     /*$flokkar = \App\Category::lists('title', 'id')->toArray();
       $flokkar[0] = ' - Enginn flokkur - ';*/
     /*$extra['flokkar'] = array_filter($this->getParents());
       $extra['flokkar'][0] = ' - Enginn flokkur valinn - ';*/
     $ret[0] = ' - Enginn flokkur - ';
     $extra['flokkar'] = $ret;
     $extra['selectedFlokkurId'] = $vara->{$vara->parent_key} ?: 0;
     if (!$extra['selectedFlokkurId']) {
         $extra['selectedFlokkurId'] = \Request::has('parent_id') ? \Request::get('parent_id') : 0;
     }
     return parent::edit($id, $extra);
 }