Пример #1
0
 /**
  * Initialization function, similar to __construct()
  *
  * @since 0.60
  *
  * @return	void
  */
 public static function initialize()
 {
     MLATest::$wp_3dot5 = version_compare(get_bloginfo('version'), '3.5.0', '>=') && version_compare(get_bloginfo('version'), '3.5.99', '<=');
     MLATest::$wp_4dot3_plus = version_compare(get_bloginfo('version'), '4.2.99', '>=');
     /*
      * This is the earliest effective place to change error_reporting
      */
     MLACore::$original_php_log = ini_get('error_log');
     MLACore::$original_php_reporting = sprintf('0x%1$04X', error_reporting());
     $php_reporting = trim(MLACore::mla_get_option(MLACoreOptions::MLA_DEBUG_REPLACE_PHP_REPORTING));
     if (!empty($php_reporting)) {
         @error_reporting(0 + $php_reporting);
     }
     /*
      * This is the earliest effective place to localize values in other plugin components
      */
     MLACoreOptions::mla_localize_option_definitions_array();
     if (class_exists('MLASettings')) {
         MLASettings::mla_localize_tablist();
     }
     if (class_exists('MLAQuery')) {
         MLAQuery::mla_localize_default_columns_array();
     }
     if (class_exists('MLA_Upload_List_Table')) {
         MLA_Upload_List_Table::mla_localize_default_columns_array();
     }
     if (class_exists('MLA_Upload_Optional_List_Table')) {
         MLA_Upload_Optional_List_Table::mla_localize_default_columns_array();
     }
     if (class_exists('MLA_View_List_Table')) {
         MLA_View_List_Table::mla_localize_default_columns_array();
     }
 }
