Index: classes.php
===================================================================
--- classes.php	(revision 6597)
+++ classes.php	(working copy)
@@ -1,26 +1,131 @@
 <?php
+/**
+ * Holds Most of the WordPress classes
+ *
+ * Some of the other classes are contained in other files.
+ * For example, the WordPress cache is in cache.php and the
+ * WordPress roles API is in capabilities.php. The third
+ * party libraries are contained in their own separate files.
+ *
+ * @package WordPress
+ */
 
+/**
+ * 
+ *
+ * @package WordPress
+ * @since 
+ */
 class WP {
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @access public
+	 * @var unknown_type
+	 */
 	var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots');
 
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id');
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $extra_query_vars = array();
 
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $query_vars;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $query_string;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $request;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $matched_rule;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $matched_query;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $did_permalink = false;
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $qv
+	 */
 	function add_query_var($qv) {
 		$this->public_query_vars[] = $qv;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $key
+	 * @param unknown_type $value
+	 */
 	function set_query_var($key, $value) {
 		$this->query_vars[$key] = $value;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $extra_query_vars
+	 */
 	function parse_request($extra_query_vars = '') {
 		global $wp_rewrite;
 
@@ -172,6 +277,13 @@
 		do_action_ref_array('parse_request', array(&$this));
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 */
 	function send_headers() {
 		@header('X-Pingback: '. get_bloginfo('pingback_url'));
 		if ( is_user_logged_in() )
@@ -226,6 +338,13 @@
 		do_action_ref_array('send_headers', array(&$this));
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 */
 	function build_query_string() {
 		$this->query_string = '';
 		foreach (array_keys($this->query_vars) as $wpvar) {
@@ -244,6 +363,13 @@
 		}
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 */
 	function register_globals() {
 		global $wp_query;
 		// Extract updated query vars back into global namespace.
@@ -262,16 +388,37 @@
 		}
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 */
 	function init() {
 		wp_get_current_user();
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 */
 	function query_posts() {
 		global $wp_the_query;
 		$this->build_query_string();
 		$wp_the_query->query($this->query_vars);
  	}
 
+ 	/**
+ 	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+ 	 */
 	function handle_404() {
 		global $wp_query;
 		// Issue a 404 if a permalink request doesn't match any posts.  Don't
@@ -287,6 +434,15 @@
 		}
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $query_args
+	 */
 	function main($query_args = '') {
 		$this->init();
 		$this->parse_request($query_args);
@@ -297,15 +453,54 @@
 		do_action_ref_array('wp', array(&$this));
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @return WP
+	 */
 	function WP() {
 		// Empty.
 	}
 }
 
+/**
+ * 
+ *
+ * @package WordPress
+ */
 class WP_Error {
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $errors = array();
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $error_data = array();
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $code
+	 * @param unknown_type $message
+	 * @param unknown_type $data
+	 * @return WP_Error
+	 */
 	function WP_Error($code = '', $message = '', $data = '') {
 		if ( empty($code) )
 			return;
@@ -316,6 +511,15 @@
 			$this->error_data[$code] = $data;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @return unknown
+	 */
 	function get_error_codes() {
 		if ( empty($this->errors) )
 			return array();
@@ -323,6 +527,15 @@
 		return array_keys($this->errors);
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @return unknown
+	 */
 	function get_error_code() {
 		$codes = $this->get_error_codes();
 
@@ -332,6 +545,16 @@
 		return $codes[0];
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $code
+	 * @return unknown
+	 */
 	function get_error_messages($code = '') {
 		// Return all messages if no code specified.
 		if ( empty($code) ) {
@@ -348,6 +571,16 @@
 			return array();
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $code
+	 * @return unknown
+	 */
 	function get_error_message($code = '') {
 		if ( empty($code) )
 			$code = $this->get_error_code();
@@ -357,6 +590,16 @@
 		return $messages[0];
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $code
+	 * @return unknown
+	 */
 	function get_error_data($code = '') {
 		if ( empty($code) )
 			$code = $this->get_error_code();
@@ -366,12 +609,33 @@
 		return null;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $code
+	 * @param unknown_type $message
+	 * @param unknown_type $data
+	 */
 	function add($code, $message, $data = '') {
 		$this->errors[$code][] = $message;
 		if ( ! empty($data) )
 			$this->error_data[$code] = $data;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $data
+	 * @param unknown_type $code
+	 */
 	function add_data($data, $code = '') {
 		if ( empty($code) )
 			$code = $this->get_error_code();
@@ -380,6 +644,16 @@
 	}
 }
 
+/**
+ * is_wp_error() - {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since 
+ *
+ * @param unknown_type $thing
+ * @return unknown
+ */
 function is_wp_error($thing) {
 	if ( is_object($thing) && is_a($thing, 'WP_Error') )
 		return true;
@@ -390,20 +664,100 @@
  * A class for displaying various tree-like structures. 
  * Extend the Walker class to use it, see examples at the bottom
  */
+/**
+ * 
+ *
+ * @package WordPress
+ * @since 
+ */
 class Walker {
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $tree_type;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $db_fields;
 
-	//abstract callbacks
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 * @abstract
+	 *
+	 * @param unknown_type $output
+	 * @return unknown
+	 */
 	function start_lvl($output) { return $output; }
+
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 * @abstract
+	 *
+	 * @param unknown_type $output
+	 * @return unknown
+	 */
 	function end_lvl($output)   { return $output; }
+
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 * @abstract
+	 *
+	 * @param unknown_type $output
+	 * @return unknown
+	 */
 	function start_el($output)  { return $output; }
+
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 * @abstract
+	 *
+	 * @param unknown_type $output
+	 * @return unknown
+	 */
 	function end_el($output)    { return $output; }
 
 	/*
  	 * display one element if the element doesn't have any children
  	 * otherwise, display the element and its children
  	 */
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $element
+	 * @param unknown_type $children_elements
+	 * @param unknown_type $max_depth
+	 * @param unknown_type $depth
+	 * @param unknown_type $args
+	 * @param unknown_type $output
+	 * @return unknown
+	 */
 	function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, $output ) {
 	
 		if ( !$element)
@@ -452,12 +806,23 @@
 	}
 
 	/*
- 	* displays array of elements hierarchically
- 	* it is a generic function which does not assume any existing order of elements
- 	* max_depth = -1 means flatly display every element 
- 	* max_depth = 0  means display all levels 
- 	* max_depth > 0  specifies the number of display levels. 
- 	*/
+	 * displays array of elements hierarchically
+	 * it is a generic function which does not assume any existing order of elements
+	 * max_depth = -1 means flatly display every element 
+	 * max_depth = 0  means display all levels 
+	 * max_depth > 0  specifies the number of display levels. 
+	 */
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $elements
+	 * @param unknown_type $max_depth
+	 * @return unknown
+	 */
 	function walk( $elements, $max_depth) {
 	
 		$args = array_slice(func_get_args(), 2);
@@ -514,9 +879,9 @@
 			$output = $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
 			
 		/* 
-		* if we are displaying all levels, and remaining children_elements is not empty, 
-		* then we got orphans, which should be displayed regardless
-	 	*/
+		 * if we are displaying all levels, and remaining children_elements is not empty, 
+		 * then we got orphans, which should be displayed regardless
+		 */
 		if ( ( $max_depth == 0 ) && sizeof( $children_elements ) > 0 ) {
 			$empty_array = array(); 
 			foreach ( $children_elements as $orphan_e )
@@ -526,22 +891,79 @@
 	}
 }
 
+/**
+ * 
+ *
+ * @package WordPress
+ * @since 
+ * @uses 
+ */
 class Walker_Page extends Walker {
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $tree_type = 'page';
-	var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this
 
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @todo decouple this
+	 * @var unknown_type
+	 */
+	var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
+
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $output
+	 * @param unknown_type $depth
+	 * @return unknown
+	 */
 	function start_lvl($output, $depth) {
 		$indent = str_repeat("\t", $depth);
 		$output .= "\n$indent<ul>\n";
 		return $output;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $output
+	 * @param unknown_type $depth
+	 * @return unknown
+	 */
 	function end_lvl($output, $depth) {
 		$indent = str_repeat("\t", $depth);
 		$output .= "$indent</ul>\n";
 		return $output;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $output
+	 * @param unknown_type $page
+	 * @param unknown_type $depth
+	 * @param unknown_type $current_page
+	 * @param unknown_type $args
+	 * @return unknown
+	 */
 	function start_el($output, $page, $depth, $current_page, $args) {
 		if ( $depth )
 			$indent = str_repeat("\t", $depth);
@@ -570,6 +992,18 @@
 		return $output;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $output
+	 * @param unknown_type $page
+	 * @param unknown_type $depth
+	 * @return unknown
+	 */
 	function end_el($output, $page, $depth) {
 		$output .= "</li>\n";
 
@@ -578,10 +1012,44 @@
 
 }
 
+/**
+ * 
+ *
+ * @package WordPress
+ * @since 
+ * @uses Walker
+ */
 class Walker_PageDropdown extends Walker {
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $tree_type = 'page';
-	var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this
 
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @todo Decouple this
+	 * @var unknown_type
+	 */
+	var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
+
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $output
+	 * @param unknown_type $page
+	 * @param unknown_type $depth
+	 * @param unknown_type $args
+	 * @return unknown
+	 */
 	function start_el($output, $page, $depth, $args) {
 				$pad = str_repeat('&nbsp;', $depth * 3);
 
@@ -597,10 +1065,43 @@
 	}
 }
 
+/**
+ * 
+ *
+ * @package WordPress
+ * @since 
+ * @uses Walker
+ */
 class Walker_Category extends Walker {
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $tree_type = 'category';
-	var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this
 
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @todo Decouple this
+	 * @var unknown_type
+	 */
+	var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
+
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $output
+	 * @param unknown_type $depth
+	 * @param unknown_type $args
+	 * @return unknown
+	 */
 	function start_lvl($output, $depth, $args) {
 		if ( 'list' != $args['style'] )
 			return $output;
@@ -610,6 +1111,18 @@
 		return $output;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $output
+	 * @param unknown_type $depth
+	 * @param unknown_type $args
+	 * @return unknown
+	 */
 	function end_lvl($output, $depth, $args) {
 		if ( 'list' != $args['style'] )
 			return $output;
@@ -619,6 +1132,19 @@
 		return $output;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $output
+	 * @param unknown_type $category
+	 * @param unknown_type $depth
+	 * @param unknown_type $args
+	 * @return unknown
+	 */
 	function start_el($output, $category, $depth, $args) {
 		extract($args);
 
@@ -686,6 +1212,19 @@
 		return $output;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $output
+	 * @param unknown_type $page
+	 * @param unknown_type $depth
+	 * @param unknown_type $args
+	 * @return unknown
+	 */
 	function end_el($output, $page, $depth, $args) {
 		if ( 'list' != $args['style'] )
 			return $output;
@@ -696,10 +1235,44 @@
 
 }
 
+/**
+ * 
+ *
+ * @package WordPress
+ * @since 
+ * @uses Walker
+ */
 class Walker_CategoryDropdown extends Walker {
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $tree_type = 'category';
-	var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this
 
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @todo Decouple this
+	 * @var unknown_type
+	 */
+	var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
+
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $output
+	 * @param unknown_type $category
+	 * @param unknown_type $depth
+	 * @param unknown_type $args
+	 * @return unknown
+	 */
 	function start_el($output, $category, $depth, $args) {
 		$pad = str_repeat('&nbsp;', $depth * 3);
 
@@ -721,15 +1294,47 @@
 	}
 }
 
+/**
+ * 
+ *
+ * @package WordPress
+ * @since 
+ */
 class WP_Ajax_Response {
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since 
+	 * @var unknown_type
+	 */
 	var $responses = array();
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $args
+	 * @return WP_Ajax_Response
+	 */
 	function WP_Ajax_Response( $args = '' ) {
 		if ( !empty($args) )
 			$this->add($args);
 	}
 
 	// a WP_Error object can be passed in 'id' or 'data'
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 *
+	 * @param unknown_type $args
+	 * @return unknown
+	 */
 	function add( $args = '' ) {
 		$defaults = array(
 			'what' => 'object', 'action' => false,
@@ -794,6 +1399,13 @@
 		return $x;
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since 
+	 */
 	function send() {
 		header('Content-Type: text/xml');
 		echo "<?xml version='1.0' standalone='yes'?><wp_ajax>";

