From ea6fb6ed60d80ebebda8ea1be2ed852e3c19dba2 Mon Sep 17 00:00:00 2001
From: lucha <lucha@paranoici.org>
Date: Mon, 9 Jul 2012 15:41:43 +0200
Subject: [PATCH] Updated Zenlite theme 4.6

---
 wp-content/themes/zenlite/color.css           |  2 +-
 wp-content/themes/zenlite/footer.php          |  3 +-
 wp-content/themes/zenlite/format-aside.php    |  2 +-
 wp-content/themes/zenlite/format-chat.php     |  2 +-
 wp-content/themes/zenlite/format-gallery.php  |  2 +-
 wp-content/themes/zenlite/format-image.php    |  4 +-
 wp-content/themes/zenlite/format-link.php     |  2 +-
 wp-content/themes/zenlite/format-quote.php    |  2 +-
 wp-content/themes/zenlite/format-standard.php |  2 +-
 wp-content/themes/zenlite/format-status.php   |  2 +-
 wp-content/themes/zenlite/format-video.php    |  2 +-
 wp-content/themes/zenlite/functions.php       | 49 +++++++++++++------
 wp-content/themes/zenlite/layout.css          | 11 ++++-
 .../themes/zenlite/library/theme-options.php  | 19 +++----
 wp-content/themes/zenlite/style.css           |  4 +-
 15 files changed, 62 insertions(+), 46 deletions(-)

diff --git a/wp-content/themes/zenlite/color.css b/wp-content/themes/zenlite/color.css
index 30074da8f..09c24d877 100644
--- a/wp-content/themes/zenlite/color.css
+++ b/wp-content/themes/zenlite/color.css
@@ -4,7 +4,7 @@ http://quirm.net/
 */
 
 body {
-	color:#606060;
+	color:#fff;
 }
 blockquote {
 	background:url(images/quotes.png) no-repeat left top;
diff --git a/wp-content/themes/zenlite/footer.php b/wp-content/themes/zenlite/footer.php
index 61164dcc1..bf57c58c2 100644
--- a/wp-content/themes/zenlite/footer.php
+++ b/wp-content/themes/zenlite/footer.php
@@ -14,8 +14,7 @@ if( is_active_sidebar( 'widget-footer' ) ) :?></div><?php endif;?>
 <li class="rss"><a href="<?php bloginfo('rss2_url'); ?>" title="RSS Feed"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/rss.png" width="14" height="14" alt="RSS" /></a></li>
 </ul>
 
-<?php $zenlite_data = get_theme_data(get_stylesheet_directory() . '/style.css');?>
-<p class="credits"><?php printf( __('Powered by the %1$s Theme %2$s', 'zenlite'), '<a href="' . $zenlite_data['URI'] . '">' . get_current_theme(), '</a>');?></p>
+<p class="credits"><?php printf( __('Powered by the %1$s Theme', 'zenlite'),  wp_get_theme() );?></p>
 </div>
 
 <!-- end wrapper -->
diff --git a/wp-content/themes/zenlite/format-aside.php b/wp-content/themes/zenlite/format-aside.php
index 691e9bf5e..3491eb3b9 100644
--- a/wp-content/themes/zenlite/format-aside.php
+++ b/wp-content/themes/zenlite/format-aside.php
@@ -1,7 +1,7 @@
 <h2 class="post-title"><?php if( !is_single() ) :?><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array('before' => __('Permalink to ', 'zenlite'), 'after' => '') ); ?>"><?php endif;?><?php the_title();?><?php if( !is_single() ) :?></a><?php endif;?></h2>
 
 <?php if( !is_search() ) :?>
-<ul class="meta">
+<ul class="meta posthead">
 <li><?php edit_post_link(sprintf( __('Edit %1$s', 'zenlite'), get_the_title() ) ); ?></li>
 </ul>
 <?php endif;?>
diff --git a/wp-content/themes/zenlite/format-chat.php b/wp-content/themes/zenlite/format-chat.php
index 93f5eb572..71830f42b 100644
--- a/wp-content/themes/zenlite/format-chat.php
+++ b/wp-content/themes/zenlite/format-chat.php
@@ -1,7 +1,7 @@
 <h2 class="post-title"><?php if( !is_single() ) :?><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array('before' => __('Permalink to ', 'zenlite'), 'after' => '') ); ?>"><?php endif;?><?php the_title();?><?php if( !is_single() ) :?></a><?php endif;?></h2>
 
 <?php if( !is_search() ) :?>
