? generic.patch
? modules/generic.patch
? modules/soc
? sites/localhost.dev.drupal
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.315
diff -u -r1.315 theme.inc
--- includes/theme.inc 5 Sep 2006 10:11:29 -0000 1.315
+++ includes/theme.inc 16 Oct 2006 02:01:26 -0000
@@ -907,6 +907,66 @@
return $output;
}
+
+
+/**
+ * Return a themed efinition list.
+ *
+ * @param $items
+ * An array containing which outputs as a
element. Contains:
+ * - $items['id']: A unique id for the definition list, useful for theming only certain instances of definition lists
+ * - $items['attributes']: allows you to apply attributes to the dl element
+ * - $items['terms']: An array of terms, or - elements. A unique key is recommended for each array that is placed here
+ * - $items['terms']['example term']: The
- . The key is for easy proramming.
+ * - $items['terms']['example term']['value']: (Required) The term's actual title
+ * - $items['terms']['example term']['href']: (optional) Use this to create a link from menu items
+ * - $items['terms']['example term']['attributes']: Drupal attributes
+ * - $items['terms']['example term']['definitions']: An array of definitions -- each term can have multipel definitions
+ * - $items['terms']['example term']['definitions']['example definiton']: An array containing a full html value, and attributes.
+ * @return
+ * A string containing the node output.
+ */
+
+function theme_definition_list($items, $attributes = NULL) {
+/*
+ $items = array(
+ // set id (optional) for themers
+ 'id' => 'example',
+ 'attributes' => $attributes,
+ // definitions are childern of terms for programming reasons (differs from markup)
+ 'terms' => array(
+ 'term 1' => array(
+ 'value' => 'term 1 title',
+ // the href key is weird, but needed for definition lists built from nodes and menus
+ 'href' => 'http://localhost.com/term1.html',
+ 'attributes' => array('class' => 'term1class'),
+ 'definitions' => array(
+ 'd1' => array('value' => 'definition 1', 'attributes' => array('id' => 'def1')),
+ 'd2' => array('value' => 'definition 2', 'attributes' => array('id' => 'def2')),
+ )
+ )
+
+ )
+
+ );
+*/
+
+ if (!empty($items)) {
+ $output = '
';
+ $output .= '
';
+ foreach ($items['terms'] as $term) {
+ if (!$term['attributes']) {
+ $term['attributes'] = array();
+ }
+ if ($term['href']) {
+ $term['value'] = l($term['value'], $term['href']);
+ }
+ $output .= '- '.$term['value'].'
';
+ // check if attributes are set
+ foreach ($term['definitions'] as $definition) {
+ $output .= '- '. $definition['value'].'
';
+ }
+ }
+ $output .= '
';
+ $output .= '
';
+ }
+ return $output;
+}
+
/**
* Returns code that emits the 'more help'-link.
*/
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.707
diff -u -r1.707 node.module
--- modules/node/node.module 14 Oct 2006 11:09:09 -0000 1.707
+++ modules/node/node.module 16 Oct 2006 02:24:11 -0000
@@ -2020,19 +2020,28 @@
}
else {
// If no (valid) node type has been provided, display a node type overview.
- foreach ($types as $type) {
- if (function_exists($type->module .'_form') && node_access('create', $type->type)) {
- $type_url_str = str_replace('_', '-', $type->type);
- $title = t('Add a new @s.', array('@s' => $type->name));
- $out = '- '. l($type->name, "node/add/$type_url_str", array('title' => $title)) .'
';
- $out .= ' - '. filter_xss_admin($type->description) .'
';
- $item[$type->type] = $out;
+
+
+ $terms = array();
+ foreach ($types as $type) {
+ if (function_exists($type->module .'_form') && node_access('create', $type->type)) {
+ $type_url_str = str_replace('_', '-', $type->type);
+ $title = t('Add a new @s.', array('@s' => $type->name));
+ $terms[] = array(
+ 'href' => 'node/add/'.$type_url_str,
+ 'value' => $type->name,
+ 'attributes' => array('title' => $title),
+ 'definitions' => array(array('value' => filter_xss_admin($type->description)))
+ );
+ }
+
}
- }
+ $items = array('id' => 'node-add-list', 'terms' => $terms);
- if (isset($item)) {
- uksort($item, 'strnatcasecmp');
- $output = t('Choose the appropriate item from the list:') .''. implode('', $item) .'
';
+ if (isset($items)) {
+ uksort($items, 'strnatcasecmp');
+ $output = t('Choose the appropriate item from the list:') .theme('definition_list', $items, array('class'=> 'node-type-list'));
+
}
else {
$output = t('No content types available.');
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.380
diff -u -r1.380 system.module
--- modules/system/system.module 14 Oct 2006 11:47:12 -0000 1.380
+++ modules/system/system.module 16 Oct 2006 22:10:45 -0000
@@ -367,16 +367,26 @@
* Provide a single block on the administration overview page.
*/
function system_admin_menu_block($block) {
- $content = array();
+ $terms = array();
if (is_array($block['children'])) {
usort($block['children'], '_menu_sort');
foreach ($block['children'] as $mid) {
$item = menu_get_item($mid);
if ($item['type'] & MENU_VISIBLE_IN_TREE) {
- $content[] = $item;
+ $terms[$item['title']] = array(
+ 'href' => $item['path'],
+ 'value' => $item['title'],
+ 'definitions' => array(
+ array('value'=> $item['description'])
+ ));
}
}
}
+ $content = array(
+ 'id' => 'system-admin-menu-block',
+ 'attributes' => array('class' => 'admin-list'),
+ 'terms' => $terms
+ );
return $content;
}
@@ -2038,12 +2048,7 @@
$output .= '';
}
else {
- $output = '';
- foreach ($content as $item) {
- $output .= '- '. l($item['title'], $item['path']) .'
';
- $output .= '- '. $item['description'] .'
';
- }
- $output .= '
';
+ $output .= theme('definition_list', $content, array('class'=> 'admin-list'));
}
return $output;
}