| [613] | 1 | <?php | 
|---|
| [641] | 2 | /** Tell WordPress to run xpress_setup() when the 'after_setup_theme' hook is run. */ | 
|---|
|  | 3 | add_action( 'after_setup_theme', 'xpress_setup' ); | 
|---|
|  | 4 | if ( ! function_exists( 'xpress_setup' ) ): | 
|---|
|  | 5 | function xpress_setup() { | 
|---|
|  | 6 | // This theme uses post thumbnails | 
|---|
|  | 7 | add_theme_support( 'post-thumbnails' ); | 
|---|
|  | 8 | // Add default posts and comments RSS feed links to head | 
|---|
|  | 9 | add_theme_support( 'automatic-feed-links' ); | 
|---|
|  | 10 |  | 
|---|
|  | 11 | // Make theme available for translation | 
|---|
|  | 12 | // Translations can be filed in the /languages/ directory | 
|---|
|  | 13 | load_theme_textdomain( 'xpress', TEMPLATEPATH . '/languages' ); | 
|---|
|  | 14 |  | 
|---|
|  | 15 | $locale = get_locale(); | 
|---|
|  | 16 | $locale_file = TEMPLATEPATH . "/languages/$locale.php"; | 
|---|
|  | 17 | if ( is_readable( $locale_file ) ) | 
|---|
|  | 18 | require_once( $locale_file ); | 
|---|
|  | 19 |  | 
|---|
|  | 20 | // This theme uses wp_nav_menu() | 
|---|
|  | 21 | if ( function_exists('add_theme_support') )add_theme_support( 'nav-menus' ); | 
|---|
|  | 22 | // This theme uses wp_nav_menu() in one location. | 
|---|
|  | 23 | if ( function_exists('register_nav_menus') ){ | 
|---|
|  | 24 | register_nav_menus( array( | 
|---|
|  | 25 | 'primary' => __('Primary Navigation','xpress'), | 
|---|
|  | 26 | ) ); | 
|---|
|  | 27 | } | 
|---|
| [620] | 28 |  | 
|---|
| [641] | 29 | } | 
|---|
|  | 30 | endif; | 
|---|
|  | 31 |  | 
|---|
| [613] | 32 | if ( function_exists('register_sidebar') ) | 
|---|
|  | 33 | register_sidebar(array( | 
|---|
|  | 34 | 'before_widget' => '<li id="%1$s" class="widget %2$s">', | 
|---|
|  | 35 | 'after_widget' => '</li>', | 
|---|
|  | 36 | 'before_title' => '<h2 class="widgettitle">', | 
|---|
|  | 37 | 'after_title' => '</h2>', | 
|---|
|  | 38 | )); | 
|---|
|  | 39 |  | 
|---|
|  | 40 |  | 
|---|
|  | 41 | function xpress_head() { | 
|---|
|  | 42 | $head = "<style type='text/css'>\n<!--"; | 
|---|
|  | 43 | $output = ''; | 
|---|
|  | 44 | if ( xpress_header_image() ) { | 
|---|
|  | 45 | $url =  xpress_header_image_url() ; | 
|---|
|  | 46 | $output .= "#xpress_header { background: url('$url') repeat-x bottom left; }\n"; | 
|---|
|  | 47 | } | 
|---|
|  | 48 | if ( false !== ( $color = xpress_header_color() ) ) { | 
|---|
|  | 49 | $output .= "#xpress-header-bar-top a, #xpress-header-bar-top a:visited, #xpress-header-bar-top .xpress-description ,#xpress-header-bar-top .xpress-conditional-title,#access a, #xpress-menu a{ color: $color; }\n"; | 
|---|
|  | 50 | } | 
|---|
|  | 51 | if ( false !== ( $display = xpress_header_display() ) ) { | 
|---|
|  | 52 | $output .= "#headerimg { display: $display }\n"; | 
|---|
|  | 53 | } | 
|---|
|  | 54 | $foot = "--></style>\n"; | 
|---|
|  | 55 | if ( '' != $output ) | 
|---|
|  | 56 | echo $head . $output . $foot; | 
|---|
|  | 57 | } | 
|---|
|  | 58 |  | 
|---|
|  | 59 | add_action('wp_head', 'xpress_head'); | 
|---|
|  | 60 |  | 
|---|
|  | 61 | function xpress_header_image() { | 
|---|
|  | 62 | return apply_filters('xpress_header_image', get_option('xpress_header_image')); | 
|---|
|  | 63 | } | 
|---|
|  | 64 |  | 
|---|
|  | 65 | function xpress_upper_color() { | 
|---|
|  | 66 | if (strpos($url = xpress_header_image_url(), 'header-img.php?') !== false) { | 
|---|
|  | 67 | parse_str(substr($url, strpos($url, '?') + 1), $q); | 
|---|
|  | 68 | return $q['upper']; | 
|---|
|  | 69 | } else | 
|---|
|  | 70 | return 'ffffff'; | 
|---|
|  | 71 | } | 
|---|
|  | 72 |  | 
|---|
|  | 73 | function xpress_lower_color() { | 
|---|
|  | 74 | if (strpos($url = xpress_header_image_url(), 'header-img.php?') !== false) { | 
|---|
|  | 75 | parse_str(substr($url, strpos($url, '?') + 1), $q); | 
|---|
|  | 76 | return $q['lower']; | 
|---|
|  | 77 | } else | 
|---|
|  | 78 | return 'ffffff'; | 
|---|
|  | 79 | } | 
|---|
|  | 80 |  | 
|---|
|  | 81 | function xpress_header_image_url() { | 
|---|
|  | 82 | if ( $image = xpress_header_image() ) | 
|---|
|  | 83 | $url = get_template_directory_uri() . '/images/' . $image; | 
|---|
|  | 84 | else | 
|---|
|  | 85 | $url = get_template_directory_uri() . '/images/xpressheader.jpg'; | 
|---|
|  | 86 |  | 
|---|
|  | 87 | return $url; | 
|---|
|  | 88 | } | 
|---|
|  | 89 |  | 
|---|
|  | 90 | function xpress_header_color() { | 
|---|
|  | 91 | return apply_filters('xpress_header_color', get_option('xpress_header_color')); | 
|---|
|  | 92 | } | 
|---|
|  | 93 |  | 
|---|
|  | 94 | function xpress_header_color_string() { | 
|---|
|  | 95 | $color = xpress_header_color(); | 
|---|
|  | 96 | if ( false === $color ) | 
|---|
|  | 97 | return 'black'; | 
|---|
|  | 98 |  | 
|---|
|  | 99 | return $color; | 
|---|
|  | 100 | } | 
|---|
|  | 101 |  | 
|---|
|  | 102 | function xpress_header_display() { | 
|---|
|  | 103 | return apply_filters('xpress_header_display', get_option('xpress_header_display')); | 
|---|
|  | 104 | } | 
|---|
|  | 105 |  | 
|---|
|  | 106 | function xpress_header_display_string() { | 
|---|
|  | 107 | $display = xpress_header_display(); | 
|---|
|  | 108 | return $display ? $display : 'inline'; | 
|---|
|  | 109 | } | 
|---|
|  | 110 |  | 
|---|
|  | 111 | add_action('admin_menu', 'xpress_add_theme_page'); | 
|---|
|  | 112 |  | 
|---|
|  | 113 | function xpress_add_theme_page() { | 
|---|
|  | 114 | if ( isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) { | 
|---|
|  | 115 | if ( isset( $_REQUEST['action'] ) && 'save' == $_REQUEST['action'] ) { | 
|---|
|  | 116 | check_admin_referer('xpress-header'); | 
|---|
|  | 117 | if ( isset($_REQUEST['njform']) ) { | 
|---|
|  | 118 | if ( isset($_REQUEST['defaults']) ) { | 
|---|
|  | 119 | delete_option('xpress_header_image'); | 
|---|
|  | 120 | delete_option('xpress_header_color'); | 
|---|
|  | 121 | delete_option('xpress_header_display'); | 
|---|
|  | 122 | } else { | 
|---|
|  | 123 | if ( '' == $_REQUEST['njfontcolor'] ) | 
|---|
|  | 124 | delete_option('xpress_header_color'); | 
|---|
|  | 125 | else { | 
|---|
|  | 126 | $fontcolor = preg_replace('/^.*(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['njfontcolor']); | 
|---|
|  | 127 | update_option('xpress_header_color', $fontcolor); | 
|---|
|  | 128 | } | 
|---|
|  | 129 | if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) { | 
|---|
|  | 130 | $uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0]; | 
|---|
|  | 131 | $lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0]; | 
|---|
|  | 132 | update_option('xpress_header_image', "header-img.php?upper=$uc&lower=$lc"); | 
|---|
|  | 133 | } | 
|---|
|  | 134 |  | 
|---|
|  | 135 | if ( isset($_REQUEST['toggledisplay']) ) { | 
|---|
|  | 136 | if ( false === get_option('xpress_header_display') ) | 
|---|
|  | 137 | update_option('xpress_header_display', 'none'); | 
|---|
|  | 138 | else | 
|---|
|  | 139 | delete_option('xpress_header_display'); | 
|---|
|  | 140 | } | 
|---|
|  | 141 | } | 
|---|
|  | 142 | } else { | 
|---|
|  | 143 |  | 
|---|
|  | 144 | if ( isset($_REQUEST['headerimage']) ) { | 
|---|
|  | 145 | check_admin_referer('xpress-header'); | 
|---|
|  | 146 | if ( '' == $_REQUEST['headerimage'] ) | 
|---|
|  | 147 | delete_option('xpress_header_image'); | 
|---|
|  | 148 | else { | 
|---|
|  | 149 | $headerimage = preg_replace('/^.*?(header-img.php\?upper=[0-9a-fA-F]{6}&lower=[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['headerimage']); | 
|---|
|  | 150 | update_option('xpress_header_image', $headerimage); | 
|---|
|  | 151 | } | 
|---|
|  | 152 | } | 
|---|
|  | 153 |  | 
|---|
|  | 154 | if ( isset($_REQUEST['fontcolor']) ) { | 
|---|
|  | 155 | check_admin_referer('xpress-header'); | 
|---|
|  | 156 | if ( '' == $_REQUEST['fontcolor'] ) | 
|---|
|  | 157 | delete_option('xpress_header_color'); | 
|---|
|  | 158 | else { | 
|---|
|  | 159 | $fontcolor = preg_replace('/^.*?(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['fontcolor']); | 
|---|
|  | 160 | update_option('xpress_header_color', $fontcolor); | 
|---|
|  | 161 | } | 
|---|
|  | 162 | } | 
|---|
|  | 163 |  | 
|---|
|  | 164 | if ( isset($_REQUEST['fontdisplay']) ) { | 
|---|
|  | 165 | check_admin_referer('xpress-header'); | 
|---|
|  | 166 | if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] ) | 
|---|
|  | 167 | delete_option('xpress_header_display'); | 
|---|
|  | 168 | else | 
|---|
|  | 169 | update_option('xpress_header_display', 'none'); | 
|---|
|  | 170 | } | 
|---|
|  | 171 | } | 
|---|
| [641] | 172 |  | 
|---|
|  | 173 |  | 
|---|
| [613] | 174 | //print_r($_REQUEST); | 
|---|
|  | 175 | wp_redirect("themes.php?page=functions.php&saved=true"); | 
|---|
|  | 176 | die; | 
|---|
|  | 177 | } | 
|---|
|  | 178 | add_action('admin_head', 'xpress_theme_page_head'); | 
|---|
| [641] | 179 |  | 
|---|
|  | 180 | if ( isset( $_REQUEST['action'] ) && 'update_footer' == $_REQUEST['action'] ) { | 
|---|
|  | 181 | check_admin_referer('xpress-footer'); | 
|---|
|  | 182 | if ( isset($_REQUEST['xpress_footer_sidebars_count']) ) { | 
|---|
|  | 183 | check_admin_referer('xpress-footer'); | 
|---|
|  | 184 | if ( '' == $_REQUEST['xpress_footer_sidebars_count'] || '0' == $_REQUEST['xpress_footer_sidebars_count'] ){ | 
|---|
|  | 185 | delete_option('xpress_footer_sidebars_count'); | 
|---|
|  | 186 | } else { | 
|---|
|  | 187 | update_option('xpress_footer_sidebars_count',  $_REQUEST['xpress_footer_sidebars_count']); | 
|---|
|  | 188 | } | 
|---|
|  | 189 | } | 
|---|
|  | 190 |  | 
|---|
|  | 191 | //print_r($_REQUEST); | 
|---|
|  | 192 | wp_redirect("themes.php?page=functions.php&footer_saved=true"); | 
|---|
|  | 193 | die; | 
|---|
|  | 194 | } | 
|---|
| [613] | 195 | } | 
|---|
| [641] | 196 | add_theme_page(__('Header & Footer', 'xpress'), __('Header & Footer', 'xpress'), 'edit_themes', basename(__FILE__), 'xpress_theme_header_page'); | 
|---|
| [613] | 197 | } | 
|---|
|  | 198 |  | 
|---|
| [641] | 199 |  | 
|---|
| [613] | 200 | function xpress_theme_page_head() { | 
|---|
|  | 201 | ?> | 
|---|
|  | 202 | <script type="text/javascript" src="../wp-includes/js/colorpicker.js"></script> | 
|---|
|  | 203 | <script type='text/javascript'> | 
|---|
|  | 204 | // <![CDATA[ | 
|---|
|  | 205 | function pickColor(color) { | 
|---|
|  | 206 | ColorPicker_targetInput.value = color; | 
|---|
|  | 207 | kUpdate(ColorPicker_targetInput.id); | 
|---|
|  | 208 | } | 
|---|
|  | 209 | function PopupWindow_populate(contents) { | 
|---|
|  | 210 | contents += '<br /><p style="text-align:center;margin-top:0px;"><input type="button" class="button-secondary" value="<?php echo attribute_escape(__('Close Color Picker', 'xpress')); ?>" onclick="cp.hidePopup(\'prettyplease\')"></input></p>'; | 
|---|
|  | 211 | this.contents = contents; | 
|---|
|  | 212 | this.populated = false; | 
|---|
|  | 213 | } | 
|---|
|  | 214 | function PopupWindow_hidePopup(magicword) { | 
|---|
|  | 215 | if ( magicword != 'prettyplease' ) | 
|---|
|  | 216 | return false; | 
|---|
|  | 217 | if (this.divName != null) { | 
|---|
|  | 218 | if (this.use_gebi) { | 
|---|
|  | 219 | document.getElementById(this.divName).style.visibility = "hidden"; | 
|---|
|  | 220 | } | 
|---|
|  | 221 | else if (this.use_css) { | 
|---|
|  | 222 | document.all[this.divName].style.visibility = "hidden"; | 
|---|
|  | 223 | } | 
|---|
|  | 224 | else if (this.use_layers) { | 
|---|
|  | 225 | document.layers[this.divName].visibility = "hidden"; | 
|---|
|  | 226 | } | 
|---|
|  | 227 | } | 
|---|
|  | 228 | else { | 
|---|
|  | 229 | if (this.popupWindow && !this.popupWindow.closed) { | 
|---|
|  | 230 | this.popupWindow.close(); | 
|---|
|  | 231 | this.popupWindow = null; | 
|---|
|  | 232 | } | 
|---|
|  | 233 | } | 
|---|
|  | 234 | return false; | 
|---|
|  | 235 | } | 
|---|
|  | 236 | function colorSelect(t,p) { | 
|---|
|  | 237 | if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" ) | 
|---|
|  | 238 | cp.hidePopup('prettyplease'); | 
|---|
|  | 239 | else { | 
|---|
|  | 240 | cp.p = p; | 
|---|
|  | 241 | cp.select(t,p); | 
|---|
|  | 242 | } | 
|---|
|  | 243 | } | 
|---|
|  | 244 | function PopupWindow_setSize(width,height) { | 
|---|
|  | 245 | this.width = 162; | 
|---|
|  | 246 | this.height = 210; | 
|---|
|  | 247 | } | 
|---|
|  | 248 |  | 
|---|
|  | 249 | var cp = new ColorPicker(); | 
|---|
|  | 250 | function advUpdate(val, obj) { | 
|---|
|  | 251 | document.getElementById(obj).value = val; | 
|---|
|  | 252 | kUpdate(obj); | 
|---|
|  | 253 | } | 
|---|
|  | 254 | function kUpdate(oid) { | 
|---|
|  | 255 | if ( 'uppercolor' == oid || 'lowercolor' == oid ) { | 
|---|
|  | 256 | uc = document.getElementById('uppercolor').value.replace('#', ''); | 
|---|
|  | 257 | lc = document.getElementById('lowercolor').value.replace('#', ''); | 
|---|
|  | 258 | hi = document.getElementById('headerimage'); | 
|---|
|  | 259 | hi.value = 'header-img.php?upper='+uc+'&lower='+lc; | 
|---|
|  | 260 | document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/'+hi.value+'") center no-repeat'; | 
|---|
|  | 261 | document.getElementById('advuppercolor').value = '#'+uc; | 
|---|
|  | 262 | document.getElementById('advlowercolor').value = '#'+lc; | 
|---|
|  | 263 | } | 
|---|
|  | 264 | if ( 'fontcolor' == oid ) { | 
|---|
|  | 265 | document.getElementById('header').style.color = document.getElementById('fontcolor').value; | 
|---|
|  | 266 | document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value; | 
|---|
|  | 267 | } | 
|---|
|  | 268 | if ( 'fontdisplay' == oid ) { | 
|---|
|  | 269 | document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value; | 
|---|
|  | 270 | } | 
|---|
|  | 271 | } | 
|---|
|  | 272 | function toggleDisplay() { | 
|---|
|  | 273 | td = document.getElementById('fontdisplay'); | 
|---|
|  | 274 | td.value = ( td.value == 'none' ) ? 'inline' : 'none'; | 
|---|
|  | 275 | kUpdate('fontdisplay'); | 
|---|
|  | 276 | } | 
|---|
|  | 277 | function toggleAdvanced() { | 
|---|
|  | 278 | a = document.getElementById('jsAdvanced'); | 
|---|
|  | 279 | if ( a.style.display == 'none' ) | 
|---|
|  | 280 | a.style.display = 'block'; | 
|---|
|  | 281 | else | 
|---|
|  | 282 | a.style.display = 'none'; | 
|---|
|  | 283 | } | 
|---|
|  | 284 | function kDefaults() { | 
|---|
|  | 285 | document.getElementById('headerimage').value = ''; | 
|---|
|  | 286 | document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#69aee7'; | 
|---|
|  | 287 | document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#4180b6'; | 
|---|
|  | 288 | document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/xpressheader.jpg") center no-repeat'; | 
|---|
|  | 289 | document.getElementById('header').style.color = '#FFFFFF'; | 
|---|
|  | 290 | document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = ''; | 
|---|
|  | 291 | document.getElementById('fontdisplay').value = 'inline'; | 
|---|
|  | 292 | document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value; | 
|---|
|  | 293 | } | 
|---|
|  | 294 | function kRevert() { | 
|---|
|  | 295 | document.getElementById('headerimage').value = '<?php echo js_escape(xpress_header_image()); ?>'; | 
|---|
|  | 296 | document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo js_escape(xpress_upper_color()); ?>'; | 
|---|
|  | 297 | document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo js_escape(xpress_lower_color()); ?>'; | 
|---|
|  | 298 | document.getElementById('header').style.background = 'url("<?php echo js_escape(xpress_header_image_url()); ?>") center no-repeat'; | 
|---|
|  | 299 | document.getElementById('header').style.color = ''; | 
|---|
|  | 300 | document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo js_escape(xpress_header_color_string()); ?>'; | 
|---|
|  | 301 | document.getElementById('fontdisplay').value = '<?php echo js_escape(xpress_header_display_string()); ?>'; | 
|---|
|  | 302 | document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value; | 
|---|
|  | 303 | } | 
|---|
|  | 304 | function kInit() { | 
|---|
|  | 305 | document.getElementById('jsForm').style.display = 'block'; | 
|---|
|  | 306 | document.getElementById('nonJsForm').style.display = 'none'; | 
|---|
|  | 307 | } | 
|---|
|  | 308 | addLoadEvent(kInit); | 
|---|
|  | 309 | // ]]> | 
|---|
|  | 310 | </script> | 
|---|
|  | 311 | <style type='text/css'> | 
|---|
|  | 312 | #headwrap { | 
|---|
|  | 313 | text-align: center; | 
|---|
|  | 314 | } | 
|---|
|  | 315 | #xpress-header { | 
|---|
|  | 316 | font-size: 80%; | 
|---|
|  | 317 | } | 
|---|
|  | 318 | #xpress-header .hibrowser { | 
|---|
|  | 319 | width: 780px; | 
|---|
|  | 320 | height: 260px; | 
|---|
|  | 321 | overflow: scroll; | 
|---|
|  | 322 | } | 
|---|
|  | 323 | #xpress-header #hitarget { | 
|---|
|  | 324 | display: none; | 
|---|
|  | 325 | } | 
|---|
|  | 326 | #xpress-header #header h1 { | 
|---|
|  | 327 | font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; | 
|---|
|  | 328 | font-weight: bold; | 
|---|
|  | 329 | font-size: 2em; | 
|---|
|  | 330 | text-align: center; | 
|---|
|  | 331 | padding-top: 70px; | 
|---|
|  | 332 | margin: 0; | 
|---|
|  | 333 | } | 
|---|
|  | 334 |  | 
|---|
|  | 335 | #xpress-header #header .description { | 
|---|
|  | 336 | font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; | 
|---|
|  | 337 | font-size: 1.2em; | 
|---|
|  | 338 | text-align: center; | 
|---|
|  | 339 | } | 
|---|
|  | 340 | #xpress-header #header { | 
|---|
|  | 341 | text-decoration: none; | 
|---|
|  | 342 | color: <?php echo xpress_header_color_string(); ?>; | 
|---|
|  | 343 | padding: 0; | 
|---|
|  | 344 | margin: 0; | 
|---|
|  | 345 | height: 200px; | 
|---|
|  | 346 | text-align: center; | 
|---|
|  | 347 | background: url('<?php echo xpress_header_image_url(); ?>') center no-repeat; | 
|---|
|  | 348 | } | 
|---|
|  | 349 | #xpress-header #headerimg { | 
|---|
|  | 350 | margin: 0; | 
|---|
|  | 351 | height: 200px; | 
|---|
|  | 352 | width: 100%; | 
|---|
|  | 353 | display: <?php echo xpress_header_display_string(); ?>; | 
|---|
|  | 354 | } | 
|---|
|  | 355 | #jsForm { | 
|---|
|  | 356 | display: none; | 
|---|
|  | 357 | text-align: center; | 
|---|
|  | 358 | } | 
|---|
|  | 359 | #jsForm input.submit, #jsForm input.button, #jsAdvanced input.button { | 
|---|
|  | 360 | padding: 0px; | 
|---|
|  | 361 | margin: 0px; | 
|---|
|  | 362 | } | 
|---|
|  | 363 | #advanced { | 
|---|
|  | 364 | text-align: center; | 
|---|
|  | 365 | width: 620px; | 
|---|
|  | 366 | } | 
|---|
|  | 367 | html>body #advanced { | 
|---|
|  | 368 | text-align: center; | 
|---|
|  | 369 | position: relative; | 
|---|
|  | 370 | left: 50%; | 
|---|
|  | 371 | margin-left: -380px; | 
|---|
|  | 372 | } | 
|---|
|  | 373 | #jsAdvanced { | 
|---|
|  | 374 | text-align: right; | 
|---|
|  | 375 | } | 
|---|
|  | 376 | #nonJsForm { | 
|---|
|  | 377 | position: relative; | 
|---|
|  | 378 | text-align: left; | 
|---|
|  | 379 | margin-left: -370px; | 
|---|
|  | 380 | left: 50%; | 
|---|
|  | 381 | } | 
|---|
|  | 382 | #nonJsForm label { | 
|---|
|  | 383 | padding-top: 6px; | 
|---|
|  | 384 | padding-right: 5px; | 
|---|
|  | 385 | float: left; | 
|---|
|  | 386 | width: 100px; | 
|---|
|  | 387 | text-align: right; | 
|---|
|  | 388 | } | 
|---|
|  | 389 | .defbutton { | 
|---|
|  | 390 | font-weight: bold; | 
|---|
|  | 391 | } | 
|---|
|  | 392 | .zerosize { | 
|---|
|  | 393 | width: 0px; | 
|---|
|  | 394 | height: 0px; | 
|---|
|  | 395 | overflow: hidden; | 
|---|
|  | 396 | } | 
|---|
|  | 397 | #colorPickerDiv a, #colorPickerDiv a:hover { | 
|---|
|  | 398 | padding: 1px; | 
|---|
|  | 399 | text-decoration: none; | 
|---|
|  | 400 | border-bottom: 0px; | 
|---|
|  | 401 | } | 
|---|
| [641] | 402 | #footer_submit { | 
|---|
|  | 403 | margin-top: 20px; | 
|---|
|  | 404 | text-align: center; | 
|---|
|  | 405 | } | 
|---|
|  | 406 | #footer_form{ | 
|---|
|  | 407 | padding-left: 40px; | 
|---|
|  | 408 | } | 
|---|
|  | 409 |  | 
|---|
| [613] | 410 | </style> | 
|---|
|  | 411 | <?php | 
|---|
|  | 412 | } | 
|---|
|  | 413 |  | 
|---|
| [641] | 414 | function xpress_theme_header_page() { | 
|---|
|  | 415 | if ( isset( $_REQUEST['saved'] ) ) echo '<div id="message" class="updated fade"><p><strong>'.__('Header Options saved.', 'xpress').'</strong></p></div>'; | 
|---|
|  | 416 | if ( isset( $_REQUEST['footer_saved'] ) ) echo '<div id="message" class="updated fade"><p><strong>'.__('Footer Options saved.', 'xpress').'</strong></p></div>'; | 
|---|
| [613] | 417 | ?> | 
|---|
|  | 418 | <div class='wrap'> | 
|---|
|  | 419 | <div id="xpress-header"> | 
|---|
|  | 420 | <h2><?php _e('Header Image and Color', 'xpress'); ?></h2> | 
|---|
|  | 421 | <div id="headwrap"> | 
|---|
|  | 422 | <div id="header"> | 
|---|
|  | 423 | <div id="headerimg"> | 
|---|
|  | 424 | <h1><?php bloginfo('name'); ?></h1> | 
|---|
|  | 425 | <div class="description"><?php bloginfo('description'); ?></div> | 
|---|
|  | 426 | </div> | 
|---|
|  | 427 | </div> | 
|---|
|  | 428 | </div> | 
|---|
|  | 429 | <br /> | 
|---|
|  | 430 | <div id="nonJsForm"> | 
|---|
|  | 431 | <form method="post" action=""> | 
|---|
|  | 432 | <?php wp_nonce_field('xpress-header'); ?> | 
|---|
|  | 433 | <div class="zerosize"><input type="submit" name="defaultsubmit" value="<?php echo attribute_escape(__('Save', 'xpress')); ?>" /></div> | 
|---|
|  | 434 | <label for="njfontcolor"><?php _e('Font Color:', 'xpress'); ?></label><input type="text" name="njfontcolor" id="njfontcolor" value="<?php echo attribute_escape(xpress_header_color()); ?>" /> <?php printf(__('Any CSS color (%s or %s or %s)', 'xpress'), '<code>red</code>', '<code>#FF0000</code>', '<code>rgb(255, 0, 0)</code>'); ?><br /> | 
|---|
|  | 435 | <label for="njuppercolor"><?php _e('Upper Color:', 'xpress'); ?></label><input type="text" name="njuppercolor" id="njuppercolor" value="#<?php echo attribute_escape(xpress_upper_color()); ?>" /> <?php printf(__('HEX only (%s or %s)', 'xpress'), '<code>#FF0000</code>', '<code>#F00</code>'); ?><br /> | 
|---|
|  | 436 | <label for="njlowercolor"><?php _e('Lower Color:', 'xpress'); ?></label><input type="text" name="njlowercolor" id="njlowercolor" value="#<?php echo attribute_escape(xpress_lower_color()); ?>" /> <?php printf(__('HEX only (%s or %s)', 'xpress'), '<code>#FF0000</code>', '<code>#F00</code>'); ?><br /> | 
|---|
|  | 437 | <input type="hidden" name="hi" id="hi" value="<?php echo attribute_escape(xpress_header_image()); ?>" /> | 
|---|
|  | 438 | <input type="submit" name="toggledisplay" id="toggledisplay" value="<?php echo attribute_escape(__('Toggle Text', 'xpress')); ?>" /> | 
|---|
|  | 439 | <input type="submit" name="defaults" value="<?php echo attribute_escape(__('Use Defaults', 'xpress')); ?>" /> | 
|---|
|  | 440 | <input type="submit" class="defbutton" name="submitform" value="  <?php _e('Save', 'xpress'); ?>  " /> | 
|---|
|  | 441 | <input type="hidden" name="action" value="save" /> | 
|---|
|  | 442 | <input type="hidden" name="njform" value="true" /> | 
|---|
|  | 443 | </form> | 
|---|
|  | 444 | </div> | 
|---|
|  | 445 | <div id="jsForm"> | 
|---|
|  | 446 | <form style="display:inline;" method="post" name="hicolor" id="hicolor" action="<?php echo attribute_escape($_SERVER['REQUEST_URI']); ?>"> | 
|---|
|  | 447 | <?php wp_nonce_field('xpress-header'); ?> | 
|---|
|  | 448 | <input type="button" class="button-secondary" onclick="tgt=document.getElementById('fontcolor');colorSelect(tgt,'pick1');return false;" name="pick1" id="pick1" value="<?php echo attribute_escape(__('Font Color', 'xpress')); ?>"></input> | 
|---|
|  | 449 | <input type="button" class="button-secondary" onclick="tgt=document.getElementById('uppercolor');colorSelect(tgt,'pick2');return false;" name="pick2" id="pick2" value="<?php echo attribute_escape(__('Upper Color', 'xpress')); ?>"></input> | 
|---|
|  | 450 | <input type="button" class="button-secondary" onclick="tgt=document.getElementById('lowercolor');colorSelect(tgt,'pick3');return false;" name="pick3" id="pick3" value="<?php echo attribute_escape(__('Lower Color', 'xpress')); ?>"></input> | 
|---|
|  | 451 | <input type="button" class="button-secondary" name="revert" value="<?php echo attribute_escape(__('Revert', 'xpress')); ?>" onclick="kRevert()" /> | 
|---|
|  | 452 | <input type="button" class="button-secondary" value="<?php echo attribute_escape(__('Advanced', 'xpress')); ?>" onclick="toggleAdvanced()" /> | 
|---|
|  | 453 | <input type="hidden" name="action" value="save" /> | 
|---|
|  | 454 | <input type="hidden" name="fontdisplay" id="fontdisplay" value="<?php echo attribute_escape(xpress_header_display()); ?>" /> | 
|---|
|  | 455 | <input type="hidden" name="fontcolor" id="fontcolor" value="<?php echo attribute_escape(xpress_header_color()); ?>" /> | 
|---|
|  | 456 | <input type="hidden" name="uppercolor" id="uppercolor" value="<?php echo attribute_escape(xpress_upper_color()); ?>" /> | 
|---|
|  | 457 | <input type="hidden" name="lowercolor" id="lowercolor" value="<?php echo attribute_escape(xpress_lower_color()); ?>" /> | 
|---|
|  | 458 | <input type="hidden" name="headerimage" id="headerimage" value="<?php echo attribute_escape(xpress_header_image()); ?>" /> | 
|---|
|  | 459 | <p class="submit"><input type="submit" name="submitform" class="defbutton" value="<?php echo attribute_escape(__('Update Header »', 'xpress')); ?>" onclick="cp.hidePopup('prettyplease')" /></p> | 
|---|
|  | 460 | </form> | 
|---|
|  | 461 | <div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;"> </div> | 
|---|
|  | 462 | <div id="advanced"> | 
|---|
|  | 463 | <form id="jsAdvanced" style="display:none;" action=""> | 
|---|
|  | 464 | <?php wp_nonce_field('xpress-header'); ?> | 
|---|
|  | 465 | <label for="advfontcolor"><?php _e('Font Color (CSS):', 'xpress'); ?> </label><input type="text" id="advfontcolor" onchange="advUpdate(this.value, 'fontcolor')" value="<?php echo attribute_escape(xpress_header_color()); ?>" /><br /> | 
|---|
|  | 466 | <label for="advuppercolor"><?php _e('Upper Color (HEX):');?> </label><input type="text" id="advuppercolor" onchange="advUpdate(this.value, 'uppercolor')" value="#<?php echo attribute_escape(xpress_upper_color()); ?>" /><br /> | 
|---|
|  | 467 | <label for="advlowercolor"><?php _e('Lower Color (HEX):'); ?> </label><input type="text" id="advlowercolor" onchange="advUpdate(this.value, 'lowercolor')" value="#<?php echo attribute_escape(xpress_lower_color()); ?>" /><br /> | 
|---|
|  | 468 | <input type="button" class="button-secondary" name="default" value="<?php echo attribute_escape(__('Select Default Colors', 'xpress')); ?>" onclick="kDefaults()" /><br /> | 
|---|
|  | 469 | <input type="button" class="button-secondary" onclick="toggleDisplay();return false;" name="pick" id="pick" value="<?php echo attribute_escape(__('Toggle Text Display', 'xpress')); ?>"></input><br /> | 
|---|
|  | 470 | </form> | 
|---|
|  | 471 | </div> | 
|---|
|  | 472 | </div> | 
|---|
|  | 473 | </div> | 
|---|
| [641] | 474 | <div id="xpress-footer"> | 
|---|
|  | 475 | <h2><?php _e('Footer', 'xpress'); ?></h2> | 
|---|
|  | 476 | <form id="footer_setting" style="display:inline;" method="post" action=""> | 
|---|
|  | 477 | <div id="footer_form"> | 
|---|
|  | 478 | <?php wp_nonce_field('xpress-footer'); ?> | 
|---|
|  | 479 | <?php | 
|---|
|  | 480 | if ( function_exists('register_sidebar') ){ | 
|---|
|  | 481 | echo __('Set number of the sidebar to display in the footer.','xpress'); | 
|---|
|  | 482 | echo '<select name="xpress_footer_sidebars_count">'."\n"; | 
|---|
|  | 483 | $side_bar_num = get_option('xpress_footer_sidebars_count'); | 
|---|
|  | 484 | if (empty($side_bar_num)) $side_bar_num = 0; | 
|---|
|  | 485 | for($i=0;$i<=5;$i++){ | 
|---|
|  | 486 | if ($i== 0) $sel_name = __('none','xpress'); else $sel_name = $i; | 
|---|
|  | 487 | if ($i == $side_bar_num) $selected = ' selected '; else $selected = ''; | 
|---|
|  | 488 | echo "\t\t\t\t<option value=\"{$i}\" label=\"{$i}\" {$selected}>{$sel_name}</option>\n"; | 
|---|
|  | 489 | } | 
|---|
|  | 490 | echo "</select>\n"; | 
|---|
|  | 491 | } | 
|---|
|  | 492 | ?> | 
|---|
|  | 493 | <input type="hidden" name="action" value="update_footer" /> | 
|---|
|  | 494 | </div> | 
|---|
|  | 495 | <div id="footer_submit"> | 
|---|
|  | 496 | <input type="submit" name="footer_submit" id="footer_submit" value="<?php echo attribute_escape(__('Update Footer »', 'xpress')); ?>" /> | 
|---|
|  | 497 | </div> | 
|---|
|  | 498 | </form> | 
|---|
|  | 499 | </div> | 
|---|
|  | 500 |  | 
|---|
| [613] | 501 | </div> | 
|---|
| [641] | 502 | <?php } | 
|---|
|  | 503 |  | 
|---|
|  | 504 | function footer_widgets_init() { | 
|---|
|  | 505 | if (!function_exists('register_sidebar') ) return; | 
|---|
|  | 506 |  | 
|---|
|  | 507 | $side_bar_num = get_option('xpress_footer_sidebars_count'); | 
|---|
|  | 508 | if (empty($side_bar_num)) return; | 
|---|
|  | 509 | for($i=1;$i <= $side_bar_num;$i++){ | 
|---|
|  | 510 | switch($i){ | 
|---|
|  | 511 | case 1: | 
|---|
|  | 512 | $name = __( 'First Footer Widget Area', 'kubrick' ); | 
|---|
|  | 513 | $description = __( 'The first footer widget area', 'kubrick' ); | 
|---|
|  | 514 | break; | 
|---|
|  | 515 | case 2: | 
|---|
|  | 516 | $name = __( 'Second Footer Widget Area', 'kubrick' ); | 
|---|
|  | 517 | $description = __( 'The second footer widget area', 'kubrick' ); | 
|---|
|  | 518 | break; | 
|---|
|  | 519 | case 3: | 
|---|
|  | 520 | $name = __( 'Third Footer Widget Area', 'kubrick' ); | 
|---|
|  | 521 | $description = __( 'The third footer widget area', 'kubrick' ); | 
|---|
|  | 522 | break; | 
|---|
|  | 523 | case 4: | 
|---|
|  | 524 | $name = __( 'Fourth Footer Widget Area', 'kubrick' ); | 
|---|
|  | 525 | $description = __( 'The fourth footer widget area', 'kubrick' ); | 
|---|
|  | 526 | break; | 
|---|
|  | 527 | case 5: | 
|---|
|  | 528 | $name = __( 'Fifth Footer Widget Area', 'kubrick' ); | 
|---|
|  | 529 | $description = __( 'The fifth footer widget area', 'kubrick' ); | 
|---|
|  | 530 | break; | 
|---|
|  | 531 |  | 
|---|
|  | 532 | } | 
|---|
|  | 533 |  | 
|---|
|  | 534 | register_sidebar( array( | 
|---|
|  | 535 | 'name' => $name, | 
|---|
|  | 536 | 'id' => 'footer-widget-area-'.$i, | 
|---|
|  | 537 | 'description' => $description, | 
|---|
|  | 538 | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', | 
|---|
|  | 539 | 'after_widget' => '</li>', | 
|---|
|  | 540 | 'before_title' => '<h3 class="widget-title">', | 
|---|
|  | 541 | 'after_title' => '</h3>', | 
|---|
|  | 542 | ) ); | 
|---|
|  | 543 | } | 
|---|
|  | 544 | } | 
|---|
|  | 545 |  | 
|---|
|  | 546 | add_action( 'widgets_init', 'footer_widgets_init' ); | 
|---|
|  | 547 |  | 
|---|
|  | 548 |  | 
|---|
|  | 549 |  | 
|---|
|  | 550 | ?> | 
|---|