From ae2012dbf24ab5ea927eb4cf5df07512afd37fb5 Mon Sep 17 00:00:00 2001 From: Marco Antonio Villegas Vega Date: Mon, 7 Dec 2009 02:36:19 -0500 Subject: [PATCH] modify theme_item_list instead of adding theme_definition_list --- includes/theme.inc | 12 ++++++++++-- modules/node/node.module | 28 ++++++++++++++-------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git includes/theme.inc includes/theme.inc index 9c1c2b7..9b13505 100644 --- includes/theme.inc +++ includes/theme.inc @@ -1805,7 +1805,7 @@ function theme_mark($variables) { * nested list. All other elements are treated as attributes of the list * item element. * - title: The title of the list. - * - type: The type of list to return (e.g. "ul", "ol"). + * - type: The type of list to return (e.g. "ul", "ol", "dl"). * - attributes: The attributes applied to the list element. */ function theme_item_list($variables) { @@ -1825,6 +1825,7 @@ function theme_item_list($variables) { foreach ($items as $i => $item) { $attributes = array(); $children = array(); + $li_type = 'li'; if (is_array($item)) { foreach ($item as $key => $value) { if ($key == 'data') { @@ -1833,6 +1834,10 @@ function theme_item_list($variables) { elseif ($key == 'children') { $children = $value; } + elseif ($key == 'term') { + $data = $value; + $li_type = 'dt'; + } else { $attributes[$key] = $value; } @@ -1851,7 +1856,10 @@ function theme_item_list($variables) { if ($i == $num_items - 1) { $attributes['class'][] = 'last'; } - $output .= '' . $data . "\n"; + if ($type == 'dl' && $li_type == 'li') { + $li_type = 'dd'; + } + $output .= '<' . $li_type . drupal_attributes($attributes) . '>' . $data . "\n"; } $output .= ""; } diff --git modules/node/node.module modules/node/node.module index de3e96a..34a9f5e 100644 --- modules/node/node.module +++ modules/node/node.module @@ -82,20 +82,20 @@ function node_help($path, $arg) { case 'admin/help#node': $output = ''; $output .= '

' . t('About') . '

'; - $output .= '

' . t('The Node module manages the creation, editing, deletion, settings, and display of the main site content. Content items managed by the Node module are typically displayed as pages on your site, and include a title, some meta-data (author, creation time, content type, etc.), and optional fields containing text or other data (fields are managed by the Field module). For more information, see the online handbook entry for Node module.', array('@node' => 'http://drupal.org/handbook/modules/node', '@field' => url('admin/help/field'))) . '

'; - $output .= '

' . t('Uses') . '

'; - $output .= '
'; - $output .= '
' . t('Creating content') . '
'; - $output .= '
' . t('When new content is created, the Node module records basic information about the content, including the author, date of creation, and the Content type. It also manages the publishing options, which define whether or not the content is published, promoted to the front page of the site, and/or sticky at the top of content lists. Default settings can be configured for each type of content on your site.', array('@content-type' => url('admin/structure/types'))) . '
'; - $output .= '
' . t('Creating custom content types') . '
'; - $output .= '
' . t('The Node module gives users with the Administer content types permission the ability to create new content types in addition to the default ones already configured. Creating custom content types allows you the flexibility to add fields and configure default settings that suit the differing needs of various site content.', array('@content-new' => url('admin/structure/types/add'), '@field' => url('admin/help/field'))) . '
'; - $output .= '
' . t('Administering content') . '
'; - $output .= '
' . t('The Content administration page allows you to review and bulk manage your site content.', array('@content' => url('admin/content'))) . '
'; - $output .= '
' . t('Creating revisions') . '
'; - $output .= '
' . t('The Node module also enables you to create multiple versions of any content, and revert to older versions using the Revision information settings.') . '
'; - $output .= '
' . t('User permissions') . '
'; - $output .= '
' . t('The Node module makes a number of permissions available for each content type, which can be set by role on the permissions page.', array('@permissions' => url('admin/people/permissions', array('fragment' => 'module-node')))) . '
'; - $output .= '
'; + $output .= '

' . t('The Node module manages the creation, editing, deletion, settings, and display of all site content. For more information, see the online handbook entry for Node module.', array('@node' => 'http://drupal.org/handbook/modules/node')) . '

'; + $items = array( + array('term' => t('Creating content')), + t('When new content is created, the Node module records basic information about the content, including the author, date of creation, and the Content type. It also manages the publishing options, which define whether or not the content is published, promoted to the front page of the site, and/or sticky at the top of content lists. Default settings can be configured for each type of content on your site.', array('@content-type' => url('admin/structure/types'))), + array('term' => t('Creating custom content types'), + t('The Node module gives users with the Administer content types permission the ability to create new content types in addition to the default ones already configured. Creating custom content types allows you the flexibility to add fields and configure default settings that suit the differing needs of various site content.', array('@content-new' => url('admin/structure/types/add'), '@field' => url('admin/help/field'))), + array('term' => t('Administering content')), + t('The Content administration page allows you to review and bulk manage your site content.', array('@content' => url('admin/content'))), + array('term' => t('Creating revisions')), + t('The Node module also enables you to create multiple versions of any content, and revert to older versions using the Revision information settings.'), + array('term' => t('User permissions')), + t('The Node module makes a number of permissions available for each content type, which can be set by role on the permissions page.', array('@permissions' => url('admin/people/permissions', array('fragment' => 'module-node')))), + ); + $output .= theme('item_list', array('items' => $items, 'title' => t('Uses'), 'type' =>'dl')); return $output; case 'admin/structure/types/add': -- 1.7.0