-<ul class="meta">
+<ul class="meta posthead">
 <li><?php edit_post_link(sprintf( __('Edit %1$s', 'zenlite'), get_the_title() )
 ); ?></li>
 </ul>
diff --git a/wp-content/themes/zenlite/format-gallery.php b/wp-content/themes/zenlite/format-gallery.php
index 7c633728e..29b8e4eae 100644
--- a/wp-content/themes/zenlite/format-gallery.php
+++ b/wp-content/themes/zenlite/format-gallery.php
@@ -1,7 +1,7 @@
 <h2 class="post-title"><?php if( !is_single() ) :?><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array('before' => __('Permalink to ', 'zenlite'), 'after' => '') ); ?>"><?php endif;?><?php the_title();?><?php if( !is_single() ) :?></a><?php endif;?></h2>
 
 <?php if( !is_search() ) :?>
-<ul class="meta">
+<ul class="meta posthead">
 <li><?php edit_post_link(sprintf( __('Edit %1$s', 'zenlite'), get_the_title() )
 ); ?></li>
 </ul>
diff --git a/wp-content/themes/zenlite/format-image.php b/wp-content/themes/zenlite/format-image.php
index 29c6a64cc..4ab047fb9 100644
--- a/wp-content/themes/zenlite/format-image.php
+++ b/wp-content/themes/zenlite/format-image.php
@@ -1,7 +1,7 @@
 <h2 class="post-title"><?php if( !is_single() ) :?><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array('before' => __('Permalink to ', 'zenlite'), 'after' => '') ); ?>"><?php endif;?><?php the_title();?><?php if( !is_single() ) :?></a><?php endif;?></h2>
 
 <?php if( !is_search() ) :?>
-<ul class="meta">
+<ul class="meta posthead">
 <li><?php edit_post_link(sprintf( __('Edit %1$s', 'zenlite'), get_the_title() )
 ); ?></li>
 </ul>
@@ -15,7 +15,7 @@
 $args = array(
 	'post_type' => 'attachment',
 	'post_mime_type' => 'image',
-	'numberposts' => -1,
+	'posts_per_page' => -1,
 	'post_status' => null,
 	'post_parent' => $post->ID
 	);
diff --git a/wp-content/themes/zenlite/format-link.php b/wp-content/themes/zenlite/format-link.php
index f434316d3..785d238d0 100644
--- a/wp-content/themes/zenlite/format-link.php
+++ b/wp-content/themes/zenlite/format-link.php
@@ -11,7 +11,7 @@ foreach( $link_bits as $bit ) {
 <h2 class="post-title"><a href="<?php echo $link_url;?>" title="<?php _e('External link', 'zenlite');?>"><?php echo $link_text;?></a></h2>
 
 <?php if( !is_search() ) :?>
-<ul class="meta">
+<ul class="meta posthead">
 <li><?php edit_post_link(sprintf( __('Edit %1$s', 'zenlite'), get_the_title() )
 ); ?></li>
 </ul>
diff --git a/wp-content/themes/zenlite/format-quote.php b/wp-content/themes/zenlite/format-quote.php
index 448e98d3b..87cf3c1e4 100644
--- a/wp-content/themes/zenlite/format-quote.php
+++ b/wp-content/themes/zenlite/format-quote.php
@@ -1,7 +1,7 @@
 <h2 class="post-title"><?php if( !is_single() ) :?><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array('before' => __('Permalink to ', 'zenlite'), 'after' => '') ); ?>"><?php endif;?><?php the_title();?><?php if( !is_single() ) :?></a><?php endif;?></h2>
 
 <?php if( !is_search() ) :?>
-<ul class="meta">
+<ul class="meta posthead">
 <li><?php edit_post_link(sprintf( __('Edit %1$s', 'zenlite'), get_the_title() )
 ); ?></li>
 </ul>
