<?php $opt = new OptionsPage(array(wp_option::factory('text', 'twitter_username'))); $opt->title = 'Other options'; $opt->file = basename(__FILE__); $opt->parent = "theme-options.php"; $opt->attach_to_wp();
$colorset2 = new color_scheme('Dark Scheme'); $colorset2->add_colors(array('000000', 'eab035', 'ffffff')); $colorset3 = new color_scheme('Red Scheme'); $colorset3->add_colors(array('350505', '151515', 'ffffff')); $color_scheme = wp_option::factory('choose_color_scheme', 'choco_color_scheme', 'Color Scheme'); $color_scheme->add_color_schemes(array($colorset1, $colorset2, $colorset3)); $color_scheme->set_default_value('Default Scheme'); $bg_image = wp_option::factory('image', 'background_image', 'Background Image'); $bg_repeat = wp_option::factory('select', 'background_repeat', 'Background Repeat'); $bg_repeat->add_options(array('no-repeat' => 'No Repeat', 'repeat-x' => 'Repeat Horizontal(repeat-x)', 'repeat-y' => 'Repeat Vertical(repeat-y)', 'repeat' => 'Repeat Horizontal and Vertical(repeat)')); $bg_repeat->set_default_value('no'); $inner_options = new OptionsPage(array(wp_option::factory('separator', 'theme'), $color_scheme, wp_option::factory('separator', 'background'), $bg_color, $bg_image, $bg_repeat, wp_option::factory('separator', 'scripts'), wp_option::factory('header_scripts', 'header_script'), wp_option::factory('footer_scripts', 'footer_script'))); $inner_options->title = 'General'; $inner_options->file = basename(__FILE__); $inner_options->parent = "theme-options.php"; $inner_options->attach_to_wp(); function print_color_scheme_background_changer_js() { ?> <script type="text/javascript" charset="utf-8"> function rgb_to_hex(r, g, b) { return to_hex(r) + to_hex(g) + to_hex(b); } function to_hex(N) { if (N==null) return "00"; N = parseInt(N); if (N==0 || isNaN(N)) return "00"; N = Math.max(0,N); N = Math.min(N,255);