/** * Constructor. Calls WP_List_Table and set up data. * * @since 1.0 */ function __construct() { if (!is_admin()) { return false; } global $status, $page; parent::__construct(array('singular' => 'movie', 'plural' => 'movies', 'ajax' => true, 'screen' => get_current_screen())); $this->posts_per_page = 15; $this->metadata = WPMOLY_Settings::get_supported_movie_meta(); $this->columns = WPMOLY_Import::get_imported_movies(); $this->column_names = array('poster' => __('Poster', 'wpmovielibrary'), 'movietitle' => __('Title', 'wpmovielibrary'), 'director' => __('Director', 'wpmovielibrary'), 'actions' => __('Actions', 'wpmovielibrary')); }
/** * Initializes variables * * @since 1.0 */ public function init() { $this->modules = array('WPMOLY_Dashboard' => WPMOLY_Dashboard::get_instance(), 'WPMOLY_Settings' => WPMOLY_Settings::get_instance(), 'WPMOLY_TMDb' => WPMOLY_TMDb::get_instance(), 'WPMOLY_Utils' => WPMOLY_Utils::get_instance(), 'WPMOLY_Metaboxes' => WPMOLY_Metaboxes::get_instance(), 'WPMOLY_Edit_Movies' => WPMOLY_Edit_Movies::get_instance(), 'WPMOLY_Media' => WPMOLY_Media::get_instance(), 'WPMOLY_Import' => WPMOLY_Import::get_instance(), 'WPMOLY_Queue' => WPMOLY_Queue::get_instance()); $this->screen_hooks = array('edit' => 'post.php', 'new' => 'post-new.php', 'movie' => 'movie', 'movies' => 'edit.php', 'widgets' => 'widgets.php', 'settings' => sprintf('%s_page_wpmovielibrary-settings', strtolower(__('Movies', 'wpmovielibrary')))); $this->hidden_pages = array(); }
<div id="wpmoly_imported" class="form-table hide-if-js<?php if ('' == $_section || 'wpmoly_imported' == $_section) { echo ' active'; } ?> "> <div id="import-intro"> <p><?php _e('Here are the movies you previously updated but didn’t save. You can save them, edit them individually or apply bulk actions. Posters are automatically saved and set as featured images, but images are not. Use the bulk action to import, but be aware that it can take some time if you select a lot of movies. Don’t forget to save your imports when you’re done!', 'wpmovielibrary'); ?> </p> </div> <?php WPMOLY_Import::display_import_movie_list(); ?> <form method="post" id="meta_data_form"> <div id="meta_data" style="display:none"></div> <p style="text-align:right"> <?php wpmoly_nonce_field('save-imported-movies', $referer = false); ?> <input type="hidden" id="wpmoly_imported_ids" name="wpmoly_imported_ids" value="" /> <input type="button" id="wpmoly_empty" name="wpmoly_empty" class="button button-secondary button-large" value="<?php _e('Empty All', 'wpmovielibrary'); ?> " />