config = apply_filters("abundatrade(applyConfig)", array());
$this->folders = apply_filters("abundatrade(getFolders)", array());
if (isset($this->config['config'])) {
if (isset($this->config['config']['settings']) && $this->config['config']['settings']) {
if (is_admin()) {
//now we add a settings menu item
add_action('admin_menu', array($this, 'buildSettings'));
add_action('admin_print_styles',array($this, 'loadcss'));
}
}
}
}
/**
* Loads tabified css
*/
public function loadcss() {
wp_register_style('abunda_admin_css', $this->folders['PluginUrl'] .'/css/admin.css');
wp_enqueue_style ('abunda_admin_css');
}
/**
* Displays the admin page for a given tab, and defaults to tab 0
* Calls stuff
*/
public function display() {
if(!isset($_GET['tab']))
{
$_GET['tab'] = 0;
}
if (current_user_can('manage_options')) $this->render_tabs();
}
/**
* Displays the tabs at the top of the settings page
*/
private function render_tabs() {
?>
Abundatrade.com Calculator Settings
config['tabs'][$_GET['tab']][0]; ?>
config['tabs'][$_GET['tab']][1];
$display->settings();
?>
id != $this->page_hook) {
return;
}
foreach ($this->config['help'] as $tab => $help) {
if($tab == $_GET['tab']) {
foreach ($help as $menu) {
$screen->add_help_tab(array(
'id' => $menu[0],
'title' => $menu[0],
'content' => $menu[1],
'callback' => array($this, 'show_content')
));
}
}
}
}
/**
* Call back for custom scenarios on the help tab
* @param WP_Screen $screen The screen object for the current page
* @param array $tab An array containing the current help tab selected
*/
function show_content($screen, $tab) {
}
/**
* Builds the settings menu stuff
*/
public function buildSettings() {
$this->page_hook = add_options_page($this->config['config']['page_title'], $this->config['config']['button_title'], 'manage_options', $this->config['config']['slug'], array($this, "display"));
add_action('load-'.$this->page_hook, array($this, 'add_help_tab'));
}
}