? .cache
? .settings
Index: modules/taxonomy/taxonomy-term.tpl.php
===================================================================
RCS file: modules/taxonomy/taxonomy-term.tpl.php
diff -N modules/taxonomy/taxonomy-term.tpl.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/taxonomy/taxonomy-term.tpl.php	9 Jan 2010 20:09:40 -0000
@@ -0,0 +1,51 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Default theme implementation to display a term.
+ *
+ * Available variables:
+ * - $name: the (sanitized) name of the term.
+ * - $content: An array of items for the content of the term (fields and
+ *   description). Use render($content) to print them all, or print a subset
+ *   such as render($content['field_example']). Use
+ *   hide($content['field_example']) to temporarily suppress the printing of a
+ *   given element.
+ * - $term_url: Direct url of the current term.
+ * - $classes: String of classes that can be used to style contextually through
+ *   CSS. It can be manipulated through the variable $classes_array from
+ *   preprocess functions. The default values can be one or more of the following:
+ *   - taxonomy-term: The current template type, i.e., "theming hook".
+ *   - vocabulary-[vocabulary-name]: The vocabulary to which the term belongs to.
+ *     For example, if the term is a "Tag" it would result in "vocabulary-tag".
+ *
+ * Other variables:
+ * - $term: Full term object. Contains data that may not be safe.
+ * - $view_mode: View mode, e.g. 'full', 'teaser'...
+ * - $page: Flag for the full page state.
+ * - $classes_array: Array of html class attribute values. It is flattened
+ *   into a string within the variable $classes.
+ * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
+ *   teaser listings.
+ * - $id: Position of the term. Increments each time it's output.
+ * - $is_front: Flags true when presented in the front page.
+ * - $logged_in: Flags true when the current user is a logged-in member.
+ * - $is_admin: Flags true when the current user is an administrator.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_taxonomy_term()
+ * @see template_process()
+ */
+?>
+<div id="taxonomy-term-<?php print $term->tid; ?>" class="<?php print $classes; ?> clearfix">
+
+  <?php if (!$page): ?>
+    <h2><a href="<?php print $term_url; ?>"><?php print $term_name; ?></a></h2>
+  <?php endif; ?>
+
+  <div class="content">
+    <?php print render($content); ?>
+  </div>
+
+</div>
Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.91
diff -u -p -r1.91 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc	9 Jan 2010 12:54:51 -0000	1.91
+++ modules/taxonomy/taxonomy.admin.inc	9 Jan 2010 18:06:16 -0000
@@ -643,12 +643,15 @@ function taxonomy_form_term($form, &$for
     '#title' => t('Name'),
     '#default_value' => $edit['name'],
     '#maxlength' => 255,
-    '#required' => TRUE);
+    '#required' => TRUE,
+    '#weight' => -5,
+  );
   $form['description'] = array(
     '#type' => 'textarea',
     '#title' => t('Description'),
     '#default_value' => $edit['description'],
     '#text_format' => $edit['format'],
+    '#weight' => 0,
   );
 
   $form['vocabulary_machine_name'] = array(
Index: modules/taxonomy/taxonomy.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.css,v
retrieving revision 1.5
diff -u -p -r1.5 taxonomy.css
--- modules/taxonomy/taxonomy.css	25 Jan 2008 21:20:26 -0000	1.5
+++ modules/taxonomy/taxonomy.css	9 Jan 2010 18:56:11 -0000
@@ -9,6 +9,4 @@ tr.taxonomy-term-divider-top {
 tr.taxonomy-term-divider-bottom {
   border-top: 1px dotted #CCC;
 }
-.taxonomy-term-description {
-  margin: 5px 0 20px;
-}
+
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.560
diff -u -p -r1.560 taxonomy.module
--- modules/taxonomy/taxonomy.module	8 Jan 2010 16:54:06 -0000	1.560
+++ modules/taxonomy/taxonomy.module	9 Jan 2010 19:11:21 -0000
@@ -129,6 +129,30 @@ function taxonomy_entity_info() {
 }
 
 /**
+ * Implements hook_field_extra_fields().
+ */
+function taxonomy_field_extra_fields() {
+  $return = array();
+
+  foreach (taxonomy_vocabulary_get_names() as $machine_name => $vocabulary) {
+    $return['taxonomy_term'][$machine_name] = array(
+      'name' => array(
+        'label' => t('Name'),
+        'description' => t('Term name textfield'),
+        'weight' => -5,
+      ),
+      'description' => array(
+        'label' => t('Description'),
+        'description' => t('Term description textarea'),
+        'weight' => 0,
+      )
+    );
+  }
+
+  return $return;
+}
+
+/**
  * Return nodes attached to a term across all field instances.
  *
  * This function requires taxonomy module to be maintaining its own tables,
@@ -193,6 +217,10 @@ function taxonomy_theme() {
     'taxonomy_overview_terms' => array(
       'render element' => 'form',
     ),
+    'taxonomy_term' => array(
+      'render element' => 'elements',
+      'template' => 'taxonomy-term',
+    ),
   );
 }
 
@@ -555,6 +583,75 @@ function taxonomy_term_delete($tid) {
   return SAVED_DELETED;
 }
 
+
+/**
+ * Generate an array for rendering the given term.
+ *
+ * @param $term
+ *   A term object.
+ * @param $view_mode
+ *   View mode, e.g. 'full', 'teaser'...
+ *
+ * @return
+ *   An array as expected by drupal_render().
+ */
+function taxonomy_term_view($term, $view_mode = 'full') {
+  $build = array(
+    '#theme' => 'taxonomy_term',
+    '#term' => $term,
+    '#view_mode' => $view_mode,
+  );
+
+  field_attach_prepare_view('taxonomy_term', array($term->tid => $term), $view_mode);
+  $build += field_attach_view('taxonomy_term', $term, $view_mode);
+
+  $build['description'] = array(
+    '#markup' => check_markup($term->description, $term->format, '', TRUE),
+    '#weight' => 0,
+   );
+
+  return $build;
+}
+
+function template_preprocess_taxonomy_term(&$variables) {
+  $variables['view_mode'] = $variables['elements']['#view_mode'];
+  $variables['term'] = $variables['elements']['#term'];
+  $term = $variables['term'];
+
+  $variables['term_url']  = url('taxonomy/term/' . $term->tid);
+  $variables['term_name'] = check_plain($term->name);
+  $variables['page']      = taxonomy_term_is_page($term);
+
+  // Flatten the term object's member fields.
+  $variables = array_merge((array)$term, $variables);
+
+  // Helpful $content variable for templates.
+  foreach (element_children($variables['elements']) as $key) {
+    $variables['content'][$key] = $variables['elements'][$key];
+  }
+
+  // Make the field variables available with the appropriate language.
+  field_attach_preprocess('taxonomy_term', $term, $variables['content'], $variables);
+
+  // Gather classes.
+  $variables['classes_array'][] = drupal_html_class('vocabulary-' . $term->vocabulary_machine_name);
+
+  // Clean up name so there are no underscores.
+  $variables['template_files'][] = 'taxonomy-term-' . str_replace('_', '-', $term->vocabulary_machine_name);
+  $variables['template_files'][] = 'taxonomy-term-' . $term->tid;
+}
+
+/**
+ * Returns whether the current page is the page of the passed in term.
+ *
+ * @param $term
+ *   A term object.
+ */
+function taxonomy_term_is_page($term) {
+  $page_term = menu_get_object('taxonomy_term', 2);
+  return (!empty($page_term) ? $page_term->tid == $term->tid : FALSE);
+}
+
 /**
  * Clear all static cache variables for terms..
  */
Index: modules/taxonomy/taxonomy.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v
retrieving revision 1.47
diff -u -p -r1.47 taxonomy.pages.inc
--- modules/taxonomy/taxonomy.pages.inc	8 Jan 2010 16:54:06 -0000	1.47
+++ modules/taxonomy/taxonomy.pages.inc	9 Jan 2010 18:53:18 -0000
@@ -28,17 +28,15 @@ function taxonomy_term_page($term) {
   $breadcrumb = array_reverse($breadcrumb);
   drupal_set_breadcrumb($breadcrumb);
   drupal_add_feed(url('taxonomy/term/' . $term->tid . '/feed'), 'RSS - ' . $term->name);
-  drupal_add_css(drupal_get_path('module', 'taxonomy') . '/taxonomy.css');
 
-  field_attach_prepare_view('taxonomy_term', array($term->tid => $term), 'full');
   $build = array();
-  $build += field_attach_view('taxonomy_term', $term);
-  $build['term_description'] = array(
-    '#markup' => check_markup($term->description, $term->format, '', TRUE),
-    '#weight' => -1,
-    '#prefix' => '<div class="taxonomy-term-description">',
+
+  $build['term_heading'] = array(
+    '#prefix' => '<div class="term-heading">',
     '#suffix' => '</div>',
+    'term' => taxonomy_term_view($term, 'full'),
   );
+
   if ($nids = taxonomy_select_nodes($term->tid, TRUE, variable_get('default_nodes_main', 10))) {
     $nodes = node_load_multiple($nids);
     $build += node_view_multiple($nodes);
