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)
 {
     $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);
 }