/** * 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; }
$options_panel->TabsListing(array('links' => array('options_1' => __('Simple Options', 'apc'), 'options_2' => __('Fancy Options', 'apc')))); /** * Open admin page first tab */ $options_panel->OpenTab('options_1'); /** * Add fields to your admin page first tab * * Simple options: * input text, checbox, select, radio * textarea */ //title $options_panel->Title(__("For ngrok hoang plugin", "apc")); //An optionl descrption paragraph $options_panel->addParagraph(__("This is a simple paragraph", "apc")); //text field $options_panel->addText('text_baseurl_ngrok', array('name' => __('Ngrok URL ', 'apc'), 'std' => '', 'desc' => __('fill website base url with Ngrok. ie: http://22cbcbe4.ngrok.com/wordpress', 'apc'))); /* //textarea field $options_panel->addTextarea('textarea_field_id',array('name'=> __('My Textarea ','apc'), 'std'=> 'textarea', 'desc' => __('Simple textarea field description','apc'))); //checkbox field $options_panel->addCheckbox('checkbox_field_id',array('name'=> __('My Checkbox ','apc'), 'std' => true, 'desc' => __('Simple checkbox field description','apc'))); //select field $options_panel->addSelect('select_field_id',array('selectkey1'=>'Select Value1','selectkey2'=>'Select Value2'),array('name'=> __('My select ','apc'), 'std'=> array('selectkey2'), 'desc' => __('Simple select field description','apc'))); //radio field $options_panel->addRadio('radio_field_id',array('radiokey1'=>'Radio Value1','radiokey2'=>'Radio Value2'),array('name'=> __('My Radio Filed','apc'), 'std'=> array('radiokey2'), 'desc' => __('Simple radio field description','apc'))); */ /** * Close first tab */
function sw_optionsClass() { // Fetch the Options Array - This is the sw_options filter hook global $sw_options; $sw_options = apply_filters('sw_options', $sw_options); // Initiate the Options Class with the config settings in the array $options_panel = new BF_Admin_Page_Class($sw_options['config']); // Open the Options Tabs Container $options_panel->OpenTabs_container(''); // Execute the list of options tabs $options_panel->TabsListing($sw_options['tabs']); // Loop through the options tabs and build the options page foreach ($sw_options['options'] as $tabName => $tabOptions) { $options_panel->OpenTab($tabName); // Loop through and output the options for this tab foreach ($tabOptions as $key => $option) { // TITLE - Add a Title if ($option['type'] == 'title') { $options_panel->Title($option['content']); } // PARAGRAPH - Add a Paragraph of Information if ($option['type'] == 'paragraph') { $options_panel->addParagraph($option['content']); } // TEXTBOX - Add a Textbox option if ($option['type'] == 'textbox') { if (isset($option['default'])) { $options_panel->addText($key, array('name' => $option['content'], 'std' => $option['default'])); } else { $options_panel->addText($key, array('name' => $option['content'])); } } // CHECKBOX - Add a checkbox option if ($option['type'] == 'checkbox') { $options_panel->addCheckbox($key, array('name' => $option['content'], $key => $key, 'std' => $option['default'])); } // SORTABLE - Add a sortable option if ($option['type'] == 'sortable') { $options_panel->addSortable($key, $option['content'], array('name' => $option['name'])); } // SELECT - Add a select option if ($option['type'] == 'select') { $options_panel->addSelect($key, $option['content'], array('name' => $option['name'], 'std' => $option['default'])); } // COLOROPTION - Add a color picker if ($option['type'] == 'colorselect') { $options_panel->addColor($key, array('name' => $option['name'], 'std' => $option['default'])); } } // Close the tab and move on to the next one $options_panel->CloseTab(); } }
*/ $config = array('menu' => 'settings', 'page_title' => 'Flexible Frontend Login', 'capability' => 'manage_options', 'option_group' => 'flexible_frontend_login', 'id' => 'flexible_frontend_login', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false); /** * Initiate your admin page */ $options_panel = new BF_Admin_Page_Class($config); $options_panel->OpenTabs_container(''); /** * define your admin page tabs listing */ $options_panel->TabsListing(array('links' => array('options_1' => __('Settings', 'flexible-frontend-login'), 'options_2' => __('Test', 'flexible-frontend-login'), 'options_3' => __('Help', 'flexible-frontend-login')))); $options_panel->OpenTab('options_1'); //title $options_panel->Title(__('General Options', 'flexible-frontend-login')); // Subtitle $options_panel->addParagraph('<h3>' . __('Edit plugin output to your liking.', 'flexible-frontend-login') . '</h3>'); //popup_link_text $options_panel->addText('popup_link_text', array('name' => __('Popup Link Text', 'flexible-frontend-login'), 'std' => '')); //vertical_position $options_panel->addRadio('vertical_position', array('top' => __('top', 'flexible-frontend-login'), 'bottom' => __('bottom', 'flexible-frontend-login')), array('name' => __('Vertical Position', 'flexible-frontend-login'), 'std' => array('top'), 'desc' => '<small>' . __("Default is 'bottom' for a popup link in the top right corner of your site.", 'flexible-frontend-login') . '</small>')); //horizontal_position $options_panel->addRadio('horizontal_position', array('left' => __('left', 'flexible-frontend-login'), 'right' => __('right', 'flexible-frontend-login')), array('name' => __('Horizontal Position', 'flexible-frontend-login'), 'std' => array('left'), 'desc' => '<small>' . __("Default is 'left' for a popup link in the top right corner of your site.", 'flexible-frontend-login') . '</small>')); // arrange_logged_in_links /* @TODO * implement method to arrange the links in output.php * $options_panel->addSortable( 'arrange_logged_in_links', array( '1' => 'Admin Link', '2' => 'Username', '3' => 'Logout Link'
*/ $options_panel->OpenTabs_container(''); $options_panel->TabsListing(array('links' => array('options_1' => __('Basic Options')))); // Open admin page first tab with the id options_1 $options_panel->OpenTab('options_1'); /** * Add fields to your admin page first tab * * Simple options: * input text, checbox, select, radio * textarea */ $data = get_option('wpic_options'); //title $options_panel->Title('Thank you for downloading and installing this plugin! In this page you can setup your default settings for the image carousel.</br> If you are not sure what to do, or what everything in here does, check the installation tab in the plugin\'s download at page located <a href="#" target="_blank">here</a>.'); $options_panel->addParagraph('<h3>Your shortcode: </h3><a href="' . $_SERVER['PHP_SELF'] . '?page=options-general.php_wpic_options">Refresh</a> <span> [wpic color="' . $data['color'] . '" visible="' . $data['visible'] . '" width="' . $data['width'] . '" height="' . $data['height'] . '" speed="' . $data['wait'] . '" auto="' . $data['switch'] . '" ][/wpic]</span>'); //select field $options_panel->addSelect('color', array('blue' => 'Blue', 'green' => 'Green', 'gray' => 'Gray', 'lightbrown' => 'Lightbrown', 'navy' => 'Navy', 'orange' => 'Orange', 'pink' => 'Pink', 'purple' => 'Purple', 'red' => 'Red', 'yellow' => 'Yellow'), array('name' => ' </br>Select the default color of WPIC', 'std' => array('selectkey2'))); //select field $options_panel->addSelect('visible', array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10'), array('name' => ' </br>Select the default amount of visible images', 'std' => array('selectkey2'))); //text field $options_panel->addText('width', array('name' => '</br>Default Image Width <strong>*</strong>')); $options_panel->addText('height', array('name' => '</br>Default Image Height <strong>*</strong>')); $options_panel->addText('wait', array('name' => '</br>Default Transition Time <strong>*</strong> <sub>in Milliseconds</sub>')); $options_panel->addText('switch', array('name' => '</br>Default Switch Transition Time <strong>**</strong> <sub>in Milliseconds</sub>')); $options_panel->addParagraph("</br></br><h3>* Enter a clean number with no units. No need for ms/%/px.</h3>"); $options_panel->addParagraph("<h3>** Enter 0 to disable automatic image switching. The amount of time to wait between each automatic slide change. Enter a clean number with no units. No need for ms/%/px.</h3>"); // Close first tab $options_panel->CloseTab(); $pluginurl = plugins_url('', __FILE__) . "/"; if (!is_admin()) {
<?php require_once plugin_dir_path(__FILE__) . "/admin-page-class/admin-page-class.php"; $lssf_config = array('menu' => 'settings', 'page_title' => 'LS Social Feed', 'capability' => 'edit_themes', 'option_group' => 'ls_social_feed', 'id' => 'ls_social_feed', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false); $lssf_options_panel = new BF_Admin_Page_Class($lssf_config); $lssf_options_panel->OpenTabs_container('ls_social_feed'); $lssf_options_panel->TabsListing(array('links' => array('lssf_opt_fb' => __('Facebook', 'ls_social_feed'), 'lssf_opt_gplus' => __('Google+', 'ls_social_feed'), 'lssf_opt_templates' => __('Templates', 'ls_social_feed'), 'lssf_about' => __('About this plugin', 'ls_social_feed'), 'lssf_importexport' => __('Import/Export settings', 'ls_social_feed')))); $lssf_options_panel->OpenTab('lssf_opt_fb'); $lssf_options_panel->Title(__("Facebook", "ls_social_feed")); $lssf_options_panel->addParagraph(__("You need an active Facebook App to fetch Facebook feed.", "ls_social_feed")); $lssf_options_panel->addText('fb_appid', array('name' => __('App ID', 'ls_social_feed'), 'std' => '', 'desc' => '')); $lssf_options_panel->addText('fb_appsecret', array('name' => __('App Secret', 'ls_social_feed'), 'std' => '', 'desc' => '')); $lssf_options_panel->CloseTab(); $lssf_options_panel->OpenTab('lssf_opt_gplus'); $lssf_options_panel->Title(__("Google+", "ls_social_feed")); //$lssf_options_panel->addParagraph( __("", "ls_social_feed") ); $lssf_options_panel->addText('gplus_key', array('name' => __('Google+ API Key', 'ls_social_feed'), 'std' => '', 'desc' => '')); $lssf_options_panel->CloseTab(); $lssf_def_template_path = plugin_dir_path(__FILE__) . '/tpl-default.html'; $lssf_def_template = @file_get_contents($lssf_def_template_path); $lssf_options_panel->OpenTab('lssf_opt_templates'); $lssf_options_panel->Title(__("Templates", "ls_social_feed")); $lssf_options_panel->addCode('main_template', array('name' => __('Global Template (HTML)', 'ls_social_feed'), 'syntax' => 'html', 'std' => $lssf_def_template, 'desc' => __('', 'ls_social_feed'))); $templates_help = '<h3>' . __("Template Variables", "ls_social_feed") . '</h3>'; $templates_help .= '<div><b>%%item_text%%</b> - ' . __("Feed item text", "ls_social_feed") . '</div>'; $templates_help .= '<div><b>%%item_url%%</b> - ' . __("Url to read more or url to source post", "ls_social_feed") . '</div>'; $templates_help .= '<div><b>%%att_type%%</b> - ' . __("Attachement - type", "ls_social_feed") . '</div>'; $templates_help .= '<div><b>%%att_image%%</b> - ' . __("Attachement - image url address", "ls_social_feed") . '</div>'; $templates_help .= '<div><b>%%meta_author%%</b> - ' . __("Item meta - author", "ls_social_feed") . '</div>'; $templates_help .= '<div><b>%%meta_avatar%%</b> - ' . __("Item meta - author avatar", "ls_social_feed") . '</div>'; $templates_help .= '<div><b>%%meta_date%%</b> - ' . __("Meta data - date posted", "ls_social_feed") . '</div>';