Make WordPress Core

Changeset 13268


Ignore:
Timestamp:
02/21/2010 12:03:42 AM (17 years ago)
Author:
ryan
Message:

Trim trailing whites

Location:
trunk
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/comment.php

    r13247 r13268  
    250250                        $redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
    251251                        break;
    252         }       
     252        }
    253253
    254254        wp_redirect( $redir );
  • trunk/wp-admin/css/custom-navigation.dev.css

    r13265 r13268  
    99 * @subpackage Administration
    1010 */
    11  
     11
    1212.fix{clear: both;height: 1px;margin: -1px 0 0;overflow: hidden;}
    1313
  • trunk/wp-admin/custom-navigation.php

    r13266 r13268  
    1010 * @subpackage Administration
    1111 */
    12  
     12
    1313require_once('admin.php');
    1414
    … …  
    2929function wp_custom_nav_reset() {
    3030        wp_custom_navigation_setup(true);
    31                
     31
    3232        return true;
    33        
     33
    3434}
    3535
    … …  
    4747        <div class="wrap">
    4848        <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
    5050        <?php
    5151        $messagesdiv = '';
    5252        $menu_id_in_edit = 0;
    53            
     53
    5454        // Get the theme name
    5555        $themename =  get_current_theme();
    56            
     56
    5757        // Check which menu is selected and if menu is in edit already
    5858        if ( isset( $_POST['switch_menu'] ) )
    … …  
    6060        elseif ( isset( $_POST['menu_id_in_edit'] ) )
    6161                $menu_selected_id = $_POST['menu_id_in_edit'];
    62            
     62
    6363        // Default Menu to show
    6464        $custom_menus = get_terms( 'menu', array( 'hide_empty' => false ) );
    … …  
    7575                }
    7676        }
    77            
     77
    7878        if ( isset( $_POST['set_wp_menu'] ) ) {
    7979                update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] );
    8080                $messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>';
    81         } 
    82          
     81        }
     82
    8383        if ( isset( $_POST['licount'] ) )
    8484                $postCounter = $_POST['licount'];
    … …  
    9494                        if ( $existing_term ) {
    9595                                $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 {
    9797                                $term = wp_insert_term( $insert_menu_name, 'menu' );
    9898                                if ( $term ) {
    … …  
    100100                                        $menu_selected_id = $term['term_id'];
    101101                                        $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>';
    103103
    104104                                        $postCounter = 0;
    … …  
    109109                }
    110110        }
    111                
    112         if ( isset($_POST['reset_wp_menu']) ) { 
     111
     112        if ( isset($_POST['reset_wp_menu']) ) {
    113113                $success = wp_custom_nav_reset();
    114114                if ($success) {
    … …  
    129129                //Loop through all POST variables
    130130                for ($k = 1;$k<= $postCounter; $k++) {
    131                        
     131
    132132                        if (isset($_POST['dbid'.$k])) { $db_id = $_POST['dbid'.$k]; } else { $db_id = 0; }
    133133                        if (isset($_POST['postmenu'.$k])) { $post_id = $_POST['postmenu'.$k]; } else { $post_id = 0; }
    … …  
    143143                        if (isset($_POST['anchortitle'.$k])) { $custom_anchor_title = stripslashes($_POST['anchortitle'.$k]); } else { $custom_anchor_title = $custom_title; }
    144144                        if (isset($_POST['newwindow'.$k])) { $new_window = $_POST['newwindow'.$k]; } else { $new_window = 0; }
    145                        
     145
    146146                        $post = array( 'post_status' => 'publish', 'post_type' => 'menu_item', 'post_author' => $user_ID,
    147147                                'ping_status' => 0, 'post_parent' => $post_id, '`menu_order' => $position,
    … …  
    176176                $messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>';
    177177        }
    178                
     178
    179179                //DISPLAY Custom Navigation
    180180                ?>
    … …  
    183183                        <h2 class="maintitle">Custom Navigation</h2>
    184184                        <?php
    185                                
     185
    186186                                //CHECK if custom menu has been enabled
    187187                                $enabled_menu = get_option('wp_custom_nav_menu');
    188188                            $checked = strtolower($enabled_menu);
    189        
     189
    190190                                if ($checked == 'true') {
    191191                                } else {
    192192                                        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>';
    193193                                }
    194                                
    195                                
     194
     195
    196196                        ?>
    197197                        <?php echo $messagesdiv; ?>
    198198                        <form onsubmit="updatepostdata()" action="custom-navigation.php" method="post"  enctype="multipart/form-data">
    199                        
     199
    200200                        <input type="hidden" name="licount" id="licount" value="0" />
    201201                        <input type="hidden" name="menu_id_in_edit" id="menu_id_in_edit" value="<?php echo $menu_selected_id; ?>" />
    202                        
     202
    203203                        <div class="sidebar-name">
    204                        
     204
    205205                                <div class="sidebar-name-arrow">
    206206                                        <br/>
    207207                                </div>
    208208                                <h3><?php echo $menu_title; ?></h3>
    209                                
     209
    210210                        </div>
    211                        
     211
    212212                        <div id="nav-container">
    213213                                <ul id="custom-nav">
    214                                
     214
    215215                        <?php
    216216                        //DISPLAY existing menu
    … …  
    220220                                //MAIN OUTPUT FUNCTION
    221221                                wp_custom_navigation_output( 'type='.$output_type.'&name='.$menu_title.'&id='.$menu_selected_id );
    222                         }                               
     222                        }
    223223                        ?>
    224                                
     224
    225225                                </ul>
    226226                        </div><!-- /#nav-container -->
    227                        
     227
    228228                        <p class="submit">
    229                        
     229
    230230                        <script type="text/javascript">
    231                                 updatepostdata();                       
     231                                updatepostdata();
    232232                        </script>
    233                        
     233
    234234                        <input id="save_bottom" name="save_bottom" type="submit" value="Save All Changes" /></p>
    235235                        </div><!-- /.inside -->
    236236                </div>
    237                
     237
    238238                <div id="menu-right">
    239                
     239
    240240                        <h2 class="heading">Options</h2>
    241                        
     241
    242242                        <div class="widgets-holder-wrap">
    243243                                <div class="sidebar-name">
    … …  
    246246                                </div>
    247247                                <div class="widget-holder">
    248                                                
     248
    249249                                        <?php
    250                                
     250
    251251                                //SETUP Custom Menu
    252                                
     252
    253253                                        $enabled_menu = get_option('wp_custom_nav_menu');
    254                                            
     254
    255255                                $checked = strtolower($enabled_menu);
    256        
     256
    257257                                ?>
    258                                
     258
    259259                                <span >
    260260                                        <label>Enable</label><input type="radio" name="enable_wp_menu" value="true" <?php if ($checked=='true') { echo 'checked="checked"'; } ?> />
    261261                                        <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
    264264                                        <input id="set_wp_menu" type="submit" value="Set Menu" name="set_wp_menu" class="button" /><br />
    265                                        
     265
    266266                                        <span>
    267267                                                <label>Reset Menu to Default</label>
    268268                                                <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?');" />
    269269                                        </span>
    270                                        
     270
    271271                                        <div class="fix"></div>
    272272                                </div>
    273273                        </div><!-- /.widgets-holder-wrap -->
    274                        
     274
    275275                        <div class="widgets-holder-wrap">
    276276                                <div class="sidebar-name">
    … …  
    280280                                <div class="widget-holder">
    281281                                        <select id="menu_select" name="menu_select">
    282                                                 <?php 
    283                                                
     282                                                <?php
     283
    284284                                                //DISPLAY SELECT OPTIONS
    285285                                                foreach( $custom_menus as $menu ) {
    … …  
    292292                                                        <option value="<?php echo $menu_term->term_id; ?>" <?php echo $selected_option; ?>><?php echo $menu_term->name; ?></option>
    293293                                                        <?php
    294                                                        
     294
    295295                                                }
    296296                                                ?>
    297297                                        </select>
    298                                        
     298
    299299                                        <input id="switch_menu" type="submit" value="Switch" name="switch_menu" class="button" />
    300300                                        <input id="add_menu_name" name="add_menu_name" type="text" value=""  />
    301301                                        <input id="add_menu" type="submit" value="Add Menu" name="add_menu" class="button" />
    302                                                
     302
    303303                                        <div class="fix"></div>
    304304                                </div>
    … …  
    310310                                        <h3>Top Level Menu Descriptions</h3>
    311311                                </div>
    312                                 <div class="widget-holder">     
     312                                <div class="widget-holder">
    313313                                        <span>Display Descriptions in Top Level Menu?</span>
    314                        
     314
    315315                                        <?php
    316                                
     316
    317317                                //UPDATE and DISPLAY Menu Description Option
    318318                                if (isset($_POST['menu-descriptions']))
    319319                                {
    320                                        
     320
    321321                                                if (isset($_POST['switch_menu'])) {
    322                                                        
     322
    323323                                                }
    324324                                                else {
    325325                                                        $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']);
    327327                                                }
    328                                        
     328
    329329                                }
    330                                
     330
    331331                                if ($menu_id_in_edit > 0)
    332332                                        {
    … …  
    336336                                                $checkedraw = get_option('wp_settings_custom_nav_'.$menu_selected_id.'_descriptions');
    337337                                        }
    338                            
     338
    339339                                $checked = strtolower($checkedraw);
    340                                
     340
    341341                                if ($advanced_option_descriptions == 'no')
    342342                                {
    343343                                        $checked = 'no';
    344344                                }
    345                                
     345
    346346                                ?>
    347                                
     347
    348348                                <span class="checkboxes">
    349349                                        <label>Yes</label><input type="radio" name="menu-descriptions" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
    … …  
    354354                                </div>
    355355                        </div><!-- /.widgets-holder-wrap -->
    356                        
     356
    357357                        <div class="widgets-holder-wrap">
    358358                                <div class="sidebar-name">
    … …  
    361361                                </div>
    362362                                <div class="widget-holder">
    363                                        
     363
    364364                                        <?php
    365                                        
     365
    366366                                        $pages_args = array(
    367367                                'child_of' => 0,
    … …  
    378378                                        'number' => '',
    379379                                        'offset' => 0 );
    380        
    381                                         //GET all pages         
     380
     381                                        //GET all pages
    382382                                        $pages_array = get_pages($pages_args);
    383383                                        $page_name = '';
    … …  
    387387                                                foreach ($pages_array as $post)
    388388                                                {
    389                                                         //Add page name to 
     389                                                        //Add page name to
    390390                                                        $page_name .= htmlentities($post->post_title).'|';
    391391                                                }
    … …  
    395395                                                $page_name = "No pages available";
    396396                                        }
    397                                                
     397
    398398                                        ?>
    399                                        
     399
    400400                                        <script>
    401401                                                jQuery(document).ready(function(){
    … …  
    403403                                                        //GET PHP pages
    404404                                                var dataposts = "<?php echo $page_name; ?>".split("|");
    405                                                
     405
    406406                                                        //Set autocomplete
    407407                                                        jQuery("#page-search").autocomplete(dataposts);
    408                                                
     408
    409409                                                        //Handle autocomplete result
    410410                                                        jQuery("#page-search").result(function(event, data, formatted) {
    411411                                                        jQuery('#existing-pages').css('display','block');
    412412                                                        jQuery("#existing-pages dt:contains('" + data + "')").css("display", "block");
    413                                                
     413
    414414                                                        jQuery('#show-pages').hide();
    415415                                                        jQuery('#hide-pages').show();
    416                                                
     416
    417417                                                        });
    418418                                                        jQuery('#existing-pages').css('display','none');
    … …  
    421421
    422422
    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>
    426426                                        <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
    428428                                        <script type="text/javascript">
    429                                        
     429
    430430                                                jQuery('#hide-pages').hide();
    431                                        
     431
    432432                                        </script>
    433                                        
     433
    434434                                        <ul id="existing-pages" class="list">
    435435                                                <?php
    … …  
    439439                                                ?>
    440440                                        </ul>
    441                                        
     441
    442442                                        <div class="fix"></div>
    443                                        
     443
    444444                                </div>
    445445                        </div><!-- /.widgets-holder-wrap -->
    446                        
     446
    447447                        <div class="widgets-holder-wrap">
    448448                                <div class="sidebar-name">
    … …  
    451451                                </div>
    452452                                <div class="widget-holder">
    453                                        
     453
    454454                                        <?php
    455                                        
     455
    456456                                        //Custom GET categories query
    457457                                        $categories = $wpdb->get_results("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC");
    … …  
    460460                                        if ($categories)
    461461                                        {
    462                                                 foreach($categories as $category) 
    463                                                 { 
     462                                                foreach($categories as $category)
     463                                                {
    464464                                                        $cat_id = $category->term_id;
    465                                
     465
    466466                                                        $cat_args=array(
    467467                                                                'orderby' => 'name',
    … …  
    470470                                                                'order' => 'ASC'
    471471                                                        );
    472                                                        
     472
    473473                                                        $category_names=get_categories($cat_args);
    474                                                        
     474
    475475                                                        if (isset($category_names[0]->name))
    476476                                                        {
    … …  
    484484                                                $cat_name = "No categories available";
    485485                                        }
    486                                  
     486
    487487                                        ?>
    488488
    … …  
    492492                                                        //GET PHP categories
    493493                                                var datacats = "<?php echo $cat_name; ?>".split("|");
    494                                                        
     494
    495495                                                        //Set autocomplete
    496496                                                        jQuery("#cat-search").autocomplete(datacats);
    497                                                
     497
    498498                                                        //Handle autocomplete result
    499499                                                        jQuery("#cat-search").result(function(event, data, formatted) {
    500500                                                        jQuery('#existing-categories').css('display','block');
    501501                                                        jQuery("#existing-categories dt:contains('" + data + "')").css("display", "block");
    502                                                                                                
     502
    503503                                                        jQuery('#show-cats').hide();
    504504                                                        jQuery('#hide-cats').show();
    505                                                
     505
    506506                                                        });
    507507                                                        jQuery('#existing-categories').css('display','none');
    508                                        
     508
    509509                                                });
    510510                                        </script>
    511511
    512512
    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>
    516516                                        <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
    518518                                        <script type="text/javascript">
    519                                        
     519
    520520                                                jQuery('#hide-cats').hide();
    521                                        
     521
    522522                                        </script>
    523                                        
     523
    524524                                        <ul id="existing-categories" class="list">
    525525                                <?php
    526526                                                        //Get default Categories
    527                                         $intCounter = wp_custom_nav_get_categories($intCounter,'default');                             
     527                                        $intCounter = wp_custom_nav_get_categories($intCounter,'default');
    528528                                                ?>
    529529                                </ul>
    530                                
     530
    531531                                <div class="fix"></div>
    532                                        
     532
    533533                                </div>
    534534                        </div><!-- /.widgets-holder-wrap -->
    535                        
     535
    536536                        <div class="widgets-holder-wrap">
    537537                                <div class="sidebar-name">
    … …  
    552552                                </div>
    553553                        </div><!-- /.widgets-holder-wrap -->
    554                        
     554
    555555       </div>
    556556    </div>
    557    
     557
    558558    <script type="text/javascript">
    559559                document.getElementById('pages-left').style.display='block';
    … …  
    561561                document.getElementById('no-js').style.display='none';
    562562        </script>
    563        
     563
    564564        <div id="dialog-confirm" title="Edit Menu Item">
    565565                </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  
    225225        $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
    226226        $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
    227 } elseif ( 'category' == $taxonomy ) { 
     227} elseif ( 'category' == $taxonomy ) {
    228228        $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
    229229} else {
    … …  
    305305
    306306<?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>
    311311<?php endif; ?>
    312312
  • trunk/wp-admin/js/custom-navigation-default-items.dev.js

    r13266 r13268  
    99 * @subpackage Administration
    1010 */
    11  
     11
    1212/*
    1313 * Init Functions
    … …  
    2424                        buttons: {
    2525                                'Save': function() {
    26                                        
     26
    2727                                        titletosave = $('#edittitle').attr('value');
    2828                                        linktosave = $('#editlink').attr('value');
    … …  
    3030                                        newwindowtosave = $('#editnewwindow').attr('value');
    3131                                        desctosave = $('#editdescription').attr('value');
    32                                        
     32
    3333                                        $('#title' + $(this).dialog('option', 'itemID')).attr('value',titletosave);
    3434                                        $('#linkurl' + $(this).dialog('option', 'itemID')).attr('value',linktosave);
    … …  
    3636                                        $('#newwindow' + $(this).dialog('option', 'itemID')).attr('value',newwindowtosave);
    3737                                        $('#description' + $(this).dialog('option', 'itemID')).attr('value',desctosave);
    38                                        
     38
    3939                                        $('#menu-' + $(this).dialog('option', 'itemID') + ' > dl > dt > span.title').text(titletosave);
    40                                        
     40
    4141                                        $('#view' + + $(this).dialog('option', 'itemID')).attr('href', linktosave);
    42                                        
     42
    4343                                        $(this).dialog('close');
    44                                        
     44
    4545                                },
    4646                                Cancel: function() {
    … …  
    4949                        }
    5050                });
    51                
     51
    5252                $('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ $(this).remove();});
    53                
     53
    5454                //Add dropzone
    55             $('#custom-nav li').prepend('<div class="dropzone"></div>');       
    56                
     55            $('#custom-nav li').prepend('<div class="dropzone"></div>');
     56
    5757                //Make li items draggable
    5858                $('#custom-nav li').draggable({
    … …  
    6969                accept: '#custom-nav li',
    7070                    tolerance: 'pointer',
    71                 drop: function(e, ui) 
     71                drop: function(e, ui)
    7272                {
    7373                        var li = $(this).parent();
    7474                        var child = !$(this).hasClass('dropzone');
    7575                        //Add UL to first child
    76                         if (child && li.children('ul').length == 0) 
     76                        if (child && li.children('ul').length == 0)
    7777                        {
    7878                        li.append('<ul id="sub-menu" />');
    7979                        }
    8080                        //Make it draggable
    81                         if (child) 
     81                        if (child)
    8282                        {
    8383                        li.children('ul').append(ui.draggable);
    8484                        }
    85                         else 
     85                        else
    8686                        {
    8787                        li.before(ui.draggable);
    … …  
    8989
    9090                        li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
    91                        
     91
    9292                        var draggablevalue = ui.draggable.attr('value');
    9393                        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);
    9595                        $(this).parent().find("dt").removeAttr('style');
    9696                        $(this).parent().find("div:first").removeAttr('style');
    97                        
    98                        
     97
     98
    9999                },
    100                 over: function() 
     100                over: function()
    101101                {
    102102                        //Add child
    103                         if ($(this).attr('class') == 'dropzone ui-droppable') 
     103                        if ($(this).attr('class') == 'dropzone ui-droppable')
    104104                        {
    105105                                $(this).parent().find("div:first").css('background', 'none').css('height', '50px');
    106106                        }
    107107                        //Add above
    108                         else if ($(this).attr('class') == 'ui-droppable') 
     108                        else if ($(this).attr('class') == 'ui-droppable')
    109109                        {
    110110                                $(this).parent().find("dt:first").css('background', '#d8d8d8');
    … …  
    112112                        //do nothing
    113113                        else {
    114                        
     114
    115115                        }
    116116                        var parentid = $(this).parent().attr('id');
    117                        
     117
    118118                },
    119                 out: function() 
     119                out: function()
    120120                {
    121121                        $(this).parent().find("dt").removeAttr('style');
    … …  
    124124                },
    125125                deactivate: function()
    126                 {       
    127                        
    128                                        
     126                {
     127
     128
    129129                }
    130                
    131                        
     130
     131
    132132                });
    133                                  
    134                 //Handle Save Button Clicks     
     133
     134                //Handle Save Button Clicks
    135135                $('#save_top').click(function()
    136136                {
    … …  
    141141                        updatepostdata();
    142142                });
    143                
     143
    144144
    145145        });
  • trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js

    r13266 r13268  
    99 * @subpackage Administration
    1010 */
    11  
     11
    1212/*
    1313 * Removes menu items from current menu
    1414 * @param int o - the id of the menu li to remove.
    1515*/
    16 function removeitem(o) 
    17 {
    18                        
     16function removeitem(o)
     17{
     18
    1919        var todelete = document.getElementById('menu-' + o);
    20        
     20
    2121        if (todelete)
    22         {               
     22        {
    2323                var parenttodelete = document.getElementById('menu-' + o).parentNode;
    24         throwaway_node = parenttodelete.removeChild(todelete); 
    25         }       
    26                        
     24        throwaway_node = parenttodelete.removeChild(todelete);
     25        }
     26
    2727        updatepostdata();
    2828};
    … …  
    3232 * @param int o - the id of the menu li to edit.
    3333*/
    34 function edititem(o) 
    35 {
    36                        
     34function edititem(o)
     35{
     36
    3737                itemTitle = jQuery('#title' + o).attr('value');
    3838                itemURL = jQuery('#linkurl' + o).attr('value');
    … …  
    4040                itemNewWindow = jQuery('#newwindow' + o).attr('value');
    4141                itemDesc = jQuery('#description' + o).attr('value');
    42                
     42
    4343                jQuery('#dialog-confirm').dialog( 'option' , 'itemID' , o )
    44                                
     44
    4545                jQuery('#dialog-confirm').dialog('open');
    46                
     46
    4747                jQuery('#edittitle').attr('value', itemTitle);
    4848                jQuery('#editlink').attr('value', itemURL);
    … …  
    5050                jQuery("#editnewwindow option[value='" + itemNewWindow  + "']").attr('selected', 'selected');
    5151                jQuery('#editdescription').attr('value', itemDesc);
    52        
     52
    5353};
    5454
    … …  
    5656 * Prepares menu items for POST
    5757*/
    58 function updatepostdata() 
    59 {               
    60        
     58function updatepostdata()
     59{
     60
    6161        var i = 0;
    6262         jQuery("#custom-nav").find("li").each(function(i) {
    6363                i = i + 1;
    6464        var j = jQuery(this).attr('value');
    65                
     65
    6666        jQuery(this).find('#position' + j).attr('value', i);
    6767        jQuery(this).attr('id','menu-' + i);
    6868        jQuery(this).attr('value', i);
    69        
     69
    7070        jQuery(this).find('#dbid' + j).attr('name','dbid' + i);
    7171        jQuery(this).find('#dbid' + j).attr('id','dbid' + i);
    72        
     72
    7373                jQuery(this).find('#postmenu' + j).attr('name','postmenu' + i);
    7474        jQuery(this).find('#postmenu' + j).attr('id','postmenu' + i);
    75        
     75
    7676        var p = jQuery(this).find('#parent' + j).parent().parent().parent().attr('value');
    77        
     77
    7878        jQuery(this).find('#parent' + j).attr('name','parent' + i);
    7979        jQuery(this).find('#parent' + j).attr('id','parent' + i);
    … …  
    8585                p = 0;
    8686        }
    87                
     87
    8888        jQuery(this).find('#parent' + j).attr('value', p);
    89                
     89
    9090        jQuery(this).find('#title' + j).attr('name','title' + i);
    9191        jQuery(this).find('#title' + j).attr('id','title' + i);
    92        
     92
    9393        jQuery(this).find('#linkurl' + j).attr('name','linkurl' + i);
    9494        jQuery(this).find('#linkurl' + j).attr('id','linkurl' + i);
    95                
     95
    9696        jQuery(this).find('#description' + j).attr('name','description' + i);
    9797        jQuery(this).find('#description' + j).attr('id','description' + i);
    98        
     98
    9999        jQuery(this).find('#icon' + j).attr('name','icon' + i);
    100100        jQuery(this).find('#icon' + j).attr('id','icon' + i);
    101        
     101
    102102        jQuery(this).find('#position' + j).attr('name','position' + i);
    103103        jQuery(this).find('#position' + j).attr('id','position' + i);
    104        
     104
    105105        jQuery(this).find('#linktype' + j).attr('name','linktype' + i);
    106106        jQuery(this).find('#linktype' + j).attr('id','linktype' + i);
    107        
     107
    108108        jQuery(this).find('#anchortitle' + j).attr('name','anchortitle' + i);
    109109        jQuery(this).find('#anchortitle' + j).attr('id','anchortitle' + i);
    110        
     110
    111111        jQuery(this).find('#newwindow' + j).attr('name','newwindow' + i);
    112112        jQuery(this).find('#newwindow' + j).attr('id','newwindow' + i);
    113        
     113
    114114        jQuery(this).find('dl > dt > span > #remove' + j).attr('value', i);
    115115        jQuery(this).find('dl > dt > span > #remove' + j).attr('onClick', 'removeitem(' + i + ')');
    … …  
    119119
    120120   });
    121    
    122    
    123        
    124 };     
     121
     122
     123
     124};
    125125
    126126/*
    … …  
    133133 * @param int itemparentid - default 0.
    134134 * @param string itemdescription - the description of the menu item.
    135 */ 
    136 function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription) 
     135*/
     136function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription)
    137137{
    138138        var inputvaluevarname = '';
    … …  
    143143        var inputicon = '';
    144144
    145         if (additemtype == 'Custom') 
     145        if (additemtype == 'Custom')
    146146        {
    147147                inputvaluevarname = document.getElementById('custom_menu_item_name').value;
    … …  
    160160                inputlinktype = 'page';
    161161                inputdescription = htmlentities(itemdescription.toString());
    162                
     162
    163163        }
    164164        else if (additemtype == 'Category')
    … …  
    171171                inputdescription = htmlentities(itemdescription.toString());
    172172        }
    173         else 
     173        else
    174174        {
    175175                inputvaluevarname = '';
    … …  
    180180                inputdescription = '';
    181181        }
    182        
     182
    183183        var count=document.getElementById('custom-nav').getElementsByTagName('li').length;
    184184
    … …  
    187187        var validatetest = 0;
    188188
    189         try 
     189        try
    190190        {
    191191                var test=document.getElementById("menu-" + randomnumber.toString()).value;
    192192        }
    193         catch (err) 
     193        catch (err)
    194194        {
    195195                validatetest = 1;
    196196        }
    197197
    198         while (validatetest == 0) 
     198        while (validatetest == 0)
    199199        {
    200200                randomnumber = randomnumber + 1;
    201201
    202                 try 
     202                try
    203203                {
    204204                        var test2=document.getElementById("menu-" + randomnumber.toString()).value;
    205205                }
    206                 catch (err) 
     206                catch (err)
    207207                {
    208208                        validatetest = 1;
    209209                }
    210210        }
    211        
     211
    212212        //Notification Message
    213213        jQuery('.maintitle').after('<div id="message" class="updated fade below-h2"><p>Menu Item added!</p></div>');
    214214        jQuery('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ jQuery(this).remove();});
    215        
     215
    216216        //Appends HTML to the menu
    217217        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>');
    … …  
    231231                accept: '#' + randomnumber + ', #custom-nav li',
    232232                tolerance: 'pointer',
    233                 drop: function(e, ui) 
     233                drop: function(e, ui)
    234234                {
    235235                        var li = jQuery(this).parent();
    236236                        var child = !jQuery(this).hasClass('dropzone');
    237237                        //Append UL to first child
    238                         if (child && li.children('ul').length == 0) 
     238                        if (child && li.children('ul').length == 0)
    239239                        {
    240240                                li.append('<ul/>');
    241241                        }
    242242                        //Make it draggable
    243                         if (child) 
     243                        if (child)
    244244                        {
    245245                                li.children('ul').append(ui.draggable);
    246246                        }
    247                         else 
     247                        else
    248248                        {
    249249                                li.before(ui.draggable);
    250250                        }
    251                        
    252                         li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' }); 
    253                        
     251
     252                        li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
     253
    254254                        var draggablevalue = ui.draggable.attr('value');
    255255                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);
    257257                jQuery(this).parent().find("dt").removeAttr('style');
    258258                jQuery(this).parent().find("div:first").removeAttr('style');
    259                
     259
    260260                },
    261                 over: function() 
     261                over: function()
    262262                {
    263263                        //Add child
    264                         if (jQuery(this).attr('class') == 'dropzone ui-droppable') 
     264                        if (jQuery(this).attr('class') == 'dropzone ui-droppable')
    265265                        {
    266266                                jQuery(this).parent().find("div:first").css('background', 'none').css('height', '50px');
    267267                        }
    268268                        //Add above
    269                         else if (jQuery(this).attr('class') == 'ui-droppable') 
     269                        else if (jQuery(this).attr('class') == 'ui-droppable')
    270270                        {
    271271                                jQuery(this).parent().find("dt:first").css('background', '#d8d8d8');
    … …  
    273273                        //do nothing
    274274                        else {
    275                        
     275
    276276                        }
    277277                        var parentid = jQuery(this).parent().attr('id');
    278                        
     278
    279279                },
    280                 out: function() 
     280                out: function()
    281281                {
    282282                        jQuery(this).parent().find("dt").removeAttr('style');
  • trunk/wp-admin/js/custom-navigation-php-functions.dev.js

    r13257 r13268  
    1 /* 
     1/*
    22 * More info at: http://phpjs.org
    3  * 
     3 *
    44 * This is version: 3.08
    55 * php.js is copyright 2010 Kevin van Zonneveld.
    6  * 
     6 *
    77 * Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
    88 * (http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
    … …  
    8585 * Rosa, Tod Gentille, Riddler (http://www.frontierwebdev.com/), Alexander M
    8686 * Beedie
    87  * 
     87 *
    8888 * Dual licensed under the MIT (MIT-LICENSE.txt)
    8989 * and GPL (GPL-LICENSE.txt) licenses.
    90  * 
     90 *
    9191 * Permission is hereby granted, free of charge, to any person obtaining a
    9292 * copy of this software and associated documentation files (the
    … …  
    9696 * permit persons to whom the Software is furnished to do so, subject to
    9797 * the following conditions:
    98  * 
     98 *
    9999 * The above copyright notice and this permission notice shall be included
    100100 * in all copies or substantial portions of the Software.
    101  * 
     101 *
    102102 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    103103 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    … …  
    107107 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    108108 * OTHER DEALINGS IN THE SOFTWARE.
    109  */ 
     109 */
    110110
    111111function get_html_translation_table (table, quote_style) {
    … …  
    129129    // *     example 1: get_html_translation_table('HTML_SPECIALCHARS');
    130130    // *     returns 1: {'"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;'}
    131    
     131
    132132    var entities = {}, hash_map = {}, decimal = 0, symbol = '';
    133133    var constMappingTable = {}, constMappingQuoteStyle = {};
    134134    var useTable = {}, useQuoteStyle = {};
    135    
     135
    136136    // Translate arguments
    137137    constMappingTable[0]      = 'HTML_SPECIALCHARS';
    … …  
    264264        hash_map[symbol] = entities[decimal];
    265265    }
    266    
     266
    267267    return hash_map;
    268268}
    … …  
    287287    var hash_map = {}, symbol = '', tmp_str = '', entity = '';
    288288    tmp_str = string.toString();
    289    
     289
    290290    if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
    291291        return false;
    … …  
    296296        tmp_str = tmp_str.split(symbol).join(entity);
    297297    }
    298    
     298
    299299    return tmp_str;
    300300}
  • trunk/wp-admin/js/tags.dev.js

    r13086 r13268  
    3939                                return;
    4040
    41                         var parent = form.find('select#parent').val(); 
     41                        var parent = form.find('select#parent').val();
    4242
    4343                        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  
    546546                                if ( is_multisite() && is_super_admin() )
    547547                                        $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
    548        
     548
    549549                                if ( !is_multisite() && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
    550550                                        $actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
    551        
     551
    552552                                if ( ! $is_active && current_user_can('delete_plugins') )
    553553                                        $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
  • trunk/wp-includes/canonical.php

    r13170 r13268  
    145145                                if ( is_tax() ) { // Custom taxonomies will have a custom query var, remove those too:
    146146                                        $tax = get_taxonomy( $obj->taxonomy );
    147                                         if ( false !== $tax->query_var) 
     147                                        if ( false !== $tax->query_var)
    148148                                                $redirect['query'] = remove_query_arg($tax->query_var, $redirect['query']);
    149149                                }
  • trunk/wp-includes/category-template.php

    r13086 r13268  
    365365        else
    366366                $output = '';
    367        
     367
    368368        if ( empty($categories) && ! $r['hide_if_empty'] && !empty($show_option_none) ) {
    369369                $show_option_none = apply_filters( 'list_cats', $show_option_none );
    370370                $output .= "\t<option value='-1' selected='selected'>$show_option_none</option>\n";
    371371        }
    372        
     372
    373373        if ( ! empty( $categories ) ) {
    374374
  • trunk/wp-includes/comment-template.php

    r13242 r13268  
    14701470                                                                                                                                                                                                        '<label for="author">' . __( 'Name' ) . '</label> ' .
    14711471                                                                                                                                                                                                        ( $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 . ' />' .
    14731473                                                                                                                                                                                                        '</p><!-- #form-section-author .form-section -->',
    14741474                                                                                                                                                                                        'email' => '<p class="comment-form-email">' .
    … …  
    14761476                                                                                                                                                                                                                ( $req ? '<span class="required">*</span>' : '' ) .
    14771477                                                                                                                                                                                                                '<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 -->',
    14791479                                                                                                                                                                                        'url' => '<p class="comment-form-url">' .
    14801480                                                                                                                                                                                                                '<label for="url">' . __( 'Website' ) . '</label>' .
    … …  
    14871487                                                '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>',
    14881488                                                '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>',
    14901490                                                '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>',
    14911491                                                'id_form' => 'commentform',
  • trunk/wp-includes/custom-navigation.php

    r13266 r13268  
    3232
    3333function wp_custom_navigation_setup($override = false) {
    34        
     34
    3535        $nav_version = '1.1.0';
    3636        //Custom Navigation Menu Setup
    37        
     37
    3838        //Check for Upgrades
    3939        if (get_option('wp_settings_custom_nav_version') <> '') {
    … …  
    4343                $nav_version_in_db = '0';
    4444        }
    45        
     45
    4646        //Override for menu descriptions
    4747        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))
    5050                update_option('wp_settings_custom_nav_version',$nav_version);
    5151
    … …  
    8585
    8686function wp_custom_navigation_output($args = array()) {
    87                
     87
    8888                //DEFAULT ARGS
    8989                $type = 'frontend';
    90                 $name = 'Menu 1'; 
     90                $name = 'Menu 1';
    9191                $id = 0;
    9292                $desc = 2;
    9393                $before_title = '';
    9494                $after_title = '';
    95                
     95
    9696                if (isset($args)) {
    97                
    98                         if ( !is_array($args) ) 
     97
     98                        if ( !is_array($args) )
    9999                        parse_str( $args, $args );
    100        
     100
    101101                        extract($args);
    102102                }
    … …  
    110110                        $desc = 2;
    111111                }
    112                
     112
    113113                $queried_id = 0;
    114114                global $wp_query;
    … …  
    146146                                        else
    147147                                                $link = $menu_item->guid;
    148                                
     148
    149149                                        if ( $menu_item->post_title == '' ) {
    150150                                                $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);
    152152                                        } else {
    153153                                                $title = htmlentities( $menu_item->post_title );
    154154                                        }
    155                                
     155
    156156                                        if ( $menu_item->post_content == '' )
    157157                                                $description = htmlentities( strip_tags( category_description( $menu_item->post_parent ) ) );
    … …  
    177177                                $anchor_title = $title;
    178178                        }
    179                        
     179
    180180                        if ($queried_id == $wp_custom_nav_menu_items->post_id) {
    181181                                $li_class = 'class="current_page_item"';
    … …  
    184184                                $li_class = '';
    185185                        }
    186                        
     186
    187187                        if (isset($wp_custom_nav_menu_items->new_window)) {
    188188                                if ($wp_custom_nav_menu_items->new_window > 0) {
    … …  
    193193                                }
    194194                        }
    195 */                     
     195*/
    196196                        //List Items
    197197                        ?><li id="menu-<?php echo $menu_item->ID; ?>" value="<?php echo $menu_item->ID; ?>" <?php echo $li_class; ?>><?php
    … …  
    199199                                        //FRONTEND Link
    200200                                        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                                                        {
    206206                                                                // 2 widget override do NOT display descriptions
    207207                                                                // 1 widget override display descriptions
    … …  
    210210                                                                {
    211211                                                                        ?><span class="nav-description"><?php echo $description; ?></span><?php
    212                                                                 } 
     212                                                                }
    213213                                                                elseif ($desc == 2)
    214214                                                                { }
    215215                                                                else
    216216                                                                { }
    217                                                         } 
    218                                                         else 
     217                                                        }
     218                                                        else
    219219                                                        {
    220220                                                                // 2 widget override do NOT display descriptions
    … …  
    224224                                                                {
    225225                                                                        ?><span class="nav-description"><?php echo $description; ?></span><?php
    226                                                                 } 
     226                                                                }
    227227                                                                elseif (($desc == 2) || ($desc == 0))
    228228                                                                { }
    229                                                                 else 
     229                                                                else
    230230                                                                { }
    231231                                                        }
    232                                                        
    233                                                 ?></a><?php 
     232
     233                                                ?></a><?php
    234234                                        }
    235235                                        //BACKEND draggable and droppable elements
    … …  
    238238                                        {
    239239                                                ?>
    240                                                
     240
    241241                                                <dl>
    242242                                                        <dt>
    … …  
    250250                                                        </dt>
    251251                                                </dl>
    252                                                
     252
    253253                                                <a><span class=""></span></a>
    254254                                                <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; ?>" />
    … …  
    263263                                                <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 ); ?>" />
    264264                                                <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
    267267                                        }
    268268
    269269                                        //@todo: implement menu heirarchy
    270270/*                                      //DISPLAY menu sub items
    271                                         if ($wp_custom_nav_menu_items->parent_id == 0) 
     271                                        if ($wp_custom_nav_menu_items->parent_id == 0)
    272272                                        {
    273273                                                //FRONTEND
    274                                                 if ($type == 'frontend') 
     274                                                if ($type == 'frontend')
    275275                                                {
    276276                                                        //Recursive function
    … …  
    278278                                                }
    279279                                                //BACKEND
    280                                                 else 
     280                                                else
    281281                                                {
    282282                                                        //Recursive function
    … …  
    285285                                        }
    286286*/                      ?></li>
    287                         <?php 
     287                        <?php
    288288                }
    289289}
    … …  
    291291//RECURSIVE Sub Menu Items
    292292function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,$menu_id = 0) {
    293        
     293
    294294        $parent_id = 0;
    295295        global $wpdb;
    296        
     296
    297297        //GET sub menu items
    298298        $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
    300300        if (empty($wp_custom_nav_menu))
    301301        {
    302        
     302
    303303        }
    304304        else
    … …  
    318318            }
    319319            //DISPLAY Loop
    320                 foreach ($wp_custom_nav_menu as $sub_item) 
     320                foreach ($wp_custom_nav_menu as $sub_item)
    321321                {
    322322                        //Figure out where the menu item sits
    323323                        $counter=$sub_item->position;
    324                        
     324
    325325                        //Prepare Menu Data
    326326                        //Category Menu Item
    327                         if ($sub_item->link_type == 'category') 
    328                         {
    329                                
     327                        if ($sub_item->link_type == 'category')
     328                        {
     329
    330330                                $parent_id = $sub_item->parent_id;
    331331                                $post_id = $sub_item->post_id;
    332                                
     332
    333333                                if ($sub_item->custom_link == '') {
    334334                                        $link = get_category_link($sub_item->post_id);
    … …  
    337337                                        $link = $sub_item->custom_link;
    338338                                }
    339                                
     339
    340340                                if ($sub_item->custom_title == '') {
    341341                                        $title_raw = get_categories('include='.$sub_item->post_id);
    … …  
    345345                                        $title = htmlentities($sub_item->custom_title);
    346346                                }
    347                                
     347
    348348                                if ($sub_item->custom_description == '') {
    349349                                        $description = strip_tags(category_description($sub_item->post_id));
    … …  
    357357                        elseif ($sub_item->link_type == 'page')
    358358                        {
    359                                
     359
    360360                                $parent_id = $sub_item->parent_id;
    361361                                $post_id = $sub_item->post_id;
    362                                
     362
    363363                                if ($sub_item->custom_link == '') {
    364364                                        $link = get_permalink($sub_item->post_id);
    … …  
    374374                                        $title = htmlentities($sub_item->custom_title);
    375375                                }
    376                                
     376
    377377                                if ($sub_item->custom_description == '') {
    378378                                        $description = get_post_meta($sub_item->post_id, 'page-description', true);
    … …  
    382382                                }
    383383                                $target = '';
    384                                
     384
    385385                        }
    386386                        //Custom Menu Item
    … …  
    400400                                $li_class = '';
    401401                        }
    402                        
     402
    403403                        //SET anchor title
    404404                        if (isset($sub_item->custom_anchor_title)) {
    … …  
    408408                                $anchor_title = $title;
    409409                        }
    410                        
     410
    411411                        if (isset($sub_item->new_window)) {
    412412                                if ($sub_item->new_window > 0) {
    … …  
    414414                                }
    415415                        }
    416                        
     416
    417417                        //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
    419419                                                //FRONTEND
    420420                                                if ($output_type == "frontend")
    421421                                                {
    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
    423423                                                }
    424424                                                //BACKEND
    … …  
    431431                                                                <span class="controls">
    432432                                                                <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>
    434434                                                                <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>
    435435                                                                <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>
    … …  
    449449                                                        <input type="hidden" name="anchortitle<?php echo $counter; ?>" id="anchortitle<?php echo $counter; ?>" value="<?php echo $anchor_title; ?>" />
    450450                                                        <input type="hidden" name="newwindow<?php echo $counter; ?>" id="newwindow<?php echo $counter; ?>" value="<?php echo $sub_item->new_window; ?>" />
    451                                                         <?php 
     451                                                        <?php
    452452                                                }
    453                                                
     453
    454454                                                //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);
    456456                        ?></li>
    457                         <?php 
    458        
    459                 } 
    460        
     457                        <?php
     458
     459                }
     460
    461461        ?></ul>
    462         <?php 
    463        
    464         } 
    465        
     462        <?php
     463
     464        }
     465
    466466        return $parent_id;
    467  
     467
    468468}
    469469
    … …  
    486486                        'number' => '',
    487487                        'offset' => 0 );
    488        
    489         //GET all pages         
     488
     489        //GET all pages
    490490        $pages_array = get_pages($pages_args);
    491        
     491
    492492        $intCounter = $counter;
    493493        $parentli = $intCounter;
    494        
     494
    495495        if ($pages_array)
    496496        {
    … …  
    498498                foreach ($pages_array as $post)
    499499                {
    500        
     500
    501501                        if ($post->post_parent == 0)
    502502                        {
    … …  
    506506                                        $description = get_post_meta($post->ID, 'page-description', true);
    507507                                        ?>
    508                                        
     508
    509509                                        <li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>">
    510                                
     510
    511511                                                <dl>
    512512                                                <dt>
    … …  
    514514                                                <span class="controls">
    515515                                                        <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>
    517517                                                        <a id="remove<?php echo $intCounter; ?>" onclick="removeitem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>">
    518518                                                                <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" />
    … …  
    522522                                                        </a>
    523523                                                </span>
    524                                                
     524
    525525                                                </dt>
    526526                                                </dl>
    … …  
    537537                                                <input type="hidden" name="anchortitle<?php echo $intCounter; ?>" id="anchortitle<?php echo $intCounter; ?>" value="<?php echo htmlentities($post->post_title); ?>" />
    538538                                                <input type="hidden" name="newwindow<?php echo $intCounter; ?>" id="newwindow<?php echo $intCounter; ?>" value="0" />
    539                                                
     539
    540540                                                <?php $parentli = $post->ID; ?>
    541                                                 <?php $intCounter++; ?>                                 
     541                                                <?php $intCounter++; ?>
    542542                                                <?php
    543                                                
     543
    544544                                                        //Recursive function
    545545                                                        $intCounter = wp_custom_navigation_default_sub_items($post->ID, $intCounter, $parentli, 'pages', 'menu');
    546                                                
     546
    547547                                                ?>
    548                                        
     548
    549549                                        </li>
    550                                        
    551                                         <?php 
    552                                        
     550
     551                                        <?php
     552
    553553                                }
    554554                                //Sidebar Menu
    … …  
    556556                                {
    557557                                        ?>
    558                                          
     558
    559559                                         <li>
    560560                                        <dl>
    … …  
    565565                                                $post_id = $post->ID;
    566566                                                $post_parent_id = $post->post_parent;
    567                                                
     567
    568568                                                        $description = htmlentities(get_post_meta($post_id, 'page-description', true));
    569                                                        
     569
    570570                                        ?>
    571571                                        <?php $templatedir = get_bloginfo('url'); ?>
    572                                        
     572
    573573                                        <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>
    574574                                        </dl>
    575575                                        <?php $parentli = $post->ID; ?>
    576                                                 <?php $intCounter++; ?>                     
     576                                                <?php $intCounter++; ?>
    577577                                        <?php
    578                                                
     578
    579579                                                        //Recursive function
    580580                                                        $intCounter = wp_custom_navigation_default_sub_items($post_id, $intCounter, $parentli, 'pages', 'default');
    581                                                
     581
    582582                                                 ?>
    583                                                
     583
    584584                                        </li>
    585        
    586                                         <?php 
    587                                
     585
     586                                        <?php
     587
    588588                                }
    589589                                else
    590590                                {
    591                                
    592                                 }       
    593                         } 
    594                 } 
    595         }
    596         else 
     591
     592                                }
     593                        }
     594                }
     595        }
     596        else
    597597        {
    598598                echo 'Not Found';
    … …  
    617617                        'number'                   => '',
    618618                        '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
    625625        $categories_array = get_categories($category_args);
    626        
     626
    627627        if ($categories_array)
    628628        {
    … …  
    637637                                {
    638638                                        ?>
    639            
     639
    640640                                <li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>">
    641641                                        <dl>
    … …  
    644644                                                        <span class="controls">
    645645                                                        <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>
    647647                                                        <a id="remove<?php echo $intCounter; ?>" onclick="removeitem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>">
    648648                                                                <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" />
    … …  
    652652                                                        </a>
    653653                                                        </span>
    654                                        
     654
    655655                                    </dt>
    656656                                    </dl>
    657657                                    <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
    659659                                    $use_cats_raw = get_option('wp_settings_custom_nav_descriptions');
    660660                                                $use_cats = strtolower($use_cats_raw);
    … …  
    673673                                                <input type="hidden" name="anchortitle<?php echo $intCounter; ?>" id="anchortitle<?php echo $intCounter; ?>" value="<?php echo htmlentities($cat_item->cat_name); ?>" />
    674674                                                <input type="hidden" name="newwindow<?php echo $intCounter; ?>" id="newwindow<?php echo $intCounter; ?>" value="0" />
    675                                                
     675
    676676                                    <?php $parentli = $cat_item->cat_ID; ?>
    677                                     <?php $intCounter++; ?>                                     
     677                                    <?php $intCounter++; ?>
    678678                                        <?php
    679                                                
     679
    680680                                                        //Recursive function
    681681                                                        $intCounter = wp_custom_navigation_default_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories','menu');
    682                                                        
     682
    683683                                                ?>
    684                                    
     684
    685685                                </li>
    686                                
    687                                 <?php 
     686
     687                                <?php
    688688                            }
    689689                            //Sidebar Menu
    … …  
    705705                                                </dl>
    706706                                                <?php $parentli = $cat_item->cat_ID; ?>
    707                                     <?php $intCounter++; ?>             
    708                                                 <?php 
     707                                    <?php $intCounter++; ?>
     708                                                <?php
    709709                                                        //Recursive function
    710710                                                        $intCounter = wp_custom_navigation_default_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories','default');
    711711                                                ?>
    712                                                
     712
    713713                                        </li>
    714                                        
    715                                         <?php 
    716                             }   
    717                         } 
     714
     715                                        <?php
     716                            }
     717                        }
    718718                }
    719719        }
    720         else 
     720        else
    721721        {
    722722                echo 'Not Found';
    723723        }
    724        
     724
    725725        return $intCounter;
    726726}
    … …  
    730730
    731731        $counter = $intCounter;
    732        
     732
    733733        //Custom Menu
    734         if ($output_type == 'menu') 
     734        if ($output_type == 'menu')
    735735        {
    736736                $sub_args = array(
    … …  
    740740        }
    741741        //Sidebar Menu
    742         elseif ($output_type == 'default') 
     742        elseif ($output_type == 'default')
    743743        {
    744744                $sub_args = array(
    … …  
    747747                'parent' => $childof);
    748748        }
    749         else 
    750         {
    751                
    752         }
    753        
    754         //Get Sub Category Items                       
     749        else
     750        {
     751
     752        }
     753
     754        //Get Sub Category Items
    755755        if ($type == 'categories')
    756756        {
    757                 $sub_array = get_categories($sub_args); 
     757                $sub_array = get_categories($sub_args);
    758758        }
    759759        //Get Sub Page Items
    … …  
    762762                $sub_array = get_pages($sub_args);
    763763        }
    764        
    765        
     764
     765
    766766        if ($sub_array)
    767767        {
    768768                ?>
    769                
     769
    770770                <ul id="sub-custom-nav-<?php echo $type ?>">
    771                
     771
    772772                <?php
    773773                //DISPLAY Loop
    … …  
    776776                        //Prepare Menu Data
    777777                        //Category Menu Item
    778                         if ($type == 'categories') 
     778                        if ($type == 'categories')
    779779                        {
    780780                                $link = get_category_link($sub_item->cat_ID);
    … …  
    784784                                $linktype = 'category';
    785785                                $appendtype = 'Category';
    786                                 $description = htmlentities(strip_tags($sub_item->description));                               
     786                                $description = htmlentities(strip_tags($sub_item->description));
    787787                        }
    788788                        //Page Menu Item
    … …  
    798798                        }
    799799                        //Custom Menu Item
    800                         else 
     800                        else
    801801                        {
    802802                                $title = '';
    … …  
    804804                                $appendtype= 'Custom';
    805805                        }
    806                        
     806
    807807                        //Custom Menu
    808808                        if ($output_type == 'menu')
    … …  
    815815                                                        <span class="controls">
    816816                                                        <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>
    818818                                                                <a id="remove<?php echo $counter; ?>" onclick="removeitem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>">
    819819                                                                        <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" />
    … …  
    823823                                                                </a>
    824824                                                </span>
    825                        
     825
    826826                                        </dt>
    827827                                        </dl>
    … …  
    838838                                        <input type="hidden" name="anchortitle<?php echo $counter; ?>" id="anchortitle<?php echo $counter; ?>" value="<?php echo $title; ?>" />
    839839                                        <input type="hidden" name="newwindow<?php echo $counter; ?>" id="newwindow<?php echo $counter; ?>" value="0" />
    840                                        
     840
    841841                                        <?php $counter++; ?>
    842                                         <?php 
    843                                                
     842                                        <?php
     843
    844844                                                //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
    847847                                        ?>
    848                                        
     848
    849849                                </li>
    850                                 <?php 
     850                                <?php
    851851                        }
    852852                        //Sidebar Menu
    853853                        elseif ($output_type == 'default')
    854854                        {
    855                                        
     855
    856856                                ?>
    857857                                <li>
    858858                                        <dl>
    859859                                        <dt>
    860                                        
     860
    861861                                        <?php $templatedir = get_bloginfo('url'); ?>
    862862                                        <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>
    863863                                        </dl>
    864                                         <?php 
    865                                        
     864                                        <?php
     865
    866866                                                //Do recursion
    867867                                                $counter = wp_custom_navigation_default_sub_items($itemid, $counter, $parent_id, $type, 'default');
    868                                                
     868
    869869                                        ?>
    870870                                </li>
    871                                          
    872                                 <?php 
    873                         }
    874                        
     871
     872                                <?php
     873                        }
     874
    875875                }
    876876                ?>
    877                
     877
    878878                </ul>
    879                
    880         <?php 
    881         }
    882        
     879
     880        <?php
     881        }
     882
    883883        return $counter;
    884884
    … …  
    892892
    893893        $counter = $intCounter;
    894        
     894
    895895        global $wpdb;
    896        
    897        
    898        
    899         //Get Sub Category Items                       
     896
     897
     898
     899        //Get Sub Category Items
    900900        if ($type == 'categories')
    901901        {
    … …  
    904904                        'hide_empty'  => false,
    905905                        'parent' => $childof);
    906                 $sub_array = get_categories($sub_args); 
     906                $sub_array = get_categories($sub_args);
    907907        }
    908908        //Get Sub Page Items
    … …  
    912912                        'child_of' => $childof,
    913913                        'parent' => $childof);
    914        
     914
    915915                $sub_array = get_pages($sub_args);
    916                
     916
    917917        }
    918918        else {
    919        
    920         }
    921        
     919
     920        }
     921
    922922        if ($sub_array)
    923923        {
    … …  
    929929                        }
    930930                        elseif (isset($sub_item->post_parent)) {
    931                                 $sub_item_parent = $sub_item->post_parent; 
     931                                $sub_item_parent = $sub_item->post_parent;
    932932                        }
    933933                        else {
    … …  
    938938                                //Prepare Menu Data
    939939                                //Category Menu Item
    940                                 if ($type == 'categories') 
     940                                if ($type == 'categories')
    941941                                {
    942942                                        $link = get_category_link($sub_item->cat_ID);
    … …  
    958958                                }
    959959                                //Custom Menu Item
    960                                 else 
     960                                else
    961961                                {
    962962                                        $title = '';
    … …  
    964964                                        $appendtype= 'Custom';
    965965                                }
    966                                
     966
    967967                                //CHECK for existing parent records
    968968                                //echo $parent_id;
    … …  
    974974                                        //$parent_id = 0;
    975975                                }
    976                                
     976
    977977                                //INSERT item
    978978                                $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."')";
    979979                                $results = $wpdb->query( $insert );
    980          
     980
    981981                                $counter++;
    982982                                $counter = get_children_menu_elements($itemid, $counter, $parent_id, $type, $menu_id, $table_name);
    983                         }       
     983                        }
    984984                        //Do nothing
    985985                        else {
    986                        
     986
    987987                        }
    988988                }
  • trunk/wp-includes/default-widgets.php

    r13257 r13268  
    10101010        function WP_CustomNavWidget() {
    10111011                $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) {
    10161016                $navmenu = $instance['navmenu'];
    10171017                $navtitle = $instance['navtitle'];
    … …  
    10231023                $navulid = $instance['navulid'];
    10241024                $navulclass = $instance['navulclass'];
    1025                
     1025
    10261026                //Override for menu descriptions
    10271027                $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                {
    10301030                        $navwidgetdescription = 2;
    1031                 } 
     1031                }
    10321032                else
    10331033                {
    … …  
    10351035                }
    10361036                $menuexists = false;
    1037                
     1037
    10381038                global $wpdb;
    1039                
     1039
    10401040                //GET menu name
    10411041                if ($navmenu > 0)
    … …  
    10471047                }
    10481048                //Do nothing
    1049                 else 
     1049                else
    10501050                {
    10511051                        $menuexists = false;
    10521052                }
    10531053                ?>
    1054                
    1055                 <?php 
     1054
     1055                <?php
    10561056                        //DEVELOPER settings enabled
    1057                         if ($navdeveloper == 'yes') 
    1058                         { 
     1057                        if ($navdeveloper == 'yes')
     1058                        {
    10591059                                //DISPLAY Custom DIV
    1060                                 if ($navdiv == 'yes') 
    1061                                 { 
     1060                                if ($navdiv == 'yes')
     1061                                {
    10621062                                        ?>
    10631063                                        <div id="<?php echo $navdivid;  ?>" class="<?php echo $navdivclass; ?>">
    1064                                         <?php 
     1064                                        <?php
    10651065                                }
    10661066                                //Do NOT display DIV
    1067                                 else 
     1067                                else
    10681068                                {
    1069                                        
    1070                                 } 
    1071                                
    1072                         } 
     1069
     1070                                }
     1071
     1072                        }
    10731073                        //DISPLAY default DIV
    1074                         else 
     1074                        else
    10751075                        {
    10761076                                ?>
    10771077                                <div class="widget">
    1078                                 <?php 
     1078                                <?php
    10791079                        }
    10801080                ?>
    1081                
     1081
    10821082                        <h3><?php echo $navtitle; ?></h3>
    1083                         <?php 
    1084                        
    1085                         if ($menuexists) 
     1083                        <?php
     1084
     1085                        if ($menuexists)
    10861086                        {
    10871087                                ?>
    1088                         <?php 
    1089                        
     1088                        <?php
     1089
    10901090                        //DEVELOPER settings enabled
    1091                                 if ($navdeveloper == 'yes') 
    1092                                 { 
     1091                                if ($navdeveloper == 'yes')
     1092                                {
    10931093                                        //DISPLAY Custom UL
    1094                                         if ($navul == 'yes') 
    1095                                         { 
     1094                                        if ($navul == 'yes')
     1095                                        {
    10961096                                                ?>
    10971097                                                <ul id="<?php echo $navulid;  ?>" class="<?php echo $navulclass; ?>">
    1098                                                 <?php 
     1098                                                <?php
    10991099                                        }
    11001100                                        //Do NOT display UL
    1101                                         else 
     1101                                        else
    11021102                                        {
    1103                                                
    1104                                         } 
    1105                                        
    1106                                 } 
     1103
     1104                                        }
     1105
     1106                                }
    11071107                                //DISPLAY default UL
    1108                                 else 
     1108                                else
    11091109                                {
    11101110                                        ?>
    11111111                                        <ul class="custom-nav">
    1112                                         <?php 
     1112                                        <?php
    11131113                                }
    1114                        
     1114
    11151115                        ?>
    1116                                
     1116
    11171117                                                <?php
    11181118                                                        //DISPLAY custom navigation menu
    11191119                                                        if (get_option('wp_custom_nav_menu') == 'true') {
    11201120                                                        custom_nav('name='.$wp_custom_nav_menu_name.'&desc='.$navwidgetdescription);
    1121                                                 }                               
     1121                                                }
    11221122                                                ?>
    1123                                
    1124                                 <?php 
    1125                                
     1123
     1124                                <?php
     1125
    11261126                                        //DEVELOPER settings enabled
    1127                                         if ($navdeveloper == 'yes') 
    1128                                         { 
     1127                                        if ($navdeveloper == 'yes')
     1128                                        {
    11291129                                                //DISPLAY Custom UL
    1130                                                 if ($navul == 'yes') 
    1131                                                 { 
     1130                                                if ($navul == 'yes')
     1131                                                {
    11321132                                                        ?>
    11331133                                                        </ul>
    1134                                                         <?php 
     1134                                                        <?php
    11351135                                                }
    11361136                                                //Do NOT display UL
    1137                                                 else 
     1137                                                else
    11381138                                                {
    1139                                                        
    1140                                                 } 
    1141                                                
    1142                                         } 
     1139
     1140                                                }
     1141
     1142                                        }
    11431143                                        //DISPLAY default UL
    1144                                         else 
     1144                                        else
    11451145                                        {
    11461146                                                ?>
    11471147                                                </ul>
    1148                                                 <?php 
     1148                                                <?php
    11491149                                        }
    1150                                        
     1150
    11511151                                ?>
    11521152                        <?php
    … …  
    11571157                        }
    11581158                        ?>
    1159                 <?php 
     1159                <?php
    11601160                        //DEVELOPER settings enabled
    1161                         if ($navdeveloper == 'yes') 
    1162                         { 
     1161                        if ($navdeveloper == 'yes')
     1162                        {
    11631163                                //DISPLAY Custom DIV
    1164                                 if ($navdiv == 'yes') 
    1165                                 { 
     1164                                if ($navdiv == 'yes')
     1165                                {
    11661166                                        ?>
    11671167                                        </div>
    1168                                         <?php 
     1168                                        <?php
    11691169                                }
    11701170                                //Do NOT display DIV
    1171                                 else 
     1171                                else
    11721172                                {
    1173                                        
    1174                                 } 
    1175                                
    1176                         } 
     1173
     1174                                }
     1175
     1176                        }
    11771177                        //DISPLAY default DIV
    1178                         else 
     1178                        else
    11791179                        {
    11801180                                ?>
    11811181                                </div>
    1182                                 <?php 
     1182                                <?php
    11831183                        }
    11841184                ?><!-- /#nav-container -->
    1185                        
     1185
    11861186                        <?php
    11871187        }
    11881188
    1189         function update($new_instance, $old_instance) {               
     1189        function update($new_instance, $old_instance) {
    11901190                return $new_instance;
    11911191        }
    11921192
    1193         function form($instance) {       
     1193        function form($instance) {
    11941194                $navmenu = esc_attr($instance['navmenu']);
    11951195                $navtitle = esc_attr($instance['navtitle']);
    … …  
    12021202                $navulclass = esc_attr($instance['navulclass']);
    12031203                $navwidgetdescription = esc_attr($instance['navwidgetdescription']);
    1204                                
     1204
    12051205                global $wpdb;
    1206                                
    1207                 //GET Menu Items for SELECT OPTIONS     
     1206
     1207                //GET Menu Items for SELECT OPTIONS
    12081208                $table_name_custom_menus = $wpdb->prefix . "custom_nav_menus";
    12091209                $custom_menu_records = $wpdb->get_results("SELECT id,menu_name FROM ".$table_name_custom_menus);
    1210                
     1210
    12111211                //CHECK if menus exist
    12121212                if ($custom_menu_records > 0)
    12131213                {
    1214                
     1214
    12151215                        ?>
    1216                        
     1216
    12171217                         <p>
    12181218                    <label for="<?php echo $this->get_field_id('navmenu'); ?>"><?php _e('Select Menu:'); ?></label>
    1219                                
     1219
    12201220                                <select id="<?php echo $this->get_field_id('navmenu'); ?>" name="<?php echo $this->get_field_name('navmenu'); ?>">
    1221                                         <?php 
    1222                                        
     1221                                        <?php
     1222
    12231223                                        //DISPLAY SELECT OPTIONS
    12241224                                        foreach ($custom_menu_records as $custom_menu_record)
    … …  
    12331233                                                <option value="<?php echo $custom_menu_record->id; ?>" <?php echo $selected_option; ?>><?php echo $custom_menu_record->menu_name; ?></option>
    12341234                                                <?php
    1235                                                
     1235
    12361236                                        }
    12371237                                        ?>
    12381238                                </select>
    1239        
     1239
    12401240                        </p>
    1241                        
     1241
    12421242                        <p>
    1243                                
     1243
    12441244                        <label for="<?php echo $this->get_field_id('navtitle'); ?>"><?php _e('Title:'); ?></label>
    12451245                        <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'); ?>" />
    12461246                    </p>
    1247                    
     1247
    12481248                <p>
    12491249                        <?php
    12501250                            $checked = strtolower($navdeveloper);
    12511251                        ?>
    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 />
    12541254                        <span class="checkboxes">
    12551255                                <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"'; } ?> />
    12561256                            <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"'; } ?> />
    12571257                        </span><!-- /.checkboxes -->
    1258                        
     1258
    12591259                        </p>
    1260                    
    1261                     <?php 
    1262                    
     1260
     1261                    <?php
     1262
    12631263                    //DEVELOPER settings
    12641264                    if ($checked == 'yes')
    12651265                    {
    12661266                        ?>
    1267                        
     1267
    12681268                        <p>
    12691269                                <?php
    12701270                                    $checked = strtolower($navdiv);
    12711271                                ?>
    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 />
    12741274                                <span class="checkboxes">
    12751275                                        <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"'; } ?> />
    12761276                                    <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"'; } ?> />
    12771277                                </span><!-- /.checkboxes -->
    1278                        
     1278
    12791279                        </p>
    1280                        
     1280
    12811281                        <?php
    1282                        
     1282
    12831283                        if ($checked == 'yes')
    12841284                        {
    1285                        
     1285
    12861286                                ?>
    1287                                
     1287
    12881288                                <p>
    1289                                
     1289
    12901290                            <label for="<?php echo $this->get_field_id('navdivid'); ?>"><?php _e('DIV id:'); ?></label>
    12911291                            <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'); ?>" />
    12921292                        </p>
    12931293                        <p>
    1294                                
     1294
    12951295                            <label for="<?php echo $this->get_field_id('navdivclass'); ?>"><?php _e('DIV class:'); ?></label>
    12961296                            <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'); ?>" />
    12971297                        </p>
    1298                                
     1298
    12991299                                <?php
    1300                                
     1300
    13011301                        }
    1302                        
     1302
    13031303                        ?>
    1304                        
     1304
    13051305                        <p>
    13061306                                <?php
    13071307                                    $checked = strtolower($navul);
    13081308                                ?>
    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 />
    13111311                                <span class="checkboxes">
    13121312                                        <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"'; } ?> />
    13131313                                    <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"'; } ?> />
    13141314                                </span><!-- /.checkboxes -->
    1315                        
     1315
    13161316                        </p>
    1317                        
     1317
    13181318                        <?php
    1319                
     1319
    13201320                        if ($checked == 'yes')
    13211321                        {
    1322                        
     1322
    13231323                                ?>
    1324                                
     1324
    13251325                                <p>
    1326                                
     1326
    13271327                            <label for="<?php echo $this->get_field_id('navulid'); ?>"><?php _e('UL id:'); ?></label>
    13281328                            <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'); ?>" />
    13291329                        </p>
    13301330                        <p>
    1331                                
     1331
    13321332                            <label for="<?php echo $this->get_field_id('navulclass'); ?>"><?php _e('UL class:'); ?></label>
    13331333                            <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'); ?>" />
    13341334                        </p>
    1335                                
     1335
    13361336                                <?php
    1337                                
     1337
    13381338                        }
    1339                        
     1339
    13401340                        ?>
    13411341                        <?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?>
    13421342                        <p <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?>>
    1343                        
     1343
    13441344                   <?php
    13451345                                    $checked = strtolower($navwidgetdescription);
    13461346                                ?>
    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 />
    13491349                                <span class="checkboxes">
    13501350                                        <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"'; } ?> />
    … …  
    13521352                                </span><!-- /.checkboxes -->
    13531353                </p>
    1354                         <?php 
     1354                        <?php
    13551355                    }
    13561356                    //Do nothing
    1357                     else 
     1357                    else
    13581358                    {
    1359                        
     1359
    13601360                    }
    1361                        
     1361
    13621362                }
    13631363                //Error message for menus not existing
    1364                 else 
     1364                else
    13651365                {
    13661366                        ?>
    … …  
    13711371                }
    13721372        }
    1373        
     1373
    13741374}
    13751375
    … …  
    14091409
    14101410        register_widget('WP_Widget_Tag_Cloud');
    1411        
     1411
    14121412        register_widget('WP_CustomNavWidget');
    1413        
     1413
    14141414        do_action('widgets_init');
    14151415}
  • trunk/wp-includes/deprecated.php

    r13229 r13268  
    20632063 * @deprecated 2.8.0
    20642064 * @deprecated Use esc_url_raw()
    2065  * @see esc_url_raw() 
     2065 * @see esc_url_raw()
    20662066 *
    20672067 * @param string $url The URL to be cleaned.
  • trunk/wp-includes/functions.php

    r13242 r13268  
    611611 *
    612612 * @package WordPress
    613  * @subpackage Option 
     613 * @subpackage Option
    614614 * @since 1.2.0
    615615 *
  • trunk/wp-includes/general-template.php

    r13262 r13268  
    714714
    715715        $tag = $wp_query->get_queried_object();;
    716        
     716
    717717        if ( ! $tag )
    718718                return;
  • trunk/wp-includes/http.php

    r13149 r13268  
    10131013                                'protocol_version' => (float) $r['httpversion'],
    10141014                                'header' => $strHeaders,
    1015                                 'ignore_errors' => true, // Return non-200 requests. 
     1015                                'ignore_errors' => true, // Return non-200 requests.
    10161016                                'timeout' => $r['timeout'],
    10171017                                'ssl' => array(
  • trunk/wp-includes/ms-default-constants.php

    r13127 r13268  
    3535function ms_cookie_constants(  ) {
    3636        global $current_site;
    37        
     37
    3838        /**
    3939         * @since 1.2.0
  • trunk/wp-includes/script-loader.php

    r13266 r13268  
    398398
    399399        }
    400        
     400
    401401        //Custom Navigation
    402402
    403403        $scripts->add( 'custom-navigation-ui-custom', '/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js', array('jquery'), '1.7.2' );
    404404        $scripts->add_data( 'custom-navigation-ui-custom', 'group', 1 );
    405        
     405
    406406        $scripts->add( 'custom-navigation-default-items', "/wp-admin/js/custom-navigation-default-items$suffix.js", false, '20100220' );
    407407        $scripts->add( 'custom-navigation-dynamic-functions', "/wp-admin/js/custom-navigation-dynamic-functions$suffix.js", false, '20100220' );
    408408        $scripts->add( 'custom-navigation-php-functions', "/wp-admin/js/custom-navigation-php-functions$suffix.js", false, '20100220' );
    409        
     409
    410410}
    411411
    … …  
    474474        $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
    475475        $styles->add( 'custom-navigation', "/wp-admin/css/custom-navigation$suffix.css", array(), '20100215' );
    476        
     476
    477477        foreach ( $rtl_styles as $rtl_style )
    478478                $styles->add_data( $rtl_style, 'rtl', true );
  • trunk/wp-includes/taxonomy.php

    r13260 r13268  
    244244                        $args[$cap] = 'manage_categories';
    245245        }
    246        
     246
    247247        if ( empty($args['singular_label']) )
    248248                $args['singular_label'] = $args['label'];
  • trunk/wp-includes/template-loader.php

    r13252 r13268  
    1515        return;
    1616elseif ( is_trackback() ) :
    17         include( ABSPATH . 'wp-trackback.php' );       
     17        include( ABSPATH . 'wp-trackback.php' );
    1818        return;
    1919endif;
  • trunk/wp-settings.php

    r13251 r13268  
    4444wp_check_php_mysql_versions();
    4545
    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
    4747wp_favicon_request();
    4848
Note: See TracChangeset for help on using the changeset viewer.