Changeset 13295
- Timestamp:
- 02/22/2010 06:03:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-navigation.php
r13294 r13295 47 47 48 48 <div class="wrap"> 49 <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 <div id="no-js"><h3><?php _e('You do not have JavaScript enabled in your browser. Please enable it to access the Custom Menu functionality.'); ?></h3></div> 50 50 51 51 <?php … … 82 82 // @todo validate set_wp_menu 83 83 update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] ); 84 $messagesdiv = '<div id="message" class="updated fade below-h2"><p>' .$themename."'s Custom Menu has been updated!</p></div>";84 $messagesdiv = '<div id="message" class="updated fade below-h2"><p>' . __('Custom Menu has been updated!') . '</p></div>'; 85 85 } 86 86 … … 97 97 $existing_term = get_term_by( 'name', $insert_menu_name, 'nav_menu' ); 98 98 if ( $existing_term ) { 99 $messagesdiv = '<div id="message" class="error fade below-h2"><p>' . $existing_term->name . ' Menu has already created - please try another name</p></div>';99 $messagesdiv = '<div id="message" class="error fade below-h2"><p>' . esc_html( sprintf( e__('A menu named "%s" already exists; please try another name.'), $existing_term->name ) ) . '</p></div>'; 100 100 } else { 101 101 $term = wp_insert_term( $insert_menu_name, 'nav_menu' ); … … 105 105 $menu_selected_id = $term->term_id; 106 106 $menu_id_in_edit = $menu_selected_id; 107 $messagesdiv = '<div id="message" class="updated fade below-h2"><p>' . $term->name . ' Menu has been created!</p></div>';107 $messagesdiv = '<div id="message" class="updated fade below-h2"><p>' . esc_html( sprintf( __('"%s" menu has been created!'), $term->name ) ) . '</p></div>'; 108 108 109 109 $postCounter = 0; … … 111 111 } 112 112 } else { 113 $messagesdiv = '<div id="message" class="error fade below-h2"><p> Please enter a valid Menu name</p></div>';113 $messagesdiv = '<div id="message" class="error fade below-h2"><p>' . __('Please enter a valid menu name.') . '</p></div>'; 114 114 } 115 115 } … … 119 119 if ( $success ) { 120 120 // DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly 121 $messagesdiv = '<div id="message" class="updated fade below-h2"><p>' .$themename."'s Custom Menu has been RESET!</p></div>";121 $messagesdiv = '<div id="message" class="updated fade below-h2"><p>' . __('The menu has been reset.') . '</p></div>'; 122 122 // GET reset menu id 123 123 $custom_menus = array(); … … 125 125 } else { 126 126 // DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly 127 $messagesdiv = '<div id="message" class="error fade below-h2"><p>' .$themename."'s Custom Menu could not be RESET. Please try again.</p></div>";127 $messagesdiv = '<div id="message" class="error fade below-h2"><p>' . __('The menu could not be reset. Please try again.') . '</p></div>'; 128 128 } 129 129 } elseif ( $postCounter > 0 && $menu_selected_id > 0 ) { … … 181 181 <div id="pages-left"> 182 182 <div class="inside"> 183 <h2 class="maintitle"> Custom Navigation</h2>183 <h2 class="maintitle"><?php esc_html_e('Custom Navigation') ?></h2> 184 184 <?php 185 185 … … 190 190 if ($checked == 'true') { 191 191 } else { 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>';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 194 … … 206 206 <br/> 207 207 </div> 208 <h3><?php echo $menu_title; ?></h3>208 <h3><?php echo esc_html($menu_title); ?></h3> 209 209 210 210 </div> … … 232 232 </script> 233 233 234 <input id="save_bottom" name="save_bottom" type="submit" value=" Save All Changes" /></p>234 <input id="save_bottom" name="save_bottom" type="submit" value="<?php esc_attr_e('Save All Changes'); ?>" /></p> 235 235 </div><!-- /.inside --> 236 236 </div> … … 238 238 <div id="menu-right"> 239 239 240 <h2 class="heading"> Options</h2>240 <h2 class="heading"><?php esc_html_e('Options'); ?></h2> 241 241 242 242 <div class="widgets-holder-wrap"> 243 243 <div class="sidebar-name"> 244 244 <div class="sidebar-name-arrow"></div> 245 <h3> Setup Custom Menu</h3>245 <h3><?php esc_html_e('Setup Custom Menu'); ?></h3> 246 246 </div> 247 247 <div class="widget-holder"> … … 258 258 259 259 <span > 260 <label> Enable</label><input type="radio" name="enable_wp_menu" value="true" <?php if ($checked=='true') { echo 'checked="checked"'; } ?> />261 <label> Disable</label><input type="radio" name="enable_wp_menu" value="false" <?php if ($checked=='true') { } else { echo 'checked="checked"'; } ?> />260 <label><?php _e('Enable'); ?></label><input type="radio" name="enable_wp_menu" value="true" <?php if ($checked=='true') { echo 'checked="checked"'; } ?> /> 261 <label><?php _e('Disable'); ?></label><input type="radio" name="enable_wp_menu" value="false" <?php if ($checked=='true') { } else { echo 'checked="checked"'; } ?> /> 262 262 </span><!-- /.checkboxes --> 263 263 … … 265 265 266 266 <span> 267 <label> Reset Menu to Default</label>267 <label><?php _e('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> … … 276 276 <div class="sidebar-name"> 277 277 <div class="sidebar-name-arrow"></div> 278 <h3> Menu Selector</h3>278 <h3><?php esc_html_e('Menu Selector'); ?></h3> 279 279 </div> 280 280 <div class="widget-holder"> … … 297 297 </select> 298 298 299 <input id="switch_menu" type="submit" value=" Switch" name="switch_menu" class="button" />299 <input id="switch_menu" type="submit" value="<?php esc_attr_e('Switch'); ?>" name="switch_menu" class="button" /> 300 300 <input id="add_menu_name" name="add_menu_name" type="text" value="" /> 301 <input id="add_menu" type="submit" value=" Add Menu" name="add_menu" class="button" />301 <input id="add_menu" type="submit" value="<?php esc_attr_e('Add Menu'); ?>" name="add_menu" class="button" /> 302 302 303 303 <div class="fix"></div> … … 308 308 <div class="sidebar-name"> 309 309 <div class="sidebar-name-arrow"></div> 310 <h3> Top Level Menu Descriptions</h3>310 <h3><?php esc_html_e('Top Level Menu Descriptions'); ?></h3> 311 311 </div> 312 312 <div class="widget-holder"> 313 <span> Display Descriptions in Top Level Menu?</span>313 <span><?php _e('Display Descriptions in Top Level Menu?'); ?></span> 314 314 315 315 <?php 316 316 317 317 //UPDATE and DISPLAY Menu Description Option 318 if (isset($_POST['menu-descriptions'])) 319 { 320 321 if (isset($_POST['switch_menu'])) { 322 323 } 324 else { 318 if ( isset($_POST['menu-descriptions']) ) { 319 320 if ( isset($_POST['switch_menu']) ) { 321 322 } else { 325 323 $menu_options_to_edit = $_POST['menu_id_in_edit']; 326 324 update_option('wp_settings_custom_nav_'.$menu_options_to_edit.'_descriptions',$_POST['menu-descriptions']); … … 329 327 } 330 328 331 if ($menu_id_in_edit > 0) 332 { 329 if ( $menu_id_in_edit > 0 ) 333 330 $checkedraw = get_option('wp_settings_custom_nav_'.$menu_id_in_edit.'_descriptions'); 334 } 335 else { 331 else 336 332 $checkedraw = get_option('wp_settings_custom_nav_'.$menu_selected_id.'_descriptions'); 337 }338 333 339 334 $checked = strtolower($checkedraw); 340 335 341 if ($advanced_option_descriptions == 'no') 342 { 336 if ( $advanced_option_descriptions == 'no' ) 343 337 $checked = 'no'; 344 }345 338 346 339 ?> 347 340 348 341 <span class="checkboxes"> 349 <label> Yes</label><input type="radio" name="menu-descriptions" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />350 <label> No</label><input type="radio" name="menu-descriptions" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />342 <label><?php _e('Yes'); ?></label><input type="radio" name="menu-descriptions" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> /> 343 <label><?php _e('No'); ?></label><input type="radio" name="menu-descriptions" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> /> 351 344 </span><!-- /.checkboxes --> 352 345 </form> … … 358 351 <div class="sidebar-name"> 359 352 <div class="sidebar-name-arrow"></div> 360 <h3> Add an Existing Page</h3>353 <h3><?php esc_html_e('Add an Existing Page'); ?></h3> 361 354 </div> 362 355 <div class="widget-holder"> … … 383 376 $page_name = ''; 384 377 //CHECK if pages exist 385 if ($pages_array) 386 { 387 foreach ($pages_array as $post) 388 { 378 if ( $pages_array ) { 379 foreach ( $pages_array as $post ) { 389 380 //Add page name to 390 381 $page_name .= htmlentities($post->post_title).'|'; 391 382 } 392 } 393 else 394 { 383 } else { 395 384 $page_name = "No pages available"; 396 385 } … … 448 437 <div class="sidebar-name"> 449 438 <div class="sidebar-name-arrow"></div> 450 <h3> Add an Existing Category</h3>439 <h3><?php esc_html_e('Add an Existing Category'); ?></h3> 451 440 </div> 452 441 <div class="widget-holder"> … … 454 443 <?php 455 444 456 //Custom GET categories query 445 // Custom GET categories query 446 // @todo Use API 457 447 $categories = $wpdb->get_results("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC"); 458 448 $cat_name = ''; 459 449 //CHECK for results 460 if ($categories) 461 { 462 foreach($categories as $category) 463 { 450 if ( $categories ) { 451 foreach( $categories as $category ) { 464 452 $cat_id = $category->term_id; 465 453 466 $cat_args =array(454 $cat_args = array( 467 455 'orderby' => 'name', 468 456 'include' => $cat_id, … … 473 461 $category_names=get_categories($cat_args); 474 462 475 if (isset($category_names[0]->name)) 476 { 477 //Add category name to data string 463 if ( isset($category_names[0]->name) ) { 464 // Add category name to data string 478 465 $cat_name .= htmlentities($category_names[0]->name).'|'; 479 466 } 480 467 } 481 } 482 else 483 { 468 } else { 484 469 $cat_name = "No categories available"; 485 470 } … … 510 495 </script> 511 496 512 513 <input type="text" onfocus="jQuery('#cat-search').attr('value','');" id="cat-search" value="Search Categories" /> 497 <input type="text" onfocus="jQuery('#cat-search').attr('value','');" id="cat-search" value="<?php esc_attr_e('Search Categories'); ?>" /> 514 498 515 499 <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> … … 537 521 <div class="sidebar-name"> 538 522 <div class="sidebar-name-arrow"></div> 539 <h3> Add a Custom Url</h3>523 <h3><?php esc_html_e('Add a Custom Url'); ?></h3> 540 524 </div> 541 525 <div class="widget-holder"> 542 526 <input id="custom_menu_item_url" type="text" value="http://" /> 543 <label> URL</label><br />527 <label><?php _e('URL'); ?></label><br /> 544 528 <?php $templatedir = get_bloginfo('url'); ?> 545 <input type="hidden" id="templatedir" value="<?php echo $templatedir; ?>" />529 <input type="hidden" id="templatedir" value="<?php echo esc_attr($templatedir); ?>" /> 546 530 <input id="custom_menu_item_name" type="text" value="Menu Item" onfocus="jQuery('#custom_menu_item_name').attr('value','');" /> 547 531 <label>Menu Text</label><br />
Note: See TracChangeset
for help on using the changeset viewer.