diff --git a/wp-content/themes/zenlite/format-standard.php b/wp-content/themes/zenlite/format-standard.php
index cd14c01a3..1da06ea68 100644
--- a/wp-content/themes/zenlite/format-standard.php
+++ b/wp-content/themes/zenlite/format-standard.php
@@ -1,7 +1,7 @@
 <h2 class="post-title"><?php if( !is_single() ) :?><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array('before' => __('Permalink to ', 'zenlite'), 'after' => '') ); ?>"><?php endif;?><?php the_title();?><?php if( !is_single() ) :?></a><?php endif;?></h2>
 
 <?php if( !is_search() ) :?>
-<ul class="meta">
+<ul class="meta posthead">
 <li class="post-date"><?php the_time(get_option('date_format')); ?> <?php the_time(get_option('time_format'));?></li>
 <li><?php edit_post_link(sprintf( __('Edit %1$s', 'zenlite'), get_the_title() ) ); ?></li>
 </ul>
diff --git a/wp-content/themes/zenlite/format-status.php b/wp-content/themes/zenlite/format-status.php
index b6d540253..6d907918c 100644
--- a/wp-content/themes/zenlite/format-status.php
+++ b/wp-content/themes/zenlite/format-status.php
@@ -1,7 +1,7 @@
 <h2 class="post-title"><?php if( !is_single() ) :?><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array('before' => __('Permalink to ', 'zenlite'), 'after' => '') ); ?>"><?php endif;?><?php the_title();?><?php if( !is_single() ) :?></a><?php endif;?></h2>
 
 <?php if( !is_search() ) :?>
-<ul class="meta">
+<ul class="meta posthead">
 <li><?php edit_post_link(sprintf( __('Edit %1$s', 'zenlite'), get_the_title() ) ); ?></li>
 </ul>
 <?php endif;?>
diff --git a/wp-content/themes/zenlite/format-video.php b/wp-content/themes/zenlite/format-video.php
index 4a56a0b82..21751d88e 100644
--- a/wp-content/themes/zenlite/format-video.php
+++ b/wp-content/themes/zenlite/format-video.php
@@ -1,5 +1,5 @@
 <h2 class="post-title"><?php if( !is_single() ) :?><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute( array('before' => __('Permalink to ', 'zenlite'), 'after' => '') ); ?>"><?php endif;?><?php the_title();?><?php if( !is_single() ) :?></a><?php endif;?></h2>
-<ul class="meta">
+<ul class="meta posthead">
 <li><?php edit_post_link(sprintf( __('Edit %1$s', 'zenlite'), get_the_title() )
 ); ?></li>
 </ul>
