Skip to content

Commit

Permalink
small fix in video controller
Browse files Browse the repository at this point in the history
  • Loading branch information
stojankukrika committed Feb 12, 2015
1 parent df3e2e8 commit 7db0ab7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Http/Controllers/Admin/VideoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function index()
}

/**
* Show a list of all the photo posts.
* Show a list of all the video posts.
*
* @return View
*/
Expand Down Expand Up @@ -105,7 +105,7 @@ public function getEdit($id)
$languages = Language::all();
$language = $video->language_id;
$videoalbums = VideoAlbum::all();
$videoalbum = $video->photo_album_id;
$videoalbum = $video->video_album_id;

return view('admin.video.create_edit',compact('video','languages','language','videoalbums','videoalbum'));
}
Expand Down Expand Up @@ -145,7 +145,7 @@ public function postEdit(VideoRequest $request, $id)

if(Input::hasFile('video'))
{
$videoalbum = VideoAlbum::find($request->photo_album_id);
$videoalbum = VideoAlbum::find($request->video_album_id);
$destinationPath = public_path() . '/images/videoalbum/'.$videoalbum->folderid.'/';
Input::file('video')->move($destinationPath, $video_file);
}
Expand Down Expand Up @@ -207,14 +207,14 @@ public function getAlbumCover($id,$album=0)
*/
public function data($albumid=0) {
$condition =(intval($albumid)==0)?">":"=";
$photoalbum = Video::join('language', 'language.id', '=', 'video.language_id')
$videoalbum = Video::join('language', 'language.id', '=', 'video.language_id')
->join('video_album', 'video_album.id', '=', 'video.video_album_id')
->where('video.video_album_id',$condition,$albumid)
->orderBy('video.position')
->select(array('video.id',DB::raw($albumid . ' as albumid'), 'video.name','video_album.name as category',
'video.album_cover','language.name as language', 'video.created_at'));

return Datatables::of($photoalbum)
return Datatables::of($videoalbum)
-> edit_column('album_cover', '<a href="{{{ URL::to(\'admin/video/\' . $id . \'/\' . $albumid . \'/albumcover\' ) }}}" class="btn btn-warning btn-sm" >@if ($album_cover=="1") <span class="glyphicon glyphicon-ok"></span> @else <span class=\'glyphicon glyphicon-remove\'></span> @endif</a>')
-> add_column('actions', '<a href="{{{ URL::to(\'admin/video/\' . $id . \'/edit\' ) }}}" class="btn btn-success btn-sm iframe" ><span class="glyphicon glyphicon-pencil"></span> {{ Lang::get("admin/modal.edit") }}</a>
<a href="{{{ URL::to(\'admin/video/\' . $id . \'/delete\' ) }}}" class="btn btn-sm btn-danger iframe"><span class="glyphicon glyphicon-trash"></span> {{ Lang::get("admin/modal.delete") }}</a>
Expand Down

0 comments on commit 7db0ab7

Please sign in to comment.