Exemplo n.º 1
0
/**
 * Format Configuration Array.
 *
 * Get an array of all default values as set in
 * options.php. The 'id','std' and 'type' keys need
 * to be defined in the configuration array. In the
 * event that these keys are not present the option
 * will not be included in this function's output.
 *
 * @return    array     Rey-keyed options configuration array.
 *
 * @access    private
 */
function of_get_default_values()
{
    $output = array();
    $config = optionsframework_options();
    foreach ((array) $config as $option) {
        if (!isset($option['id'])) {
            continue;
        }
        if (!isset($option['std'])) {
            continue;
        }
        if (!isset($option['type'])) {
            continue;
        }
        if (has_filter('of_sanitize_' . $option['type'])) {
            $output[$option['id']] = apply_filters('of_sanitize_' . $option['type'], $option['std'], $option);
        }
    }
    generate_options_css($output);
    //generate static css file
    generate_options_js($output);
    return $output;
}
Exemplo n.º 2
0
 function zn_set_options()
 {
     // THIS IS THE EXPORTED THEME OPTIONS
     $import_code = 'YTo3MDp7czoxMToibWVudV9mb2xsb3ciO3M6MzoieWVzIjtzOjE0OiJwYWdlX3ByZWxvYWRlciI7czoyOiJubyI7czoxNToiaGVhZF9zaG93X2xvZ2luIjtzOjE6IjEiO3M6MTE6ImxvZ29fdXBsb2FkIjtzOjY5OiJodHRwOi8vaG9nYXNoLWRlbW8uY29tL2thbGx5YXNfd3Avd3AtY29udGVudC91cGxvYWRzLzIwMTMvMDEvbG9nby5wbmciO3M6OToibG9nb19zaXplIjtzOjM6InllcyI7czoxNjoibG9nb19tYW51YWxfc2l6ZSI7YToyOntzOjU6IndpZHRoIjtzOjM6IjEyNiI7czo2OiJoZWlnaHQiO3M6MjoiNDIiO31zOjk6ImxvZ29fZm9udCI7YTo0OntzOjQ6InNpemUiO3M6NDoiMzZweCI7czo2OiJoZWlnaHQiO3M6NDoiNDBweCI7czo1OiJzdHlsZSI7czo2OiJub3JtYWwiO3M6NToiY29sb3IiO3M6NDoiIzAwMCI7fXM6NToiZm9udHMiO2E6Nzp7czo5OiJsb2dvX2ZvbnQiO3M6OToiTm92YSBNb25vIjtzOjc6ImgxX3R5cG8iO3M6OToiT3Bl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I7fXM6MTQ6ImNzX3NvY2lhbF9pY29uIjtzOjA6IiI7fX1zOjE2OiI0MDRfaGVhZGVyX3N0eWxlIjtzOjI2OiJwYWdlc18tX2JhY2tncm91bmRfM19zdHlsZSI7czoxMzoid29vX3Nob3dfY2FydCI7czoxOiIxIjtzOjEzOiJ3b29fbmV3X2JhZGdlIjtzOjE6IjEiO3M6MTg6Indvb19uZXdfYmFkZ2VfZGF5cyI7czoxOiIzIjtzOjE5OiJ3b29fYXJjaF9wYWdlX3RpdGxlIjtzOjEyOiJPVVIgUFJPRFVDVFMiO3M6MjI6Indvb19hcmNoX3BhZ2Vfc3VidGl0bGUiO3M6MzY6IlNob3AgY2F0ZWdvcnkgaGVyZSB3aXRoIHByb2R1Y3QgbGlzdCI7czoyNToid29vX2FyY2hfc2lkZWJhcl9wb3NpdGlvbiI7czoxMzoicmlnaHRfc2lkZWJhciI7czoxNjoid29vX2FyY2hfc2lkZWJhciI7czoxNDoiZGVmYXVsdHNpZGViYXIiO3M6Mjc6Indvb19zaW5nbGVfc2lkZWJhcl9wb3NpdGlvbiI7czoxMzoicmlnaHRfc2lkZWJhciI7czoxODoid29vX3NpbmdsZV9zaWRlYmFyIjtzOjE0OiJkZWZhdWx0c2lkZWJhciI7czo3OiJmYWNlX29nIjtzOjE6IjEiO3M6MTA6ImZhY2VfQVBfSUQiO3M6MTU6IjQyNjM5MTAyNDEwNzE4MiI7czo4OiJ6bl9yZXNldCI7czo1OiJyZXNldCI7fQ==';
     $import_code = base64_decode($import_code);
     $import_code = unserialize($import_code);
     // Remove some values
     $import_code['mailchimp_api'] = '';
     $import_code['face_AP_ID'] = '';
     $import_code = array_map('stripslashes_deep', $import_code);
     // FIX IMAGES URL'S AND UPLOAD LOCAL IMAGES
     $import_code = zn_replace_image_links_with_local($import_code);
     update_option('zn_kallyas_options', $import_code);
     generate_options_css($import_code);
     //generate static css file
     generate_options_js($import_code);
     //generate static js file
 }
