Esempio n. 1
0
/**
 * Get Testimonial Basics Plugin Option Defaults
 * 
 * Array that holds all of the deault values
 * for Testimonial Basics Plugin Options. 
 *
 * @uses	katb_get_option_parameters()	defined below
 * 
 * 
 * @return	array	$katb_option_defaults	current default values for all Theme options
 */
function katb_get_option_defaults()
{
    // Get the array that holds all
    // Theme option parameters
    $katb_option_parameters = katb_get_option_parameters();
    // Initialize the array to hold
    // the default values for all
    // Theme options
    $katb_option_defaults = array();
    // Loop through the option
    // parameters array
    foreach ($katb_option_parameters as $katb_option_parameter) {
        $name = $katb_option_parameter['name'];
        // Add an associative array key
        // to the defaults array for each
        // option in the parameters array
        $katb_option_defaults[$name] = $katb_option_parameter['default'];
    }
    // Return the defaults array
    return $katb_option_defaults;
}
/**
 * Separate settings by tab
 * 
 * Returns an array of tabs, each of
 * which is an indexed array of settings
 * included with the specified tab.
 *
 * @uses	katb_get_option_parameters()	
 * @uses	katb_get_settings_page_tabs()
 * 
 * @return	array	$settingsbytab	array of arrays of settings by tab
 */
function katb_get_settings_by_tab()
{
    // Get the list of settings page tabs
    $tabs = katb_get_settings_page_tabs();
    // Initialize an array to hold
    // an indexed array of tabnames
    $settingsbytab = array();
    // Loop through the array of tabs
    foreach ($tabs as $tab) {
        $tabname = $tab['name'];
        // Add an indexed array key
        // to the settings-by-tab
        // array for each tab name
        $settingsbytab[] = $tabname;
    }
    // Get the array of option parameters
    $option_parameters = katb_get_option_parameters();
    // Loop through the option parameters
    // array
    foreach ($option_parameters as $option_parameter) {
        $optiontab = $option_parameter['tab'];
        $optionname = $option_parameter['name'];
        // Add an indexed array key to the
        // settings-by-tab array for each
        // setting associated with each tab
        $settingsbytab[$optiontab][] = $optionname;
        $settingsbytab['all'][] = $optionname;
    }
    // Return the settings-by-tab
    // array
    return $settingsbytab;
}