예제 #1
0
	/**
	 * Adds admin menu entry for Custom Admin bar module
	 * @return void
	 */
	function create_admin_menu_entry() {
		if ( @$_POST && isset( $_POST['option_page'] ) ) {
			$changed = false;
			if ( 'wdcab_options' == @$_POST['option_page'] ) {
				if ( isset( $_POST['wdcab']['links']['_last_'] ) ) {
					$last = $_POST['wdcab']['links']['_last_'];
					unset( $_POST['wdcab']['links']['_last_'] );
					if ( @$last['url'] && @$last['title'] ) {
						$_POST['wdcab']['links'][] = $last;
					}
				}
				if ( isset( $_POST['wdcab']['links'] ) ) {
					$_POST['wdcab']['links'] = array_filter( $_POST['wdcab']['links'] );
				}
				ub_update_option( 'wdcab', $_POST['wdcab'] );
				$changed = true;
			}

			if ( $changed ) {
				$goback = UB_Help::add_query_arg_raw( 'settings-updated', 'true', wp_get_referer() );
				wp_redirect( $goback );
				die;
			}
		}
		$page  = is_multisite() ? 'settings.php' : 'options-general.php';
		$perms = is_multisite() ? 'manage_network_options' : 'manage_options';
		add_submenu_page( $page, __( 'Custom Admin Bar', 'ub' ), __( 'Custom Admin Bar', 'ub' ), $perms, 'wdcab', array(
			$this,
			'create_admin_page'
		) );
	}
예제 #2
0
	function create_admin_menu_entry () {
		if (@$_POST && isset($_POST['option_page']) && 'admin_help_content' == @$_POST['option_page']) {
			if (isset($_POST['admin_help_content'])) {
				$tabs = $_POST['admin_help_content']['tabs'];
				$tabs = is_array($tabs) ? $tabs : array();
				if (trim(@$_POST['admin_help_content']['new_tab']['title']) && trim(@$_POST['admin_help_content']['new_tab']['content'])) {
					$tabs[] = $_POST['admin_help_content']['new_tab'];
					unset($_POST['admin_help_content']['new_tab']);
				}
				foreach ($tabs as $key=>$tab) {
					$tabs[$key]['title'] = strip_tags(stripslashes($tab['title']));
					$tabs[$key]['content'] = stripslashes($tab['content']);
				}
				$_POST['admin_help_content']['tabs'] = $tabs;
				$_POST['admin_help_content']['sidebar'] = stripslashes($_POST['admin_help_content']['sidebar']);
				$this->_set_options($_POST['admin_help_content']);
			}
			$goback = UB_Help::add_query_arg_raw('settings-updated', 'true',  wp_get_referer());
			wp_redirect($goback);
			die;
		}

	}
예제 #3
0
        function handle_ultimate_color_schemes_panel() {

            global $action, $page;

            $messages = array();
            $messages[1] = __('Changes saved.', 'ub');
            $messages[2] = __('There was an error, please try again.', 'ub');

            $messages = apply_filters('ultimatebranding_settings_menu_css_messages', $messages);
            ?>
            <div class="icon32" id="icon-index"><br></div>
            <h2><?php _e('Ultimate Color Schemes', 'ub'); ?>
            </h2>

            <?php
            if (isset($_GET['msg'])) {
                echo '<div id="message" class="updated fade"><p>' . $messages[(int) $_GET['msg']] . '</p></div>';
                $_SERVER['REQUEST_URI'] = UB_Help::remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
            }
            ?>
            <div id="poststuff" class="metabox-holder m-settings">
                <form action='' method="post" enctype="multipart/form-data">

                    <input type='hidden' name='page' value='<?php echo $page; ?>' />
                    <input type='hidden' name='action' value='process' />
                    <?php
                    wp_nonce_field('ultimatebranding_settings_menu_ultimate_color_schemes');

                    do_action('ultimatebranding_settings_menu_ultimate_color_schemes');
                    ?>

                    <?php
                    if (has_filter('ultimatebranding_settings_menu_ultimate_color_schemes_process')) {
                        ?>
                        <p class="submit">
                            <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes', 'ub'); ?>" />
                        </p>
                        <?php
                    }
                    ?>

                </form>
            </div>
            <?php
        }