@@ -4,104 +4,104 @@ |
||
| 4 | 4 | |
| 5 | 5 | class Slide |
| 6 | 6 | { |
| 7 | - protected $show; |
|
| 8 | - protected $type; |
|
| 9 | - protected $playOrder; |
|
| 10 | - protected $index; |
|
| 11 | - |
|
| 12 | - public static function fromScheduledShow($show) |
|
| 13 | - { |
|
| 14 | - $slide = new Slide(); |
|
| 15 | - |
|
| 16 | - $slide->type = 'SHOW'; |
|
| 17 | - $slide->show = $show; |
|
| 18 | - |
|
| 19 | - return $slide; |
|
| 20 | - } |
|
| 21 | - |
|
| 22 | - public static function fromEvent($event) |
|
| 23 | - { |
|
| 24 | - $slide = new Slide(); |
|
| 25 | - |
|
| 26 | - $slide->type = 'EVENT'; |
|
| 27 | - $slide->event = $event; |
|
| 28 | - |
|
| 29 | - return $slide; |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - public function playOrder($playOrder) |
|
| 33 | - { |
|
| 34 | - $this->playOrder = $playOrder; |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - public function displayText() |
|
| 38 | - { |
|
| 39 | - if ($this->type == 'EVENT') |
|
| 40 | - { |
|
| 41 | - return; |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - if ($this->playOrder == 0) |
|
| 45 | - { |
|
| 46 | - return '► Now Playing'; |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - if ($this->playOrder == 1) |
|
| 50 | - { |
|
| 51 | - return 'Up Next:'; |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - return $this->show->getRelativeAirDate() . ' ' . $this->show->timespan(); |
|
| 55 | - } |
|
| 56 | - |
|
| 57 | - public function image() |
|
| 58 | - { |
|
| 59 | - if ($this->type == 'EVENT') |
|
| 60 | - { |
|
| 61 | - return $this->event->picture; |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - return $this->show->sliderPicture(); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - public function textStyle() |
|
| 68 | - { |
|
| 69 | - if ($this->type != 'SHOW') |
|
| 70 | - { |
|
| 71 | - return; |
|
| 72 | - } |
|
| 7 | + protected $show; |
|
| 8 | + protected $type; |
|
| 9 | + protected $playOrder; |
|
| 10 | + protected $index; |
|
| 11 | + |
|
| 12 | + public static function fromScheduledShow($show) |
|
| 13 | + { |
|
| 14 | + $slide = new Slide(); |
|
| 15 | + |
|
| 16 | + $slide->type = 'SHOW'; |
|
| 17 | + $slide->show = $show; |
|
| 18 | + |
|
| 19 | + return $slide; |
|
| 20 | + } |
|
| 21 | + |
|
| 22 | + public static function fromEvent($event) |
|
| 23 | + { |
|
| 24 | + $slide = new Slide(); |
|
| 25 | + |
|
| 26 | + $slide->type = 'EVENT'; |
|
| 27 | + $slide->event = $event; |
|
| 28 | + |
|
| 29 | + return $slide; |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + public function playOrder($playOrder) |
|
| 33 | + { |
|
| 34 | + $this->playOrder = $playOrder; |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + public function displayText() |
|
| 38 | + { |
|
| 39 | + if ($this->type == 'EVENT') |
|
| 40 | + { |
|
| 41 | + return; |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + if ($this->playOrder == 0) |
|
| 45 | + { |
|
| 46 | + return '► Now Playing'; |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + if ($this->playOrder == 1) |
|
| 50 | + { |
|
| 51 | + return 'Up Next:'; |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + return $this->show->getRelativeAirDate() . ' ' . $this->show->timespan(); |
|
| 55 | + } |
|
| 56 | + |
|
| 57 | + public function image() |
|
| 58 | + { |
|
| 59 | + if ($this->type == 'EVENT') |
|
| 60 | + { |
|
| 61 | + return $this->event->picture; |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + return $this->show->sliderPicture(); |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + public function textStyle() |
|
| 68 | + { |
|
| 69 | + if ($this->type != 'SHOW') |
|
| 70 | + { |
|
| 71 | + return; |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - return $this->show->sliderStyle(); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - public function url() |
|
| 78 | - { |
|
| 79 | - if ($this->type != 'EVENT') |
|
| 80 | - { |
|
| 81 | - return; |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - return $this->event->url; |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - public function type() |
|
| 88 | - { |
|
| 89 | - return $this->type; |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - public function index($index) |
|
| 93 | - { |
|
| 94 | - $this->index = $index; |
|
| 95 | - } |
|
| 96 | - |
|
| 97 | - public function displayIndex() |
|
| 98 | - { |
|
| 99 | - $display = [ |
|
| 100 | - 0 => 'first', |
|
| 101 | - 1 => 'second', |
|
| 102 | - 2 => 'third', |
|
| 103 | - 3 => 'fourth', |
|
| 104 | - ]; |
|
| 105 | - return $display[$this->index]; |
|
| 106 | - } |
|
| 74 | + return $this->show->sliderStyle(); |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + public function url() |
|
| 78 | + { |
|
| 79 | + if ($this->type != 'EVENT') |
|
| 80 | + { |
|
| 81 | + return; |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + return $this->event->url; |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + public function type() |
|
| 88 | + { |
|
| 89 | + return $this->type; |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + public function index($index) |
|
| 93 | + { |
|
| 94 | + $this->index = $index; |
|
| 95 | + } |
|
| 96 | + |
|
| 97 | + public function displayIndex() |
|
| 98 | + { |
|
| 99 | + $display = [ |
|
| 100 | + 0 => 'first', |
|
| 101 | + 1 => 'second', |
|
| 102 | + 2 => 'third', |
|
| 103 | + 3 => 'fourth', |
|
| 104 | + ]; |
|
| 105 | + return $display[$this->index]; |
|
| 106 | + } |
|
| 107 | 107 | } |
@@ -7,27 +7,27 @@ |
||
| 7 | 7 | class Slides extends Collection |
| 8 | 8 | { |
| 9 | 9 | |
| 10 | - public static function forShows($shows) |
|
| 11 | - { |
|
| 12 | - $slides = new Slides(); |
|
| 10 | + public static function forShows($shows) |
|
| 11 | + { |
|
| 12 | + $slides = new Slides(); |
|
| 13 | 13 | |
| 14 | - foreach ($shows as $key => $show) { |
|
| 15 | - $slide = Slide::fromScheduledShow($show); |
|
| 16 | - $slide->playOrder($key); |
|
| 17 | - $slide->index($key); |
|
| 18 | - $slides->push($slide); |
|
| 19 | - } |
|
| 14 | + foreach ($shows as $key => $show) { |
|
| 15 | + $slide = Slide::fromScheduledShow($show); |
|
| 16 | + $slide->playOrder($key); |
|
| 17 | + $slide->index($key); |
|
| 18 | + $slides->push($slide); |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - return $slides; |
|
| 22 | - } |
|
| 21 | + return $slides; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - public function addEvent($event) |
|
| 25 | - { |
|
| 26 | - $this->pop(); |
|
| 27 | - $this->prepend(Slide::fromEvent($event)); |
|
| 28 | - $index = 0; |
|
| 29 | - foreach ($this as $value) { |
|
| 30 | - $value->index($index++); |
|
| 31 | - } |
|
| 32 | - } |
|
| 24 | + public function addEvent($event) |
|
| 25 | + { |
|
| 26 | + $this->pop(); |
|
| 27 | + $this->prepend(Slide::fromEvent($event)); |
|
| 28 | + $index = 0; |
|
| 29 | + foreach ($this as $value) { |
|
| 30 | + $value->index($index++); |
|
| 31 | + } |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -21,12 +21,12 @@ |
||
| 21 | 21 | public $timestamps = false; |
| 22 | 22 | |
| 23 | 23 | public function setUrlTagAttribute($value) |
| 24 | - { |
|
| 25 | - parse_str( parse_url( $value, PHP_URL_QUERY ), $params ); |
|
| 24 | + { |
|
| 25 | + parse_str( parse_url( $value, PHP_URL_QUERY ), $params ); |
|
| 26 | 26 | if (isset($params['v']) || array_key_exists('v', $params)) { |
| 27 | 27 | $this->attributes['url_tag'] = $params['v']; |
| 28 | 28 | } else { |
| 29 | 29 | $this->attributes['url_tag'] = $value; |
| 30 | 30 | } |
| 31 | - } |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | public function setUrlTagAttribute($value) |
| 24 | 24 | { |
| 25 | - parse_str( parse_url( $value, PHP_URL_QUERY ), $params ); |
|
| 25 | + parse_str(parse_url($value, PHP_URL_QUERY), $params); |
|
| 26 | 26 | if (isset($params['v']) || array_key_exists('v', $params)) { |
| 27 | 27 | $this->attributes['url_tag'] = $params['v']; |
| 28 | 28 | } else { |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class DJsViewComposer { |
| 9 | 9 | |
| 10 | - protected $djs; |
|
| 10 | + protected $djs; |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * Bind data to the view. |
@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | * @return void |
| 17 | 17 | */ |
| 18 | 18 | public function compose(View $view) |
| 19 | - { |
|
| 20 | - if ($this->djs == null) { |
|
| 21 | - $this->djs = DJ::orderBy('name', 'asc')->get(); |
|
| 22 | - } |
|
| 19 | + { |
|
| 20 | + if ($this->djs == null) { |
|
| 21 | + $this->djs = DJ::orderBy('name', 'asc')->get(); |
|
| 22 | + } |
|
| 23 | 23 | $view->with('djs', $this->djs); |
| 24 | 24 | } |
| 25 | 25 | } |
@@ -18,8 +18,8 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function compose(View $view) |
| 20 | 20 | { |
| 21 | - $client = new Client(); |
|
| 22 | - try { |
|
| 21 | + $client = new Client(); |
|
| 22 | + try { |
|
| 23 | 23 | $response = $client->get('http://logger.witr.rit.edu/latest.json', [ |
| 24 | 24 | 'timeout' => 1, |
| 25 | 25 | ]); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * Display a listing of the Shows. |
| 22 | 22 | * |
| 23 | - * @return Response |
|
| 23 | + * @return \Illuminate\View\View |
|
| 24 | 24 | */ |
| 25 | 25 | public function index() |
| 26 | 26 | { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * Display a listing of the resource. |
| 33 | 33 | * |
| 34 | - * @return Response |
|
| 34 | + * @return \Illuminate\View\View |
|
| 35 | 35 | */ |
| 36 | 36 | public function new_show() |
| 37 | 37 | { |
@@ -3,9 +3,6 @@ |
||
| 3 | 3 | use WITR\Http\Requests\Admin\Video as Requests; |
| 4 | 4 | use WITR\Http\Controllers\Controller; |
| 5 | 5 | use WITR\Video; |
| 6 | -use Input; |
|
| 7 | - |
|
| 8 | -use Illuminate\Http\Request; |
|
| 9 | 6 | |
| 10 | 7 | class VideoController extends Controller { |
| 11 | 8 | |
@@ -37,10 +37,10 @@ |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * Save the new eboard position. |
|
| 41 | - * |
|
| 42 | - *@return Response |
|
| 43 | - */ |
|
| 40 | + * Save the new eboard position. |
|
| 41 | + * |
|
| 42 | + *@return Response |
|
| 43 | + */ |
|
| 44 | 44 | public function create(Requests\CreateRequest $request) |
| 45 | 45 | { |
| 46 | 46 | $input = $request->all(); |
@@ -46,8 +46,7 @@ |
||
| 46 | 46 | if ($request->ajax()) |
| 47 | 47 | { |
| 48 | 48 | return response('Unauthorized.', 401); |
| 49 | - } |
|
| 50 | - else |
|
| 49 | + } else |
|
| 51 | 50 | { |
| 52 | 51 | return redirect()->guest('auth/login'); |
| 53 | 52 | } |