Changeset 3660
- Timestamp:
- 03/29/2006 01:51:55 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-db.php
r3570 r3660 175 175 176 176 // Delete the category. 177 $wpdb->query("DELETE FROM $wpdb->categories WHERE cat_ID = '$cat_ID'"); 177 if ( !$wpdb->query("DELETE FROM $wpdb->categories WHERE cat_ID = '$cat_ID'") ) 178 return 0; 178 179 179 180 // Update children to point to new parent. -
trunk/wp-admin/admin-functions.php
r3653 r3660 603 603 function write_nested_categories($categories) { 604 604 foreach ($categories as $category) { 605 echo '<l abel for="category-', $category['cat_ID'], '" class="selectit"><input value="', $category['cat_ID'], '" type="checkbox" name="post_category[]" id="category-', $category['cat_ID'], '"', ($category['checked'] ? ' checked="checked"' : ""), '/> ', wp_specialchars($category['cat_name']), "</label>\n";606 607 if ( isset ($category['children'])) {608 echo " \n<span class='cat-nest'>\n";605 echo '<li id="category-', $category['cat_ID'], '"><label for="in-category-', $category['cat_ID'], '" class="selectit"><input value="', $category['cat_ID'], '" type="checkbox" name="post_category[]" id="in-category-', $category['cat_ID'], '"', ($category['checked'] ? ' checked="checked"' : ""), '/> ', wp_specialchars($category['cat_name']), "</label></li>\n"; 606 607 if ( $category['children'] ) { 608 echo "<ul>\n"; 609 609 write_nested_categories($category['children']); 610 echo "</ span>\n";610 echo "</ul>\n"; 611 611 } 612 612 } … … 627 627 foreach ($categories as $category) { 628 628 if ($category->category_parent == $parent) { 629 $category->cat_name = wp_specialchars($category->cat_name );629 $category->cat_name = wp_specialchars($category->cat_name,'double'); 630 630 $pad = str_repeat('— ', $level); 631 631 if ( current_user_can('manage_categories') ) { … … 635 635 636 636 if ( ($category->cat_ID != $default_cat_id) && ($category->cat_ID != $default_link_cat_id) ) 637 $edit .= "<td><a href='categories.php?action=delete&cat_ID=$category->cat_ID' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '".sprintf(__("You are about to delete the category "%s". All of its posts and bookmarks will go to the default categories.\\n"OK" to delete, "Cancel" to stop."), wp_specialchars($category->cat_name, 1))."' );\" class='delete'>".__('Delete')."</a>";637 $edit .= "<td><a href='categories.php?action=delete&cat_ID=$category->cat_ID' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '".sprintf(__("You are about to delete the category "%s". All of its posts and bookmarks will go to the default categories.\\n"OK" to delete, "Cancel" to stop."), addslashes($category->cat_name))."' );\" class='delete'>".__('Delete')."</a>"; 638 638 else 639 639 $edit .= "<td style='text-align:center'>".__("Default"); … … 685 685 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td> 686 686 <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='page.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td> 687 <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='page.php?action=delete&post=$id' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the "%s" page.\\n"OK" to delete, "Cancel" to stop."), wp_specialchars(get_the_title('','',0), 1)) . "' );\">" . __('Delete') . "</a>"; } ?></td>687 <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='page.php?action=delete&post=$id' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the "%s" page.\\n"OK" to delete, "Cancel" to stop."), addslashes(wp_specialchars(get_the_title(),'double')) ) . "' );\">" . __('Delete') . "</a>"; } ?></td> 688 688 </tr> 689 689 … … 829 829 global $post_ID; 830 830 // Exit if no meta 831 if (!$meta) 831 if (!$meta) { 832 echo '<tbody id="the-list"></tbody>'; //TBODY needed for list-manipulation JS 832 833 return; 834 } 833 835 $count = 0; 834 836 ?> 835 <table id='meta-list' cellpadding="3">837 <thead> 836 838 <tr> 837 839 <th><?php _e('Key') ?></th> … … 839 841 <th colspan='2'><?php _e('Action') ?></th> 840 842 </tr> 843 </thead> 841 844 <?php 842 843 845 $r ="\n\t<tbody id='the-list'>"; 844 846 foreach ($meta as $entry) { 845 847 ++ $count; … … 850 852 if ('_' == $entry['meta_key'] { 0 }) 851 853 $style .= ' hidden'; 852 echo " 853 <tr class='$style'> 854 <td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td> 855 <td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td> 856 <td align='center'><input name='updatemeta' type='submit' class='updatemeta' tabindex='6' value='".__('Update')."' /><br /> 857 <input name='deletemeta[{$entry['meta_id']}]' type='submit' class='deletemeta' tabindex='6' value='".__('Delete')."' /></td> 858 </tr> 859 "; 860 } 861 echo " 862 </table> 863 "; 854 $key_js = addslashes(wp_specialchars( $entry['meta_key'], 'double' )); 855 $entry['meta_key'] = wp_specialchars( $entry['meta_key'], true ); 856 $entry['meta_value'] = wp_specialchars( $entry['meta_value'], true ); 857 $r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>"; 858 $r .= "\n\t\t<td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>"; 859 $r .= "\n\t\t<td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>"; 860 $r .= "\n\t\t<td align='center'><input name='updatemeta' type='submit' class='updatemeta' tabindex='6' value='".__('Update')."' /><br />"; 861 $r .= "\n\t\t<input name='deletemeta[{$entry['meta_id']}]' type='submit' onclick=\"return deleteSomething( 'meta', {$entry['meta_id']}, '"; 862 $r .= sprintf(__("You are about to delete the "%s" custom field on this post.\\n"OK" to delete, "Cancel" to stop."), $key_js); 863 $r .= "' );\" class='deletemeta' tabindex='6' value='".__('Delete')."' /></td>"; 864 $r .= "\n\t</tr>"; 865 } 866 echo $r; 867 echo "\n\t</tbody>"; 864 868 } 865 869 … … 887 891 ?> 888 892 <h3><?php _e('Add a new custom field:') ?></h3> 889 <table cellspacing="3" cellpadding="3">893 <table id="newmeta" cellspacing="3" cellpadding="3"> 890 894 <tr> 891 895 <th colspan="2"><?php _e('Key') ?></th> … … 911 915 912 916 </table> 913 <p class="submit"><input type="submit" name="updatemeta" tabindex="9" value="<?php _e('Add Custom Field »') ?>" /></p>917 <p class="submit"><input type="submit" id="updatemetasub" name="updatemeta" tabindex="9" value="<?php _e('Add Custom Field »') ?>" /></p> 914 918 <?php 915 919 … … 918 922 function add_meta($post_ID) { 919 923 global $wpdb; 924 $post_ID = (int) $post_ID; 920 925 921 926 $metakeyselect = $wpdb->escape(stripslashes(trim($_POST['metakeyselect']))); … … 927 932 // input for the key have data, the input takes precedence: 928 933 929 if ('#NONE#' != $metakeyselect)934 if ('#NONE#' != $metakeyselect) 930 935 $metakey = $metakeyselect; 931 936 … … 938 943 VALUES ('$post_ID','$metakey','$metavalue') 939 944 "); 940 } 945 return $wpdb->insert_id; 946 } 947 return false; 941 948 } // add_meta 942 949 943 950 function delete_meta($mid) { 944 951 global $wpdb; 945 946 $result = $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 952 $mid = (int) $mid; 953 954 return $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 947 955 } 948 956 949 957 function update_meta($mid, $mkey, $mvalue) { 950 958 global $wpdb; 959 $mid = (int) $mid; 951 960 952 961 return $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '$mkey', meta_value = '$mvalue' WHERE meta_id = '$mid'"); 962 } 963 964 function get_post_meta_by_id($mid) { 965 global $wpdb; 966 $mid = (int) $mid; 967 968 return $wpdb->get_row("SELECT * FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 953 969 } 954 970 -
trunk/wp-admin/admin-header.php
r3570 r3660 4 4 if ( $editing ) { 5 5 $dbx_js = true; 6 if ( current_user_can('manage_categories') ) 6 $pmeta_js = true; 7 if ( current_user_can('manage_categories') ) { 8 $list_js = true; 7 9 $cat_js = true; 10 } 8 11 } 9 if ( $list_js || $cat_js)12 if ( $list_js ) 10 13 $sack_js = true; 11 14 ?> … … 30 33 <?php } ?> 31 34 <?php if ( $list_js ) { ?> 32 <script type="text/javascript" src="list-manipulation.js"></script> 35 <script type="text/javascript" src="list-manipulation-js.php"></script> 36 <?php } ?> 37 <?php if ( $pmeta_js ) { ?> 38 <script type="text/javascript" src="custom-fields.js"></script> 39 <?php } ?> 40 <?php if ( 'categories.php' == $pagenow && 'edit' != $action ) { ?> 41 <script type="text/javascript" src="categories.js"></script> 33 42 <?php } ?> 34 43 <?php if ( $dbx_js ) { ?> -
trunk/wp-admin/admin.php
r3607 r3660 41 41 } 42 42 43 $xfn_js = $sack_js = $list_js = $cat_js = $dbx_js = $ editing = false;43 $xfn_js = $sack_js = $list_js = $cat_js = $dbx_js = $pmeta_js = $editing = false; 44 44 45 45 require(ABSPATH . '/wp-admin/menu.php'); -
trunk/wp-admin/cat-js.php
r3645 r3660 3 3 header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true); 4 4 ?> 5 var ajaxCat = new sack(); 6 var newcat; 7 5 addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.clearInputs.push('newcat');}); 6 addLoadEvent(newCatAddIn); 8 7 function newCatAddIn() { 9 8 if ( !document.getElementById('jaxcat') ) return false; … … 17 16 newcat.size = '16'; 18 17 newcat.setAttribute('autocomplete', 'off'); 19 newcat.onkeypress = ajaxNewCatKeyPress;18 newcat.onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','categorydiv');", e); }; 20 19 21 20 var newcatSub = document.createElement('input'); … … 23 22 newcatSub.name = 'Button'; 24 23 newcatSub.id = 'catadd'; 25 newcatSub.value = ' <?php echo addslashes(__('Add')); ?>';26 newcatSub.onclick = ajaxNewCat;24 newcatSub.value = 'Add'; 25 newcatSub.onclick = function() { catList.ajaxAdder('category', 'categorydiv'); }; 27 26 28 27 ajaxcat.appendChild(newcat); … … 31 30 32 31 howto = document.createElement('span'); 33 howto.innerHTML = '<?php echo addslashes(__('Separate multiple categories with commas.')); ?>';32 howto.innerHTML = "<?php _e('Separate multiple categories with commas.'); ?>"; 34 33 howto.id = 'howto'; 35 34 ajaxcat.appendChild(howto); 36 35 } 37 38 addLoadEvent(newCatAddIn);39 40 function getResponseElement() {41 var p = document.getElementById('ajaxcatresponse');42 if (!p) {43 p = document.createElement('span');44 document.getElementById('jaxcat').appendChild(p);45 p.id = 'ajaxcatresponse';46 }47 return p;48 }49 50 function newCatLoading() {51 var p = getResponseElement();52 p.innerHTML = '<?php echo addslashes(__('Sending Data...')); ?>';53 }54 55 function newCatLoaded() {56 var p = getResponseElement();57 p.innerHTML = '<?php echo addslashes(__('Data Sent...')); ?>';58 }59 60 function newCatInteractive() {61 var p = getResponseElement();62 p.innerHTML = '<?php echo addslashes(__('Processing Request...')); ?>';63 }64 65 function newCatCompletion() {66 var p = getResponseElement();67 var id = 0;68 var ids = new Array();69 var names = new Array();70 71 ids = myPload( ajaxCat.response );72 names = myPload( newcat.value );73 for ( i = 0; i < ids.length; i++ ) {74 id = ids[i].replace(/[\n\r]+/g, "");75 if ( id == '-1' ) {76 p.innerHTML = "<?php echo addslashes(__("You don't have permission to do that.")); ?>";77 return;78 }79 if ( id == '0' ) {80 p.innerHTML = "<?php echo addslashes(__('That category name is invalid. Try something else.')); ?>";81 return;82 }83 84 var exists = document.getElementById('category-' + id);85 86 if (exists) {87 var moveIt = exists.parentNode;88 var container = moveIt.parentNode;89 container.removeChild(moveIt);90 container.insertBefore(moveIt, container.firstChild);91 moveIt.id = 'new-category-' + id;92 exists.checked = 'checked';93 var nowClass = moveIt.className;94 moveIt.className = nowClass + ' fade';95 Fat.fade_all();96 moveIt.className = nowClass;97 } else {98 var catDiv = document.getElementById('categorychecklist');99 var newLabel = document.createElement('label');100 newLabel.setAttribute('for', 'category-' + id);101 newLabel.id = 'new-category-' + id;102 newLabel.className = 'selectit fade';103 104 var newCheck = document.createElement('input');105 newCheck.type = 'checkbox';106 newCheck.value = id;107 newCheck.name = 'post_category[]';108 newCheck.id = 'category-' + id;109 newLabel.appendChild(newCheck);110 111 var newLabelText = document.createTextNode(' ' + names[i]);112 newLabel.appendChild(newLabelText);113 114 catDiv.insertBefore(newLabel, catDiv.firstChild);115 newCheck.checked = 'checked';116 117 Fat.fade_all();118 newLabel.className = 'selectit';119 }120 newcat.value = '';121 }122 p.parentNode.removeChild(p);123 // var id = parseInt(ajaxCat.response, 10);124 }125 126 function ajaxNewCatKeyPress(e) {127 if (!e) {128 if (window.event) {129 e = window.event;130 } else {131 return;132 }133 }134 if (e.keyCode == 13) {135 ajaxNewCat();136 e.returnValue = false;137 e.cancelBubble = true;138 return false;139 }140 }141 142 function ajaxNewCat() {143 var newcat = document.getElementById('newcat');144 var split_cats = new Array(1);145 var catString = '';146 147 catString = 'ajaxnewcat=' + encodeURIComponent(newcat.value);148 ajaxCat.requestFile = 'edit-form-ajax-cat.php';149 ajaxCat.method = 'GET';150 ajaxCat.onLoading = newCatLoading;151 ajaxCat.onLoaded = newCatLoaded;152 ajaxCat.onInteractive = newCatInteractive;153 ajaxCat.onCompletion = newCatCompletion;154 ajaxCat.runAJAX(catString);155 }156 157 function myPload( str ) {158 var fixedExplode = new Array();159 var comma = new String(',');160 var count = 0;161 var currentElement = '';162 163 for( x=0; x < str.length; x++) {164 andy = str.charAt(x);165 if ( comma.indexOf(andy) != -1 ) {166 currentElement = currentElement.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // trim167 fixedExplode[count] = currentElement;168 currentElement = "";169 count++;170 } else {171 currentElement += andy;172 }173 }174 175 if ( currentElement != "" )176 fixedExplode[count] = currentElement;177 return fixedExplode;178 } -
trunk/wp-admin/categories.php
r3585 r3660 4 4 $title = __('Categories'); 5 5 $parent_file = 'edit.php'; 6 $list_js = true;7 6 8 7 $wpvarstoreset = array('action','cat'); … … 105 104 default: 106 105 106 $list_js = true; 107 107 require_once ('admin-header.php'); 108 108 … … 122 122 <h2><?php _e('Categories') ?> </h2> 123 123 <?php endif; ?> 124 <table id="the-list-x" width="100%" cellpadding="3" cellspacing="3"> 124 <table width="100%" cellpadding="3" cellspacing="3"> 125 <thead> 125 126 <tr> 126 127 <th scope="col"><?php _e('ID') ?></th> … … 131 132 <th colspan="2"><?php _e('Action') ?></th> 132 133 </tr> 134 </thead> 135 <tbody id="the-list"> 133 136 <?php 134 137 cat_rows(); 135 138 ?> 139 </tbody> 136 140 </table> 137 141 … … 150 154 151 155 <p><?php _e('Name:') ?><br /> 152 <input type="text" name="cat_name" value="" /></p>156 <input type="text" name="cat_name" id="cat_name" value="" /></p> 153 157 <p><?php _e('Category parent:') ?><br /> 154 <select name='category_parent' class='postform'>158 <select name='category_parent' id='category_parent' class='postform'> 155 159 <option value='0'><?php _e('None') ?></option> 156 160 <?php wp_dropdown_cats(0); ?> 157 161 </select></p> 158 162 <p><?php _e('Description: (optional)') ?> <br /> 159 <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>163 <textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p> 160 164 <p class="submit"><input type="hidden" name="action" value="addcat" /><input type="submit" name="submit" value="<?php _e('Add Category »') ?>" /></p> 161 165 </form> -
trunk/wp-admin/edit-comments.php
r3652 r3660 134 134 </li> 135 135 136 <?php } // end foreach ?>136 <?php } // end foreach($comment) ?> 137 137 </ol> 138 138 … … 140 140 141 141 <?php 142 } else { 142 } else { //no comments to show 143 143 144 144 ?> … … 163 163 foreach ($comments as $comment) { 164 164 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); 165 $comment_status = wp_get_comment_status($comment->comment_ID); 165 166 $class = ('alternate' == $class) ? '' : 'alternate'; 166 ?> 167 <tr class='<?php echo $class; ?>'> 167 $class .= ('unapproved' == $comment_status) ? ' unapproved' : ''; 168 ?> 169 <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'> 168 170 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> 169 171 <td><?php comment_author_link() ?></td> … … 171 173 <td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td> 172 174 <td><?php comment_excerpt(); ?></td> 173 <td><a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a></td> 175 <td> 176 <?php if ('unapproved' == $comment_status) { ?> 177 (Unapproved) 178 <?php } else { ?> 179 <a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a> 180 <?php } ?> 181 </td> 174 182 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 175 183 echo "<a href='comment.php?action=editcomment&comment=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td> 176 184 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 177 echo "<a href=\"comment.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\" class='delete'>" . __('Delete') . "</a>"; } ?></td> 185 echo "<a href=\"comment.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars( $comment->comment_author, 1 )) . "' );\" class='edit'>" . __('Delete') . "</a> "; 186 } ?></td> 178 187 </tr> 179 188 <?php … … 184 193 <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam »') ?>" onclick="return confirm('<?php _e("You are about to mark these comments as spam \\n \'Cancel\' to stop, \'OK\' to mark as spam.") ?>')" /></p> 185 194 </form> 195 <div id="ajax-response"></div> 186 196 <?php 187 197 } else { -
trunk/wp-admin/edit-form-advanced.php
r3651 r3660 22 22 $form_action = 'post'; 23 23 $temp_ID = -1 * time(); 24 $form_extra = "<input type='hidden' name='temp_ID' value='$temp_ID' />";24 $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />"; 25 25 } else { 26 26 $form_action = 'editpost'; 27 $form_extra = "<input type='hidden' name='post_ID' value='$post_ID' />";27 $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; 28 28 } 29 29 … … 50 50 51 51 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" /> 52 <input type="hidden" name="action" value="<?php echo $form_action ?>" />52 <input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" /> 53 53 <input type="hidden" name="post_author" value="<?php echo $post->post_author ?>" /> 54 54 <input type="hidden" name="post_type" value="post" /> … … 73 73 <div class="dbx-content"> 74 74 <p id="jaxcat"></p> 75 < div id="categorychecklist"><?php dropdown_categories(get_settings('default_category')); ?></div></div>75 <ul id="categorychecklist"><?php dropdown_categories(get_settings('default_category')); ?></ul></div> 76 76 </fieldset> 77 77 … … 249 249 <h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3> 250 250 <div id="postcustomstuff" class="dbx-content"> 251 < ?php252 if($metadata = has_meta($post_ID)) { 253 ?> 254 <?php 255 list_meta($metadata); 256 ?> 257 < ?php258 } 251 <table cellpadding="3"> 252 <?php 253 $metadata = has_meta($post_ID); 254 list_meta($metadata); 255 ?> 256 257 </table> 258 <?php 259 259 meta_form(); 260 260 ?> 261 <div id="ajax-response"></div> 261 262 </div> 262 263 </fieldset> -
trunk/wp-admin/edit-page-form.php
r3563 r3660 7 7 $form_action = 'post'; 8 8 $temp_ID = -1 * time(); 9 $form_extra = "<input type='hidden' name='temp_ID' value='$temp_ID' />";9 $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />"; 10 10 } else { 11 11 $form_action = 'editpost'; 12 $form_extra = "<input type='hidden' name='post_ID' value='$post_ID' />";12 $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; 13 13 } 14 14 … … 210 210 <h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3> 211 211 <div id="postcustomstuff" class="dbx-content"> 212 <table cellpadding="3"> 212 213 <?php 213 if($metadata = has_meta($post_ID)) { 214 ?> 215 <?php 216 list_meta($metadata); 217 ?> 218 <?php 219 } 214 $metadata = has_meta($post_ID); 215 list_meta($metadata); 216 ?> 217 218 </table> 219 <?php 220 220 meta_form(); 221 221 ?> -
trunk/wp-admin/edit-pages.php
r3564 r3660 29 29 if ($posts) { 30 30 ?> 31 <table id="the-list-x" width="100%" cellpadding="3" cellspacing="3"> 32 <tr> 33 <th scope="col"><?php _e('ID') ?></th> 34 <th scope="col"><?php _e('Title') ?></th> 31 <table width="100%" cellpadding="3" cellspacing="3"> 32 <thead> 33 <tr> 34 <th scope="col"><?php _e('ID') ?></th> 35 <th scope="col"><?php _e('Title') ?></th> 35 36 <th scope="col"><?php _e('Owner') ?></th> 36 37 <th scope="col"><?php _e('Updated') ?></th> 37 <th scope="col"></th> 38 <th scope="col"></th> 39 <th scope="col"></th> 40 </tr> 38 <th scope="col"></th> 39 <th scope="col"></th> 40 <th scope="col"></th> 41 </tr> 42 </thead> 43 <tbody id="the-list"> 41 44 <?php 42 45 page_rows(0, 0, $posts, $all); 43 46 ?> 44 </table> 47 </tbody> 48 </table> 45 49 46 50 <div id="ajax-response"></div> -
trunk/wp-admin/edit.php
r3564 r3660 115 115 116 116 <?php 117 118 117 // define the columns to display, the syntax is 'internal name' => 'display name' 119 118 $posts_columns = array( … … 134 133 ?> 135 134 136 <table id="the-list-x" width="100%" cellpadding="3" cellspacing="3"> 135 <table width="100%" cellpadding="3" cellspacing="3"> 136 <thead> 137 137 <tr> 138 138 … … 142 142 143 143 </tr> 144 </thead> 145 <tbody id="the-list"> 144 146 <?php 145 147 if ($posts) { 146 148 $bgcolor = ''; 147 149 foreach ($posts as $post) { start_wp(); 150 add_filter('the_title','wp_specialchars'); 148 151 $class = ('alternate' == $class) ? '' : 'alternate'; 149 152 ?> … … 208 211 case 'control_delete': 209 212 ?> 210 <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='post.php?action=delete&post=$id' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . sprintf(__("You are about to delete this post "%s".\\n"OK" to delete, "Cancel" to stop."), wp_specialchars(get_the_title('', ''), 1) ) . "' );\">" . __('Delete') . "</a>"; } ?></td>213 <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='post.php?action=delete&post=$id' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . sprintf(__("You are about to delete this post "%s".\\n"OK" to delete, "Cancel" to stop."), addslashes(wp_specialchars(get_the_title(),'double')) ) . "' );\">" . __('Delete') . "</a>"; } ?></td> 211 214 <?php 212 215 break; … … 230 233 <?php 231 234 } // end if ($posts) 232 ?> 235 ?> 236 </tbody> 233 237 </table> 234 238 … … 247 251 ?> 248 252 <h3><?php _e('Comments') ?></h3> 249 <ol id="comments"> 250 <?php 253 <ol id="the-list"> 254 <?php 255 $i = 0; 251 256 foreach ($comments as $comment) { 252 $comment_status = wp_get_comment_status($comment->comment_ID); 257 $class = ( ++$i % 2 ) ? array('alternate') : array(); 258 if ( 'unapproved' == $comment_status = wp_get_comment_status($comment->comment_ID) ) 259 $class[] = 'unapproved'; 253 260 ?> 254 261 255 <li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?>>262 <li id='comment-<?php echo $comment->comment_ID; ?>'<?php if ( $class ) echo " class='" . join(' ', $class) . "'"; ?>> 256 263 <?php comment_date('Y-n-j') ?> 257 264 @ … … 259 266 <?php 260 267 if ( current_user_can('edit_post', $post->ID) ) { 261 echo "[ <a href= \"post.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit') . "</a>";262 echo " - <a href=\"post.php?action=deletecomment&p=".$post->ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n \'OK\' to delete, \'Cancel\' to stop."), $comment->comment_author) . "')\">" . __('Delete') . "</a> ";268 echo "[ <a href='post.php?action=editcomment&comment=".$comment->comment_ID."\'>" . __('Edit') . '</a>'; 269 echo ' - <a href="post.php?action=deletecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars($comment->comment_author, 1)) . "' );\">" . __('Delete') . '</a> '; 263 270 if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { 264 if ('approved' == wp_get_comment_status($comment->comment_ID)) { 265 echo " - <a href=\"post.php?action=unapprovecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">" . __('Unapprove') . "</a> "; 266 } else { 267 echo " - <a href=\"post.php?action=approvecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">" . __('Approve') . "</a> "; 268 } 271 echo '<span class="unapprove"> - <a href="comment.php?action=unapprovecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>'; 272 echo '<span class="approve"> - <a href="comment.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>'; 269 273 } 270 274 echo "]"; -
trunk/wp-admin/link-manager.php
r3617 r3660 115 115 <input type="hidden" name="order_by" value="<?php echo wp_specialchars($order_by, 1); ?>" /> 116 116 <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" /> 117 <table id="the-list-x" width="100%" cellpadding="3" cellspacing="3"> 117 <table width="100%" cellpadding="3" cellspacing="3"> 118 <thead> 118 119 <tr> 119 120 <th width="15%"><?php _e('Name') ?></th> … … 125 126 <th><input type="checkbox" onclick="checkAll(document.getElementById('links'));" /></th> 126 127 </tr> 128 </thead> 129 <tbody id="the-list"> 127 130 <?php 128 131 if ( 'all' == $cat_id ) … … 175 178 } 176 179 ?> 180 </tbody> 177 181 </table> 178 182 -
trunk/wp-admin/post.php
r3621 r3660 18 18 } 19 19 } 20 21 20 if (isset($_POST['deletepost'])) 22 21 $action = "delete"; 23 22 24 23 switch($action) { 24 case 'postajaxpost': 25 25 case 'post': 26 26 check_admin_referer(); 27 27 28 $post_ID = write_post();28 $post_ID = 'post' == $action ? write_post() : edit_post(); 29 29 30 30 // Redirect. -
trunk/wp-admin/wp-admin.css
r3570 r3660 90 90 fieldset legend { 91 91 padding: .1em .3em; 92 }93 94 fieldset span.cat-nest {95 display: block;96 margin-left: 10px;97 92 } 98 93 … … 325 320 .unapproved a:hover { 326 321 color: #009ef0; 322 } 323 324 .approve { 325 display: none; 326 } 327 328 .unapproved .approve { 329 display: inline; 330 } 331 332 .unapproved .unapprove { 333 display: none; 327 334 } 328 335 … … 805 812 } 806 813 807 #categorydiv div div { 814 #categorydiv ul { 815 list-style: none; 816 padding: 0; 817 margin-left:10px; 818 } 819 #categorychecklist { 808 820 height: 12em; 809 821 overflow: auto; 810 } 811 822 margin-top: 8px; 823 } 824 #categorychecklist li { 825 margin: 0; 826 padding: 0; 827 } 812 828 #ajaxcat input { 813 829 border: 1px solid #ccc; -
trunk/wp-includes/functions-formatting.php
r3641 r3660 102 102 $text = str_replace('<', '<', $text); 103 103 $text = str_replace('>', '>', $text); 104 if ( $quotes ) { 104 if ( 'double' === $quotes ) { 105 $text = str_replace('"', '"', $text); 106 } elseif ( $quotes ) { 105 107 $text = str_replace('"', '"', $text); 106 108 $text = str_replace("'", ''', $text); -
trunk/wp-includes/js/fat.js
r3517 r3660 12 12 return "#" + r + g + b; 13 13 }, 14 fade_all : function ( )14 fade_all : function (dur) 15 15 { 16 16 var a = document.getElementsByTagName("*"); … … 22 22 { 23 23 if (!r[1]) r[1] = ""; 24 if (o.id) Fat.fade_element(o.id,null, null,"#"+r[1]);24 if (o.id) Fat.fade_element(o.id,null,dur,"#"+r[1]); 25 25 } 26 26 } -
trunk/wp-includes/pluggable-functions.php
r3566 r3660 235 235 die(__('Sorry, you need to <a href="http://codex.wordpress.org/Enable_Sending_Referrers">enable sending referrers</a> for this feature to work.')); 236 236 do_action('check_admin_referer'); 237 } 238 endif; 239 240 if ( !function_exists('check_ajax_referer') ) : 241 function check_ajax_referer() { 242 $cookie = explode(';', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie'])); // AJAX scripts must pass cookie=document.cookie 243 foreach ( $cookie as $tasty ) { 244 if ( false !== strpos($tasty, USER_COOKIE) ) 245 $user = substr(strstr($tasty, '='), 1); 246 if ( false !== strpos($tasty, PASS_COOKIE) ) 247 $pass = substr(strstr($tasty, '='), 1); 248 } 249 if ( !wp_login( $user, $pass, true ) ) 250 die('-1'); 251 do_action('check_ajax_referer'); 237 252 } 238 253 endif;
Note: See TracChangeset
for help on using the changeset viewer.