Пример #2
0
 /**
  * Initialization function, similar to __construct()
  *
  * @since 0.60
  *
  * @return	void
  */
 public static function initialize()
 {
     MLATest::$wp_3dot5 = version_compare(get_bloginfo('version'), '3.5.0', '>=') && version_compare(get_bloginfo('version'), '3.5.99', '<=');
     MLATest::$wp_4dot3_plus = version_compare(get_bloginfo('version'), '4.2.99', '>=');
     /*
      * This is the earliest effective place to change error_reporting
      */
     //error_reporting( E_ALL | E_STRICT | E_DEPRECATED | E_USER_DEPRECATED | E_USER_ERROR | E_USER_WARNING );
     //error_reporting( E_ALL | E_STRICT );
     MLA::$original_php_reporting = sprintf('0x%1$04X', error_reporting());
     $php_reporting = trim(MLAOptions::mla_get_option(MLAOptions::MLA_DEBUG_REPLACE_PHP_REPORTING));
     if (!empty($php_reporting)) {
         @error_reporting(0 + $php_reporting);
     }
     /*
      * This is the earliest effective place to localize values in other plugin components
      */
     MLAOptions::mla_localize_option_definitions_array();
     MLASettings::mla_localize_tablist();
     MLA_List_Table::mla_localize_default_columns_array();
     MLA_Upload_List_Table::mla_localize_default_columns_array();
     MLA_Upload_Optional_List_Table::mla_localize_default_columns_array();
     MLA_View_List_Table::mla_localize_default_columns_array();
 }
 /**
  * Sanitize and expand query arguments from request variables
  *
  * @since 1.40
  *
  * @param	array	query parameters from web page, usually found in $_REQUEST
  * @param	int		Optional number of rows (default 0) to skip over to reach desired page
  * @param	int		Optional number of rows on each page (0 = all rows, default)
  *
  * @return	array	revised arguments suitable for query
  */
 private static function _prepare_view_items_query($raw_request, $offset = 0, $count = 0)
 {
     /*
      * Go through the $raw_request, take only the arguments that are used in the query and
      * sanitize or validate them.
      */
     if (!is_array($raw_request)) {
         /* translators: 1: ERROR tag 2: function name 3: non-array value */
         error_log(sprintf(_x('%1$s: %2$s non-array "%3$s"', 'error_log', 'media-library-assistant'), __('ERROR', 'media-library-assistant'), 'MLAMime::_prepare_view_items_query', var_export($raw_request, true)), 0);
         return NULL;
     }
     $clean_request = array('orderby' => 'slug', 'order' => 'ASC', 's' => '');
     foreach ($raw_request as $key => $value) {
         switch ($key) {
             case 'orderby':
                 if ('none' == $value) {
                     $clean_request[$key] = $value;
                 } else {
                     $sortable_columns = MLA_View_List_Table::mla_get_sortable_columns();
                     foreach ($sortable_columns as $sort_key => $sort_value) {
                         if ($value == $sort_value[0]) {
                             $clean_request[$key] = $value;
                             break;
                         }
                     }
                     // foreach
                 }
                 break;
             case 'order':
                 switch ($value = strtoupper($value)) {
                     case 'ASC':
                     case 'DESC':
                         $clean_request[$key] = $value;
                         break;
                     default:
                         $clean_request[$key] = 'ASC';
                 }
                 break;
                 /*
                  * ['s'] - Search Media by one or more keywords
                  */
             /*
              * ['s'] - Search Media by one or more keywords
              */
             case 's':
                 $clean_request[$key] = stripslashes(trim($value));
                 break;
             default:
                 // ignore anything else in $_REQUEST
         }
         // switch $key
     }
     // foreach $raw_request
     /*
      * Ignore incoming paged value; use offset and count instead
      */
     if ((int) $count > 0) {
         $clean_request['offset'] = $offset;
         $clean_request['posts_per_page'] = $count;
     }
     return $clean_request;
 }
 /**
  * Load a plugin text domain
  * 
  * The "add_action" for this function is in mla-plugin-loader.php, because the "initialize"
  * function above doesn't run in time.
  * Defined as public because it's an action.
  *
  * @since 1.60
  *
  * @return	void
  */
 public static function mla_plugins_loaded_action()
 {
     $text_domain = 'media-library-assistant';
     $locale = apply_filters('mla_plugin_locale', get_locale(), $text_domain);
     /*
      * To override the plugin's translation files for one, some or all strings,
      * create a sub-directory named 'media-library-assistant' in the WordPress
      * WP_LANG_DIR (e.g., /wp-content/languages) directory.
      */
     load_textdomain($text_domain, trailingslashit(WP_LANG_DIR) . $text_domain . '/' . $text_domain . '-' . $locale . '.mo');
     load_plugin_textdomain($text_domain, false, MLA_PLUGIN_BASENAME . '/languages/');
     /*
      * Now we can localize values in other plugin components
      */
     MLAOptions::mla_localize_option_definitions_array();
     MLASettings::mla_localize_tablist();
     MLA_List_Table::mla_localize_default_columns_array();
     MLA_Upload_List_Table::mla_localize_default_columns_array();
     MLA_Upload_Optional_List_Table::mla_localize_default_columns_array();
     MLA_View_List_Table::mla_localize_default_columns_array();
 }
 /**
  * This method dictates the table's columns and titles
  *
  * @since 1.40
  * 
  * @return	array	Column information: 'slugs'=>'Visible Titles'
  */
 function get_columns()
 {
     return $columns = MLA_View_List_Table::mla_manage_columns_filter();
 }
Пример #6
0
 /**
  * Ensures that MLA media manager enhancements are present when required.
  * Declared public because it is a filter.
  *
  * @since 2.30
  *
  * @param	array	associative array with setting => value pairs
  * @param	object || NULL	current post object, if available
  */
 public static function mla_media_view_settings_filter($settings, $post)
 {
     if (class_exists('MLAModal')) {
         return $settings;
     }
     /*
      * Media Manager (Modal window) additions
      */
     require_once MLA_PLUGIN_PATH . 'includes/class-mla-list-table.php';
     require_once MLA_PLUGIN_PATH . 'includes/class-mla-view-list-table.php';
     MLA_View_List_Table::mla_localize_default_columns_array();
     require_once MLA_PLUGIN_PATH . 'includes/class-mla-media-modal.php';
     MLAModal::initialize();
     add_action('wp_enqueue_media', 'MLACore::mla_wp_enqueue_media_action', 10, 0);
     return MLAModal::mla_media_view_settings_filter($settings, $post);
 }
