add_admin_menu(); // Filter to add admin pages for Amin UI process add_filter( $this->plugin_name . '_admin_pages', array( $this, 'add_admin_pages' ) ); add_action( 'admin_menu', array( $this, 'register_admin_menu' ) ); add_action( 'plugins_loaded', array( $this, 'get_all_settings' ), 8 ); } /*-----------------------------------------------------------------------------------*/ /* set_default_settings() */ /* Called when plugin just installed */ /*-----------------------------------------------------------------------------------*/ public function set_default_settings() { do_action( $this->plugin_name . '_set_default_settings' ); } /*-----------------------------------------------------------------------------------*/ /* get_all_settings() */ /* Get all settings when plugin is loaded */ /*-----------------------------------------------------------------------------------*/ public function get_all_settings() { do_action( $this->plugin_name . '_get_all_settings' ); } /** * add_admin_menu() * Add the Admin menu * ============================================= * check add_menu_page() function at http://codex.wordpress.org/Function_Reference/add_menu_page to know the parameters need to parse for type is menu * check add_submenu_page() function at http://codex.wordpress.org/Function_Reference/add_submenu_page to know the parameters need to parse for type is submenu * array ( * array ( * 'type' => 'menu' : (required) add it as main menu on left sidebar of Dashboard * 'page_title' => 'Quotes & Orders Mode' : (required) The text to be displayed in the title tags of the page when the menu is selected * 'menu_title' => 'Quotes & Orders Mode' : (required) The text to be displayed in the title tags of the page when the menu is selected * 'capability' => 'manage_options' : (required) The capability required for this menu to be displayed to the user. * View instruction at http://codex.wordpress.org/Roles_and_Capabilities * 'menu_slug' => 'quotes-orders-mode' : (required) The slug name to refer to this menu by. * 'function' => 'my_function_name' : (required) The function that displays the page content for the menu page. * 'icon_url' => 'http://my_icon.png' : (optional) The url to the icon to be used for this menu. * 'position' => 50 : (optional) The position in the menu order this menu should appear. * By default, if this parameter is omitted, the menu will appear at the bottom of the menu structure. * 'admin_url' => 'admin.php' : (required) The admin url : admin.php , options-general.php * 'callback_function'=> 'my_callback_function': (optional) The callback function is called when this page does not have tab * 'script_function' => 'my_script_function' : (optional) The script function that only include for this page. * 'view_doc' => '' : (optional) Support html. The text show on the heading * ), * array ( * 'type' => 'submenu' : (required) add it as sub menu on left sidebar of Dashboard * 'parent_slug' => 'quotes-orders-mode' : (required) The slug name for the parent menu. * 'page_title' => 'Quotes & Orders Mode' : (required) The text to be displayed in the title tags of the page when the menu is selected * 'menu_title' => 'Quotes & Orders Mode' : (required) The text to be displayed in the title tags of the page when the menu is selected * 'capability' => 'manage_options' : (required) The capability required for this menu to be displayed to the user. * View instruction at http://codex.wordpress.org/Roles_and_Capabilities * 'menu_slug' => 'quotes-orders-mode' : (required) The slug name to refer to this menu by. * 'function' => 'my_function_name' : (required) The function that displays the page content for the menu page. * 'admin_url' => 'admin.php' : (required) The admin url : admin.php , options-general.php * 'callback_function'=> 'my_callback_function': (optional) The callback function is called when this page does not have tab * 'script_function' => 'my_script_function' : (optional) The script function that only include for this page. * 'view_doc' => '' : (optional) Support html. The text show on the heading * ) * ) * */ public function add_admin_menu() { $this->admin_menu = apply_filters( $this->plugin_name . '_add_admin_menu', $this->admin_menu ); } /*-----------------------------------------------------------------------------------*/ /* register_admin_menu() */ /* Setup the Admin menu in WordPress /*-----------------------------------------------------------------------------------*/ public function register_admin_menu() { if ( is_array( $this->admin_menu ) && count( $this->admin_menu ) > 0 ) { foreach ( $this->admin_menu as $menu_item ) { if ( ! isset( $menu_item['type'] ) || trim( $menu_item['type'] ) == '' ) continue; switch( $menu_item['type'] ) { case 'menu': $menu_page = add_menu_page( esc_html( $menu_item['page_title'] ), esc_html( $menu_item['menu_title'] ), $menu_item['capability'], $menu_item['menu_slug'] , $menu_item['function'], $menu_item['icon_url'], $menu_item['position'] ); if ( isset( $menu_item['script_function'] ) && trim( $menu_item['script_function'] ) != '' ) add_action( "admin_print_scripts-" . $menu_page, $menu_item['script_function'] ); break; case 'submenu': $submenu_page = add_submenu_page( $menu_item['parent_slug'] , esc_html( $menu_item['page_title'] ), esc_html( $menu_item['menu_title'] ), $menu_item['capability'], $menu_item['menu_slug'] , $menu_item['function'] ); if ( isset( $menu_item['script_function'] ) && trim( $menu_item['script_function'] ) != '' ) add_action( "admin_print_scripts-" . $submenu_page, $menu_item['script_function'] ); break; } } } } /*-----------------------------------------------------------------------------------*/ /* add_admin_pages() */ /* Get list page for Admin UI can include scripts and styles at header and footer /*-----------------------------------------------------------------------------------*/ public function add_admin_pages( $admin_pages ) { if ( ! is_array( $admin_pages ) ) $admin_pages = array(); if ( is_array( $this->admin_menu ) && count( $this->admin_menu ) > 0 ) { foreach ( $this->admin_menu as $menu_item ) { if ( ! isset( $menu_item['type'] ) || trim( $menu_item['type'] ) == '' ) continue; switch( $menu_item['type'] ) { case 'menu': case 'submenu': if ( ! in_array( $menu_item['menu_slug'], $admin_pages ) ) $admin_pages[] = $menu_item['menu_slug']; break; } } } return $admin_pages; } /*-----------------------------------------------------------------------------------*/ /* admin_settings_page() */ /* Show Settings Page Layout /*-----------------------------------------------------------------------------------*/ public function admin_settings_page( $page_data = array() ) { global $current_tab; if ( ! is_array( $page_data ) || count( $page_data ) < 1 ) return; $current_page = $page_data['menu_slug']; do_action( $this->plugin_name . '_page_start' ); do_action( $this->plugin_name . '-' . $current_page . '_page_start' ); ?>

