示例#1
0
 /**
  * Get addons for Plugins.
  *
  * @access public
  *
  * @param  void
  *
  * @return void
  */
 public function get_addons()
 {
     $tabs = array();
     global $rtmedia_admin;
     if (!is_rtmedia_vip_plugin()) {
         $tabs[] = array('title' => esc_html__('Plugins', 'buddypress-media'), 'name' => esc_html__('Plugins', 'buddypress-media'), 'href' => '#rtm-plugins', 'icon' => 'dashicons-admin-plugins', 'callback' => array($this, 'plugins_content'));
     }
     RTMediaAdmin::render_admin_ui(self::$page, $tabs);
 }
示例#2
0
 /**
  * Create core admin tabs.
  *
  * @access public
  *
  * @param void
  *
  * @return void
  */
 public function rtmedia_tabs()
 {
     // Declare local variables
     $idle_class = 'nav-tab';
     $active_class = 'nav-tab nav-tab-active';
     // Setup core admin tabs
     $tabs = array(array('href' => get_admin_url(null, esc_url(add_query_arg(array('page' => 'rtmedia-settings'), 'admin.php'))), 'name' => esc_html__('Settings', 'buddypress-media'), 'slug' => 'rtmedia-settings'), array('href' => get_admin_url(null, esc_url(add_query_arg(array('page' => 'rtmedia-addons'), 'admin.php'))), 'name' => esc_html__('Addons', 'buddypress-media'), 'slug' => 'rtmedia-addons'));
     if (!is_rtmedia_vip_plugin()) {
         $tabs[] = array('href' => get_admin_url(null, esc_url(add_query_arg(array('page' => 'rtmedia-themes'), 'admin.php'))), 'name' => esc_html__('Themes', 'buddypress-media'), 'slug' => 'rtmedia-themes');
         $tabs[] = array('href' => get_admin_url(null, esc_url(add_query_arg(array('page' => 'rtmedia-hire-us'), 'admin.php'))), 'name' => esc_html__('Hire Us', 'buddypress-media'), 'slug' => 'rtmedia-hire-us');
     }
     $tabs[] = array('href' => get_admin_url(null, esc_url(add_query_arg(array('page' => 'rtmedia-support'), 'admin.php'))), 'name' => esc_html__('Support', 'buddypress-media'), 'slug' => 'rtmedia-support');
     if (has_filter('rtmedia_license_tabs') || has_action('rtmedia_addon_license_details')) {
         $tabs[] = array('href' => get_admin_url(null, esc_url(add_query_arg(array('page' => 'rtmedia-license'), 'admin.php'))), 'name' => esc_html__('Licenses', 'buddypress-media'), 'slug' => 'rtmedia-license');
     }
     $tabs = apply_filters('media_add_tabs', $tabs);
     // Loop through tabs and build navigation
     foreach (array_values($tabs) as $tab_data) {
         $is_current = (bool) ($tab_data['slug'] === $this->get_current_tab());
         $tab_class = $is_current ? $active_class : $idle_class;
         if (isset($tab_data['class']) && is_array($tab_data['class'])) {
             $tab_class .= ' ' . implode(' ', $tab_data['class']);
         }
         echo '<a href="' . esc_url($tab_data['href']) . '" class="' . esc_attr($tab_class) . '">' . esc_html($tab_data['name']) . '</a>';
     }
 }