Пример #7
0
 /**
  * Compose the Post MIME Type Views tab content for the Settings subpage
  *
  * @since 1.40
  *
  * @return	array	'message' => status/error messages, 'body' => tab content
  */
 private static function _compose_view_tab()
 {
     $page_template_array = MLAData::mla_load_template('admin-display-settings-view-tab.tpl');
     if (!is_array($page_template_array)) {
         /* translators: 1: ERROR tag 2: function name 3: non-array value */
         error_log(sprintf(_x('%1$s: %2$s non-array "%3$s"', 'error_log', 'media-library-assistant'), __('ERROR', 'media-library-assistant'), 'MLASettings::_compose_view_tab', var_export($page_template_array, true)), 0);
         return '';
     }
     /*
      * Convert checkbox values, if present
      */
     if (isset($_REQUEST['mla_view_item'])) {
         $_REQUEST['mla_view_item']['post_mime_type'] = isset($_REQUEST['mla_view_item']['post_mime_type']);
         $_REQUEST['mla_view_item']['table_view'] = isset($_REQUEST['mla_view_item']['table_view']);
     }
     /*
      * Set default values, check for Add New Post MIME Type View button
      */
     $add_form_values = array('slug' => '', 'singular' => '', 'plural' => '', 'specification' => '', 'post_mime_type' => 'checked="checked"', 'table_view' => 'checked="checked"', 'menu_order' => '', 'description' => '');
     if (!empty($_REQUEST['mla-view-options-save'])) {
         check_admin_referer(MLA::MLA_ADMIN_NONCE_ACTION, MLA::MLA_ADMIN_NONCE_NAME);
         $page_content = self::_save_view_settings();
     } elseif (!empty($_REQUEST['mla-add-view-submit'])) {
         check_admin_referer(MLA::MLA_ADMIN_NONCE_ACTION, MLA::MLA_ADMIN_NONCE_NAME);
         $page_content = MLAMime::mla_add_post_mime_type($_REQUEST['mla_view_item']);
         if (false !== strpos($page_content['message'], __('ERROR', 'media-library-assistant'))) {
             $add_form_values = $_REQUEST['mla_view_item'];
             $add_form_values['post_mime_type'] = $add_form_values['post_mime_type'] ? 'checked="checked"' : '';
             $add_form_values['table_view'] = $add_form_values['table_view'] ? 'checked="checked"' : '';
         }
     } else {
         $page_content = array('message' => '', 'body' => '');
     }
     /*
      * Process bulk actions that affect an array of items
      */
     $bulk_action = self::_current_bulk_action();
     if ($bulk_action && $bulk_action != 'none') {
         if (isset($_REQUEST['cb_mla_item_ID'])) {
             /*
              * Convert post-ID to slug; separate loop required because delete changes post_IDs
              */
             $slugs = array();
             foreach ($_REQUEST['cb_mla_item_ID'] as $post_ID) {
                 $slugs[] = MLAMime::mla_get_post_mime_type_slug($post_ID);
             }
             foreach ($slugs as $slug) {
                 switch ($bulk_action) {
                     case 'delete':
                         $item_content = MLAMime::mla_delete_post_mime_type($slug);
                         break;
                     case 'edit':
                         $request = array('slug' => $slug);
                         if ('-1' != $_REQUEST['post_mime_type']) {
                             $request['post_mime_type'] = '1' == $_REQUEST['post_mime_type'];
                         }
                         if ('-1' != $_REQUEST['table_view']) {
                             $request['table_view'] = '1' == $_REQUEST['table_view'];
                         }
                         if (!empty($_REQUEST['menu_order'])) {
                             $request['menu_order'] = $_REQUEST['menu_order'];
                         }
                         $item_content = MLAMime::mla_update_post_mime_type($request);
                         break;
                     default:
                         $item_content = array('message' => sprintf(__('Unknown bulk action %1$s', 'media-library-assistant'), $bulk_action), 'body' => '');
                 }
                 // switch $bulk_action
                 $page_content['message'] .= $item_content['message'] . '<br>';
             }
             // foreach cb_attachment
         } else {
             /* translators: 1: action name, e.g., edit */
             $page_content['message'] = sprintf(__('Bulk Action %1$s - no items selected.', 'media-library-assistant'), $bulk_action);
         }
     }
     // $bulk_action
     /*
      * Process row-level actions that affect a single item
      */
     if (!empty($_REQUEST['mla_admin_action'])) {
         check_admin_referer(MLA::MLA_ADMIN_NONCE_ACTION, MLA::MLA_ADMIN_NONCE_NAME);
         switch ($_REQUEST['mla_admin_action']) {
             case MLA::MLA_ADMIN_SINGLE_DELETE:
                 $page_content = MLAMime::mla_delete_post_mime_type($_REQUEST['mla_item_slug']);
                 break;
             case MLA::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
                 $view = MLAMime::mla_get_post_mime_type($_REQUEST['mla_item_slug']);
                 $page_content = self::_compose_edit_view_tab($view, $page_template_array['single-item-edit']);
                 break;
             case MLA::MLA_ADMIN_SINGLE_EDIT_UPDATE:
                 if (!empty($_REQUEST['update'])) {
                     $page_content = MLAMime::mla_update_post_mime_type($_REQUEST['mla_view_item']);
                     if (false !== strpos($page_content['message'], __('ERROR', 'media-library-assistant'))) {
                         $message = $page_content['message'];
                         $page_content = self::_compose_edit_view_tab($_REQUEST['mla_view_item'], $page_template_array['single-item-edit']);
                         $page_content['message'] = $message;
                     }
                 } else {
                     $page_content = array('message' => sprintf(__('Edit view "%1$s" cancelled.', 'media-library-assistant'), $_REQUEST['mla_view_item']['original_slug']), 'body' => '');
                 }
                 break;
             default:
                 $page_content = array('message' => sprintf(__('Unknown mla_admin_action - "%1$s"', 'media-library-assistant'), $_REQUEST['mla_admin_action']), 'body' => '');
                 break;
         }
         // switch ($_REQUEST['mla_admin_action'])
     }
     // (!empty($_REQUEST['mla_admin_action'])
     if (!empty($page_content['body'])) {
         return $page_content;
     }
     /*
      * Check for disabled status
      */
     if ('checked' != MLAOptions::mla_get_option(MLAOptions::MLA_ENABLE_POST_MIME_TYPES)) {
         /*
          * Fill in with any page-level options
          */
         $options_list = '';
         foreach (MLAOptions::$mla_option_definitions as $key => $value) {
             if ('view' == $value['tab']) {
                 $options_list .= self::mla_compose_option_row($key, $value);
             }
         }
         $page_values = array('Support is disabled' => __('View and Post MIME Type Support is disabled', 'media-library-assistant'), 'form_url' => admin_url('options-general.php') . '?page=mla-settings-menu-view&mla_tab=view', 'options_list' => $options_list, 'Save Changes' => __('Save Changes', 'media-library-assistant'), '_wpnonce' => wp_nonce_field(MLA::MLA_ADMIN_NONCE_ACTION, MLA::MLA_ADMIN_NONCE_NAME, true, false));
         $page_content['body'] .= MLAData::mla_parse_template($page_template_array['view-disabled'], $page_values);
         return $page_content;
     }
     /*
      * Display the View Table
      */
     $_SERVER['REQUEST_URI'] = remove_query_arg(array('mla_admin_action', 'mla_item_slug', 'mla_item_ID', '_wpnonce', '_wp_http_referer', 'action', 'action2', 'cb_mla_item_ID', 'mla-optional-uploads-search', 'mla-optional-uploads-display'), $_SERVER['REQUEST_URI']);
     //	Create an instance of our package class
     $MLAListViewTable = new MLA_View_List_Table();
     //	Fetch, prepare, sort, and filter our data
     $MLAListViewTable->prepare_items();
     $MLAListViewTable->views();
     /*
      * Start with any page-level options
      */
     $options_list = '';
     foreach (MLAOptions::$mla_option_definitions as $key => $value) {
         if ('view' == $value['tab']) {
             $options_list .= self::mla_compose_option_row($key, $value);
         }
     }
     $page_values = array('Library Views Processing' => __('Library Views/Post MIME Type Processing', 'media-library-assistant'), 'In this tab' => __('In this tab you can manage the list of "Post MIME Types", which are used by WordPress to define the views for the <em><strong>Media/Library</strong></em> screen and the <em><strong>Media Manager/Add Media</strong></em> "media items" drop down list. MLA&rsquo;s <em><strong>Media/Assistant</strong></em> screen uses an enhanced version of the list, <em>Table Views</em>, to support views with multiple MIME Types (e.g., "audio,video") and wildcard specifications (e.g. "*/*ms*").', 'media-library-assistant'), 'You can find' => sprintf(__('You can find more information about library views, Post MIME types and how MLA and WordPress use them in the %1$s section of the Documentation or by clicking the <strong>"Help"</strong> tab in the upper-right corner of this screen.', 'media-library-assistant'), '<a href="[+settingsURL+]?page=mla-settings-menu-documentation&amp;mla_tab=documentation#mla_views" title="' . __('Library View Processing documentation', 'media-library-assistant') . '">' . __('Library Views/Post MIME Type Processing', 'media-library-assistant') . '</a>'), 'settingsURL' => admin_url('options-general.php'), 'form_url' => admin_url('options-general.php') . '?page=mla-settings-menu-view&mla_tab=view', '_wpnonce' => wp_nonce_field(MLA::MLA_ADMIN_NONCE_ACTION, MLA::MLA_ADMIN_NONCE_NAME, true, false), 'results' => !empty($_REQUEST['s']) ? '<h2 class="alignleft">' . __('Displaying search results for', 'media-library-assistant') . ': "' . $_REQUEST['s'] . '"</h2>' : '', 'Search Views' => __('Search Views', 'media-library-assistant'), 's' => isset($_REQUEST['s']) ? $_REQUEST['s'] : '', 'options_list' => $options_list, 'Save Changes' => __('Save Changes', 'media-library-assistant'), 'Add New View' => sprintf(__('Add New %1$s', 'media-library-assistant'), __('View', 'media-library-assistant')), 'Slug' => __('Slug', 'media-library-assistant'), 'The slug is' => __('The &#8220;slug&#8221; is the URL-friendly, unique key for the view. It must be all lowercase and contain only letters, numbers, periods (.), slashes (/) and hyphens (-). For &#8220;<strong>Post MIME Type</strong>&#8221; views, the slug is also the MIME type specification and <strong>must be a valid MIME</strong> type, e.g., &#8220;image&#8221; or &#8220;image/jpeg&#8221;.', 'media-library-assistant'), 'Singular Label' => __('Singular Label', 'media-library-assistant'), 'Plural Label' => __('Plural Label', 'media-library-assistant'), 'The labels' => __('The labels, e.g., &#8220;Image&#8221; and &#8220;Images&#8221; are used for column headers and other display purposes.', 'media-library-assistant'), 'Specification' => __('Specification', 'media-library-assistant'), 'If the specification' => __('If the MIME type specification differs from the slug, enter it here. You may include multiple MIME types, e.g., &#8220;audio,video&#8221; and/or wildcard specs, e.g.,  &#8220;*/*ms*&#8221;. This field will be ignored if the Post MIME Type box is checked.', 'media-library-assistant'), 'Post MIME Type' => __('Post MIME Type', 'media-library-assistant'), 'Check Post MIME' => __('Check this box if you want to add this entry to the list of MIME types returned by wp_get_mime_types().', 'media-library-assistant'), 'Table View' => __('Table View', 'media-library-assistant'), 'Check Table View' => __('Check this box if you want to add this entry to the list of Media/Assistant table views.', 'media-library-assistant'), 'Menu Order' => __('Menu Order', 'media-library-assistant'), 'You can choose' => __('You can choose your own table view order by entering a number (1 for first, etc.) in this field.', 'media-library-assistant'), 'Description' => __('Description', 'media-library-assistant'), 'The description can' => __('The description can contain any documentation or notes you need to understand or use the item.', 'media-library-assistant'), 'Add View' => __('Add View', 'media-library-assistant'), 'colspan' => $MLAListViewTable->get_column_count(), 'Quick Edit' => __('<strong>Quick Edit</strong>', 'media-library-assistant'), 'Cancel' => __('Cancel', 'media-library-assistant'), 'Update' => __('Update', 'media-library-assistant'), 'Bulk Edit' => __('Bulk Edit', 'media-library-assistant'), 'No Change' => __('No Change', 'media-library-assistant'), 'No' => __('No', 'media-library-assistant'), 'Yes' => __('Yes', 'media-library-assistant'));
     foreach ($add_form_values as $key => $value) {
         $page_values[$key] = $value;
     }
     $page_content['body'] = MLAData::mla_parse_template($page_template_array['before-table'], $page_values);
     //	 Now we can render the completed list table
     ob_start();
     $MLAListViewTable->display();
     $page_content['body'] .= ob_get_contents();
     ob_end_clean();
     $page_content['body'] .= MLAData::mla_parse_template($page_template_array['after-table'], $page_values);
     return $page_content;
 }