diff --git a/wp-content/themes/zenlite/functions.php b/wp-content/themes/zenlite/functions.php
index 2f779ebc9..263213082 100644
--- a/wp-content/themes/zenlite/functions.php
+++ b/wp-content/themes/zenlite/functions.php
@@ -4,9 +4,9 @@ if ( ! function_exists( 'zenlite_setup' ) ):
 function zenlite_setup() {
 
 	// Load language files
-	load_theme_textdomain( 'zenlite', TEMPLATEPATH . '/langs' );
+	load_theme_textdomain( 'zenlite', get_template_directory() . '/langs' );
 	$locale = get_locale();
-	$locale_file = TEMPLATEPATH . "/langs/$locale.php";
+	$locale_file = get_template_directory() . "/langs/$locale.php";
 	if ( is_readable( $locale_file ) ) require_once( $locale_file );
 
 	// set content width
@@ -25,23 +25,41 @@ function zenlite_setup() {
 	add_editor_style();
 
 	// Get the post thumbnail dimensions from Settings/Media
-	define('THUMB_WIDTH', get_option('thumbnail_size_w'));
-	define('THUMB_HEIGHT', get_option('thumbnail_size_h'));
-	set_post_thumbnail_size( THUMB_WIDTH, THUMB_HEIGHT ); // box (proportional) resize mode
-
-	// Add support for custom background
-	add_custom_background();
+	set_post_thumbnail_size( get_option('thumbnail_size_w'), get_option('thumbnail_size_h') ); // box (proportional) resize mode
 
 	// Remove inline gallery css
 	add_filter( 'use_default_gallery_style', '__return_false' );
 
-	// Header & Background customisation/
-	define('HEADER_IMAGE_WIDTH', apply_filters( 'zenlite_header_image_width',1000 ) );
-	define('HEADER_IMAGE_HEIGHT', apply_filters( 'zenlite_header_image_height', 150 ) );
-	define('HEADER_IMAGE', get_stylesheet_directory_uri() . '/images/banner.jpg');
-	define('HEADER_TEXTCOLOR', apply_filters( 'zenlite_header_color', '606060' ) );
-	define ('BACKGROUND_COLOR', apply_filters( 'zenlite_background_color', 'fff' ) );
-	define ('BACKGROUND_IMAGE', apply_filters( 'zenlite_background_image', '' ) );
+	// Header & background customisation
+	$zenlite_header = array(
+		'default-text-color' => apply_filters( 'zenlite_header_color', '606060'),
+		'width' => apply_filters( 'zenlite_header_image_width', 1000 ),
+		'height' => apply_filters( 'zenlite_header_image_height', 150 ),
+		'default-image' =>  get_stylesheet_directory_uri() . '/images/banner.jpg',
+		'wp-head-callback' => 'zenlite_custom_header_style',
+		'admin-head-callback' => 'zenlite_admin_header_style',
+		'admin-preview-callback' => '',
+	);
+	add_theme_support( 'custom-header', $zenlite_header );
+
+	$zenlite_background = array(
+		'default-color'  => apply_filters( 'zenlite_background_color', '606060' ),
+		'default-image' => apply_filters( 'zenlite_background_image', '' )
+	);
+	add_theme_support( 'custom-background', $zenlite_background );
+
+	// Temp support for < WP 3.4
+	if ( ! function_exists( 'get_custom_header' ) ) {
+		define('HEADER_IMAGE_WIDTH', $zenlite_header['width'] );
+		define('HEADER_IMAGE_HEIGHT', $zenlite_header['height'] );
+		define('HEADER_IMAGE', $zenlite_header['default_image']);
+		define('HEADER_TEXTCOLOR', $zenlite_header['default-text-color'] );
+		add_custom_image_header( $zenlite_header['wp-head-callback'], $zenlite_header['admin-head-callback'], $zenlite_header['admin-preview-callback'] );
+
+		define ('BACKGROUND_COLOR',$zenlite_background['default-color'] );
+		define ('BACKGROUND_IMAGE', $zenlite_background['default-image'] );
+		add_custom_background();
+	}
 
 	// Load banner selection images into UI
 	register_default_headers( array(
@@ -367,4 +385,3 @@ function zenlite_admin_header_style() {
 <?php
 }
 endif;
-add_custom_image_header('zenlite_custom_header_style', 'zenlite_admin_header_style');
diff --git a/wp-content/themes/zenlite/layout.css b/wp-content/themes/zenlite/layout.css
index 6d3969584..00cc459d5 100644
--- a/wp-content/themes/zenlite/layout.css
+++ b/wp-content/themes/zenlite/layout.css
@@ -275,7 +275,7 @@ ul.jumplinks,.jumplinks {
 	min-height:400px;
 	line-height:1.5em;
 	margin:20px 0 0;
-	padding:0 10px;
+	padding:0 30px;
 	font-size:.9em;
 }
 /* clear all floats */
@@ -322,6 +322,9 @@ ul.jumplinks,.jumplinks {
 .meta ul {
 	display:inline;
 }
+.meta.posthead li {
+	display:inline;
+}
 .meta li li {
 	display:inline;
 	padding-right:.1em;
@@ -345,10 +348,14 @@ ul.jumplinks,.jumplinks {
 }
 div.more-link {
 	font-size:.9em;
+	text-align:right;
+}
+div.more-link .wp-post-image {
+	float:none;
 }
 .post-edit-link {
 	clear:both;
-	display:block;
+	display:inline-block;
 }
 
 /* Post formats */
diff --git a/wp-content/themes/zenlite/library/theme-options.php b/wp-content/themes/zenlite/library/theme-options.php
index 4f1a7239f..8bb26e2ec 100644
--- a/wp-content/themes/zenlite/library/theme-options.php
+++ b/wp-content/themes/zenlite/library/theme-options.php
@@ -30,19 +30,12 @@ function add_zenlite_contextual_help() {
 	) );
 }
 
-// Load theme options stylesheet(s)
-function add_theme_options_style() {
-	wp_register_style('theme_options_style', get_template_directory_uri() . '/library/theme-options.css', '', '', 'screen');
-	if ( file_exists( get_stylesheet_directory() . '/theme-options-custom.css' ) ) {
-		wp_register_style('theme_options_custom_style', get_stylesheet_directory_uri() . '/theme-options-custom.css', '', '', 'screen');
-	}
-}
 function enqueue_theme_options_style() {
-	wp_enqueue_style('theme_options_style');
-	wp_enqueue_style('theme_options_custom_style');
+	wp_enqueue_style('theme_options_style', get_template_directory_uri() . '/library/theme-options.css', '', false, 'screen');
+	if ( file_exists( get_stylesheet_directory() . '/theme-options-custom.css' ) )
+		wp_enqueue_style('theme_options_custom_style', get_stylesheet_directory_uri() . '/theme-options-custom.css', '', false, 'screen');
 }
-add_action('admin_init', 'add_theme_options_style');
-add_action('admin_print_styles', 'enqueue_theme_options_style');
+add_action('admin_print_styles-appearance_page_theme_options', 'enqueue_theme_options_style');
 
 // Create tabs
 function zenlite_option_tabs( $current = 'options' ) {
@@ -64,7 +57,7 @@ function theme_options_do_page() {
 	$updated = false;
 	if ( isset( $_REQUEST['updated'] ) || isset( $_REQUEST['settings-updated'] ) ) $updated = true;?>
 	<div class="wrap">
-	<?php screen_icon(); echo "<h2>" . get_current_theme() . "</h2>"; ?>
+	<?php screen_icon(); echo "<h2>" . wp_get_theme() . "</h2>"; ?>
 	<?php if ( $updated == true ) : ?>
 	<div class="updated fade"><p><strong><?php _e( 'Your theme options have been saved', 'zenlite'); ?></strong></p></div>
 	<?php endif; ?>
@@ -179,7 +172,7 @@ function theme_options_do_radio($radio_options, $stored_options, $name, $default
 			if ( $option['value']  ==  $default ) $checked = 'checked="checked"';
 			else $checked = '';
 		}?>
-		<label class="description" for="<?php echo $name;?>_<?php esc_attr_e( $option['value'] ); ?>"><input type="radio" id="<?php echo $name;?>_<?php esc_attr_e( $option['value'] ); ?>" name="<?php echo 'zenlite';?>_theme_options[<?php echo $name;?>]" value="<?php esc_attr_e( $option['value'] ); ?>" <?php echo $checked; ?> /> <?php echo $option['label']; ?></label>
+		<label class="description" for="<?php echo $name;?>_<?php echo esc_attr( $option['value'] ); ?>"><input type="radio" id="<?php echo $name;?>_<?php echo esc_attr( $option['value'] ); ?>" name="<?php echo 'zenlite';?>_theme_options[<?php echo $name;?>]" value="<?php echo esc_attr( $option['value'] ); ?>" <?php echo $checked; ?> /> <?php echo $option['label']; ?></label>
 		<?php
 	}
 }
diff --git a/wp-content/themes/zenlite/style.css b/wp-content/themes/zenlite/style.css
index cc7fd636e..a525681ae 100644
--- a/wp-content/themes/zenlite/style.css
+++ b/wp-content/themes/zenlite/style.css
@@ -1,11 +1,11 @@
 /*  
 Theme Name:ZenLite
-Version: 4.5
+Version: 4.6
 Theme URI: http://quirm.net/themes/zenlite/
 Description: A minimalistic single column design with a widget-ready horizontal navigation menu for listing Pages, Categories or a custom menu. Includes additional templates for archives, categories, author lists, pages without comments, images, attachments and search results. Thickbox enabled image template. Customisable header and background images. Post format support. Additional theme options. Translation-ready and child-theme friendly. Suitable for WordPress 3.1 and above. Support available at http://forum.quirm.net/
 Author: Mel Pedley
 Author URI: http://blackwidows.co.uk
-Tags: one-column, custom-header, custom-background, custom-menu, light, white, flexible-width, theme-options, translation-ready, threaded-comments, editor-style
+Tags: one-column, custom-header, custom-background, custom-menu, light, white, fixed-width, theme-options, translation-ready, threaded-comments, editor-style
 
 License: GNU General Public License v2
 License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-- 
GitLab