display(); } function oc_theme_page_ajax() { check_ajax_referer( 'oc_admin' ); $theme = new OricloneTheme; $theme->display_ajax(); die(); } /*-- The Oriclone Theme Class --*/ /*------------------------------*/ class OricloneTheme extends GenericOptions { function __construct() { $this->parent_key = 'oriclone'; $this->hidden_field_name = 'oc_submit_hidden'; } /*-- View/ Template --*/ function display() { $nonce = wp_create_nonce( 'oc_admin' ); include('tmpl-admin/admin-form.php'); } function display_ajax() { $current_tab = $_POST[ 'oc_tab' ] ? $_POST[ 'oc_tab' ] : 'oc_tab_1'; $isRebuild = $_POST[ $this->hidden_field_name ] == 'CSS'; if ($isRebuild) { include('tmpl-admin/build_css.php'); $saved_options = get_option( $this->parent_key ); $css = new Build_CSS(dirname(__FILE__), $saved_options); $css->build(); } $this->init_options_form_value(); $this->update_options_data(); $isPost = $this->isPost; $options =& $this->options_form; $hidden_field_name = $this->hidden_field_name; include('tmpl-admin/admin-form-ajax.php'); } /*-- Model --*/ protected function init_options_form_value() { include('tmpl-admin/admin-form-data.php'); $this->options_form = oc_form_value(); } public function on_oc_before_update_options() { // fix raw html in textarea $keys = array( 'cpdesc', 'contact-address', 'guest-message', 'home-find-member', 'home-find-group', 'home-find-blog', 'home-read-news' ); foreach ($keys as $key) $this->options_data[$key] = stripslashes($this->options_data[$key]); } }