public function get_folder_view(MediaURL $media_url, &$plugin_cookies) { $this->vod->folder_entered($media_url, $plugin_cookies); $movie = $this->vod->get_loaded_movie($media_url->movie_id, $plugin_cookies); if ($movie === null) { // TODO: dialog? return null; } $has_right_button = $this->vod->is_favorites_supported(); $right_button_caption = null; $right_button_action = null; if ($has_right_button) { $this->vod->ensure_favorites_loaded($plugin_cookies); $is_favorite = $this->vod->is_favorite_movie_id($movie->id); $right_button_caption = $is_favorite ? 'Remove from My Movies' : 'Add to My Movies'; $right_button_action = UserInputHandlerRegistry::create_action($this, 'favorites', array('movie_id' => $movie->id)); } $movie_folder_view = array(PluginMovieFolderView::movie => $movie->get_movie_array(), PluginMovieFolderView::has_right_button => $has_right_button, PluginMovieFolderView::right_button_caption => $right_button_caption, PluginMovieFolderView::right_button_action => $right_button_action, PluginMovieFolderView::has_multiple_series => count($movie->series_list) > 1, PluginMovieFolderView::series_media_url => VodSeriesListScreen::get_media_url_str($movie->id)); return array(PluginFolderView::multiple_views_supported => false, PluginFolderView::archive => null, PluginFolderView::view_kind => PLUGIN_FOLDER_VIEW_MOVIE, PluginFolderView::data => $movie_folder_view); }
public function get_folder_view(MediaURL $media_url, &$plugin_cookies) { hd_print(__METHOD__ . ': teste' . print_r($media_url, true)); $this->vod->folder_entered($media_url, $plugin_cookies); $movie = $this->vod->get_loaded_movie($media_url->movie_id, $plugin_cookies); if ($movie === null) { // TODO: dialog? return null; } $has_right_button = $this->vod->is_favorites_supported(); $right_button_caption = null; $right_button_action = null; if ($has_right_button) { $this->vod->ensure_favorites_loaded($plugin_cookies); $is_favorite = $this->vod->is_favorite_movie_id($movie->id); $right_button_caption = $is_favorite ? 'Remove from Favorites' : 'Add to Favorites'; $right_button_action = UserInputHandlerRegistry::create_action($this, 'favorites', array('movie_id' => $movie->id)); } $movie_folder_view = array(PluginMovieFolderView::movie => $movie->get_movie_array(), PluginMovieFolderView::has_right_button => $has_right_button, PluginMovieFolderView::right_button_caption => $right_button_caption, PluginMovieFolderView::right_button_action => $right_button_action, PluginMovieFolderView::has_multiple_series => count($movie->series_list) > 1, PluginMovieFolderView::series_media_url => VodSeriesListScreen::get_media_url_str($movie->id), PluginMovieFolderView::params => array(PluginFolderViewParams::paint_path_box => false, PluginFolderViewParams::paint_content_box_background => true)); $a = array(PluginFolderView::multiple_views_supported => false, PluginFolderView::archive => null, PluginFolderView::view_kind => PLUGIN_FOLDER_VIEW_MOVIE, PluginFolderView::data => $movie_folder_view); // HD::print_backtrace(); hd_print(__METHOD__ . ':' . print_r($a, true)); return $a; }