public function index(AngkorCMSFolderRepository $folder_repository, AngkorCMSImageRepository $image_repository)
 {
     $images = $image_repository->getListByFolder();
     $folders = $folder_repository->getListByFolder();
     $data = array_merge($images, $folders);
     return view('angkorcms/medias/index', $data);
 }
 public function postOpenFolderAjax(AngkorCMSImageRepository $image_repository)
 {
     $folderid = null;
     if (is_numeric(Input::get('folder_id'))) {
         $folderid = Input::get('folder_id');
     }
     $folder = $this->repository->getById($folderid);
     $images = $image_repository->getListByFolder($folderid);
     $folders = $this->repository->getListByFolder($folderid);
     $data = array_merge($images, $folders, $folder);
     return Response::json(array('ok' => 1, 'folder' => $folder, 'html' => view('angkorcms/medias/listMedia')->with($data)->render()));
 }