Make WordPress Core

Changeset 2029


Ignore:
Timestamp:
01/01/2005 11:05:07 PM (22 years ago)
Author:
saxmatt
Message:

Sub-page hierarchy, show pages on default menu. TODO: Ping Michael about top-level pages in kubrick menu.

Location:
trunk
Files:
5 edited

Legend:

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

    r2019 r2029  
    128128                                <td>$edit</td>
    129129                                </tr>";
    130                                 cat_rows($category->cat_ID, $level + 1);
     130                                cat_rows($category->cat_ID, $level + 1, $categories);
     131                        }
     132                }
     133        } else {
     134                return false;
     135        }
     136}
     137
     138function page_rows( $parent = 0, $level = 0, $pages = 0 ) {
     139        global $wpdb, $class, $user_level, $post;
     140        if (!$pages)
     141                $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' ORDER BY menu_order");
     142
     143        if ($pages) {
     144                foreach ($pages as $post) { start_wp();
     145                        if ($post->post_parent == $parent) {
     146                                $post->post_title = wp_specialchars($post->post_title);
     147                                $pad = str_repeat('&#8212; ', $level);
     148                                $id = $post->ID;
     149                                $class = ('alternate' == $class) ? '' : 'alternate';
     150?>
     151  <tr class='<?php echo $class; ?>'>
     152    <th scope="row"><?php echo $post->ID; ?></th>
     153    <td>
     154      <?php echo $pad; ?><?php the_title() ?>
     155    </td>
     156    <td><?php the_author() ?></td>
     157    <td><?php the_time('Y-m-d g:i a'); ?></td>
     158        <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td>
     159    <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
     160    <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=delete&amp;post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), the_title('','',0)) . "')\">" . __('Delete') . "</a>"; } ?></td>
     161  </tr>
     162
     163<?php
     164                                page_rows($id, $level + 1, $pages);
    131165                        }
    132166                }
  • trunk/wp-admin/edit-pages.php

    r1902 r2029  
    3030    <th scope="col"></th>
    3131  </tr>
    32 <?php
    33 $bgcolor = '';
    34 foreach ($posts as $post) : start_wp();
    35 $class = ('alternate' == $class) ? '' : 'alternate';
    36 ?>
    37   <tr class='<?php echo $class; ?>'>
    38     <th scope="row"><?php echo $id ?></th>
    39     <td>
    40       <?php the_title() ?>
    41     </td>
    42     <td><?php the_author() ?></td>
    43     <td><?php the_time('Y-m-d g:i a'); ?></td>
    44         <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td>
    45     <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
    46     <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=delete&amp;post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), the_title('','',0)) . "')\">" . __('Delete') . "</a>"; } ?></td>
    47   </tr>
    48 <?php endforeach; ?>
     32<?php page_rows(); ?>
    4933</table>
    5034<?php
  • trunk/wp-includes/template-functions-post.php

    r2022 r2029  
    5050        global $post, $wpdb;
    5151        $title = $post->post_title;
     52
    5253        if ( 0 != $id )
    5354                $title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $id");
     
    366367        if (!isset($r['show_date'])) $r['show_date'] = '';
    367368        if (!isset($r['child_of'])) $r['child_of'] = 0;
     369        if ( !isset($r['title_li']) ) $r['title_li'] = __('Pages');
     370
    368371
    369372        // Query pages.
    370373        $pages = get_pages($args);
    371 
     374        if ( $pages ) :
     375
     376        if ( $r['title_li'] )
     377                echo '<li>' . $r['title_li'] . '<ul>';
    372378        // Now loop over all pages that were selected
    373379        $page_tree = Array();
     
    398404        // child_of defaults to 0 if not supplied in the query.
    399405        _page_level_out($r['child_of'],$page_tree, $r);
     406        if ( $r['title_li'] )
     407                echo '</ul></li>';
     408        endif;
    400409}
    401410
  • trunk/wp-includes/wp-layout.css

    r2009 r2029  
    229229#menu ul ul li {
    230230        border: 0;
    231         font: normal normal 70%/115% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
     231        font: normal normal 12px/115% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
    232232        letter-spacing: 0;
    233233        margin-top: 0;
  • trunk/wp-includes/wp-sidebar.php

    r2009 r2029  
    44
    55<ul>
     6        <?php wp_list_pages(); ?>
    67        <?php get_links_list(); ?>
    78 <li id="categories"><?php _e('Categories:'); ?>
Note: See TracChangeset for help on using the changeset viewer.