Make WordPress Core


Ignore:
Timestamp:
11/19/2006 07:56:05 AM (19 years ago)
Author:
ryan
Message:

Remove trailing spaces and convert spaces to tabs. Props Nazgul. fixes #986

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r4483 r4495  
    1313    var $matched_query;
    1414    var $did_permalink = false;
    15    
     15
    1616    function add_query_var($qv) {
    1717        $this->public_query_vars[] = $qv;
     
    9797                    // Got a match.
    9898                    $this->matched_rule = $match;
    99                    
     99
    100100                    // Trim the query of everything up to the '?'.
    101101                    $query = preg_replace("!^.+\?!", '', $query);
     
    191191            )
    192192                $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT';
    193             else 
     193            else
    194194                $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT';
    195195            $wp_etag = '"' . md5($wp_last_modified) . '"';
     
    198198
    199199            // Support for Conditional GET
    200             if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) 
     200            if (isset($_SERVER['HTTP_IF_NONE_MATCH']))
    201201                $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
    202202            else $client_etag = false;
     
    322322            return '';
    323323
    324         return $codes[0];   
     324        return $codes[0];
    325325    }
    326326
     
    338338            return $this->errors[$code];
    339339        else
    340             return array(); 
     340            return array();
    341341    }
    342342
     
    382382// A class for displaying various tree-like structures. Extend the Walker class to use it, see examples at the bottom
    383383
    384 class Walker { 
     384class Walker {
    385385    var $tree_type;
    386386    var $db_fields;
    387    
     387
    388388    //abstract callbacks
    389389    function start_lvl($output) { return $output; }
     
    391391    function start_el($output)  { return $output; }
    392392    function end_el($output)    { return $output; }
    393    
     393
    394394    function walk($elements, $to_depth) {
    395395        $args = array_slice(func_get_args(), 2); $parents = array(); $depth = 1; $previous_element = ''; $output = '';
    396    
     396
    397397        //padding at the end
    398398        $last_element->post_parent = 0;
    399399        $last_element->post_id = 0;
    400400        $elements[] = $last_element;
    401    
     401
    402402        $id_field = $this->db_fields['id'];
    403403        $parent_field = $this->db_fields['parent'];
    404    
     404
    405405        $flat = ($to_depth == -1) ? true : false;
    406    
     406
    407407        foreach ( $elements as $element ) {
    408408            // If flat, start and end the element and skip the level checks.
     
    444444                    $output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
    445445                }
    446    
     446
    447447                while ( $parent = array_shift($parents) ) {
    448448                    $depth--;
     
    464464                }
    465465            }
    466    
     466
    467467            // Start the element.
    468468            if ( !$to_depth || ($depth <= $to_depth) ) {
     
    472472                }
    473473            }
    474    
     474
    475475            $previous_element = $element;
    476476        }
    477        
     477
    478478        return $output;
    479479    }
     
    483483    var $tree_type = 'page';
    484484    var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this
    485    
     485
    486486    function start_lvl($output, $depth) {
    487487        $indent = str_repeat("\t", $depth);
     
    489489        return $output;
    490490    }
    491    
     491
    492492    function end_lvl($output, $depth) {
    493493        $indent = str_repeat("\t", $depth);
     
    495495        return $output;
    496496    }
    497    
     497
    498498    function start_el($output, $page, $depth, $current_page, $show_date, $date_format) {
    499499        if ( $depth )
     
    531531
    532532    function start_el($output, $page, $depth, $args) {
    533         $pad = str_repeat('&nbsp;', $depth * 3);
    534 
    535         $output .= "\t<option value=\"$page->ID\"";
    536         if ( $page->ID == $args['selected'] )
    537                 $output .= ' selected="selected"';
    538         $output .= '>';
    539         $title = wp_specialchars($page->post_title);
    540         $output .= "$pad$title";
    541         $output .= "</option>\n";
    542 
    543         return $output;
     533                $pad = str_repeat('&nbsp;', $depth * 3);
     534
     535                $output .= "\t<option value=\"$page->ID\"";
     536                if ( $page->ID == $args['selected'] )
     537                                $output .= ' selected="selected"';
     538                $output .= '>';
     539                $title = wp_specialchars($page->post_title);
     540                $output .= "$pad$title";
     541                $output .= "</option>\n";
     542
     543                return $output;
    544544    }
    545545}
     
    548548    var $tree_type = 'category';
    549549    var $db_fields = array ('parent' => 'category_parent', 'id' => 'cat_ID'); //TODO: decouple this
    550    
     550
    551551    function start_lvl($output, $depth, $args) {
    552552        if ( 'list' != $args['style'] )
    553553            return $output;
    554    
     554
    555555        $indent = str_repeat("\t", $depth);
    556556        $output .= "$indent<ul class='children'>\n";
    557557        return $output;
    558558    }
    559    
     559
    560560    function end_lvl($output, $depth, $args) {
    561561        if ( 'list' != $args['style'] )
    562562            return $output;
    563    
     563
    564564        $indent = str_repeat("\t", $depth);
    565565        $output .= "$indent</ul>\n";
    566566        return $output;
    567567    }
    568    
     568
    569569    function start_el($output, $category, $depth, $args) {
    570570        extract($args);
    571    
     571
    572572        $link = '<a href="' . get_category_link($category->cat_ID) . '" ';
    573573        if ( $use_desc_for_title == 0 || empty($category->category_description) )
     
    577577        $link .= '>';
    578578        $link .= apply_filters('list_cats', $category->cat_name, $category).'</a>';
    579    
     579
    580580        if ( (! empty($feed_image)) || (! empty($feed)) ) {
    581581            $link .= ' ';
    582    
     582
    583583            if ( empty($feed_image) )
    584584                $link .= '(';
    585    
     585
    586586            $link .= '<a href="' . get_category_rss_link(0, $category->cat_ID, $category->category_nicename) . '"';
    587    
     587
    588588            if ( !empty($feed) ) {
    589589                $title = ' title="' . $feed . '"';
     
    592592                $link .= $title;
    593593            }
    594    
     594
    595595            $link .= '>';
    596    
     596
    597597            if ( !empty($feed_image) )
    598598                $link .= "<img src='$feed_image' $alt$title" . ' />';
     
    619619            $output .= "\t$link<br />\n";
    620620        }
    621    
    622         return $output;
    623     }
    624    
     621
     622        return $output;
     623    }
     624
    625625    function end_el($output, $page, $depth, $args) {
    626626        if ( 'list' != $args['style'] )
    627627            return $output;
    628    
     628
    629629        $output .= "</li>\n";
    630630        return $output;
     
    636636    var $tree_type = 'category';
    637637    var $db_fields = array ('parent' => 'category_parent', 'id' => 'cat_ID'); //TODO: decouple this
    638    
    639     function start_el($output, $category, $depth, $args) { 
     638
     639    function start_el($output, $category, $depth, $args) {
    640640        $pad = str_repeat('&nbsp;', $depth * 3);
    641        
     641
    642642        $cat_name = apply_filters('list_cats', $category->cat_name, $category);
    643643        $output .= "\t<option value=\"".$category->cat_ID."\"";
     
    653653        }
    654654        $output .= "</option>\n";
    655        
     655
    656656        return $output;
    657657    }
Note: See TracChangeset for help on using the changeset viewer.