public function getVer($id)
 {
     $video = SFVideos::find(strstr($id, '-', true));
     if ($video) {
         $args = array('video' => $video, 'route' => self::$route);
         return View::make('frontend.video.ver')->with($args);
     } else {
         return View::make('specialpages.404');
     }
 }
 public function getIndex()
 {
     $event = Events::where('title', '=', 'EVENTOS')->take(1)->get();
     $courses = isset($event[0]) ? $event[0]->getPublishCourses(3) : null;
     $banner = SFNews::where('sticky', '=', '0')->where('category', '=', '0')->where('status', '=', '1')->where('home', '=', '1')->orderBy('date', 'DESC')->take(3)->get();
     $principal = SFNews::where('sticky', '=', '0')->where('category', '=', '1')->where('status', '=', '1')->where('home', '=', '1')->orderBy('date', 'DESC')->take(1)->get();
     $news = SFNews::where('status', '=', '1')->where('home', '=', '1')->orderBy('date', 'DESC')->take(3)->get();
     $video = SFVideos::where('position', '=', '1')->take(1)->get();
     $video = isset($video[0]) ? $video[0] : null;
     $args = array('news' => $news, 'courses' => $courses, 'principal' => $principal, 'banner' => $banner, 'video' => $video);
     return View::make('frontend.home.index')->with($args);
 }
Exemple #3
0
 public function getDelete($id = '')
 {
     if ($id == '') {
         return Redirect::to($this->route)->with('msg_error', Lang::get('messages.videos_display_err'));
     } else {
         $video = SFVideos::find($id);
         $delete = SFVideos::destroy($id);
         if (!$delete) {
             return Redirect::to($this->route)->with('msg_error', Lang::get('messages.videos_delete_err', array('title' => $video->title)));
         } else {
             return Redirect::to($this->route)->with('msg_success', Lang::get('messages.videos_delete', array('title' => $video->title)));
         }
     }
 }
Exemple #4
0
 public function getVideos($id)
 {
     $args = array('news' => SFNews::find($id), 'videos' => SFVideos::all(), 'route' => $this->route);
     return View::make('backend.news.videos')->with($args);
 }