/** * Specifies the classname and description, instantiates the widget. No * stylesheets or JavaScript needed, localization loaded in public class. */ public function __construct() { $this->widget_name = __('WPMovieLibrary Movies', 'wpmovielibrary'); $this->widget_description = __('Display a list of movies from a specific taxonomy, media, status, rating…', 'wpmovielibrary'); $this->widget_css = 'wpmoly movies'; $this->widget_id = 'wpmovielibrary-movies-widget'; $this->widget_form = 'movies-widget/movies-admin.php'; $this->widget_params = array('title' => array('type' => 'text', 'std' => __('Movies', 'wpmovielibrary')), 'description' => array('type' => 'text', 'std' => ''), 'select' => array('type' => 'select', 'std' => 'date'), 'select_status' => array('type' => 'select', 'std' => 'all'), 'select_media' => array('type' => 'select', 'std' => 'all'), 'select_rating' => array('type' => 'select', 'std' => 'all'), 'select_meta' => array('type' => 'select', 'std' => 'all'), 'release_date' => array('type' => 'text', 'std' => ''), 'spoken_languages' => array('type' => 'text', 'std' => ''), 'production_companies' => array('type' => 'text', 'std' => ''), 'production_countries' => array('type' => 'text', 'std' => ''), 'certification' => array('type' => 'text', 'std' => ''), 'sort' => array('type' => 'select', 'std' => 'DESC'), 'limit' => array('type' => 'number', 'std' => 4), 'show_poster' => array('type' => 'select', 'std' => 'normal'), 'show_title' => array('type' => 'select', 'std' => 'no'), 'show_rating' => array('type' => 'select', 'std' => 'starsntext'), 'exclude_current' => array('type' => 'select', 'std' => 'no')); $this->movies_by = array('status' => __('Status', 'wpmovielibrary'), 'media' => __('Media', 'wpmovielibrary'), 'rating' => __('Rating', 'wpmovielibrary'), 'title' => __('Title', 'wpmovielibrary'), 'date' => __('Date', 'wpmovielibrary'), 'meta' => __('Metadata', 'wpmovielibrary'), 'random' => __('Random', 'wpmovielibrary')); $this->status = WPMOLY_Settings::get_available_movie_status(); $this->media = WPMOLY_Settings::get_available_movie_media(); $this->rating = WPMOLY_Settings::get_available_movie_rating(); $this->meta = array('release_date' => __('Release Date', 'wpmovielibrary'), 'production_companies' => __('Production', 'wpmovielibrary'), 'production_countries' => __('Country', 'wpmovielibrary'), 'spoken_languages' => __('Languages', 'wpmovielibrary'), 'certification' => __('Certification', 'wpmovielibrary')); $this->years = WPMOLY_Utils::get_used_years($count = true); $this->languages = WPMOLY_Utils::get_used_languages($count = true); $this->companies = WPMOLY_Utils::get_used_companies($count = true); $this->countries = WPMOLY_Utils::get_used_countries($count = true); $this->certifications = WPMOLY_Utils::get_used_certifications($count = true); parent::__construct(); }