public function themeOptions() { if (is_req('saved')) { echo '<div id="message" class="updated fade"><p><strong>' . __('Options saved.', WPI_META) . '</strong></p></div>'; } ?> <div id="wpi-theme-options" class="wrap cf"> <div class="main"> <h2><?php _e('General Settings', WPI_META); ?> </h2> <form method="post" action=""> <?php wp_nonce_field(wpiFilter::NONCE_THEME_OPTIONS); ?> <?php do_action(wpiFilter::ACTION_THEME_OPTIONS); ?> <input type="hidden" name="action" value="c2F2ZQ" /> </form> </div> <div class="side-panel"> <h2>Help</h2> <ul> <li><a href="http://wp.istalker.net/chrome-milk/quick-start/" title="Quick start guide">Quick start</a></li> <li><a href="http://wp.istalker.net/chrome-milk/features/" title="Features">Features</a></li> <li><a href="http://wp.istalker.net/" title="Project Home">Project Home</a></li> <li><a href="http://blog.kaizeku.com" title="Author Blog">Kaizeku Ban</a></li> </ul> </div> </div> <?php }
/** * Wpi::setThemeOptions() * * @return */ public function setThemeOptions() { if (!class_exists('wpiAdmin')) { self::getFile('admin', 'class'); $this->AdminUI = new wpiAdmin(); $req_page = basename(WPI_DIR . 'functions.php'); $token = wpiFilter::NONCE_THEME_OPTIONS; if (is_get('page') && is_get('page') == $req_page) { if (is_req('action') && 'save' == b64_safe_decode($_REQUEST['action'])) { check_admin_referer($token); $this->AdminUI->filterRequest($_REQUEST); wp_redirect('themes.php?page=' . $req_page . '&saved=true'); die; } add_action('admin_head', array($this->AdminUI, 'printCSS')); wp_enqueue_script(WPI_META . '_admin'); } add_theme_page(__('WPI Theme Options', WPI_META), __('Theme Options', WPI_META), 'edit_themes', $req_page, array($this->AdminUI, 'themeOptions')); } }