function __construct() { $this->settings = op_page_option('feature_area'); $this->enabled = true; $this->oldFeatures = false; $this->config = new stdClass(); parent::__construct(); //var_dump(op_get_var($this->settings,'type','A')); // here we put all styles that are using old feature areas for backward compatibility $oldFeatures = array(); $which = op_get_var($this->settings, 'type', 'A'); $this->which = $which; if (in_array($which, $oldFeatures)) { op_page_clean_layouts(array()); //op_page_clear_settings(); $this->oldFeatures = true; $this->get_options($which); } else { //op_page_clean_layouts(array()); //op_page_clear_settings(); $this->oldFeatures = false; $this->getOptions($which); } //var_dump($this->options); add_filter('op_page_color_options_selectors', array($this, 'color_scheme_selectors')); add_filter('op_page_color_options', array($this, 'color_scheme_selectors')); add_filter('op_typography_elements', array($this, 'typography')); add_filter('op_typography_output_elements', array($this, 'typography_selectors')); }
function save_step_2() { $op = op_post('op', 'page'); $cur = op_page_option('theme', 'type'); if ($_POST['theme_type'] != $cur && $_POST['theme_type'] != 'membership') { op_page_clear_settings(); op_page_clean_layouts(array()); } if (isset($_POST['theme_type'])) { op_update_page_option('theme', 'type', $_POST['theme_type']); $this->_redirect(); } }
function save_page() { //exit; $this->check_nonce(); $this->init_page(); $GLOBALS['op_feature_area']->save_features(); wp_update_post(array('ID' => OP_PAGEBUILDER_ID, 'post_status' => $_POST['status'])); $layouts = op_post('layouts'); //die(print_r($layouts)); if (!is_array($layouts)) { $layouts = array(); } $usedTypes = array(); foreach ($layouts as $name => $layout) { $usedTypes[] = $name; $this->_save_layout($layout, $name); } /* * We need to delete rows that are obsolete */ op_page_clean_layouts($usedTypes); $op = $_POST['op']; //die(print_r($op));exit; $section = 'functionality'; if (!(op_page_config('disable', $section) === true)) { require_once OP_LIB . 'sections/page/functionality.php'; $object = new OptimizePress_Sections_Functionality(); $data['sections'] = $object->sections(); foreach ($data['sections'] as $name => $section) { if (is_array($section)) { if (isset($section['save_action'])) { call_user_func_array($section['save_action'], array(op_get_var($op, $name, array()))); } if (isset($section['module'])) { $mod_ops = op_get_var($op, $name, array()); $opts = op_get_var($section, 'options', array()); op_mod($section['module'], op_get_var($section, 'module_type', 'blog'))->save_settings($name, $opts, $mod_ops); } } } } op_update_page_option('typography', $this->_save_typography(true)); }