Changeset 10590
- Timestamp:
- 02/18/2009 09:55:00 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/theme-install.php
r10567 r10590 6 6 * @subpackage Administration 7 7 */ 8 9 $themes_allowedtags = array('a' => array('href' => array(), 'title' => array(), 'target' => array()), 10 'abbr' => array('title' => array()), 'acronym' => array('title' => array()), 11 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(), 12 'div' => array(), 'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(), 13 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(), 14 'img' => array('src' => array(), 'class' => array(), 'alt' => array())); 8 15 9 16 /** … … 258 265 */ 259 266 function display_themes($themes, $page = 1, $totalpages = 1) { 267 global $themes_allowedtags; 268 260 269 $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : ''; 261 270 $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : ''; … … 299 308 $name = wp_kses($theme->name, $themes_allowedtags); 300 309 $desc = wp_kses($theme->description, $themes_allowedtags); 301 if ( strlen($desc) > 30 ) 302 $desc = substr($desc, 0, 30) . '<span class="dots">...</span><span>' . substr($desc, 30) . '</span>'; 303 310 //if ( strlen($desc) > 30 ) 311 // $desc = substr($desc, 0, 30) . '<span class="dots">...</span><span>' . substr($desc, 30) . '</span>'; 312 313 $preview_link = $theme->preview_url . '?TB_iframe=true&width=600&height=400'; 304 314 $action_links = array(); 305 315 $action_links[] = '<a href="' . admin_url('theme-install.php?tab=theme-information&theme=' . $theme->slug . 306 '&TB_iframe=true&width=600&height=800') . '" class="thickbox onclick" title="' . 307 attribute_escape($name) . '">' . __('Install') . '</a>'; 308 $action_links[] = '<a href="' . $theme->preview_url . '&TB_iframe" class="thickbox onclick" title="' . 309 attribute_escape( sprintf(__('Preview %s'), $name) ) . '">' . __('Preview') . '</a>'; 316 '&TB_iframe=true&width=600&height=800') . '" class="button thickbox onclick">' . __('Install') . '</a>'; 317 $action_links[] = '<a href="' . $preview_link . '" class="button thickbox onclick previewlink">' . __('Preview') . '</a>'; 310 318 311 319 $action_links = apply_filters('theme_install_action_links', $action_links, $theme); 312 $actions = implode ( ' |', $action_links );320 $actions = implode ( ' ', $action_links ); 313 321 echo " 314 <div class='theme-item'> 315 <h3>{$theme->name}</h3> 316 <img src='{$theme->screenshot_url}' width='150' /><br /> 322 <div class='theme-item available-theme'> 323 <a class='thickbox screenshot' href='$preview_link'> 324 <img src='{$theme->screenshot_url}' width='150' /> 325 </a> 326 <h3>{$name}</h3> 327 <span class='action-links'>$actions</span> 317 328 <div class='theme-item-info'> 318 329 {$desc} 319 <br class='line' />320 <span class='action-links'>$actions</span>321 330 </div> 322 331 </div>"; … … 358 367 function install_theme_information() { 359 368 //TODO: This function needs a LOT of UI work :) 360 global $tab ;369 global $tab, $themes_allowedtags;; 361 370 362 371 $api = themes_api('theme_information', array('slug' => stripslashes( $_REQUEST['theme'] ) )); … … 365 374 wp_die($api); 366 375 367 $themes_allowedtags = array('a' => array('href' => array(), 'title' => array(), 'target' => array()),368 'abbr' => array('title' => array()), 'acronym' => array('title' => array()),369 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(),370 'div' => array(), 'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(),371 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(),372 'img' => array('src' => array(), 'class' => array(), 'alt' => array()));373 376 //Sanitize HTML 374 377 foreach ( (array)$api->sections as $section_name => $content ) -
trunk/wp-admin/js/theme-preview.dev.js
r10365 r10590 15 15 16 16 return $('a.thickbox').each( function() { 17 var href = $(this). parents('.available-theme').find('.previewlink').attr('href');17 var href = $(this).attr('href'); 18 18 if ( ! href ) return; 19 19 href = href.replace(/&width=[0-9]+/g, ''); … … 27 27 var alink = $(this).parents('.available-theme').find('.activatelink'), url = alink.attr('href'), text = alink.html(); 28 28 29 if ( null == text ) text = ''; 29 30 $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'}); 30 31 $('#TB_closeAjaxWindow').css({'float':'left'}); -
trunk/wp-admin/js/theme-preview.js
r10365 r10590 1 var thickDims;jQuery(document).ready(function(a){thickDims=function(){var d=a("#TB_window"),c=a(window).height(),b=a(window).width();if(d.size()){d.width(b-90).height(c-60);a("#TB_iframeContent").width(b-90).height(c-90);d.css({"margin-left":"-"+parseInt(((b-90)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){d.css({top:"30px","margin-top":"0"})}}return a("a.thickbox").each(function(){var e=a(this). parents(".available-theme").find(".previewlink").attr("href");if(!e){return}e=e.replace(/&width=[0-9]+/g,"");e=e.replace(/&height=[0-9]+/g,"");a(this).attr("href",e+"&width="+(b-110)+"&height="+(c-100))})};thickDims().click(function(){var c=a(this).parents(".available-theme").find(".activatelink"),b=c.attr("href"),d=c.html();a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_closeAjaxWindow").css({"float":"left"});a("#TB_ajaxWindowTitle").css({"float":"right"}).append(' <a href="'+b+'" target="_top" class="tb-theme-preview-link">'+d+"</a>");a("#TB_iframeContent").width("100%");return false});a(window).resize(function(){thickDims()})});function tb_position(){thickDims()};1 var thickDims;jQuery(document).ready(function(a){thickDims=function(){var d=a("#TB_window"),c=a(window).height(),b=a(window).width();if(d.size()){d.width(b-90).height(c-60);a("#TB_iframeContent").width(b-90).height(c-90);d.css({"margin-left":"-"+parseInt(((b-90)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){d.css({top:"30px","margin-top":"0"})}}return a("a.thickbox").each(function(){var e=a(this).attr("href");if(!e){return}e=e.replace(/&width=[0-9]+/g,"");e=e.replace(/&height=[0-9]+/g,"");a(this).attr("href",e+"&width="+(b-110)+"&height="+(c-100))})};thickDims().click(function(){var c=a(this).parents(".available-theme").find(".activatelink"),b=c.attr("href"),d=c.html();if(null==d){d=""}a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_closeAjaxWindow").css({"float":"left"});a("#TB_ajaxWindowTitle").css({"float":"right"}).append(' <a href="'+b+'" target="_top" class="tb-theme-preview-link">'+d+"</a>");a("#TB_iframeContent").width("100%");return false});a(window).resize(function(){thickDims()})});function tb_position(){thickDims()}; -
trunk/wp-admin/theme-install.php
r10567 r10590 23 23 24 24 add_thickbox(); 25 wp_enqueue_script( 'theme-preview' ); 25 26 26 27 //These are the tabs which are shown on the page, -
trunk/wp-admin/themes.php
r10150 r10590 179 179 $activate_text = attribute_escape( sprintf( __('Activate "%s"'), $title ) ); 180 180 ?> 181 <a href="<?php echo $ activate_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">181 <a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot"> 182 182 <?php if ( $screenshot ) : ?> 183 183 <img src="<?php echo WP_CONTENT_URL . $stylesheet_dir . '/' . $screenshot; ?>" alt="" /> -
trunk/wp-includes/script-loader.php
r10581 r10590 342 342 )); 343 343 344 $scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090 114' );344 $scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090218' ); 345 345 $scripts->add_data( 'theme-preview', 'group', 1 ); 346 346
Note: See TracChangeset
for help on using the changeset viewer.