public function edit($id, AngkorCMSLangRepository $lang_repository)
 {
     $langs = $lang_repository->allLangsShort();
     $post = $this->post_repository->getPost($id);
     $data = array_merge(compact('post'), compact('langs'));
     return view('angkorcms/news/edit', $data);
 }
 public function edit($id, AngkorCMSLangRepository $lang_repository, AngkorCMSThemeRepository $theme_repository)
 {
     $page = $this->repository->getById($id);
     if (!$page) {
         return Redirect::route('angkorcmspages.index')->with('error', 'The page doesn\'t exist.');
     }
     $themes = $theme_repository->getByTemplate($page->theme->template_id);
     $nb_langs = $lang_repository->count();
     $data = array("page" => $page, "nb_langs" => $nb_langs, "themes" => $themes);
     return view('angkorcms/pages/page/edit', $data);
 }
 public function edit($id, AngkorCMSLangRepository $lang_repository)
 {
     $module = $this->repository->getById($id);
     if (is_null($module)) {
         return Redirect::route('angkorcmsmodules.index')->with('error', 'The module doesn\'t exist.');
     }
     if ($module->unique) {
         App::abort(404);
     }
     $data = array('langs' => $lang_repository->allLangsShort(), 'module' => $module);
     if ($module->nature != null) {
         $config = Config::get('angkorcmsmodules.natures')[$module->nature];
         if (!Config::get($config . '.unique')) {
             $view = Config::get($config . '.makerView');
             $data['view'] = $view;
         }
     }
     return view('angkorcms/pages/module/edit', $data);
 }
 public function create($page_id, AngkorCMSLangRepository $lang_repository, AngkorCMSPageRepository $page_repository)
 {
     $page = $page_repository->getById($page_id);
     $data = array('langs' => $lang_repository->notInShort($this->repository->getListTradLang($page_id)), "page" => $page);
     return view('angkorcms/pages/page_trans/create', $data);
 }