예제 #1
0
 /**
  * Build admin page
  *
  * @wp-hook plugins_loaded
  * @since   2012.12.21
  * @return  void
  */
 public function build_admin()
 {
     # Initiate the admin page
     $options_panel = new BF_Admin_Page_Class($this->config);
     $options_panel->OpenTabs_container('');
     # Define tabs listing
     $tabs_links = array('appearance' => __('Appearance', 'mtt'), 'admin_bar' => __('Admin Bar', 'mtt'), 'admin_menus' => __('Admin Menus'), 'dashboard' => __('Dashboard', 'mtt'), 'post_listing' => __('Post and Page Listing', 'mtt'), 'post_editing' => __('Post and Page Editing', 'mtt'), 'media' => __('Media', 'mtt'), 'widgets' => __('Widgets', 'mtt'), 'plugins' => __('Plugins', 'mtt'), 'user_profile' => __('Users and Profile', 'mtt'), 'shortcodes' => __('Shortcodes', 'mtt'), 'general' => __('General Settings', 'mtt'), 'login_logout' => __('Login', 'mtt'), 'maintenance' => __('Maintenance Mode', 'mtt'));
     # MS support
     if ($this->multisite) {
         $tabs_links['multisite'] = __('Multisite', 'mtt');
     }
     # Finish tabs listing
     $tabs_links['credits'] = __('Credits', 'mtt');
     $tabs_links['import_export'] = __('Import Export Reset', 'mtt');
     # Declare tabs listing
     $options_panel->TabsListing(array('links' => $tabs_links));
     # Include Admin Tabs
     $plugin_url = B5F_MTT_Init::get_instance()->plugin_url;
     foreach ($this->plugin_sections as $section) {
         require_once 'admin-tabs/' . $section . '.php';
     }
     # Special Admin Section
     require_once 'admin-tabs/credits.php';
     # Import Export Admin Tabs
     $options_panel->OpenTab('import_export');
     $options_panel->Title(__('Import Export Reset', 'mtt'));
     $options_panel->addImportExport();
     $options_panel->addParagraph("<hr><h3> Reset</h3>");
     $options_panel->addCheckboxList('mtt_reset_plugin', array('do_it' => 'Select this to reset all plugin data.'), array('name' => 'Reset all plugin data.', 'desc' => '', 'class' => 'no-toggle', 'std' => false));
     $options_panel->addCheckboxList('mtt_verbose_plugin', array('visible' => ''), array('name' => '', 'class' => 'mtt-hidden', 'desc' => '', 'std' => false));
     $options_panel->CloseTab();
     # End Admin Tabs Container
     $options_panel->CloseTab();
     # Create Admin Interface
     $this->options_class = $options_panel;
 }
예제 #2
0
//max numeric value
$options_panel->addText('nmax_text_field_id', array('name' => __('My Max numeric validation ', 'apc'), 'std' => 9, 'desc' => __("Field with max numeric value validation", "apc"), 'validate' => array('maxvalue' => array('param' => 10, 'message' => __("must be numeric with a Max value of 10", "apc")))));
//is_url validation
$options_panel->addText('url_text_field_id', array('name' => __('My URL validation ', 'apc'), 'std' => 'http://en.bainternet.info', 'desc' => __("Field with url value validation", "apc"), 'validate' => array('url' => array('param' => '', 'message' => __("must be a valid URL", "apc")))));
/**
 * Close 6th tab
 */
$options_panel->CloseTab();
/**
 * Open admin page 7th tab
 */
$options_panel->OpenTab('options_7');
//title
$options_panel->Title(__("Import Export", "apc"));
/**
 * add import export functionallty
 */
$options_panel->addImportExport();
/**
 * Close 7th tab
 */
$options_panel->CloseTab();
$options_panel->CloseTab();
//Now Just for the fun I'll add Help tabs
$options_panel->HelpTab(array('id' => 'tab_id', 'title' => __('My help tab title', 'apc'), 'content' => '<p>' . __('This is my Help Tab content', 'apc') . '</p>'));
$options_panel->HelpTab(array('id' => 'tab_id2', 'title' => __('My 2nd help tab title', 'apc'), 'callback' => 'help_tab_callback_demo'));
//help tab callback function
function help_tab_callback_demo()
{
    echo '<p>' . __('This is my 2nd Help Tab content from a callback function', 'apc') . '</p>';
}