public function __construct(array $nested_params, array $external_params) { parent::__construct($nested_params, $external_params); $this->document = new RESTApiVideoGenreDocument(); if (!empty($this->nested_params['video.category'])) { $category = new \VideoCategory(); $category_ids = explode(',', $this->nested_params['video.category']); foreach ($category_ids as $category_id) { $this->categories[] = $category->getById($category_id, true); } if (empty($this->categories)) { throw new RESTNotFound("Category not found"); } } }
public function displayList() { $id_lang = $this->context->language->id; $id_shop = $this->context->shop->id; $limit_per_page = intval($this->conf['list_limit_page']); $current_page = isset($_GET['p']) && is_numeric($_GET['p']) ? intval($_GET['p']) : 1; $start = ($current_page - 1) * $limit_per_page; $list = VideoCategory::getCategories(); $listCategories = array(); if (isset($list) && is_array($list) && count($list)) { /** pagination * */ // $nb_pages = ceil($nb_articles / $limit_per_page); // $next = $current_page > 1 ? true : false; //articles plus recents // $back = $current_page >= 1 && ($current_page < $nb_pages) ? true : false; //articles precedents $i = 0; foreach ($list as $cat) { $videos = Videos::getVideoByCategory($cat['id_video_cat']); $list_video = array(); foreach ($videos as $key => $val) { $video = $val; $video['average'] = VideosRatting::getAverage($val['id_video']); $list_video[] = $video; } $cat['videos'] = $list_video; $listCategories[] = $cat; } // echo '<pre>'; // print_r($listCategories); // echo '</pre>'; $this->context->smarty->assign(array('list_categories' => $listCategories, 'img_video_dir' => _THEME_VIDEO_DIR_, 'customer' => $this->context->customer->id)); } $this->setTemplate('list.tpl'); }
private function loadCategory($id, $slug) { $model = VideoCategory::model()->findByAttributes(array('term_id' => (int) $id, 'slug' => $slug)); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function index() { if (\Input::get('theme')) { \Cookie::queue('theme', \Input::get('theme'), 100); return Redirect::to('/')->withCookie(cookie('theme', \Input::get('theme'), 100)); } $data = array('videos' => Video::where('active', '=', '1')->orderBy('created_at', 'DESC')->simplePaginate($this->videos_per_page), 'current_page' => 1, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/videos', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); //dd($data['videos']); return View::make('Theme::home', $data); }
public function index() { $search_value = Input::get('value'); if (empty($search_value)) { return Redirect::to('/'); } $videos = Video::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get(); $posts = Post::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get(); $data = array('videos' => $videos, 'posts' => $posts, 'search_value' => $search_value, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); return View::make('Theme::search-list', $data); }
public function category($category) { $page = Input::get('page'); if (!empty($page)) { $page = Input::get('page'); } else { $page = 1; } $cat = PostCategory::where('slug', '=', $category)->first(); $data = array('posts' => Post::where('active', '=', '1')->where('post_category_id', '=', $cat->id)->orderBy('created_at', 'DESC')->simplePaginate($this->posts_per_page), 'current_page' => $page, 'category' => $cat, 'page_title' => 'Posts - ' . $cat->name, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/posts/category/' . $category, 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); return View::make('Theme::post-list', $data); }
public function show_favorites() { if (!Auth::guest()) { $page = Input::get('page'); if (empty($page)) { $page = 1; } $favorites = Favorite::where('user_id', '=', Auth::user()->id)->orderBy('created_at', 'desc')->get(); $favorite_array = array(); foreach ($favorites as $key => $fave) { array_push($favorite_array, $fave->video_id); } $videos = Video::where('active', '=', '1')->whereIn('id', $favorite_array)->paginate(12); $data = array('videos' => $videos, 'page_title' => ucfirst(Auth::user()->username) . '\'s Favorite Videos', 'current_page' => $page, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/favorites', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); return View::make('Theme::video-list', $data); } else { return Redirect::to('videos'); } }
public function order() { $category_order = json_decode(Input::get('order')); $video_categories = VideoCategory::all(); $order = 1; foreach ($category_order as $category_level_1) { $level1 = VideoCategory::find($category_level_1->id); if ($level1->id) { $level1->order = $order; $level1->parent_id = NULL; $level1->save(); $order += 1; } if (isset($category_level_1->children)) { $children_level_1 = $category_level_1->children; foreach ($children_level_1 as $category_level_2) { $level2 = VideoCategory::find($category_level_2->id); if ($level2->id) { $level2->order = $order; $level2->parent_id = $level1->id; $level2->save(); $order += 1; } if (isset($category_level_2->children)) { $children_level_2 = $category_level_2->children; foreach ($children_level_2 as $category_level_3) { $level3 = VideoCategory::find($category_level_3->id); if ($level3->id) { $level3->order = $order; $level3->parent_id = $level2->id; $level3->save(); $order += 1; } } } } } } return 1; }
public function renderForm() { $this->toolbar_btn['save-and-stay'] = array('href' => '#', 'desc' => $this->l('Save and stay')); $defaultLanguage = $this->default_form_language; $this->initToolbar(); if (!$this->loadObject(true)) { return; } $this->fields_form = array('tinymce' => true, 'legend' => array('title' => $this->l('Video'), 'image' => '../img/admin/tab-categories.gif'), 'input' => array(array('type' => 'text', 'label' => $this->l('Title:'), 'name' => 'title', 'required' => true, 'lang' => true, 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'textarea', 'label' => $this->l('Description :'), 'name' => 'description', 'autoload_rte' => true, 'rows' => 10, 'cols' => 100, 'lang' => true, 'desc' => $this->l('Will be displayed in top of category page')), array('type' => 'text', 'label' => $this->l('Video ID:'), 'name' => 'youtube_id', 'required' => true, 'class' => 'copy2friendlyUrl', 'hint' => $this->l('This is the id of youtube video')), array('type' => 'file', 'label' => $this->l('Image Cover:'), 'name' => 'image', 'required' => true, 'display_image' => true)), 'submit' => array('title' => $this->l('Save'), 'class' => 'button')); $this->fields_form['input'][] = array('type' => 'text', 'label' => $this->l('Position :'), 'size' => 3, 'name' => 'position'); $categories = VideoCategory::listCategories($defaultLanguage); $this->fields_form['input'][] = array('type' => 'select', 'label' => $this->l('Category'), 'desc' => $this->l('Choose a category'), 'name' => 'id_video_cat', 'required' => true, 'options' => array('query' => $categories, 'id' => 'id_option', 'name' => 'name')); $this->fields_form['input'][] = array('type' => 'radio', 'label' => $this->l('Status :'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')))); if (!($video = $this->loadObject(true))) { return; } // $image = ImageManager::thumbnail(_PS_MYVIDEO_IMG_DIR_.'/'.$video->id.'.jpg', $this->table.'_'.(int)$video->id.'.'.$this->imageType, 350, $this->imageType, true); // $this->fields_value = array( // 'image' => $image ? $image : false, // 'size' => $image ? filesize(_PS_MYVIDEO_IMG_DIR_.'/'.$video->id.'.jpg') / 1000 : false // ); return parent::renderForm(); }
public function get(RESTApiRequest $request) { $categories = new \VideoCategory(); $categories->setLocale($request->getLanguage()); return $this->filter($categories->getAll(true)); }
<?php echo $form->textFieldRow($model, 'name', array('class' => 'span12')); ?> <p class='muted'>Nama Yang akan tampil</p><hr> <?php echo $form->textFieldRow($model, 'slug', array('class' => 'span12')); ?> <p class=' muted'>'slug' adalah versi URL dari nama. Dalam hal ini berupa huruf kecil semua dan hanya mengandung huruf, angka, dan tanda (-). <br>(Jika Kosong maka akan di isi otomatis.)</p><hr> <?php echo $form->dropDownListRow($model, 'parent', VideoCategory::makeDropDown(), array('empty' => '-- none --')); ?> <p class='muted'> Kategori dapat memiliki hirarki. Contoh anda memiliki kategori Musik, dan kategori tersebut memiliki anak kategori yaitu Rock dan Metal.<br> (Kosongkan jika tidak mempunyai hirarki) </p><hr> <?php echo $form->textAreaRow($model, 'description', array('class' => 'span12', 'rows' => '3')); ?> <hr>
public function listVideoCategory() { return CHtml::listData(VideoCategory::model()->findAll(array('order' => 'name ASC')), 'term_id', 'name'); }
public function password_reset_token($token) { $data = array('type' => 'reset_password', 'token' => $token, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'payment_settings' => PaymentSetting::first(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); return View::make('Theme::auth', $data); }
public function pages() { $data = array('pages' => Page::orderBy('created_at', 'DESC')->get(), 'page_title' => 'Pages', 'page_description' => 'All Pages', 'menu' => Menu::orderBy('order', 'ASC')->get(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); return View::make('Theme::page-list', $data); }
function generate_menu($menu) { $previous_item = array(); $first_parent_id = 0; $depth = 0; $output = ''; foreach ($menu as $menu_item) { $hasChildren = $menu_item->hasChildren(); if (isset($previous_item->id) && $menu_item->parent_id == $previous_item->parent_id || $menu_item->parent_id == NULL) { $output .= '</li>'; } if (isset($previous_item->parent_id) && $previous_item->parent_id !== $menu_item->parent_id && $previous_item->id != $menu_item->parent_id) { if ($depth == 2) { $output .= '</li></ul>'; $depth -= 1; } if ($depth == 1 && $menu_item->parent_id == $first_parent_id) { $output .= '</li></ul>'; $depth -= 1; } } if ($menu_item->type == 'videos') { $active = ''; if (Request::is('videos')) { $active = ' active'; } $output .= '<li class="dropdown' . $active . '">'; $output .= '<a href="/videos" class="dropdown-toggle">' . $menu_item->name . ' <span class="caret"></span></a>'; $output .= '<ul class="dropdown-menu multi-level" role="menu">'; $output .= generate_video_post_menu(VideoCategory::orderBy('order', 'ASC')->get(), '/videos/category/'); $output .= '</li></ul>'; $output .= '</li>'; continue; } if ($menu_item->type == 'posts') { $active = ''; if (Request::is('posts')) { $active = ' active'; } $output .= '<li class="dropdown' . $active . '">'; $output .= '<a href="/posts" class="dropdown-toggle">' . $menu_item->name . ' <span class="caret"></span></a>'; $output .= '<ul class="dropdown-menu multi-level" role="menu">'; $output .= generate_video_post_menu(PostCategory::orderBy('order', 'ASC')->get(), '/posts/category/'); $output .= '</li></ul>'; $output .= '</li>'; continue; } $li_class = ''; $caret = ''; $dropdown_toggle = ''; if ($hasChildren) { $dropdown_toggle = ' class="dropdown-toggle"'; } if ($hasChildren && $depth == 0) { if (Request::is(str_replace('/', '', $menu_item->url))) { $li_class .= ' class="active dropdown"'; } else { $li_class .= ' class="dropdown"'; } $caret = ' <span class="caret"></span>'; } elseif ($hasChildren && $depth > 0) { $li_class .= ' class="dropdown-submenu"'; } if (!$hasChildren && $depth == 0 && Request::is(str_replace('/', '', $menu_item->url)) || $menu_item->url == '/' && Request::is('/')) { $li_class .= ' class="active"'; } $output .= '<li' . $li_class . '>'; $output .= '<a href="' . $menu_item->url . '"' . $dropdown_toggle . '>' . $menu_item->name . $caret . '</a>'; if ($hasChildren) { $output .= '<ul class="dropdown-menu multi-level" role="menu">'; $depth += 1; } $previous_item = $menu_item; } $output .= '</li></ul>'; return $output; }
<?php include_once $CFG->dirroot . "/lib/classes/" . "application/VideoCategory.Class.php5"; $videocategoryObj = new VideoCategory(); $GeneralObj->getRequestVars(); $section = 'Video Category'; $mode = $_REQUEST['mode']; if ($mode == "Update") { $videocategoryObj->select($iVideoCategoryId); $videocategoryObj->getAllVar(); } else { $mode = "Add"; } if ($file != '') { $link = "index.php?file=" . $file . "&mode=" . $mode . "&listfile=" . $listfile; } $TOP_HEADER = $mode . ' ' . $section; if ($mode == 'Update') { $TOP_HEADER .= ' [' . $vCategoryName . ']'; } ?> <form name="frmadd" method="post" enctype="multipart/form-data" action="index.php?file=m-videocategoryadd_a"> <input type="hidden" id="mode" name="mode" value="<?php echo $mode; ?> "> <input type="hidden" id="SAMPM" name="SAMPM" value="<?php echo $SAMPM; ?> "> <input type="hidden" id="EAMPM" name="EAMPM" value="<?php
array(XmlEmitter::ATR.'title'=>'Group' , XmlEmitter::ATR.'description'=>'Select a Group' , XmlEmitter::ATR.'sd_img'=>"$WebServer/$MythRokuDir/images/tab-detach.png" , XmlEmitter::ATR.'hd_img'=>"$WebServer/$MythRokuDir/images/tab-detach.png" , 'categoryLeaf'=>array() ) ); $menu = array(); $results = array(); $rec_cat = Recorded::find_by_sql( "select distinct playgroup from recorded where basename like '%.mp4'" ); foreach ( $rec_cat as $value ) { $results[] = ucwords(str_replace('-', ' ', $value->playgroup)); } $vid_genre = VideoCategory::find_by_sql( 'select distinct vc.category from videocategory vc join videometadata v on v.category = vc.intid' ); foreach ( $vid_genre as $value ) { $results[] = ucwords(str_replace('-', ' ', $value->category)); } asort($results); $results = array_unique($results); foreach ( $results as $value ) { $parms = array('Group'=>rawurlencode($value)); $menu[] = new categoryLeaf( array(XmlEmitter::ATR.'title'=>$value , XmlEmitter::ATR.'feed'=>"$WebServer/$MythRokuDir/mythtv_group_xml.php?".http_build_query($parms)) ); } $group->categoryLeaf = $menu;
public function renew($username) { $user = User::where('username', '=', $username)->first(); $payment_settings = PaymentSetting::first(); if ($payment_settings->live_mode) { User::setStripeKey($payment_settings->live_secret_key); } else { User::setStripeKey($payment_settings->test_secret_key); } if (Auth::user()->username == $username) { $data = array('user' => $user, 'post_route' => URL::to('user') . '/' . $user->username . '/update', 'type' => 'renew_subscription', 'menu' => Menu::orderBy('order', 'ASC')->get(), 'payment_settings' => $payment_settings, 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); return View::make('Theme::user', $data); } else { return Redirect::to('/'); } }
<p> You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b> <></b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done. </p> <?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get')); echo $form->textFieldRow($model, 'post_name', array('class' => 'span5', 'maxlength' => 255)); echo $form->dropDownListRow($model, 'authorSearch', $this->listUser('author'), array('class' => 'span3', 'prompt' => '')); echo $form->dropDownListRow($model, 'editorSearch', $this->listUser('editor'), array('class' => 'span3', 'prompt' => '')); echo $form->dropDownListRow($model, 'categorySearch', Category::makeDropDown(), array('class' => 'span3', 'prompt' => '')); echo $form->dropDownListRow($model, 'videocategorySearch', VideoCategory::makeDropDown(), array('class' => 'span3', 'prompt' => '')); ?> <?php echo $form->dropDownListRow($model, 'tagSearch', Tag::makeList(), array('class' => 'span3', 'prompt' => '')); echo $form->dropDownListRow($model, 'post_status', $this->listAllStatus(), array('class' => 'span3', 'prompt' => '')); ?> <?php /*echo $form->datepickerRow($model,'post_date', array('options'=>array('format' => 'yyyy-mm-dd','viewformat' => 'yyyy-mm-dd')), array('prepend' => '<i class="icon-calendar"></i>',)); */ echo $form->datepickerRow($model, 'post_modified', array('options' => array('format' => 'yyyy-mm-dd', 'viewformat' => 'yyyy-mm-dd')), array('prepend' => '<i class="icon-calendar"></i>')); ?> <?php echo $form->textFieldRow($model, 'post_hits', array('class' => 'span2')); ?>
public function __construct($show){ $WebServer = $GLOBALS['WebServer']; $MythRokuDir = $GLOBALS['MythRokuDir']; $RokuDisplayType = $GLOBALS['RokuDisplayType']; $BitRate = $GLOBALS['BitRate']; $this->media = new media( array( 'streamFormat'=>new streamFormat(array('content'=>'mp4')) , 'streamQuality'=>new streamQuality(array('content'=>$RokuDisplayType)) , 'streamBitrate'=>new streamBitrate(array('content'=>$BitRate)) , 'streamUrl'=>new streamUrl() ) ); if(1==0){ //dummy to make editing easier - RSH }elseif(is_a($show,'Weather')){ //handles Weather current conditions, forecast items, and alerts schemae $ShowLength = $show->Delay; $title = "$show->Location"; $title .= empty($show->Temperature) ? "" : ", $show->Temperature"; $title .= empty($show->Description) ? "" : ", $show->Description"; $subtitle = empty($show->Message) ? $show->Conditions : $show->Message; $subtitle .= empty($show->WindDirection) ? "" : ", $show->WindDirection"; $subtitle .= empty($show->WindSpeed) ? "" : "@$show->WindSpeed"; $subtitle .= empty($show->WindGust) ? "" : ", G$show->WindGust"; $subtitle .= empty($show->Humidity) ? "" : ", hum $show->Humidity"; $subtitle .= empty($show->Clouds) ? "" : ", vis $show->Clouds mi."; $genre = empty($show->Until) ? $show->Temperature : $show->Until; $synopsis = "$subtitle $show->Source"; $this->title = new title(array('content'=>$title)); $this->contentQuality = new contentQuality(array('content'=>$RokuDisplayType)); $this->subtitle = new subtitle(array('content'=>$subtitle)); $this->addToAttributes('sdImg', "$show->Icon"); $this->addToAttributes('hdImg', "$show->Icon"); $this->contentId = new contentId(array('content'=>$show->Location)); //$this->contentType = new contentType(array('content'=>'TV')); //$this->media->streamUrl->setContent("$streamUrl "); //yes the space is required $this->synopsis = new synopsis(array('content'=>$synopsis)); $this->genres = new genres(array('content'=>$genre)); $this->runtime = new runtime(array('content'=>$ShowLength)); $this->date = new date(array('content'=>$show->AsOf)); $this->tvormov = new tvormov(array('content'=>'weather')); }elseif(is_a($show,'Program')){ /// MythTV Program schema $ShowLength = convert_datetime($show->EndTime) - convert_datetime($show->StartTime); if($show->isScheduled){ $imgUrl = "$WebServer/$MythRokuDir/images/oval_green.png"; } elseif($show->isRecording){ $imgUrl = "$WebServer/$MythRokuDir/images/oval_blue.png"; $show->Category = 'NOW RECORDING!'; } elseif($show->hasJob) { $imgUrl = "$WebServer/$MythRokuDir/images/oval_orange.png"; $show->Category = 'NOW PROCESSING A JOB!'; } elseif($show->isConflict) { $imgUrl = "$WebServer/$MythRokuDir/images/oval_red.png"; $show->Category = 'SCHEDULE CONFLICT!'; } else { $imgUrl = "$WebServer/$MythRokuDir/images/oval_grey.png"; } $this->title = new title(array('content'=>normalizeHtml($show->Title))); $this->contentQuality = new contentQuality(array('content'=>$RokuDisplayType)); $this->subtitle = new subtitle(array('content'=>normalizeHtml($show->SubTitle))); $this->addToAttributes('sdImg', $imgUrl); $this->addToAttributes('hdImg', $imgUrl); $this->contentId = new contentId(array('content'=>$show->ProgramId)); //$this->contentType = new contentType(array('content'=>'TV')); //$this->media->streamUrl->setContent("$streamUrl "); //yes the space is required $this->synopsis = new synopsis(array('content'=>normalizeHtml($show->Description))); $this->genres = new genres(array('content'=>normalizeHtml($show->Category))); $this->runtime = new runtime(array('content'=>$ShowLength)); if(!is_a($show, 'ProgramTpl)')) $this->date = new date(array('content'=>date("F j, Y, g:i a", convert_datetime($show->StartTime)))); else $this->date = new date(array('content'=>$show->StartTime)); $this->tvormov = new tvormov(array('content'=>'upcoming')); }elseif(is_a($show,'Guide')){ //handles Pilots/Premieres schema $ShowLength = convert_datetime($show->endtime) - convert_datetime($show->starttime); $ImgType = ($show->subtitle == 'Pilot' ? "rectangle" : "oval"); if($show->recstatus == -1){ $imgUrl = "$WebServer/$MythRokuDir/images/". $ImgType . "_blue.png"; $show->category .= ' (WILL RECORD)'; } elseif($show->recstatus == 10 || $show->recstatus == 7){ //inactive or conflict $imgUrl = "$WebServer/$MythRokuDir/images/". $ImgType . "_purple.png"; $show->category .= ' (' . $show->getStatusName( $show->recstatus ) . ')'; } elseif($show->last && $show->first){ $imgUrl = "$WebServer/$MythRokuDir/images/". $ImgType . "_red.png"; if(!empty($show->recstatus) && $show->recstatus != 10 && $show->recstatus != 7) { $imgUrl = "$WebServer/$MythRokuDir/images/". $ImgType . "_grey.png"; $show->category .= ' (' . $show->getStatusName( $show->recstatus ) . ')'; } else { $show->category .= ' (ONLY CHANCE)'; } } elseif($show->last) { $imgUrl = "$WebServer/$MythRokuDir/images/". $ImgType . "_orange.png"; if(!empty($show->recstatus) && $show->recstatus != 10 && $show->recstatus != 7) { $imgUrl = "$WebServer/$MythRokuDir/images/". $ImgType . "_grey.png"; $show->category .= ' (' . $show->getStatusName( $show->recstatus ) . ')'; } else { $show->category .= ' (LAST CHANCE)'; } } else { if(!empty($show->recstatus)) { $imgUrl = "$WebServer/$MythRokuDir/images/". $ImgType . "_grey.png"; $show->category .= ' (' . $show->getStatusName( $show->recstatus ) . ')'; } else { $imgUrl = "$WebServer/$MythRokuDir/images/". $ImgType . "_green.png"; } } $this->title = new title(array('content'=>normalizeHtml($show->station.' '.$show->title))); $this->contentQuality = new contentQuality(array('content'=>$RokuDisplayType)); $this->subtitle = new subtitle(array('content'=>normalizeHtml($show->subtitle))); $this->addToAttributes('sdImg', $imgUrl); $this->addToAttributes('hdImg', $imgUrl); $this->contentId = new contentId(array('content'=>$show->programid)); //$this->contentType = new contentType(array('content'=>'TV')); //$this->media->streamUrl->setContent("$streamUrl "); //yes the space is required $this->synopsis = new synopsis(array('content'=>normalizeHtml($show->description))); $this->genres = new genres(array('content'=>normalizeHtml($show->category))); $this->runtime = new runtime(array('content'=>$ShowLength)); $this->date = new date(array('content'=>date("F j, Y, g:i a", convert_datetime($show->starttime)))); $this->tvormov = new tvormov(array('content'=>'new')); }elseif(is_a($show,'Recorded')){ /// TV from Recorded table $ShowLength = convert_datetime($show->endtime) - convert_datetime($show->starttime); $streamfile = $show->storagegroups->dirname . $show->basename; $parms = array('image'=>$streamfile); $streamUrl = "$WebServer/$MythRokuDir/imageSvc.php?" .http_build_query($parms); $parms = array('preview'=>str_pad($show->chanid, 6, "_", STR_PAD_LEFT).rawurlencode($show->starttime)); $imgUrl = "$WebServer/$MythRokuDir/imageSvc.php?" .http_build_query($parms); $this->title = new title(array('content'=>normalizeHtml($show->title))); $this->contentQuality = new contentQuality(array('content'=>$RokuDisplayType)); $this->subtitle = new subtitle(array('content'=>normalizeHtml($show->subtitle))); $this->addToAttributes('sdImg', $imgUrl); $this->addToAttributes('hdImg', $imgUrl); $this->contentId = new contentId(array('content'=>$show->basename)); $this->contentType = new contentType(array('content'=>'TV')); $this->media->streamUrl->setContent("$streamUrl "); //yes the space is required $this->synopsis = new synopsis(array('content'=>normalizeHtml($show->description))); $this->genres = new genres(array('content'=>normalizeHtml($show->category.' ('.$show->programid.' '.$show->airdate.')'))); $this->runtime = new runtime(array('content'=>$ShowLength)); $this->date = new date(array('content'=>date("F j, Y, g:i a", convert_datetime($show->starttime)))); $this->programid = new programid(array('content'=>$show->programid)); $this->airdate = new airdate(array('content'=>$show->airdate)); $this->tvormov = new tvormov(array('content'=>'tv')); $this->delcommand = new delcommand(array('content'=>"$WebServer/mythroku/mythtv_tv_del.php?basename=$show->basename")); }elseif(is_a($show,'VideoMetadata')){ /// Video from VideoMetadata table $videos = StorageGroup::first( array('conditions' => array('groupname = ?', 'Videos')) ); $streamfile = $videos->dirname . $show->filename; $parms = array('image'=>$streamfile); $streamUrl = "$WebServer/$MythRokuDir/imageSvc.php?" .http_build_query($parms); // http://www.mythtv.org/wiki/Video_Library#Metadata_Grabber_Troubleshooting // http://www.mythtv.org/wiki/MythVideo_File_Parsing#Filenames // if(!empty($show->screenshot)){ $screenart = StorageGroup::first( array('conditions' => array('groupname = ?', 'Screenshots')) ); $imgfile = !empty($screenart) && !empty($show->screenshot) ? $screenart->dirname . $show->screenshot : "images/oval_grey.png"; // }elseif(!empty($show->fanart)){ // $fanart = StorageGroup::first( array('conditions' => array('groupname = ?', 'Fanart')) ); // $imgfile = $fanart->dirname . $show->fanart; // }else{ // $coverart = StorageGroup::first( array('conditions' => array('groupname = ?', 'Coverart')) ); // $imgfile = $coverart->dirname . $show->coverfile; // } //TODO coverart and fanart are 5-10X sizeof screenshots. videometadata doesn't contain screenshots for movies. create screenshots and update db $parms = array('image'=>$imgfile); $imgUrl = "$WebServer/$MythRokuDir/imageSvc.php?" .http_build_query($parms); //TODO lookup genres for item::genres. can be an array? $category = VideoCategory::first( array('conditions' => array('intid = ?', $show->category)) ); $this->title = new title(array('content'=>normalizeHtml($show->title))); $this->contentQuality = new contentQuality(array('content'=>$RokuDisplayType)); $this->subtitle = new subtitle(array('content'=>normalizeHtml($show->subtitle))); $this->addToAttributes('sdImg', $imgUrl); $this->addToAttributes('hdImg', $imgUrl); $this->contentId = new contentId(array('content'=>$show->filename)); $this->contentType = new contentType(array('content'=>'Movie')); $this->media->streamUrl->setContent("$streamUrl "); //yes the space is required $this->synopsis = new synopsis(array('content'=>normalizeHtml($show->plot))); $season = '(S'.$show->season.'E'.$show->episode.' '.(new DateTime($show->starttime))->format('Y-m-d').')'; $this->genres = new genres(array('content'=>normalizeHtml(empty($category->category) ? '':$category->category).' '.$season)); $this->runtime = new runtime(array('content'=>$show->length * 60)); $this->date = new date(array('content'=>date("Y-m-d", convert_datetime($show->starttime)))); $this->programid = new programid( array('content'=> sprintf("%02d", $show->season) .'.' .sprintf("%03d",$show->episode) ) ); $this->tvormov = new tvormov(array('content'=>'movie')); $this->starrating = new starrating(array('content'=>$show->userrating * 10)); }else{ parent::__construct($show); } }
/** * Show the form for editing the specified video. * * @param int $id * @return Response */ public function edit($id) { $video = Video::find($id); $data = array('headline' => '<i class="fa fa-edit"></i> Edit Video', 'video' => $video, 'post_route' => URL::to('admin/videos/update'), 'button_text' => 'Update Video', 'admin_user' => Auth::user(), 'video_categories' => VideoCategory::all()); return View::make('admin.videos.create_edit', $data); }
<?php return array(array('header' => '#', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)', 'htmlOptions' => array('style' => 'width:30px;')), array('name' => 'name', 'type' => 'raw', 'value' => '$data->parent != 0 ? $data->selfParent->name ." <i class=\'fa fa-angle-double-right\'></i> ". $data->name."<br><small class=muted>Slug : ".$data->slug." | ".count($data->postAll)." Posts</small>": $data->name."<br><small class=muted>Slug : ".$data->slug." | ".count($data->postAll)." Posts</small>"'), array('name' => 'parent', 'type' => 'raw', 'filter' => VideoCategory::makeDropDown(), 'value' => '$data->parent != 0 ? "<span class=muted>".$data->selfParent->name."</span>" : "<span class=\'muted\'>---</span>"'));
$ad->delById($id); header("Location: vclub_ad.php"); exit; } } } if (!empty($_GET['edit']) && !empty($id)) { $current_ad = $ad->getById($id); } $ads = $ad->getAllWithStatForMonth(); if (!empty($_GET['id'])) { $denied_categories = $ad->getDeniedVclubCategoriesForAd((int) $_GET['id']); } else { $denied_categories = array(); } $video_category = new VideoCategory(); $video_categories = $video_category->getAll(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> body { font-family: Arial, Helvetica, sans-serif; font-weight: bold; } td { font-family: Arial, Helvetica, sans-serif; font-size: 14px; text-decoration: none;
<?php $this->breadcumbs(); ?> <h3>Lihat : <?php echo $model->post_name; ?> </h3> <?php $this->alert(); $webUrl = Yii::app()->FrontUrl->createUrl('/video/index/', array('id' => $model->ID, 'slug' => $model->post_link)); $mobileUrl = Yii::app()->FrontMobileUrl->createUrl('/video/index/', array('id' => $model->ID, 'slug' => $model->post_link)); $link = "Web Url : " . $webUrl . " - " . CHtml::Link('Go to Link', $webUrl) . "<br>"; $link .= frontendMobileUrl == '' ? "" : "Mobile url : " . $mobileUrl . " - " . CHtml::Link('Go to Link', $mobileUrl); $this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('ID', 'post_name', 'post_title', 'post_image', array('name' => 'post_link', 'type' => 'raw', 'value' => $link), array('name' => 'post_excerpt', 'type' => 'raw'), array('name' => 'post_content', 'type' => 'raw'), 'post_source', 'post_source_link', array('name' => 'post_status', 'type' => 'raw', 'value' => array($this, 'Status')), array('label' => 'Author', 'name' => 'authors.username'), array('label' => 'Editor', 'name' => 'editors.username'), array('name' => 'tags.name', 'type' => 'raw', 'value' => Tag::makeValue($model)), array('label' => 'Category', 'type' => 'raw', 'value' => Category::makeValue($model)), array('label' => 'Category Video', 'type' => 'raw', 'value' => VideoCategory::makeValue($model)), 'post_created', 'post_modified', 'post_meta_key', 'post_meta_desc')));
public function edit_video_ads() { if ($no_auth = $this->checkAuth()) { return $no_auth; } if ($this->method == 'POST' && !empty($this->postData['form']['id'])) { $id = $this->postData['form']['id']; } else { if ($this->method == 'GET' && !empty($this->data['id'])) { $id = $this->data['id']; } else { return $this->app->redirect('add-video-ads'); } } $this->ads = new \VclubAdvertising(); $this->ad = $this->ads->getById($id); $this->ad['denied_categories'] = $this->ads->getDeniedVclubCategoriesForAd($id); $video_category = new \VideoCategory(); $this->video_categories = $video_category->getAll(); $this->getVideoCatForAds(); $form = $this->buildAdsForm($this->ad); if ($this->saveVideoAdsData($form)) { return $this->app->redirect('video-advertise'); } $this->app['form'] = $form->createView(); $this->app['adsEdit'] = TRUE; $this->app['adsTitle'] = $this->ad['title']; $this->app['breadcrumbs']->addItem($this->setLocalization('Advertising'), $this->app['controller_alias'] . '/video-advertise'); $this->app['breadcrumbs']->addItem($this->setLocalization('Edit commercial')); return $this->app['twig']->render('VideoClub_add_video_ads.twig'); }
<?php return array(array('value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)', 'htmlOptions' => array('style' => 'width:20px;')), array('name' => 'post_name', 'type' => 'raw', 'value' => array($this, 'Post')), array('name' => 'videocategorySearch', 'filter' => VideoCategory::makeDropDown(), 'type' => 'raw', 'value' => 'VideoCategory::makeValue($data)'), array('name' => 'categorySearch', 'filter' => Category::makeDropDown(), 'type' => 'raw', 'value' => 'Category::makeValue($data)'), array('name' => 'post_status', 'filter' => array('draft' => 'Draft', 'publish' => 'Publish'), 'type' => 'raw', 'value' => array($this, 'Status'), 'htmlOptions' => array('style' => 'width:100px;')));