Make WordPress Core

Ticket #7964: 7964.1.diff

File 7964.1.diff, 5.2 KB (added by ShaneF, 16 years ago)
  • wp-admin/edit-pages.php

     
    6868if ( empty($title) )
    6969        $title = __('Edit Pages');
    7070$parent_file = 'edit.php';
     71add_thickbox();
    7172wp_enqueue_script('admin-forms');
     73wp_enqueue_script('inline-preview');
    7274wp_enqueue_script('inline-edit-post');
    7375wp_enqueue_script('pages');
    7476
  • wp-admin/edit.php

     
    6969if ( empty($title) )
    7070        $title = __('Edit Posts');
    7171$parent_file = 'edit.php';
     72add_thickbox();
    7273wp_enqueue_script('admin-forms');
     74wp_enqueue_script('inline-preview');
    7375wp_enqueue_script('inline-edit-post');
    7476wp_enqueue_script('posts');
    7577
  • wp-admin/includes/template.php

     
    12771277                                $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . attribute_escape(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>';
    12781278                                $actions['delete'] = "<a class='submitdelete' title='" . attribute_escape(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    12791279                        }
    1280                         if ( in_array($post->post_status, array('pending', 'draft')) )
    1281                                 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
    1282                         else
     1280                        if ( in_array($post->post_status, array('pending', 'draft')) ) {
     1281                                $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => get_option('template') , 'stylesheet' => get_option('stylesheet'), 'TB_iframe' => 'true', 'width' => 600, 'height' => 400 ), get_permalink($post->ID) ) );
     1282                                $actions['view'] = '<a class="thickbox" href="' . $preview_link . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
     1283                        } else
    12831284                                $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
    12841285                        $action_count = count($actions);
    12851286                        $i = 0;
     
    14611462                $actions['edit'] = '<a href="' . $edit_link . '" title="' . attribute_escape(__('Edit this page')) . '">' . __('Edit') . '</a>';
    14621463                $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
    14631464                $actions['delete'] = "<a class='submitdelete' title='" . attribute_escape(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&amp;post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    1464                 if ( in_array($post->post_status, array('pending', 'draft')) )
    1465                         $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
    1466                 else
     1465                if ( in_array($post->post_status, array('pending', 'draft')) ) {
     1466                        $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => get_option('template') , 'stylesheet' => get_option('stylesheet'), 'TB_iframe' => 'true', 'width' => 600, 'height' => 400 ), get_permalink($page->ID) ) );
     1467                        $actions['view'] = '<a class="thickbox" href="' . $preview_link . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
     1468                } else
    14671469                        $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
    14681470                $action_count = count($actions);
    14691471                $i = 0;
  • wp-includes/script-loader.php

     
    242242                ));
    243243
    244244                $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' );
    245 
     245                $scripts->add( 'inline-preview', '/wp-admin/js/inline-preview.js', array( 'thickbox', 'jquery' ), '20081025' );
     246               
    246247                $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081023' );
    247248                $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
    248249                        'error' => __('Error while saving the changes.')