Index: taxonomy_title.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_title/taxonomy_title.module,v retrieving revision 1.8 diff -u -r1.8 taxonomy_title.module --- taxonomy_title.module 19 Dec 2009 05:06:49 -0000 1.8 +++ taxonomy_title.module 24 Dec 2009 12:50:51 -0000 @@ -21,9 +21,9 @@ $title = _taxonomy_title_get_title($form['tid']['#value']); $form['identification']['taxonomy_title'] = array( '#type' => 'textfield', - '#title' => t('Taxonomy Page Title'), + '#title' => t('Term page title'), '#default_value' => $title, - '#description' => t('This is the title you will see on your taxonomy term page. If left blank, the term name will be used.'), + '#description' => t('This is the title you will see on your taxonomy term page. If left blank, the term name will be used.'), '#weight' => 0, ); } @@ -38,10 +38,12 @@ case 'delete': _taxonomy_title_delete_title($array['tid']); break; + case 'update': _taxonomy_title_delete_title($array['tid']); _taxonomy_title_insert_title($array['tid'], $array['taxonomy_title']); break; + case 'insert': _taxonomy_title_insert_title($array['tid'], $array['taxonomy_title']); break; @@ -49,21 +51,21 @@ } } -/* +/** * Implementation of hook_preprocess_page(). * - * overrides variables sent to template_preprocess + * Overrides variables sent to template_preprocess. */ function taxonomy_title_preprocess_page(&$variables) { if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2)) && arg(2) > 0) { $title = _taxonomy_title_get_title(arg(2)); if (!empty($title)){ drupal_set_title($title); - + if ($new_title = drupal_get_title()) { // Assures the page heading is set. $variables['title'] = $new_title; - + // Sets the meta title. if (!module_exists('page_title')){ $head_title = array(strip_tags($new_title), variable_get('site_name', 'Drupal')); @@ -90,8 +92,8 @@ function taxonomy_title_token_values($type, $object = NULL, $options = array()) { $values = array(); if ($type == 'taxonomy') { - $category = $object; - // use taxonomy title if it exists, else category name + $category = $object; + // Use taxonomy title if it exists, else the category name. $token = _taxonomy_title_get_title($category->tid); $values['term-title'] = ($token) ? $token : $category->name; } @@ -99,40 +101,38 @@ } /** - * Adds term title + * Adds the term title. * * @param $tid - * The taxonomy term id of the term + * The taxonomy term id of the term. * @param $title - * The title to use for this term + * The taxonomy term title to use for this term. */ function _taxonomy_title_insert_title($tid, $title){ - if (!empty($title)){ + if (!empty($title)) { db_query("INSERT INTO {taxonomy_title} (tid, title) VALUES (%d, '%s')", $tid, $title); } } /** - * Deletes term title + * Deletes the term title. * * @param $tid - * The taxonomy term id of the term to delete + * The taxonomy term id of the term to delete. */ function _taxonomy_title_delete_title($tid){ - db_query('DELETE FROM {taxonomy_title} WHERE tid = %d', $tid); + db_query("DELETE FROM {taxonomy_title} WHERE tid = %d", $tid); } /** - * Retrieves term title + * Retrieves the term title. * * @param $tid - * The taxonomy term id of the term to delete - * + * The taxonomy term id of the term to delete. * @return - * The taxonomy title for the term + * The taxonomy term title for the term. */ function _taxonomy_title_get_title($tid){ - $title = db_result(db_query('SELECT title FROM {taxonomy_title} WHERE tid = %d', $tid)); + $title = db_result(db_query("SELECT title FROM {taxonomy_title} WHERE tid = %d", $tid)); return $title; } - Index: taxonomy_title.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_title/taxonomy_title.info,v retrieving revision 1.3 diff -u -r1.3 taxonomy_title.info --- taxonomy_title.info 18 Dec 2009 22:15:58 -0000 1.3 +++ taxonomy_title.info 24 Dec 2009 12:50:50 -0000 @@ -1,5 +1,5 @@ ; $Id: taxonomy_title.info,v 1.3 2009/12/18 22:15:58 jenlampton Exp $ -name = Taxonomy Title +name = Taxonomy title description = Enables control over the taxonomy page titles. dependencies[] = taxonomy core = 6.x \ No newline at end of file