? .svn ? 56670_taxonomy_nodeapi_check_types.patch.txt ? database/.svn ? database/database.prefixed.mysql ? includes/.svn ? misc/.svn ? misc/drupal_clean.css ? modules/.svn ? scripts/.svn ? sites/.svn ? sites/default/.svn ? themes/.svn ? themes/bluemarine/.svn ? themes/chameleon/.svn ? themes/chameleon/marvin/.svn ? themes/engines/.svn ? themes/engines/phptemplate/.svn ? themes/pushbutton/.svn Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.538 diff -u -F^f -r1.538 common.inc --- includes/common.inc 7 May 2006 00:08:36 -0000 1.538 +++ includes/common.inc 8 May 2006 19:05:18 -0000 @@ -1053,8 +1053,8 @@ function drupal_attributes($attributes = * @param $text * The text to be enclosed with the anchor tag. * @param $path - * The Drupal path being linked to, such as "admin/node". Note, this must be a - * system URL as the url() function will generate the alias. + * The Drupal path being linked to, such as "admin/node". Can be an external or internal url. If you provide the full url, it will be considered an external url. + * If you provide only the path (e.g. "admin/node"), it is considered an internal link. In this case, it must be a system URL as the url() function will generate the alias. * @param $attributes * An associative array of HTML attributes to apply to the anchor tag. * @param $query @@ -1065,7 +1065,7 @@ function drupal_attributes($attributes = * Whether to force the output to be an absolute link (beginning with http:). * Useful for links that will be displayed outside the site, such as in an RSS feed. * @param $html - * Whether the title is HTML, or just plain-text. + * Whether the title is HTML, or just plain-text. For example for making an image a link, this must be set to TRUE, or else you will see the encoded HTML. * @return * an HTML string containing a link to the given path. */ Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.295 diff -u -F^f -r1.295 theme.inc --- includes/theme.inc 7 May 2006 00:08:36 -0000 1.295 +++ includes/theme.inc 8 May 2006 19:05:18 -0000 @@ -845,6 +845,45 @@ function theme_item_list($items = array( return $output; } + /** + * Return a themed list of definition items. + * @param $items + * An array of items to be displayed in the list. + * The argument is: array("term" => $term, "definitions" => $definitions) + * If you provide the $definition as arrays, you will get multiple DDs with each DT. + * If you provide the $definitions as a string, only one DD will be added to the DT. + * @param $title + * The title of the list. + * @param $filter + * Boolean value to define wether or not you wish to filter the input. Should be left TRUE, unless you sanitize your input yourself. + * @return + * A string containing the list output. + */ +function theme_definition_list($items = array(), $title = NULL, $filter = TRUE) { + $output = '
'; + if (isset($title)) { + $output .= '

'. ($filter ? check_plain($title) : $title).'

'; + } + + if (!empty($items)) { + $output .= "
";; + foreach ($items as $item) { + $output .= '
'. ($filter ? check_plain($item['term']) : $item['term']) .'
'; + if (is_string($item['definitions'])) { + $output .= '
'. ($filter ? filter_xss($item['definitions']) : $item['definitions']) .'
'; + } + elseif (is_array($item['definitions'])) { + foreach ($item['definitions'] as $definition) { + $output .= '
'. ($filter ? filter_xss($definition) : $definition) .'
'; + } + } + } + $output .= "
"; + } + $output .= '
'; + return $output; +} + /** * Returns code that emits the 'more help'-link. */ Index: modules/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy.module,v retrieving revision 1.278 diff -u -F^f -r1.278 taxonomy.module --- modules/taxonomy.module 7 May 2006 03:33:03 -0000 1.278 +++ modules/taxonomy.module 8 May 2006 19:05:18 -0000 @@ -615,6 +615,20 @@ function taxonomy_get_vocabularies($type } /** + * Return TRUE if a node has vocabularies connections. + * + * @param $node + * + */ +function taxonomy_node_in_vocabularies($node) { + $result = db_fetch_object(db_query("SELECT count(vid) AS found FROM {vocabulary_node_types} WHERE type = '%s'", $node->type)); + if ($result->found) { + return TRUE; + } + return FALSE; +} + +/** * Generate a form for selecting terms to associate with a node. */ function taxonomy_form_alter($form_id, &$form) { @@ -1168,6 +1182,11 @@ function taxonomy_render_nodes($result) * Implementation of hook_nodeapi(). */ function taxonomy_nodeapi($node, $op, $arg = 0) { + if (!taxonomy_node_in_vocabularies($node)) { + //Do not run all the hooks for nodes that have no taxonomy association + return; + } + switch ($op) { case 'load': $output['taxonomy'] = taxonomy_node_get_terms($node->nid);