Changeset 13268
- Timestamp:
- 02/21/2010 12:03:42 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/comment.php
r13247 r13268 250 250 $redir = add_query_arg( array( 'unapproved' => 1 ), $redir ); 251 251 break; 252 } 252 } 253 253 254 254 wp_redirect( $redir ); -
trunk/wp-admin/css/custom-navigation.dev.css
r13265 r13268 9 9 * @subpackage Administration 10 10 */ 11 11 12 12 .fix{clear: both;height: 1px;margin: -1px 0 0;overflow: hidden;} 13 13 -
trunk/wp-admin/custom-navigation.php
r13266 r13268 10 10 * @subpackage Administration 11 11 */ 12 12 13 13 require_once('admin.php'); 14 14 … … 29 29 function wp_custom_nav_reset() { 30 30 wp_custom_navigation_setup(true); 31 31 32 32 return true; 33 33 34 34 } 35 35 … … 47 47 <div class="wrap"> 48 48 <div id="no-js"><h3>You do not have JavaScript enabled in your browser. Please enable it to access the Custom Menu functionality.</h3></div> 49 49 50 50 <?php 51 51 $messagesdiv = ''; 52 52 $menu_id_in_edit = 0; 53 53 54 54 // Get the theme name 55 55 $themename = get_current_theme(); 56 56 57 57 // Check which menu is selected and if menu is in edit already 58 58 if ( isset( $_POST['switch_menu'] ) ) … … 60 60 elseif ( isset( $_POST['menu_id_in_edit'] ) ) 61 61 $menu_selected_id = $_POST['menu_id_in_edit']; 62 62 63 63 // Default Menu to show 64 64 $custom_menus = get_terms( 'menu', array( 'hide_empty' => false ) ); … … 75 75 } 76 76 } 77 77 78 78 if ( isset( $_POST['set_wp_menu'] ) ) { 79 79 update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] ); 80 80 $messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>'; 81 } 82 81 } 82 83 83 if ( isset( $_POST['licount'] ) ) 84 84 $postCounter = $_POST['licount']; … … 94 94 if ( $existing_term ) { 95 95 $messagesdiv = '<div id="message" class="error fade below-h2"><p>'.$insert_menu_name.' Menu has already created - please try another name</p></div>'; 96 } else { 96 } else { 97 97 $term = wp_insert_term( $insert_menu_name, 'menu' ); 98 98 if ( $term ) { … … 100 100 $menu_selected_id = $term['term_id']; 101 101 $menu_id_in_edit = $menu_selected_id; 102 $messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$insert_menu_name.' Menu has been created!</p></div>'; 102 $messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$insert_menu_name.' Menu has been created!</p></div>'; 103 103 104 104 $postCounter = 0; … … 109 109 } 110 110 } 111 112 if ( isset($_POST['reset_wp_menu']) ) { 111 112 if ( isset($_POST['reset_wp_menu']) ) { 113 113 $success = wp_custom_nav_reset(); 114 114 if ($success) { … … 129 129 //Loop through all POST variables 130 130 for ($k = 1;$k<= $postCounter; $k++) { 131 131 132 132 if (isset($_POST['dbid'.$k])) { $db_id = $_POST['dbid'.$k]; } else { $db_id = 0; } 133 133 if (isset($_POST['postmenu'.$k])) { $post_id = $_POST['postmenu'.$k]; } else { $post_id = 0; } … … 143 143 if (isset($_POST['anchortitle'.$k])) { $custom_anchor_title = stripslashes($_POST['anchortitle'.$k]); } else { $custom_anchor_title = $custom_title; } 144 144 if (isset($_POST['newwindow'.$k])) { $new_window = $_POST['newwindow'.$k]; } else { $new_window = 0; } 145 145 146 146 $post = array( 'post_status' => 'publish', 'post_type' => 'menu_item', 'post_author' => $user_ID, 147 147 'ping_status' => 0, 'post_parent' => $post_id, '`menu_order' => $position, … … 176 176 $messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>'; 177 177 } 178 178 179 179 //DISPLAY Custom Navigation 180 180 ?> … … 183 183 <h2 class="maintitle">Custom Navigation</h2> 184 184 <?php 185 185 186 186 //CHECK if custom menu has been enabled 187 187 $enabled_menu = get_option('wp_custom_nav_menu'); 188 188 $checked = strtolower($enabled_menu); 189 189 190 190 if ($checked == 'true') { 191 191 } else { 192 192 echo '<div id="message-enabled" class="error fade below-h2"><p><strong>The Custom Menu has not been Enabled yet. Please enable it in order to use it --------></strong></p></div>'; 193 193 } 194 195 194 195 196 196 ?> 197 197 <?php echo $messagesdiv; ?> 198 198 <form onsubmit="updatepostdata()" action="custom-navigation.php" method="post" enctype="multipart/form-data"> 199 199 200 200 <input type="hidden" name="licount" id="licount" value="0" /> 201 201 <input type="hidden" name="menu_id_in_edit" id="menu_id_in_edit" value="<?php echo $menu_selected_id; ?>" /> 202 202 203 203 <div class="sidebar-name"> 204 204 205 205 <div class="sidebar-name-arrow"> 206 206 <br/> 207 207 </div> 208 208 <h3><?php echo $menu_title; ?></h3> 209 209 210 210 </div> 211 211 212 212 <div id="nav-container"> 213 213 <ul id="custom-nav"> 214 214 215 215 <?php 216 216 //DISPLAY existing menu … … 220 220 //MAIN OUTPUT FUNCTION 221 221 wp_custom_navigation_output( 'type='.$output_type.'&name='.$menu_title.'&id='.$menu_selected_id ); 222 } 222 } 223 223 ?> 224 224 225 225 </ul> 226 226 </div><!-- /#nav-container --> 227 227 228 228 <p class="submit"> 229 229 230 230 <script type="text/javascript"> 231 updatepostdata(); 231 updatepostdata(); 232 232 </script> 233 233 234 234 <input id="save_bottom" name="save_bottom" type="submit" value="Save All Changes" /></p> 235 235 </div><!-- /.inside --> 236 236 </div> 237 237 238 238 <div id="menu-right"> 239 239 240 240 <h2 class="heading">Options</h2> 241 241 242 242 <div class="widgets-holder-wrap"> 243 243 <div class="sidebar-name"> … … 246 246 </div> 247 247 <div class="widget-holder"> 248 248 249 249 <?php 250 250 251 251 //SETUP Custom Menu 252 252 253 253 $enabled_menu = get_option('wp_custom_nav_menu'); 254 254 255 255 $checked = strtolower($enabled_menu); 256 256 257 257 ?> 258 258 259 259 <span > 260 260 <label>Enable</label><input type="radio" name="enable_wp_menu" value="true" <?php if ($checked=='true') { echo 'checked="checked"'; } ?> /> 261 261 <label>Disable</label><input type="radio" name="enable_wp_menu" value="false" <?php if ($checked=='true') { } else { echo 'checked="checked"'; } ?> /> 262 </span><!-- /.checkboxes --> 263 262 </span><!-- /.checkboxes --> 263 264 264 <input id="set_wp_menu" type="submit" value="Set Menu" name="set_wp_menu" class="button" /><br /> 265 265 266 266 <span> 267 267 <label>Reset Menu to Default</label> 268 268 <input id="reset_wp_menu" type="submit" value="Reset" name="reset_wp_menu" class="button" onclick="return confirm('Are you sure you want to RESET the Custom Navigation Menu to its Default Settings?');" /> 269 269 </span> 270 270 271 271 <div class="fix"></div> 272 272 </div> 273 273 </div><!-- /.widgets-holder-wrap --> 274 274 275 275 <div class="widgets-holder-wrap"> 276 276 <div class="sidebar-name"> … … 280 280 <div class="widget-holder"> 281 281 <select id="menu_select" name="menu_select"> 282 <?php 283 282 <?php 283 284 284 //DISPLAY SELECT OPTIONS 285 285 foreach( $custom_menus as $menu ) { … … 292 292 <option value="<?php echo $menu_term->term_id; ?>" <?php echo $selected_option; ?>><?php echo $menu_term->name; ?></option> 293 293 <?php 294 294 295 295 } 296 296 ?> 297 297 </select> 298 298 299 299 <input id="switch_menu" type="submit" value="Switch" name="switch_menu" class="button" /> 300 300 <input id="add_menu_name" name="add_menu_name" type="text" value="" /> 301 301 <input id="add_menu" type="submit" value="Add Menu" name="add_menu" class="button" /> 302 302 303 303 <div class="fix"></div> 304 304 </div> … … 310 310 <h3>Top Level Menu Descriptions</h3> 311 311 </div> 312 <div class="widget-holder"> 312 <div class="widget-holder"> 313 313 <span>Display Descriptions in Top Level Menu?</span> 314 314 315 315 <?php 316 316 317 317 //UPDATE and DISPLAY Menu Description Option 318 318 if (isset($_POST['menu-descriptions'])) 319 319 { 320 320 321 321 if (isset($_POST['switch_menu'])) { 322 322 323 323 } 324 324 else { 325 325 $menu_options_to_edit = $_POST['menu_id_in_edit']; 326 update_option('wp_settings_custom_nav_'.$menu_options_to_edit.'_descriptions',$_POST['menu-descriptions']); 326 update_option('wp_settings_custom_nav_'.$menu_options_to_edit.'_descriptions',$_POST['menu-descriptions']); 327 327 } 328 328 329 329 } 330 330 331 331 if ($menu_id_in_edit > 0) 332 332 { … … 336 336 $checkedraw = get_option('wp_settings_custom_nav_'.$menu_selected_id.'_descriptions'); 337 337 } 338 338 339 339 $checked = strtolower($checkedraw); 340 340 341 341 if ($advanced_option_descriptions == 'no') 342 342 { 343 343 $checked = 'no'; 344 344 } 345 345 346 346 ?> 347 347 348 348 <span class="checkboxes"> 349 349 <label>Yes</label><input type="radio" name="menu-descriptions" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> /> … … 354 354 </div> 355 355 </div><!-- /.widgets-holder-wrap --> 356 356 357 357 <div class="widgets-holder-wrap"> 358 358 <div class="sidebar-name"> … … 361 361 </div> 362 362 <div class="widget-holder"> 363 363 364 364 <?php 365 365 366 366 $pages_args = array( 367 367 'child_of' => 0, … … 378 378 'number' => '', 379 379 'offset' => 0 ); 380 381 //GET all pages 380 381 //GET all pages 382 382 $pages_array = get_pages($pages_args); 383 383 $page_name = ''; … … 387 387 foreach ($pages_array as $post) 388 388 { 389 //Add page name to 389 //Add page name to 390 390 $page_name .= htmlentities($post->post_title).'|'; 391 391 } … … 395 395 $page_name = "No pages available"; 396 396 } 397 397 398 398 ?> 399 399 400 400 <script> 401 401 jQuery(document).ready(function(){ … … 403 403 //GET PHP pages 404 404 var dataposts = "<?php echo $page_name; ?>".split("|"); 405 405 406 406 //Set autocomplete 407 407 jQuery("#page-search").autocomplete(dataposts); 408 408 409 409 //Handle autocomplete result 410 410 jQuery("#page-search").result(function(event, data, formatted) { 411 411 jQuery('#existing-pages').css('display','block'); 412 412 jQuery("#existing-pages dt:contains('" + data + "')").css("display", "block"); 413 413 414 414 jQuery('#show-pages').hide(); 415 415 jQuery('#hide-pages').show(); 416 416 417 417 }); 418 418 jQuery('#existing-pages').css('display','none'); … … 421 421 422 422 423 <input type="text" onfocus="jQuery('#page-search').attr('value','');" id="page-search" value="Search Pages" /> 424 425 <a id="show-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();">View All</a> 423 <input type="text" onfocus="jQuery('#page-search').attr('value','');" id="page-search" value="Search Pages" /> 424 425 <a id="show-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();">View All</a> 426 426 <a id="hide-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','none');jQuery('#page-search').attr('value','Search Pages');jQuery('#existing-pages dt').css('display','none');jQuery('#show-pages').show();jQuery('#hide-pages').hide();">Hide All</a> 427 427 428 428 <script type="text/javascript"> 429 429 430 430 jQuery('#hide-pages').hide(); 431 431 432 432 </script> 433 433 434 434 <ul id="existing-pages" class="list"> 435 435 <?php … … 439 439 ?> 440 440 </ul> 441 441 442 442 <div class="fix"></div> 443 443 444 444 </div> 445 445 </div><!-- /.widgets-holder-wrap --> 446 446 447 447 <div class="widgets-holder-wrap"> 448 448 <div class="sidebar-name"> … … 451 451 </div> 452 452 <div class="widget-holder"> 453 453 454 454 <?php 455 455 456 456 //Custom GET categories query 457 457 $categories = $wpdb->get_results("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC"); … … 460 460 if ($categories) 461 461 { 462 foreach($categories as $category) 463 { 462 foreach($categories as $category) 463 { 464 464 $cat_id = $category->term_id; 465 465 466 466 $cat_args=array( 467 467 'orderby' => 'name', … … 470 470 'order' => 'ASC' 471 471 ); 472 472 473 473 $category_names=get_categories($cat_args); 474 474 475 475 if (isset($category_names[0]->name)) 476 476 { … … 484 484 $cat_name = "No categories available"; 485 485 } 486 486 487 487 ?> 488 488 … … 492 492 //GET PHP categories 493 493 var datacats = "<?php echo $cat_name; ?>".split("|"); 494 494 495 495 //Set autocomplete 496 496 jQuery("#cat-search").autocomplete(datacats); 497 497 498 498 //Handle autocomplete result 499 499 jQuery("#cat-search").result(function(event, data, formatted) { 500 500 jQuery('#existing-categories').css('display','block'); 501 501 jQuery("#existing-categories dt:contains('" + data + "')").css("display", "block"); 502 502 503 503 jQuery('#show-cats').hide(); 504 504 jQuery('#hide-cats').show(); 505 505 506 506 }); 507 507 jQuery('#existing-categories').css('display','none'); 508 508 509 509 }); 510 510 </script> 511 511 512 512 513 <input type="text" onfocus="jQuery('#cat-search').attr('value','');" id="cat-search" value="Search Categories" /> 514 515 <a id="show-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();">View All</a> 513 <input type="text" onfocus="jQuery('#cat-search').attr('value','');" id="cat-search" value="Search Categories" /> 514 515 <a id="show-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();">View All</a> 516 516 <a id="hide-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','none');jQuery('#cat-search').attr('value','Search Categories');jQuery('#existing-categories dt').css('display','none');jQuery('#show-cats').show();jQuery('#hide-cats').hide();">Hide All</a> 517 517 518 518 <script type="text/javascript"> 519 519 520 520 jQuery('#hide-cats').hide(); 521 521 522 522 </script> 523 523 524 524 <ul id="existing-categories" class="list"> 525 525 <?php 526 526 //Get default Categories 527 $intCounter = wp_custom_nav_get_categories($intCounter,'default'); 527 $intCounter = wp_custom_nav_get_categories($intCounter,'default'); 528 528 ?> 529 529 </ul> 530 530 531 531 <div class="fix"></div> 532 532 533 533 </div> 534 534 </div><!-- /.widgets-holder-wrap --> 535 535 536 536 <div class="widgets-holder-wrap"> 537 537 <div class="sidebar-name"> … … 552 552 </div> 553 553 </div><!-- /.widgets-holder-wrap --> 554 554 555 555 </div> 556 556 </div> 557 557 558 558 <script type="text/javascript"> 559 559 document.getElementById('pages-left').style.display='block'; … … 561 561 document.getElementById('no-js').style.display='none'; 562 562 </script> 563 563 564 564 <div id="dialog-confirm" title="Edit Menu Item"> 565 565 </label><input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle">Menu Title</label><br /> -
trunk/wp-admin/edit-tags.php
r13215 r13268 225 225 $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page ); 226 226 $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter 227 } elseif ( 'category' == $taxonomy ) { 227 } elseif ( 'category' == $taxonomy ) { 228 228 $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter 229 229 } else { … … 305 305 306 306 <?php if ( 'category' == $taxonomy ) : ?> 307 <div class="form-wrap"> 308 <p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?></p> 309 <p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag') ?></p> 310 </div> 307 <div class="form-wrap"> 308 <p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?></p> 309 <p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag') ?></p> 310 </div> 311 311 <?php endif; ?> 312 312 -
trunk/wp-admin/js/custom-navigation-default-items.dev.js
r13266 r13268 9 9 * @subpackage Administration 10 10 */ 11 11 12 12 /* 13 13 * Init Functions … … 24 24 buttons: { 25 25 'Save': function() { 26 26 27 27 titletosave = $('#edittitle').attr('value'); 28 28 linktosave = $('#editlink').attr('value'); … … 30 30 newwindowtosave = $('#editnewwindow').attr('value'); 31 31 desctosave = $('#editdescription').attr('value'); 32 32 33 33 $('#title' + $(this).dialog('option', 'itemID')).attr('value',titletosave); 34 34 $('#linkurl' + $(this).dialog('option', 'itemID')).attr('value',linktosave); … … 36 36 $('#newwindow' + $(this).dialog('option', 'itemID')).attr('value',newwindowtosave); 37 37 $('#description' + $(this).dialog('option', 'itemID')).attr('value',desctosave); 38 38 39 39 $('#menu-' + $(this).dialog('option', 'itemID') + ' > dl > dt > span.title').text(titletosave); 40 40 41 41 $('#view' + + $(this).dialog('option', 'itemID')).attr('href', linktosave); 42 42 43 43 $(this).dialog('close'); 44 44 45 45 }, 46 46 Cancel: function() { … … 49 49 } 50 50 }); 51 51 52 52 $('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ $(this).remove();}); 53 53 54 54 //Add dropzone 55 $('#custom-nav li').prepend('<div class="dropzone"></div>'); 56 55 $('#custom-nav li').prepend('<div class="dropzone"></div>'); 56 57 57 //Make li items draggable 58 58 $('#custom-nav li').draggable({ … … 69 69 accept: '#custom-nav li', 70 70 tolerance: 'pointer', 71 drop: function(e, ui) 71 drop: function(e, ui) 72 72 { 73 73 var li = $(this).parent(); 74 74 var child = !$(this).hasClass('dropzone'); 75 75 //Add UL to first child 76 if (child && li.children('ul').length == 0) 76 if (child && li.children('ul').length == 0) 77 77 { 78 78 li.append('<ul id="sub-menu" />'); 79 79 } 80 80 //Make it draggable 81 if (child) 81 if (child) 82 82 { 83 83 li.children('ul').append(ui.draggable); 84 84 } 85 else 85 else 86 86 { 87 87 li.before(ui.draggable); … … 89 89 90 90 li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' }); 91 91 92 92 var draggablevalue = ui.draggable.attr('value'); 93 93 var droppablevalue = li.attr('value'); 94 li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue); 94 li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue); 95 95 $(this).parent().find("dt").removeAttr('style'); 96 96 $(this).parent().find("div:first").removeAttr('style'); 97 98 97 98 99 99 }, 100 over: function() 100 over: function() 101 101 { 102 102 //Add child 103 if ($(this).attr('class') == 'dropzone ui-droppable') 103 if ($(this).attr('class') == 'dropzone ui-droppable') 104 104 { 105 105 $(this).parent().find("div:first").css('background', 'none').css('height', '50px'); 106 106 } 107 107 //Add above 108 else if ($(this).attr('class') == 'ui-droppable') 108 else if ($(this).attr('class') == 'ui-droppable') 109 109 { 110 110 $(this).parent().find("dt:first").css('background', '#d8d8d8'); … … 112 112 //do nothing 113 113 else { 114 114 115 115 } 116 116 var parentid = $(this).parent().attr('id'); 117 117 118 118 }, 119 out: function() 119 out: function() 120 120 { 121 121 $(this).parent().find("dt").removeAttr('style'); … … 124 124 }, 125 125 deactivate: function() 126 { 127 128 126 { 127 128 129 129 } 130 131 130 131 132 132 }); 133 134 //Handle Save Button Clicks 133 134 //Handle Save Button Clicks 135 135 $('#save_top').click(function() 136 136 { … … 141 141 updatepostdata(); 142 142 }); 143 143 144 144 145 145 }); -
trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js
r13266 r13268 9 9 * @subpackage Administration 10 10 */ 11 11 12 12 /* 13 13 * Removes menu items from current menu 14 14 * @param int o - the id of the menu li to remove. 15 15 */ 16 function removeitem(o) 17 { 18 16 function removeitem(o) 17 { 18 19 19 var todelete = document.getElementById('menu-' + o); 20 20 21 21 if (todelete) 22 { 22 { 23 23 var parenttodelete = document.getElementById('menu-' + o).parentNode; 24 throwaway_node = parenttodelete.removeChild(todelete); 25 } 26 24 throwaway_node = parenttodelete.removeChild(todelete); 25 } 26 27 27 updatepostdata(); 28 28 }; … … 32 32 * @param int o - the id of the menu li to edit. 33 33 */ 34 function edititem(o) 35 { 36 34 function edititem(o) 35 { 36 37 37 itemTitle = jQuery('#title' + o).attr('value'); 38 38 itemURL = jQuery('#linkurl' + o).attr('value'); … … 40 40 itemNewWindow = jQuery('#newwindow' + o).attr('value'); 41 41 itemDesc = jQuery('#description' + o).attr('value'); 42 42 43 43 jQuery('#dialog-confirm').dialog( 'option' , 'itemID' , o ) 44 44 45 45 jQuery('#dialog-confirm').dialog('open'); 46 46 47 47 jQuery('#edittitle').attr('value', itemTitle); 48 48 jQuery('#editlink').attr('value', itemURL); … … 50 50 jQuery("#editnewwindow option[value='" + itemNewWindow + "']").attr('selected', 'selected'); 51 51 jQuery('#editdescription').attr('value', itemDesc); 52 52 53 53 }; 54 54 … … 56 56 * Prepares menu items for POST 57 57 */ 58 function updatepostdata() 59 { 60 58 function updatepostdata() 59 { 60 61 61 var i = 0; 62 62 jQuery("#custom-nav").find("li").each(function(i) { 63 63 i = i + 1; 64 64 var j = jQuery(this).attr('value'); 65 65 66 66 jQuery(this).find('#position' + j).attr('value', i); 67 67 jQuery(this).attr('id','menu-' + i); 68 68 jQuery(this).attr('value', i); 69 69 70 70 jQuery(this).find('#dbid' + j).attr('name','dbid' + i); 71 71 jQuery(this).find('#dbid' + j).attr('id','dbid' + i); 72 72 73 73 jQuery(this).find('#postmenu' + j).attr('name','postmenu' + i); 74 74 jQuery(this).find('#postmenu' + j).attr('id','postmenu' + i); 75 75 76 76 var p = jQuery(this).find('#parent' + j).parent().parent().parent().attr('value'); 77 77 78 78 jQuery(this).find('#parent' + j).attr('name','parent' + i); 79 79 jQuery(this).find('#parent' + j).attr('id','parent' + i); … … 85 85 p = 0; 86 86 } 87 87 88 88 jQuery(this).find('#parent' + j).attr('value', p); 89 89 90 90 jQuery(this).find('#title' + j).attr('name','title' + i); 91 91 jQuery(this).find('#title' + j).attr('id','title' + i); 92 92 93 93 jQuery(this).find('#linkurl' + j).attr('name','linkurl' + i); 94 94 jQuery(this).find('#linkurl' + j).attr('id','linkurl' + i); 95 95 96 96 jQuery(this).find('#description' + j).attr('name','description' + i); 97 97 jQuery(this).find('#description' + j).attr('id','description' + i); 98 98 99 99 jQuery(this).find('#icon' + j).attr('name','icon' + i); 100 100 jQuery(this).find('#icon' + j).attr('id','icon' + i); 101 101 102 102 jQuery(this).find('#position' + j).attr('name','position' + i); 103 103 jQuery(this).find('#position' + j).attr('id','position' + i); 104 104 105 105 jQuery(this).find('#linktype' + j).attr('name','linktype' + i); 106 106 jQuery(this).find('#linktype' + j).attr('id','linktype' + i); 107 107 108 108 jQuery(this).find('#anchortitle' + j).attr('name','anchortitle' + i); 109 109 jQuery(this).find('#anchortitle' + j).attr('id','anchortitle' + i); 110 110 111 111 jQuery(this).find('#newwindow' + j).attr('name','newwindow' + i); 112 112 jQuery(this).find('#newwindow' + j).attr('id','newwindow' + i); 113 113 114 114 jQuery(this).find('dl > dt > span > #remove' + j).attr('value', i); 115 115 jQuery(this).find('dl > dt > span > #remove' + j).attr('onClick', 'removeitem(' + i + ')'); … … 119 119 120 120 }); 121 122 123 124 }; 121 122 123 124 }; 125 125 126 126 /* … … 133 133 * @param int itemparentid - default 0. 134 134 * @param string itemdescription - the description of the menu item. 135 */ 136 function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription) 135 */ 136 function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription) 137 137 { 138 138 var inputvaluevarname = ''; … … 143 143 var inputicon = ''; 144 144 145 if (additemtype == 'Custom') 145 if (additemtype == 'Custom') 146 146 { 147 147 inputvaluevarname = document.getElementById('custom_menu_item_name').value; … … 160 160 inputlinktype = 'page'; 161 161 inputdescription = htmlentities(itemdescription.toString()); 162 162 163 163 } 164 164 else if (additemtype == 'Category') … … 171 171 inputdescription = htmlentities(itemdescription.toString()); 172 172 } 173 else 173 else 174 174 { 175 175 inputvaluevarname = ''; … … 180 180 inputdescription = ''; 181 181 } 182 182 183 183 var count=document.getElementById('custom-nav').getElementsByTagName('li').length; 184 184 … … 187 187 var validatetest = 0; 188 188 189 try 189 try 190 190 { 191 191 var test=document.getElementById("menu-" + randomnumber.toString()).value; 192 192 } 193 catch (err) 193 catch (err) 194 194 { 195 195 validatetest = 1; 196 196 } 197 197 198 while (validatetest == 0) 198 while (validatetest == 0) 199 199 { 200 200 randomnumber = randomnumber + 1; 201 201 202 try 202 try 203 203 { 204 204 var test2=document.getElementById("menu-" + randomnumber.toString()).value; 205 205 } 206 catch (err) 206 catch (err) 207 207 { 208 208 validatetest = 1; 209 209 } 210 210 } 211 211 212 212 //Notification Message 213 213 jQuery('.maintitle').after('<div id="message" class="updated fade below-h2"><p>Menu Item added!</p></div>'); 214 214 jQuery('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ jQuery(this).remove();}); 215 215 216 216 //Appends HTML to the menu 217 217 jQuery('#custom-nav').append('<li id="menu-' + randomnumber + '" value="' + randomnumber + '"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="title">' + inputvaluevarname + '</span><span class="controls"><span class="type">' + additemtype + '</span><a id="edit' + randomnumber + '" onclick="edititem(' + randomnumber + ')" value="' + randomnumber +'"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="' + templatedir + '/wp-admin/images/ico-edit.png" /></a> <a id="remove' + randomnumber + '" onclick="removeitem(' + randomnumber + ')" value="' + randomnumber +'"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="' + templatedir + '/wp-admin/images/ico-close.png" /></a> <a href="' + inputvaluevarurl + '" target="_blank"><img alt="View Custom Link" title="View Custom Link" src="' + templatedir + '/wp-admin/images/ico-viewpage.png" /></a></span></dt></dl><a class="hide" href="' + inputvaluevarurl + '">' + inputvaluevarname + '</a><input type="hidden" name="postmenu' + randomnumber + '" id="postmenu' + randomnumber + '" value="' + inputitemid + '" /><input type="hidden" name="parent' + randomnumber + '" id="parent' + randomnumber + '" value="' + inputparentid + '" /><input type="hidden" name="title' + randomnumber + '" id="title' + randomnumber + '" value="' + inputvaluevarname + '" /><input type="hidden" name="linkurl' + randomnumber + '" id="linkurl' + randomnumber + '" value="' + inputvaluevarurl + '" /><input type="hidden" name="description' + randomnumber + '" id="description' + randomnumber + '" value="' + inputdescription + '" /><input type="hidden" name="icon' + randomnumber + '" id="icon' + randomnumber + '" value="' + inputicon + '" /><input type="hidden" name="position' + randomnumber + '" id="position' + randomnumber + '" value="' + randomnumber + '" /><input type="hidden" name="linktype' + randomnumber + '" id="linktype' + randomnumber + '" value="' + inputlinktype + '" /><input type="hidden" name="anchortitle' + randomnumber + '" id="anchortitle' + randomnumber + '" value="' + inputvaluevarname + '" /><input type="hidden" name="newwindow' + randomnumber + '" id="newwindow' + randomnumber + '" value="0" /></li>'); … … 231 231 accept: '#' + randomnumber + ', #custom-nav li', 232 232 tolerance: 'pointer', 233 drop: function(e, ui) 233 drop: function(e, ui) 234 234 { 235 235 var li = jQuery(this).parent(); 236 236 var child = !jQuery(this).hasClass('dropzone'); 237 237 //Append UL to first child 238 if (child && li.children('ul').length == 0) 238 if (child && li.children('ul').length == 0) 239 239 { 240 240 li.append('<ul/>'); 241 241 } 242 242 //Make it draggable 243 if (child) 243 if (child) 244 244 { 245 245 li.children('ul').append(ui.draggable); 246 246 } 247 else 247 else 248 248 { 249 249 li.before(ui.draggable); 250 250 } 251 252 li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' }); 253 251 252 li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' }); 253 254 254 var draggablevalue = ui.draggable.attr('value'); 255 255 var droppablevalue = li.attr('value'); 256 li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue); 256 li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue); 257 257 jQuery(this).parent().find("dt").removeAttr('style'); 258 258 jQuery(this).parent().find("div:first").removeAttr('style'); 259 259 260 260 }, 261 over: function() 261 over: function() 262 262 { 263 263 //Add child 264 if (jQuery(this).attr('class') == 'dropzone ui-droppable') 264 if (jQuery(this).attr('class') == 'dropzone ui-droppable') 265 265 { 266 266 jQuery(this).parent().find("div:first").css('background', 'none').css('height', '50px'); 267 267 } 268 268 //Add above 269 else if (jQuery(this).attr('class') == 'ui-droppable') 269 else if (jQuery(this).attr('class') == 'ui-droppable') 270 270 { 271 271 jQuery(this).parent().find("dt:first").css('background', '#d8d8d8'); … … 273 273 //do nothing 274 274 else { 275 275 276 276 } 277 277 var parentid = jQuery(this).parent().attr('id'); 278 278 279 279 }, 280 out: function() 280 out: function() 281 281 { 282 282 jQuery(this).parent().find("dt").removeAttr('style'); -
trunk/wp-admin/js/custom-navigation-php-functions.dev.js
r13257 r13268 1 /* 1 /* 2 2 * More info at: http://phpjs.org 3 * 3 * 4 4 * This is version: 3.08 5 5 * php.js is copyright 2010 Kevin van Zonneveld. 6 * 6 * 7 7 * Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld 8 8 * (http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White … … 85 85 * Rosa, Tod Gentille, Riddler (http://www.frontierwebdev.com/), Alexander M 86 86 * Beedie 87 * 87 * 88 88 * Dual licensed under the MIT (MIT-LICENSE.txt) 89 89 * and GPL (GPL-LICENSE.txt) licenses. 90 * 90 * 91 91 * Permission is hereby granted, free of charge, to any person obtaining a 92 92 * copy of this software and associated documentation files (the … … 96 96 * permit persons to whom the Software is furnished to do so, subject to 97 97 * the following conditions: 98 * 98 * 99 99 * The above copyright notice and this permission notice shall be included 100 100 * in all copies or substantial portions of the Software. 101 * 101 * 102 102 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 103 103 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF … … 107 107 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 108 108 * OTHER DEALINGS IN THE SOFTWARE. 109 */ 109 */ 110 110 111 111 function get_html_translation_table (table, quote_style) { … … 129 129 // * example 1: get_html_translation_table('HTML_SPECIALCHARS'); 130 130 // * returns 1: {'"': '"', '&': '&', '<': '<', '>': '>'} 131 131 132 132 var entities = {}, hash_map = {}, decimal = 0, symbol = ''; 133 133 var constMappingTable = {}, constMappingQuoteStyle = {}; 134 134 var useTable = {}, useQuoteStyle = {}; 135 135 136 136 // Translate arguments 137 137 constMappingTable[0] = 'HTML_SPECIALCHARS'; … … 264 264 hash_map[symbol] = entities[decimal]; 265 265 } 266 266 267 267 return hash_map; 268 268 } … … 287 287 var hash_map = {}, symbol = '', tmp_str = '', entity = ''; 288 288 tmp_str = string.toString(); 289 289 290 290 if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) { 291 291 return false; … … 296 296 tmp_str = tmp_str.split(symbol).join(entity); 297 297 } 298 298 299 299 return tmp_str; 300 300 } -
trunk/wp-admin/js/tags.dev.js
r13086 r13268 39 39 return; 40 40 41 var parent = form.find('select#parent').val(); 41 var parent = form.find('select#parent').val(); 42 42 43 43 if ( parent > 0 && $('#tag-' + parent ).length > 0 ) // If the parent exists on this page, insert it below. Else insert it at the top of the list. -
trunk/wp-admin/plugins.php
r13235 r13268 546 546 if ( is_multisite() && is_super_admin() ) 547 547 $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>'; 548 548 549 549 if ( !is_multisite() && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) 550 550 $actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>'; 551 551 552 552 if ( ! $is_active && current_user_can('delete_plugins') ) 553 553 $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; -
trunk/wp-includes/canonical.php
r13170 r13268 145 145 if ( is_tax() ) { // Custom taxonomies will have a custom query var, remove those too: 146 146 $tax = get_taxonomy( $obj->taxonomy ); 147 if ( false !== $tax->query_var) 147 if ( false !== $tax->query_var) 148 148 $redirect['query'] = remove_query_arg($tax->query_var, $redirect['query']); 149 149 } -
trunk/wp-includes/category-template.php
r13086 r13268 365 365 else 366 366 $output = ''; 367 367 368 368 if ( empty($categories) && ! $r['hide_if_empty'] && !empty($show_option_none) ) { 369 369 $show_option_none = apply_filters( 'list_cats', $show_option_none ); 370 370 $output .= "\t<option value='-1' selected='selected'>$show_option_none</option>\n"; 371 371 } 372 372 373 373 if ( ! empty( $categories ) ) { 374 374 -
trunk/wp-includes/comment-template.php
r13242 r13268 1470 1470 '<label for="author">' . __( 'Name' ) . '</label> ' . 1471 1471 ( $req ? '<span class="required">*</span>' : '' ) . 1472 '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1"' . $aria_req . ' />' . 1472 '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1"' . $aria_req . ' />' . 1473 1473 '</p><!-- #form-section-author .form-section -->', 1474 1474 'email' => '<p class="comment-form-email">' . … … 1476 1476 ( $req ? '<span class="required">*</span>' : '' ) . 1477 1477 '<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" tabindex="2"' . $aria_req . ' />' . 1478 '</p><!-- #form-section-email .form-section -->', 1478 '</p><!-- #form-section-email .form-section -->', 1479 1479 'url' => '<p class="comment-form-url">' . 1480 1480 '<label for="url">' . __( 'Website' ) . '</label>' . … … 1487 1487 'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>', 1488 1488 'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%s">%s</a>. <a href="%s" title="Log out of this account">Log out?</a></p>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ), 1489 'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email is <em>never</em> published nor shared.' ) . ( $req ? __( ' Required fields are marked <span class="required">*</span>' ) : '' ) . '</p>', 1489 'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email is <em>never</em> published nor shared.' ) . ( $req ? __( ' Required fields are marked <span class="required">*</span>' ) : '' ) . '</p>', 1490 1490 'comment_notes_after' => '<dl class="form-allowed-tags"><dt>' . __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:' ) . '</dt> <dd><code>' . allowed_tags() . '</code></dd></dl>', 1491 1491 'id_form' => 'commentform', -
trunk/wp-includes/custom-navigation.php
r13266 r13268 32 32 33 33 function wp_custom_navigation_setup($override = false) { 34 34 35 35 $nav_version = '1.1.0'; 36 36 //Custom Navigation Menu Setup 37 37 38 38 //Check for Upgrades 39 39 if (get_option('wp_settings_custom_nav_version') <> '') { … … 43 43 $nav_version_in_db = '0'; 44 44 } 45 45 46 46 //Override for menu descriptions 47 47 update_option('wp_settings_custom_nav_advanced_options','yes'); 48 49 if(($nav_version_in_db <> $nav_version) || ($override)) 48 49 if(($nav_version_in_db <> $nav_version) || ($override)) 50 50 update_option('wp_settings_custom_nav_version',$nav_version); 51 51 … … 85 85 86 86 function wp_custom_navigation_output($args = array()) { 87 87 88 88 //DEFAULT ARGS 89 89 $type = 'frontend'; 90 $name = 'Menu 1'; 90 $name = 'Menu 1'; 91 91 $id = 0; 92 92 $desc = 2; 93 93 $before_title = ''; 94 94 $after_title = ''; 95 95 96 96 if (isset($args)) { 97 98 if ( !is_array($args) ) 97 98 if ( !is_array($args) ) 99 99 parse_str( $args, $args ); 100 100 101 101 extract($args); 102 102 } … … 110 110 $desc = 2; 111 111 } 112 112 113 113 $queried_id = 0; 114 114 global $wp_query; … … 146 146 else 147 147 $link = $menu_item->guid; 148 148 149 149 if ( $menu_item->post_title == '' ) { 150 150 $title_raw = get_categories( 'include='.$menu_item->post_parent ); 151 $title = htmlentities($title_raw[0]->cat_name); 151 $title = htmlentities($title_raw[0]->cat_name); 152 152 } else { 153 153 $title = htmlentities( $menu_item->post_title ); 154 154 } 155 155 156 156 if ( $menu_item->post_content == '' ) 157 157 $description = htmlentities( strip_tags( category_description( $menu_item->post_parent ) ) ); … … 177 177 $anchor_title = $title; 178 178 } 179 179 180 180 if ($queried_id == $wp_custom_nav_menu_items->post_id) { 181 181 $li_class = 'class="current_page_item"'; … … 184 184 $li_class = ''; 185 185 } 186 186 187 187 if (isset($wp_custom_nav_menu_items->new_window)) { 188 188 if ($wp_custom_nav_menu_items->new_window > 0) { … … 193 193 } 194 194 } 195 */ 195 */ 196 196 //List Items 197 197 ?><li id="menu-<?php echo $menu_item->ID; ?>" value="<?php echo $menu_item->ID; ?>" <?php echo $li_class; ?>><?php … … 199 199 //FRONTEND Link 200 200 if ($type == "frontend") 201 { 202 ?><a title="<?php echo $anchor_title; ?>" href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $before_title.$title.$after_title; ?><?php 203 204 if ( $advanced_option_descriptions == 'no' ) 205 { 201 { 202 ?><a title="<?php echo $anchor_title; ?>" href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $before_title.$title.$after_title; ?><?php 203 204 if ( $advanced_option_descriptions == 'no' ) 205 { 206 206 // 2 widget override do NOT display descriptions 207 207 // 1 widget override display descriptions … … 210 210 { 211 211 ?><span class="nav-description"><?php echo $description; ?></span><?php 212 } 212 } 213 213 elseif ($desc == 2) 214 214 { } 215 215 else 216 216 { } 217 } 218 else 217 } 218 else 219 219 { 220 220 // 2 widget override do NOT display descriptions … … 224 224 { 225 225 ?><span class="nav-description"><?php echo $description; ?></span><?php 226 } 226 } 227 227 elseif (($desc == 2) || ($desc == 0)) 228 228 { } 229 else 229 else 230 230 { } 231 231 } 232 233 ?></a><?php 232 233 ?></a><?php 234 234 } 235 235 //BACKEND draggable and droppable elements … … 238 238 { 239 239 ?> 240 240 241 241 <dl> 242 242 <dt> … … 250 250 </dt> 251 251 </dl> 252 252 253 253 <a><span class=""></span></a> 254 254 <input type="hidden" name="dbid<?php echo $menu_item->menu_order; ?>" id="dbid<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->ID; ?>" /> … … 263 263 <input type="hidden" name="anchortitle<?php echo $menu_item->menu_order; ?>" id="anchortitle<?php echo $menu_item->menu_order; ?>" value="<?php echo esc_html( $menu_item->post_excerpt ); ?>" /> 264 264 <input type="hidden" name="newwindow<?php echo $menu_item->menu_order; ?>" id="newwindow<?php echo $menu_item->menu_order; ?>" value="<?php echo ( '' == $menu_item->post_content_filtered ? '0' : '1' ); ?>" /> 265 266 <?php 265 266 <?php 267 267 } 268 268 269 269 //@todo: implement menu heirarchy 270 270 /* //DISPLAY menu sub items 271 if ($wp_custom_nav_menu_items->parent_id == 0) 271 if ($wp_custom_nav_menu_items->parent_id == 0) 272 272 { 273 273 //FRONTEND 274 if ($type == 'frontend') 274 if ($type == 'frontend') 275 275 { 276 276 //Recursive function … … 278 278 } 279 279 //BACKEND 280 else 280 else 281 281 { 282 282 //Recursive function … … 285 285 } 286 286 */ ?></li> 287 <?php 287 <?php 288 288 } 289 289 } … … 291 291 //RECURSIVE Sub Menu Items 292 292 function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,$menu_id = 0) { 293 293 294 294 $parent_id = 0; 295 295 global $wpdb; 296 296 297 297 //GET sub menu items 298 298 $wp_custom_nav_menu = $wpdb->get_results("SELECT id,post_id,parent_id,position,custom_title,custom_link,custom_description,menu_icon,link_type,custom_anchor_title,new_window FROM ".$table_name." WHERE parent_id = '".$post_id."' AND menu_id='".$menu_id."' ORDER BY position ASC"); 299 299 300 300 if (empty($wp_custom_nav_menu)) 301 301 { 302 302 303 303 } 304 304 else … … 318 318 } 319 319 //DISPLAY Loop 320 foreach ($wp_custom_nav_menu as $sub_item) 320 foreach ($wp_custom_nav_menu as $sub_item) 321 321 { 322 322 //Figure out where the menu item sits 323 323 $counter=$sub_item->position; 324 324 325 325 //Prepare Menu Data 326 326 //Category Menu Item 327 if ($sub_item->link_type == 'category') 328 { 329 327 if ($sub_item->link_type == 'category') 328 { 329 330 330 $parent_id = $sub_item->parent_id; 331 331 $post_id = $sub_item->post_id; 332 332 333 333 if ($sub_item->custom_link == '') { 334 334 $link = get_category_link($sub_item->post_id); … … 337 337 $link = $sub_item->custom_link; 338 338 } 339 339 340 340 if ($sub_item->custom_title == '') { 341 341 $title_raw = get_categories('include='.$sub_item->post_id); … … 345 345 $title = htmlentities($sub_item->custom_title); 346 346 } 347 347 348 348 if ($sub_item->custom_description == '') { 349 349 $description = strip_tags(category_description($sub_item->post_id)); … … 357 357 elseif ($sub_item->link_type == 'page') 358 358 { 359 359 360 360 $parent_id = $sub_item->parent_id; 361 361 $post_id = $sub_item->post_id; 362 362 363 363 if ($sub_item->custom_link == '') { 364 364 $link = get_permalink($sub_item->post_id); … … 374 374 $title = htmlentities($sub_item->custom_title); 375 375 } 376 376 377 377 if ($sub_item->custom_description == '') { 378 378 $description = get_post_meta($sub_item->post_id, 'page-description', true); … … 382 382 } 383 383 $target = ''; 384 384 385 385 } 386 386 //Custom Menu Item … … 400 400 $li_class = ''; 401 401 } 402 402 403 403 //SET anchor title 404 404 if (isset($sub_item->custom_anchor_title)) { … … 408 408 $anchor_title = $title; 409 409 } 410 410 411 411 if (isset($sub_item->new_window)) { 412 412 if ($sub_item->new_window > 0) { … … 414 414 } 415 415 } 416 416 417 417 //List Items 418 ?><li id="menu-<?php echo $counter; ?>" value="<?php echo $counter; ?>" <?php echo $li_class; ?>><?php 418 ?><li id="menu-<?php echo $counter; ?>" value="<?php echo $counter; ?>" <?php echo $li_class; ?>><?php 419 419 //FRONTEND 420 420 if ($output_type == "frontend") 421 421 { 422 ?><a title="<?php echo $anchor_title; ?>" href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $title; ?></a><?php 422 ?><a title="<?php echo $anchor_title; ?>" href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $title; ?></a><?php 423 423 } 424 424 //BACKEND … … 431 431 <span class="controls"> 432 432 <span class="type"><?php echo $sub_item->link_type; ?></span> 433 <a id="edit<?php echo $counter; ?>" onclick="edititem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a> 433 <a id="edit<?php echo $counter; ?>" onclick="edititem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a> 434 434 <a id="remove<?php echo $counter; ?>" onclick="removeitem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" /></a> 435 435 <a id="view<?php echo $counter; ?>" target="_blank" href="<?php echo $link; ?>"><img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" /></a> … … 449 449 <input type="hidden" name="anchortitle<?php echo $counter; ?>" id="anchortitle<?php echo $counter; ?>" value="<?php echo $anchor_title; ?>" /> 450 450 <input type="hidden" name="newwindow<?php echo $counter; ?>" id="newwindow<?php echo $counter; ?>" value="<?php echo $sub_item->new_window; ?>" /> 451 <?php 451 <?php 452 452 } 453 453 454 454 //Do recursion 455 wp_custom_navigation_sub_items($sub_item->id,$sub_item->link_type,$table_name,$output_type,$menu_id); 455 wp_custom_navigation_sub_items($sub_item->id,$sub_item->link_type,$table_name,$output_type,$menu_id); 456 456 ?></li> 457 <?php 458 459 } 460 457 <?php 458 459 } 460 461 461 ?></ul> 462 <?php 463 464 } 465 462 <?php 463 464 } 465 466 466 return $parent_id; 467 467 468 468 } 469 469 … … 486 486 'number' => '', 487 487 'offset' => 0 ); 488 489 //GET all pages 488 489 //GET all pages 490 490 $pages_array = get_pages($pages_args); 491 491 492 492 $intCounter = $counter; 493 493 $parentli = $intCounter; 494 494 495 495 if ($pages_array) 496 496 { … … 498 498 foreach ($pages_array as $post) 499 499 { 500 500 501 501 if ($post->post_parent == 0) 502 502 { … … 506 506 $description = get_post_meta($post->ID, 'page-description', true); 507 507 ?> 508 508 509 509 <li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>"> 510 510 511 511 <dl> 512 512 <dt> … … 514 514 <span class="controls"> 515 515 <span class="type">page</span> 516 <a id="edit<?php echo $intCounter; ?>" onclick="edititem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a> 516 <a id="edit<?php echo $intCounter; ?>" onclick="edititem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a> 517 517 <a id="remove<?php echo $intCounter; ?>" onclick="removeitem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"> 518 518 <img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" /> … … 522 522 </a> 523 523 </span> 524 524 525 525 </dt> 526 526 </dl> … … 537 537 <input type="hidden" name="anchortitle<?php echo $intCounter; ?>" id="anchortitle<?php echo $intCounter; ?>" value="<?php echo htmlentities($post->post_title); ?>" /> 538 538 <input type="hidden" name="newwindow<?php echo $intCounter; ?>" id="newwindow<?php echo $intCounter; ?>" value="0" /> 539 539 540 540 <?php $parentli = $post->ID; ?> 541 <?php $intCounter++; ?> 541 <?php $intCounter++; ?> 542 542 <?php 543 543 544 544 //Recursive function 545 545 $intCounter = wp_custom_navigation_default_sub_items($post->ID, $intCounter, $parentli, 'pages', 'menu'); 546 546 547 547 ?> 548 548 549 549 </li> 550 551 <?php 552 550 551 <?php 552 553 553 } 554 554 //Sidebar Menu … … 556 556 { 557 557 ?> 558 558 559 559 <li> 560 560 <dl> … … 565 565 $post_id = $post->ID; 566 566 $post_parent_id = $post->post_parent; 567 567 568 568 $description = htmlentities(get_post_meta($post_id, 'page-description', true)); 569 569 570 570 ?> 571 571 <?php $templatedir = get_bloginfo('url'); ?> 572 572 573 573 <span class="title"><?php echo $post->post_title; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','Page','<?php echo $post_text; ?>','<?php echo $post_url; ?>','<?php echo $post_id; ?>','<?php echo $post_parent_id ?>','<?php echo $description; ?>')" name="<?php echo $post_text; ?>" value="<?php echo get_permalink($post->ID); ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a></dt> 574 574 </dl> 575 575 <?php $parentli = $post->ID; ?> 576 <?php $intCounter++; ?> 576 <?php $intCounter++; ?> 577 577 <?php 578 578 579 579 //Recursive function 580 580 $intCounter = wp_custom_navigation_default_sub_items($post_id, $intCounter, $parentli, 'pages', 'default'); 581 581 582 582 ?> 583 583 584 584 </li> 585 586 <?php 587 585 586 <?php 587 588 588 } 589 589 else 590 590 { 591 592 } 593 } 594 } 595 } 596 else 591 592 } 593 } 594 } 595 } 596 else 597 597 { 598 598 echo 'Not Found'; … … 617 617 'number' => '', 618 618 'pad_counts' => false ); 619 620 621 622 $intCounter = $counter; 623 624 //GET all categories 619 620 621 622 $intCounter = $counter; 623 624 //GET all categories 625 625 $categories_array = get_categories($category_args); 626 626 627 627 if ($categories_array) 628 628 { … … 637 637 { 638 638 ?> 639 639 640 640 <li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>"> 641 641 <dl> … … 644 644 <span class="controls"> 645 645 <span class="type">category</span> 646 <a id="edit<?php echo $intCounter; ?>" onclick="edititem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a> 646 <a id="edit<?php echo $intCounter; ?>" onclick="edititem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a> 647 647 <a id="remove<?php echo $intCounter; ?>" onclick="removeitem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"> 648 648 <img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" /> … … 652 652 </a> 653 653 </span> 654 654 655 655 </dt> 656 656 </dl> 657 657 <a class="hide" href="<?php echo get_category_link($cat_item->cat_ID); ?>"><span class="title"><?php echo $cat_item->cat_name; ?></span> 658 <?php 658 <?php 659 659 $use_cats_raw = get_option('wp_settings_custom_nav_descriptions'); 660 660 $use_cats = strtolower($use_cats_raw); … … 673 673 <input type="hidden" name="anchortitle<?php echo $intCounter; ?>" id="anchortitle<?php echo $intCounter; ?>" value="<?php echo htmlentities($cat_item->cat_name); ?>" /> 674 674 <input type="hidden" name="newwindow<?php echo $intCounter; ?>" id="newwindow<?php echo $intCounter; ?>" value="0" /> 675 675 676 676 <?php $parentli = $cat_item->cat_ID; ?> 677 <?php $intCounter++; ?> 677 <?php $intCounter++; ?> 678 678 <?php 679 679 680 680 //Recursive function 681 681 $intCounter = wp_custom_navigation_default_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories','menu'); 682 682 683 683 ?> 684 684 685 685 </li> 686 687 <?php 686 687 <?php 688 688 } 689 689 //Sidebar Menu … … 705 705 </dl> 706 706 <?php $parentli = $cat_item->cat_ID; ?> 707 <?php $intCounter++; ?> 708 <?php 707 <?php $intCounter++; ?> 708 <?php 709 709 //Recursive function 710 710 $intCounter = wp_custom_navigation_default_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories','default'); 711 711 ?> 712 712 713 713 </li> 714 715 <?php 716 } 717 } 714 715 <?php 716 } 717 } 718 718 } 719 719 } 720 else 720 else 721 721 { 722 722 echo 'Not Found'; 723 723 } 724 724 725 725 return $intCounter; 726 726 } … … 730 730 731 731 $counter = $intCounter; 732 732 733 733 //Custom Menu 734 if ($output_type == 'menu') 734 if ($output_type == 'menu') 735 735 { 736 736 $sub_args = array( … … 740 740 } 741 741 //Sidebar Menu 742 elseif ($output_type == 'default') 742 elseif ($output_type == 'default') 743 743 { 744 744 $sub_args = array( … … 747 747 'parent' => $childof); 748 748 } 749 else 750 { 751 752 } 753 754 //Get Sub Category Items 749 else 750 { 751 752 } 753 754 //Get Sub Category Items 755 755 if ($type == 'categories') 756 756 { 757 $sub_array = get_categories($sub_args); 757 $sub_array = get_categories($sub_args); 758 758 } 759 759 //Get Sub Page Items … … 762 762 $sub_array = get_pages($sub_args); 763 763 } 764 765 764 765 766 766 if ($sub_array) 767 767 { 768 768 ?> 769 769 770 770 <ul id="sub-custom-nav-<?php echo $type ?>"> 771 771 772 772 <?php 773 773 //DISPLAY Loop … … 776 776 //Prepare Menu Data 777 777 //Category Menu Item 778 if ($type == 'categories') 778 if ($type == 'categories') 779 779 { 780 780 $link = get_category_link($sub_item->cat_ID); … … 784 784 $linktype = 'category'; 785 785 $appendtype = 'Category'; 786 $description = htmlentities(strip_tags($sub_item->description)); 786 $description = htmlentities(strip_tags($sub_item->description)); 787 787 } 788 788 //Page Menu Item … … 798 798 } 799 799 //Custom Menu Item 800 else 800 else 801 801 { 802 802 $title = ''; … … 804 804 $appendtype= 'Custom'; 805 805 } 806 806 807 807 //Custom Menu 808 808 if ($output_type == 'menu') … … 815 815 <span class="controls"> 816 816 <span class="type"><?php echo $linktype; ?></span> 817 <a id="edit<?php echo $counter; ?>" onclick="edititem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a> 817 <a id="edit<?php echo $counter; ?>" onclick="edititem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a> 818 818 <a id="remove<?php echo $counter; ?>" onclick="removeitem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"> 819 819 <img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" /> … … 823 823 </a> 824 824 </span> 825 825 826 826 </dt> 827 827 </dl> … … 838 838 <input type="hidden" name="anchortitle<?php echo $counter; ?>" id="anchortitle<?php echo $counter; ?>" value="<?php echo $title; ?>" /> 839 839 <input type="hidden" name="newwindow<?php echo $counter; ?>" id="newwindow<?php echo $counter; ?>" value="0" /> 840 840 841 841 <?php $counter++; ?> 842 <?php 843 842 <?php 843 844 844 //Do recursion 845 $counter = wp_custom_navigation_default_sub_items($parent_id, $counter, $parent_id, $type, 'menu'); 846 845 $counter = wp_custom_navigation_default_sub_items($parent_id, $counter, $parent_id, $type, 'menu'); 846 847 847 ?> 848 848 849 849 </li> 850 <?php 850 <?php 851 851 } 852 852 //Sidebar Menu 853 853 elseif ($output_type == 'default') 854 854 { 855 855 856 856 ?> 857 857 <li> 858 858 <dl> 859 859 <dt> 860 860 861 861 <?php $templatedir = get_bloginfo('url'); ?> 862 862 <span class="title"><?php echo $title; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','<?php echo $appendtype; ?>','<?php echo $title; ?>','<?php echo $link; ?>','<?php echo $itemid; ?>','<?php echo $parent_id ?>','<?php echo $description; ?>')" name="<?php echo $title; ?>" value="<?php echo $link; ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a> </dt> 863 863 </dl> 864 <?php 865 864 <?php 865 866 866 //Do recursion 867 867 $counter = wp_custom_navigation_default_sub_items($itemid, $counter, $parent_id, $type, 'default'); 868 868 869 869 ?> 870 870 </li> 871 872 <?php 873 } 874 871 872 <?php 873 } 874 875 875 } 876 876 ?> 877 877 878 878 </ul> 879 880 <?php 881 } 882 879 880 <?php 881 } 882 883 883 return $counter; 884 884 … … 892 892 893 893 $counter = $intCounter; 894 894 895 895 global $wpdb; 896 897 898 899 //Get Sub Category Items 896 897 898 899 //Get Sub Category Items 900 900 if ($type == 'categories') 901 901 { … … 904 904 'hide_empty' => false, 905 905 'parent' => $childof); 906 $sub_array = get_categories($sub_args); 906 $sub_array = get_categories($sub_args); 907 907 } 908 908 //Get Sub Page Items … … 912 912 'child_of' => $childof, 913 913 'parent' => $childof); 914 914 915 915 $sub_array = get_pages($sub_args); 916 916 917 917 } 918 918 else { 919 920 } 921 919 920 } 921 922 922 if ($sub_array) 923 923 { … … 929 929 } 930 930 elseif (isset($sub_item->post_parent)) { 931 $sub_item_parent = $sub_item->post_parent; 931 $sub_item_parent = $sub_item->post_parent; 932 932 } 933 933 else { … … 938 938 //Prepare Menu Data 939 939 //Category Menu Item 940 if ($type == 'categories') 940 if ($type == 'categories') 941 941 { 942 942 $link = get_category_link($sub_item->cat_ID); … … 958 958 } 959 959 //Custom Menu Item 960 else 960 else 961 961 { 962 962 $title = ''; … … 964 964 $appendtype= 'Custom'; 965 965 } 966 966 967 967 //CHECK for existing parent records 968 968 //echo $parent_id; … … 974 974 //$parent_id = 0; 975 975 } 976 976 977 977 //INSERT item 978 978 $insert = "INSERT INTO ".$table_name." (position,post_id,parent_id,custom_title,custom_link,custom_description,menu_icon,link_type,menu_id,custom_anchor_title) "."VALUES ('".$counter."','".$itemid."','".$parent_id."','".$title."','".$link."','','','".$linktype."','".$menu_id."','".$title."')"; 979 979 $results = $wpdb->query( $insert ); 980 980 981 981 $counter++; 982 982 $counter = get_children_menu_elements($itemid, $counter, $parent_id, $type, $menu_id, $table_name); 983 } 983 } 984 984 //Do nothing 985 985 else { 986 986 987 987 } 988 988 } -
trunk/wp-includes/default-widgets.php
r13257 r13268 1010 1010 function WP_CustomNavWidget() { 1011 1011 $widget_ops = array('description' => 'Use this widget to add one of your Custom Navigation Menus as a widget.' ); 1012 parent::WP_Widget(false, __('Custom Navigation Menu'),$widget_ops); 1013 } 1014 1015 function widget($args, $instance) { 1012 parent::WP_Widget(false, __('Custom Navigation Menu'),$widget_ops); 1013 } 1014 1015 function widget($args, $instance) { 1016 1016 $navmenu = $instance['navmenu']; 1017 1017 $navtitle = $instance['navtitle']; … … 1023 1023 $navulid = $instance['navulid']; 1024 1024 $navulclass = $instance['navulclass']; 1025 1025 1026 1026 //Override for menu descriptions 1027 1027 $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); 1028 if ($advanced_option_descriptions == 'no') 1029 { 1028 if ($advanced_option_descriptions == 'no') 1029 { 1030 1030 $navwidgetdescription = 2; 1031 } 1031 } 1032 1032 else 1033 1033 { … … 1035 1035 } 1036 1036 $menuexists = false; 1037 1037 1038 1038 global $wpdb; 1039 1039 1040 1040 //GET menu name 1041 1041 if ($navmenu > 0) … … 1047 1047 } 1048 1048 //Do nothing 1049 else 1049 else 1050 1050 { 1051 1051 $menuexists = false; 1052 1052 } 1053 1053 ?> 1054 1055 <?php 1054 1055 <?php 1056 1056 //DEVELOPER settings enabled 1057 if ($navdeveloper == 'yes') 1058 { 1057 if ($navdeveloper == 'yes') 1058 { 1059 1059 //DISPLAY Custom DIV 1060 if ($navdiv == 'yes') 1061 { 1060 if ($navdiv == 'yes') 1061 { 1062 1062 ?> 1063 1063 <div id="<?php echo $navdivid; ?>" class="<?php echo $navdivclass; ?>"> 1064 <?php 1064 <?php 1065 1065 } 1066 1066 //Do NOT display DIV 1067 else 1067 else 1068 1068 { 1069 1070 } 1071 1072 } 1069 1070 } 1071 1072 } 1073 1073 //DISPLAY default DIV 1074 else 1074 else 1075 1075 { 1076 1076 ?> 1077 1077 <div class="widget"> 1078 <?php 1078 <?php 1079 1079 } 1080 1080 ?> 1081 1081 1082 1082 <h3><?php echo $navtitle; ?></h3> 1083 <?php 1084 1085 if ($menuexists) 1083 <?php 1084 1085 if ($menuexists) 1086 1086 { 1087 1087 ?> 1088 <?php 1089 1088 <?php 1089 1090 1090 //DEVELOPER settings enabled 1091 if ($navdeveloper == 'yes') 1092 { 1091 if ($navdeveloper == 'yes') 1092 { 1093 1093 //DISPLAY Custom UL 1094 if ($navul == 'yes') 1095 { 1094 if ($navul == 'yes') 1095 { 1096 1096 ?> 1097 1097 <ul id="<?php echo $navulid; ?>" class="<?php echo $navulclass; ?>"> 1098 <?php 1098 <?php 1099 1099 } 1100 1100 //Do NOT display UL 1101 else 1101 else 1102 1102 { 1103 1104 } 1105 1106 } 1103 1104 } 1105 1106 } 1107 1107 //DISPLAY default UL 1108 else 1108 else 1109 1109 { 1110 1110 ?> 1111 1111 <ul class="custom-nav"> 1112 <?php 1112 <?php 1113 1113 } 1114 1114 1115 1115 ?> 1116 1116 1117 1117 <?php 1118 1118 //DISPLAY custom navigation menu 1119 1119 if (get_option('wp_custom_nav_menu') == 'true') { 1120 1120 custom_nav('name='.$wp_custom_nav_menu_name.'&desc='.$navwidgetdescription); 1121 } 1121 } 1122 1122 ?> 1123 1124 <?php 1125 1123 1124 <?php 1125 1126 1126 //DEVELOPER settings enabled 1127 if ($navdeveloper == 'yes') 1128 { 1127 if ($navdeveloper == 'yes') 1128 { 1129 1129 //DISPLAY Custom UL 1130 if ($navul == 'yes') 1131 { 1130 if ($navul == 'yes') 1131 { 1132 1132 ?> 1133 1133 </ul> 1134 <?php 1134 <?php 1135 1135 } 1136 1136 //Do NOT display UL 1137 else 1137 else 1138 1138 { 1139 1140 } 1141 1142 } 1139 1140 } 1141 1142 } 1143 1143 //DISPLAY default UL 1144 else 1144 else 1145 1145 { 1146 1146 ?> 1147 1147 </ul> 1148 <?php 1148 <?php 1149 1149 } 1150 1150 1151 1151 ?> 1152 1152 <?php … … 1157 1157 } 1158 1158 ?> 1159 <?php 1159 <?php 1160 1160 //DEVELOPER settings enabled 1161 if ($navdeveloper == 'yes') 1162 { 1161 if ($navdeveloper == 'yes') 1162 { 1163 1163 //DISPLAY Custom DIV 1164 if ($navdiv == 'yes') 1165 { 1164 if ($navdiv == 'yes') 1165 { 1166 1166 ?> 1167 1167 </div> 1168 <?php 1168 <?php 1169 1169 } 1170 1170 //Do NOT display DIV 1171 else 1171 else 1172 1172 { 1173 1174 } 1175 1176 } 1173 1174 } 1175 1176 } 1177 1177 //DISPLAY default DIV 1178 else 1178 else 1179 1179 { 1180 1180 ?> 1181 1181 </div> 1182 <?php 1182 <?php 1183 1183 } 1184 1184 ?><!-- /#nav-container --> 1185 1185 1186 1186 <?php 1187 1187 } 1188 1188 1189 function update($new_instance, $old_instance) { 1189 function update($new_instance, $old_instance) { 1190 1190 return $new_instance; 1191 1191 } 1192 1192 1193 function form($instance) { 1193 function form($instance) { 1194 1194 $navmenu = esc_attr($instance['navmenu']); 1195 1195 $navtitle = esc_attr($instance['navtitle']); … … 1202 1202 $navulclass = esc_attr($instance['navulclass']); 1203 1203 $navwidgetdescription = esc_attr($instance['navwidgetdescription']); 1204 1204 1205 1205 global $wpdb; 1206 1207 //GET Menu Items for SELECT OPTIONS 1206 1207 //GET Menu Items for SELECT OPTIONS 1208 1208 $table_name_custom_menus = $wpdb->prefix . "custom_nav_menus"; 1209 1209 $custom_menu_records = $wpdb->get_results("SELECT id,menu_name FROM ".$table_name_custom_menus); 1210 1210 1211 1211 //CHECK if menus exist 1212 1212 if ($custom_menu_records > 0) 1213 1213 { 1214 1214 1215 1215 ?> 1216 1216 1217 1217 <p> 1218 1218 <label for="<?php echo $this->get_field_id('navmenu'); ?>"><?php _e('Select Menu:'); ?></label> 1219 1219 1220 1220 <select id="<?php echo $this->get_field_id('navmenu'); ?>" name="<?php echo $this->get_field_name('navmenu'); ?>"> 1221 <?php 1222 1221 <?php 1222 1223 1223 //DISPLAY SELECT OPTIONS 1224 1224 foreach ($custom_menu_records as $custom_menu_record) … … 1233 1233 <option value="<?php echo $custom_menu_record->id; ?>" <?php echo $selected_option; ?>><?php echo $custom_menu_record->menu_name; ?></option> 1234 1234 <?php 1235 1235 1236 1236 } 1237 1237 ?> 1238 1238 </select> 1239 1239 1240 1240 </p> 1241 1241 1242 1242 <p> 1243 1243 1244 1244 <label for="<?php echo $this->get_field_id('navtitle'); ?>"><?php _e('Title:'); ?></label> 1245 1245 <input type="text" name="<?php echo $this->get_field_name('navtitle'); ?>" value="<?php echo $navtitle; ?>" class="widefat" id="<?php echo $this->get_field_id('navtitle'); ?>" /> 1246 1246 </p> 1247 1247 1248 1248 <p> 1249 1249 <?php 1250 1250 $checked = strtolower($navdeveloper); 1251 1251 ?> 1252 1253 <label for="<?php echo $this->get_field_id('navdeveloper'); ?>"><?php _e('Advanced Options:'); ?></label><br /> 1252 1253 <label for="<?php echo $this->get_field_id('navdeveloper'); ?>"><?php _e('Advanced Options:'); ?></label><br /> 1254 1254 <span class="checkboxes"> 1255 1255 <label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navdeveloper'); ?>" name="<?php echo $this->get_field_name('navdeveloper'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> /> 1256 1256 <label>No</label><input type="radio" id="<?php echo $this->get_field_name('navdeveloper'); ?>" name="<?php echo $this->get_field_name('navdeveloper'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> /> 1257 1257 </span><!-- /.checkboxes --> 1258 1258 1259 1259 </p> 1260 1261 <?php 1262 1260 1261 <?php 1262 1263 1263 //DEVELOPER settings 1264 1264 if ($checked == 'yes') 1265 1265 { 1266 1266 ?> 1267 1267 1268 1268 <p> 1269 1269 <?php 1270 1270 $checked = strtolower($navdiv); 1271 1271 ?> 1272 1273 <label for="<?php echo $this->get_field_id('navdiv'); ?>"><?php _e('Wrap in container DIV:'); ?></label><br /> 1272 1273 <label for="<?php echo $this->get_field_id('navdiv'); ?>"><?php _e('Wrap in container DIV:'); ?></label><br /> 1274 1274 <span class="checkboxes"> 1275 1275 <label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navdiv'); ?>" name="<?php echo $this->get_field_name('navdiv'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> /> 1276 1276 <label>No</label><input type="radio" id="<?php echo $this->get_field_name('navdiv'); ?>" name="<?php echo $this->get_field_name('navdiv'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> /> 1277 1277 </span><!-- /.checkboxes --> 1278 1278 1279 1279 </p> 1280 1280 1281 1281 <?php 1282 1282 1283 1283 if ($checked == 'yes') 1284 1284 { 1285 1285 1286 1286 ?> 1287 1287 1288 1288 <p> 1289 1289 1290 1290 <label for="<?php echo $this->get_field_id('navdivid'); ?>"><?php _e('DIV id:'); ?></label> 1291 1291 <input type="text" name="<?php echo $this->get_field_name('navdivid'); ?>" value="<?php echo $navdivid; ?>" class="widefat" id="<?php echo $this->get_field_id('navdivid'); ?>" /> 1292 1292 </p> 1293 1293 <p> 1294 1294 1295 1295 <label for="<?php echo $this->get_field_id('navdivclass'); ?>"><?php _e('DIV class:'); ?></label> 1296 1296 <input type="text" name="<?php echo $this->get_field_name('navdivclass'); ?>" value="<?php echo $navdivclass; ?>" class="widefat" id="<?php echo $this->get_field_id('navdivclass'); ?>" /> 1297 1297 </p> 1298 1298 1299 1299 <?php 1300 1300 1301 1301 } 1302 1302 1303 1303 ?> 1304 1304 1305 1305 <p> 1306 1306 <?php 1307 1307 $checked = strtolower($navul); 1308 1308 ?> 1309 1310 <label for="<?php echo $this->get_field_id('navul'); ?>"><?php _e('Wrap in container UL:'); ?></label><br /> 1309 1310 <label for="<?php echo $this->get_field_id('navul'); ?>"><?php _e('Wrap in container UL:'); ?></label><br /> 1311 1311 <span class="checkboxes"> 1312 1312 <label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navul'); ?>" name="<?php echo $this->get_field_name('navul'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> /> 1313 1313 <label>No</label><input type="radio" id="<?php echo $this->get_field_name('navul'); ?>" name="<?php echo $this->get_field_name('navul'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> /> 1314 1314 </span><!-- /.checkboxes --> 1315 1315 1316 1316 </p> 1317 1317 1318 1318 <?php 1319 1319 1320 1320 if ($checked == 'yes') 1321 1321 { 1322 1322 1323 1323 ?> 1324 1324 1325 1325 <p> 1326 1326 1327 1327 <label for="<?php echo $this->get_field_id('navulid'); ?>"><?php _e('UL id:'); ?></label> 1328 1328 <input type="text" name="<?php echo $this->get_field_name('navulid'); ?>" value="<?php echo $navulid; ?>" class="widefat" id="<?php echo $this->get_field_id('navulid'); ?>" /> 1329 1329 </p> 1330 1330 <p> 1331 1331 1332 1332 <label for="<?php echo $this->get_field_id('navulclass'); ?>"><?php _e('UL class:'); ?></label> 1333 1333 <input type="text" name="<?php echo $this->get_field_name('navulclass'); ?>" value="<?php echo $navulclass; ?>" class="widefat" id="<?php echo $this->get_field_id('navulclass'); ?>" /> 1334 1334 </p> 1335 1335 1336 1336 <?php 1337 1337 1338 1338 } 1339 1339 1340 1340 ?> 1341 1341 <?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?> 1342 1342 <p <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?>> 1343 1343 1344 1344 <?php 1345 1345 $checked = strtolower($navwidgetdescription); 1346 1346 ?> 1347 1348 <label for="<?php echo $this->get_field_id('navwidgetdescription'); ?>"><?php _e('Show Top Level Descriptions:'); ?></label><br /> 1347 1348 <label for="<?php echo $this->get_field_id('navwidgetdescription'); ?>"><?php _e('Show Top Level Descriptions:'); ?></label><br /> 1349 1349 <span class="checkboxes"> 1350 1350 <label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navwidgetdescription'); ?>" name="<?php echo $this->get_field_name('navwidgetdescription'); ?>" value="1" <?php if ($checked=='1') { echo 'checked="checked"'; } ?> /> … … 1352 1352 </span><!-- /.checkboxes --> 1353 1353 </p> 1354 <?php 1354 <?php 1355 1355 } 1356 1356 //Do nothing 1357 else 1357 else 1358 1358 { 1359 1359 1360 1360 } 1361 1361 1362 1362 } 1363 1363 //Error message for menus not existing 1364 else 1364 else 1365 1365 { 1366 1366 ?> … … 1371 1371 } 1372 1372 } 1373 1373 1374 1374 } 1375 1375 … … 1409 1409 1410 1410 register_widget('WP_Widget_Tag_Cloud'); 1411 1411 1412 1412 register_widget('WP_CustomNavWidget'); 1413 1413 1414 1414 do_action('widgets_init'); 1415 1415 } -
trunk/wp-includes/deprecated.php
r13229 r13268 2063 2063 * @deprecated 2.8.0 2064 2064 * @deprecated Use esc_url_raw() 2065 * @see esc_url_raw() 2065 * @see esc_url_raw() 2066 2066 * 2067 2067 * @param string $url The URL to be cleaned. -
trunk/wp-includes/functions.php
r13242 r13268 611 611 * 612 612 * @package WordPress 613 * @subpackage Option 613 * @subpackage Option 614 614 * @since 1.2.0 615 615 * -
trunk/wp-includes/general-template.php
r13262 r13268 714 714 715 715 $tag = $wp_query->get_queried_object();; 716 716 717 717 if ( ! $tag ) 718 718 return; -
trunk/wp-includes/http.php
r13149 r13268 1013 1013 'protocol_version' => (float) $r['httpversion'], 1014 1014 'header' => $strHeaders, 1015 'ignore_errors' => true, // Return non-200 requests. 1015 'ignore_errors' => true, // Return non-200 requests. 1016 1016 'timeout' => $r['timeout'], 1017 1017 'ssl' => array( -
trunk/wp-includes/ms-default-constants.php
r13127 r13268 35 35 function ms_cookie_constants( ) { 36 36 global $current_site; 37 37 38 38 /** 39 39 * @since 1.2.0 -
trunk/wp-includes/script-loader.php
r13266 r13268 398 398 399 399 } 400 400 401 401 //Custom Navigation 402 402 403 403 $scripts->add( 'custom-navigation-ui-custom', '/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js', array('jquery'), '1.7.2' ); 404 404 $scripts->add_data( 'custom-navigation-ui-custom', 'group', 1 ); 405 405 406 406 $scripts->add( 'custom-navigation-default-items', "/wp-admin/js/custom-navigation-default-items$suffix.js", false, '20100220' ); 407 407 $scripts->add( 'custom-navigation-dynamic-functions', "/wp-admin/js/custom-navigation-dynamic-functions$suffix.js", false, '20100220' ); 408 408 $scripts->add( 'custom-navigation-php-functions', "/wp-admin/js/custom-navigation-php-functions$suffix.js", false, '20100220' ); 409 409 410 410 } 411 411 … … 474 474 $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' ); 475 475 $styles->add( 'custom-navigation', "/wp-admin/css/custom-navigation$suffix.css", array(), '20100215' ); 476 476 477 477 foreach ( $rtl_styles as $rtl_style ) 478 478 $styles->add_data( $rtl_style, 'rtl', true ); -
trunk/wp-includes/taxonomy.php
r13260 r13268 244 244 $args[$cap] = 'manage_categories'; 245 245 } 246 246 247 247 if ( empty($args['singular_label']) ) 248 248 $args['singular_label'] = $args['label']; -
trunk/wp-includes/template-loader.php
r13252 r13268 15 15 return; 16 16 elseif ( is_trackback() ) : 17 include( ABSPATH . 'wp-trackback.php' ); 17 include( ABSPATH . 'wp-trackback.php' ); 18 18 return; 19 19 endif; -
trunk/wp-settings.php
r13251 r13268 44 44 wp_check_php_mysql_versions(); 45 45 46 // Check if we have recieved a request due to missing favicon.ico 46 // Check if we have recieved a request due to missing favicon.ico 47 47 wp_favicon_request(); 48 48
Note: See TracChangeset
for help on using the changeset viewer.