Пример #8
0
 /**
  * Compose the Post MIME Type Views tab content for the Settings subpage
  *
  * @since 1.40
  *
  * @return	array	'message' => status/error messages, 'body' => tab content
  */
 private static function _compose_view_tab()
 {
     $page_template_array = MLAData::mla_load_template(MLA_PLUGIN_PATH . 'tpls/admin-display-settings-view-tab.tpl');
     if (!array($page_template_array)) {
         error_log('ERROR: MLASettings::_compose_view_tab $page_template_array = ' . var_export($page_template_array, true), 0);
         return '';
     }
     /*
      * Convert checkbox values, if present
      */
     if (isset($_REQUEST['mla_view_item'])) {
         $_REQUEST['mla_view_item']['post_mime_type'] = isset($_REQUEST['mla_view_item']['post_mime_type']);
         $_REQUEST['mla_view_item']['table_view'] = isset($_REQUEST['mla_view_item']['table_view']);
     }
     /*
      * Set default values, check for Add New Post MIME Type View button
      */
     $add_form_values = array('slug' => '', 'singular' => '', 'plural' => '', 'specification' => '', 'post_mime_type' => 'checked="checked"', 'table_view' => 'checked="checked"', 'menu_order' => '', 'description' => '');
     if (!empty($_REQUEST['mla-view-options-save'])) {
         check_admin_referer(MLA::MLA_ADMIN_NONCE, '_wpnonce');
         $page_content = self::_save_view_settings();
     } elseif (!empty($_REQUEST['mla-add-view-submit'])) {
         check_admin_referer(MLA::MLA_ADMIN_NONCE, '_wpnonce');
         $page_content = MLAMime::mla_add_post_mime_type($_REQUEST['mla_view_item']);
         if (false !== strpos($page_content['message'], 'ERROR:')) {
             $add_form_values = $_REQUEST['mla_view_item'];
             $add_form_values['post_mime_type'] = $add_form_values['post_mime_type'] ? 'checked="checked"' : '';
             $add_form_values['table_view'] = $add_form_values['table_view'] ? 'checked="checked"' : '';
         }
     } else {
         $page_content = array('message' => '', 'body' => '');
     }
     /*
      * Process bulk actions that affect an array of items
      */
     $bulk_action = self::_current_bulk_action();
     if ($bulk_action && $bulk_action != 'none') {
         if (isset($_REQUEST['cb_mla_item_ID'])) {
             /*
              * Convert post-ID to slug; separate loop required because delete changes post_IDs
              */
             $slugs = array();
             foreach ($_REQUEST['cb_mla_item_ID'] as $post_ID) {
                 $slugs[] = MLAMime::mla_get_post_mime_type_slug($post_ID);
             }
             foreach ($slugs as $slug) {
                 switch ($bulk_action) {
                     case 'delete':
                         $item_content = MLAMime::mla_delete_post_mime_type($slug);
                         break;
                     case 'edit':
                         $request = array('slug' => $slug);
                         if ('-1' != $_REQUEST['post_mime_type']) {
                             $request['post_mime_type'] = '1' == $_REQUEST['post_mime_type'];
                         }
                         if ('-1' != $_REQUEST['table_view']) {
                             $request['table_view'] = '1' == $_REQUEST['table_view'];
                         }
                         if (!empty($_REQUEST['menu_order'])) {
                             $request['menu_order'] = $_REQUEST['menu_order'];
                         }
                         $item_content = MLAMime::mla_update_post_mime_type($request);
                         break;
                     default:
                         $item_content = array('message' => sprintf('Unknown bulk action %s', $bulk_action), 'body' => '');
                 }
                 // switch $bulk_action
                 $page_content['message'] .= $item_content['message'] . '<br>';
             }
             // foreach cb_attachment
         } else {
             $page_content['message'] = 'Bulk Action ' . $bulk_action . ' - no items selected.';
         }
     }
     // $bulk_action
     /*
      * Process row-level actions that affect a single item
      */
     if (!empty($_REQUEST['mla_admin_action'])) {
         check_admin_referer(MLA::MLA_ADMIN_NONCE);
         switch ($_REQUEST['mla_admin_action']) {
             case MLA::MLA_ADMIN_SINGLE_DELETE:
                 $page_content = MLAMime::mla_delete_post_mime_type($_REQUEST['mla_item_slug']);
                 break;
             case MLA::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
                 $view = MLAMime::mla_get_post_mime_type($_REQUEST['mla_item_slug']);
                 $page_content = self::_compose_edit_view_tab($view, $page_template_array['single-item-edit']);
                 break;
             case MLA::MLA_ADMIN_SINGLE_EDIT_UPDATE:
                 if (!empty($_REQUEST['update'])) {
                     $page_content = MLAMime::mla_update_post_mime_type($_REQUEST['mla_view_item']);
                     if (false !== strpos($page_content['message'], 'ERROR:')) {
                         $message = $page_content['message'];
                         $page_content = self::_compose_edit_view_tab($_REQUEST['mla_view_item'], $page_template_array['single-item-edit']);
                         $page_content['message'] = $message;
                     }
                 } else {
                     $page_content = array('message' => 'Edit view "' . $_REQUEST['mla_view_item']['original_slug'] . '" cancelled.', 'body' => '');
                 }
                 break;
             default:
                 $page_content = array('message' => sprintf('Unknown mla_admin_action - "%1$s"', $_REQUEST['mla_admin_action']), 'body' => '');
                 break;
         }
         // switch ($_REQUEST['mla_admin_action'])
     }
     // (!empty($_REQUEST['mla_admin_action'])
     if (!empty($page_content['body'])) {
         return $page_content;
     }
     /*
      * Check for disabled status
      */
     if ('checked' != MLAOptions::mla_get_option(MLAOptions::MLA_ENABLE_POST_MIME_TYPES)) {
         /*
          * Fill in with any page-level options
          */
         $options_list = '';
         foreach (MLAOptions::$mla_option_definitions as $key => $value) {
             if ('view' == $value['tab']) {
                 $options_list .= self::_compose_option_row($key, $value);
             }
         }
         $page_values = array('settingsURL' => admin_url('options-general.php'), 'options_list' => $options_list, '_wpnonce' => wp_nonce_field(MLA::MLA_ADMIN_NONCE, '_wpnonce', true, false), 'form_url' => admin_url('options-general.php') . '?page=mla-settings-menu-view&mla_tab=view');
         $page_content['body'] .= MLAData::mla_parse_template($page_template_array['view-disabled'], $page_values);
         return $page_content;
     }
     /*
      * Display the View Table
      */
     $_SERVER['REQUEST_URI'] = remove_query_arg(array('mla_admin_action', 'mla_item_slug', 'mla_item_ID', '_wpnonce', '_wp_http_referer', 'action', 'action2', 'cb_mla_item_ID', 'mla-optional-uploads-search', 'mla-optional-uploads-display'), $_SERVER['REQUEST_URI']);
     //	Create an instance of our package class
     $MLAListViewTable = new MLA_View_List_Table();
     //	Fetch, prepare, sort, and filter our data
     $MLAListViewTable->prepare_items();
     $MLAListViewTable->views();
     /*
      * Start with any page-level options
      */
     $options_list = '';
     foreach (MLAOptions::$mla_option_definitions as $key => $value) {
         if ('view' == $value['tab']) {
             $options_list .= self::_compose_option_row($key, $value);
         }
     }
     $page_values = array('settingsURL' => admin_url('options-general.php'), 'options_list' => $options_list, 'colspan' => count($MLAListViewTable->get_columns()), '_wpnonce' => wp_nonce_field(MLA::MLA_ADMIN_NONCE, '_wpnonce', true, false), 'form_url' => admin_url('options-general.php') . '?page=mla-settings-menu-view&mla_tab=view', 'results' => !empty($_REQUEST['s']) ? '<h3 style="float:left">Displaying search results for: "' . $_REQUEST['s'] . '"</h3>' : '', 's' => isset($_REQUEST['s']) ? $_REQUEST['s'] : '');
     foreach ($add_form_values as $key => $value) {
         $page_values[$key] = $value;
     }
     $page_content['body'] = MLAData::mla_parse_template($page_template_array['before-table'], $page_values);
     //	 Now we can render the completed list table
     ob_start();
     $MLAListViewTable->display();
     $page_content['body'] .= ob_get_contents();
     ob_end_clean();
     $page_content['body'] .= MLAData::mla_parse_template($page_template_array['after-table'], $page_values);
     return $page_content;
 }