Exemplo n.º 3
0
function zn_ajax_callback()
{
    $nonce = $_POST['security'];
    if (!wp_verify_nonce($nonce, 'zn_ajax_nonce')) {
        die('-1');
    }
    //get options array from db
    $all = get_option(OPTIONS);
    $save_type = $_POST['type'];
    if ($save_type == 'save') {
        $_POST = array_map('stripslashes_deep', $_POST);
        parse_str($_POST['data'], $data);
        unset($data['security']);
        unset($data['of_save']);
        $args = wp_parse_args($data, $all);
        update_option(OPTIONS, $args);
        generate_options_css($args);
        //generate static css file
        generate_options_js($args);
        //generate static js file
        echo '1';
    } elseif ($save_type == 'zn_restore_options') {
        $saved_backup = get_option($_POST['data']);
        update_option(OPTIONS, $saved_backup);
        generate_options_css($args);
        //generate static css file
        generate_options_js($args);
        //generate static js file
        ob_clean();
        echo '1';
    } elseif ($save_type == 'zn_delete_backup') {
        $saved_backup = delete_option($_POST['data']);
        ob_clean();
        echo '1';
    } elseif ($save_type == 'install_dummy') {
        locate_template(array('admin/dummy_content/zn_importer.php'), true, true);
        installDummy();
    } elseif ($save_type == 'zn_backup_options') {
        $_POST = array_map('stripslashes_deep', $_POST);
        parse_str($_POST['data'], $data);
        unset($data['security']);
        unset($data['of_save']);
        $args = wp_parse_args($data, $all);
        $date = date('Y m d H i s');
        $option_field = THEMENAME . '_backup_from_' . str_replace(' ', '_', $date);
        $option_field = strtolower($option_field);
        add_option($option_field, $args, '', 'no');
        ob_clean();
        echo $option_field;
    } elseif ($save_type == 'add_element') {
        //$what_element = $_POST['data'];
        $html = new zn_html();
        parse_str($_POST['data'], $data);
        // Make a check to see if the element is a subelement
        // All subelements options must be placed in the same array that is passed to zn_get_element_from_id() function in functions-zn-admin.php !!
        $full_id = $data['element_type'];
        if (preg_match('/\\[(\\d+)\\]/', $full_id, $matches)) {
            $split_element_type = preg_split('/\\[(\\d+)\\]/', $full_id);
            $number_of_ids = count($split_element_type) - 1;
            $string = str_replace('[', '', $split_element_type[$number_of_ids]);
            $string = str_replace(']', '', $string);
            $data['element_type'] = $string;
        }
        $option = zn_get_element_from_id($data['element_type']);
        if (isset($option['link'])) {
            $option['is_dynamic'] = true;
        }
        $option['id'] = $full_id;
        if (isset($data['pb_area']) && !empty($data['pb_area'])) {
            $option['pb_area'] = $data['pb_area'];
        }
        echo $html->zn_render_element($option);
        //print_r($option);
        unset($data['security']);
        unset($data['of_save']);
        die(1);
    }
    die;
}