* 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' ), array( 'name'=> __( 'Arrange list order for logged in user links', 'flexible-frontend-login' ), 'desc' => '<small>' . __('Only those you have chosen to display below will be included.', 'flexible-frontend-login' ) . '</small>', ) ); */ // show_logout_link $options_panel->addCheckbox('show_logout_link', array('name' => __('Show Logout Link', 'flexible-frontend-login'), 'desc' => '<small>' . __('Turn ON if you want to display a <strong>logout link</strong> for logged in users.', 'flexible-frontend-login') . '</small>', 'std' => true)); // logout_link_text $options_panel->addText('logout_link_text', array('name' => __('Logout Link Text', 'flexible-frontend-login'), 'std' => __('Logout', 'flexible-frontend-login'))); // show_username $options_panel->addCheckbox('show_username', array('name' => __('Show Username', 'flexible-frontend-login'), 'desc' => '<small>' . __('Turn ON if you want to display the <strong>user\'s name</strong> for logged in users.', 'flexible-frontend-login') . '</small>', 'std' => true)); // show_username $options_panel->addRadio('username_display_type', array('firstname' => __('Firstname', 'flexible-frontend-login'), 'displayname' => __('Display Name', 'flexible-frontend-login'), 'loginname' => __('Login Name', 'flexible-frontend-login')), array('name' => __('How to display username', 'flexible-frontend-login'), 'std' => array('firstname'), 'desc' => '<small>' . __("Default is 'Display Name'", 'flexible-frontend-login') . '</small>')); // show_admin_link $options_panel->addCheckbox('show_admin_link', array('name' => __('Show Admin Link', 'flexible-frontend-login'), 'desc' => '<small>' . __('Turn ON if you want to display an <strong>admin link</strong> for logged in users.', 'flexible-frontend-login') . '</small>', 'std' => true)); // admin_link_text $options_panel->addText('admin_link_text', array('name' => __('Admin Link Text', 'flexible-frontend-login'), 'std' => __('Admin', 'flexible-frontend-login'))); //role_for_admin_link /** * @ TODO * define method to filter the Admin links in output.php *
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(); } }
* Add fields to your admin page first tab * * Simple options: * input text, checbox, select, radio * textarea */ //title $options_panel->Title(__("Simple Options", "apc")); //An optionl descrption paragraph $options_panel->addParagraph(__("This is a simple paragraph", "apc")); //text field $options_panel->addText('text_field_id', array('name' => __('My Text ', 'apc'), 'std' => 'text', 'desc' => __('Simple text field description', '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 */ $options_panel->CloseTab(); /** * Open admin page Second tab */ $options_panel->OpenTab('options_2'); /** * Add fields to your admin page 2nd tab *