plugin_name . '-' . $current_page . '_settings_tabs_array', array() ); if ( ! is_array( $tabs ) || count( $tabs ) < 1 ) { ?>

plugin_name . '-' . $current_page . '_settings_tabs_' . $current_tab ); } ?>
plugin_name . '_page_end' ); do_action( $this->plugin_name . '-' . $current_page . '_page_end' ); } /*-----------------------------------------------------------------------------------*/ /* admin_settings_tab() */ /* Show Settings Tab Layout /*-----------------------------------------------------------------------------------*/ public function admin_settings_tab( $current_page = '', $tab_data = array() ) { global $current_subtab; if ( ! is_array( $tab_data ) || count( $tab_data ) < 1 ) return; $current_tab = $tab_data['name']; do_action( $this->plugin_name . '-' . $current_page . '_tab_start' ); do_action( $this->plugin_name . '-' . $current_tab . '_tab_start' ); $subtabs = apply_filters( $this->plugin_name . '-' . $current_tab . '_settings_subtabs_array', array() ); if ( is_array( $subtabs ) && count( $subtabs ) > 0 ) { ?>

plugin_name . '-' . $current_tab . '_settings_subtabs_content' ); ?>
plugin_name . '-' . $current_page . '_tab_end' ); do_action( $this->plugin_name . '-' . $current_tab . '_tab_end' ); } } global $a3_responsive_slider_admin_init; $a3_responsive_slider_admin_init = new A3_Responsive_Slider_Admin_Init(); ?>