Exemplo n.º 1
0
        /**
         * Admin settings HTML code
         */
        function settings()
        {
            if (!App_Roles::current_user_can('manage_options', App_Roles::CTX_PAGE_SETTINGS)) {
                wp_die(__('You do not have sufficient permissions to access this page.', 'appointments'));
            }
            $this->get_lsw();
            global $wpdb;
            ?>
		<div class="wrap">
		<div class="icon32" style="margin:10px 0 0 0"><img src="<?php 
            echo $this->plugin_url . '/images/general.png';
            ?>
" /></div>
		<h2><?php 
            echo __('Appointments+ Settings', 'appointments');
            ?>
</h2>
		<h3 class="nav-tab-wrapper">
			<?php 
            $tab = !empty($_GET['tab']) ? $_GET['tab'] : 'main';
            $tabs = array('gcal' => __('Google Calendar', 'appointments'), 'working_hours' => __('Working Hours', 'appointments'), 'exceptions' => __('Exceptions', 'appointments'), 'services' => __('Services', 'appointments'), 'workers' => __('Service Providers', 'appointments'), 'addons' => __('Add-ons', 'appointments'), 'log' => __('Logs', 'appointments'));
            $tabhtml = array();
            // If someone wants to remove or add a tab
            $tabs = apply_filters('appointments_tabs', $tabs);
            $class = 'main' == $tab ? ' nav-tab-active' : '';
            $tabhtml[] = '	<a href="' . admin_url('admin.php?page=app_settings') . '" class="nav-tab' . $class . '">' . __('General', 'appointments') . '</a>';
            foreach ($tabs as $stub => $title) {
                $class = $stub == $tab ? ' nav-tab-active' : '';
                $tabhtml[] = '	<a href="' . admin_url('admin.php?page=app_settings&amp;tab=' . $stub) . '" class="nav-tab' . $class . '" id="app_tab_' . $stub . '">' . $title . '</a>';
            }
            echo implode("\n", $tabhtml);
            ?>
		</h3>
		<div class="clear"></div>
			<?php 
            App_Template::admin_settings_tab($tab);
            ?>
		</div>
	<?php 
        }