From ed1a53698a1d9f020c35d0cada0b9f4e990509a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Thu, 11 Oct 2007 09:51:29 +0000 Subject: [PATCH] #180897 by sun and dvessel: fix various XHTML validity issues in Drupal by closing unclosed tags, avoiding empty table containers, and so on --- misc/maintenance.tpl.php | 5 +++-- modules/block/block.module | 2 +- modules/color/color.module | 2 +- modules/help/help.admin.inc | 5 +++-- modules/node/node.module | 4 ++-- modules/profile/profile.module | 2 +- modules/search/search.admin.inc | 2 +- modules/system/system.module | 2 +- modules/trigger/trigger.module | 7 ++++++- themes/garland/node.tpl.php | 4 ++-- themes/garland/page.tpl.php | 16 +++++++--------- themes/garland/style-rtl.css | 26 -------------------------- themes/garland/style.css | 8 -------- themes/garland/template.php | 16 +++------------- 14 files changed, 31 insertions(+), 70 deletions(-) diff --git a/misc/maintenance.tpl.php b/misc/maintenance.tpl.php index de0d867d9d6..24d554f4a63 100644 --- a/misc/maintenance.tpl.php +++ b/misc/maintenance.tpl.php @@ -40,8 +40,9 @@ '. $title .''; endif; ?> - - +
+ +
diff --git a/modules/block/block.module b/modules/block/block.module index 58eac904834..5c8f354ceaa 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -82,7 +82,7 @@ function block_help($path, $arg) { "); $output .= '

'. t('Module blocks') .'

'; - $output .= '

'. t('Some modules generate blocks that become available when the modules are enabled. These blocks can be administered via the blocks administration page.

', array('@admin-block' => url('admin/build/block'))) .'

'; + $output .= '

'. t('Some modules generate blocks that become available when the modules are enabled. These blocks can be administered via the blocks administration page.', array('@admin-block' => url('admin/build/block'))) .'

'; $output .= '

'. t('Administrator defined blocks') .'

'; $output .= '

'. t('Administrators can also define custom blocks. These blocks consist of a title, a description, and a body which can be as long as you wish. Block content can be in any of the input formats supported for other content.') .'

'; $output .= '

'. t('For more information please read the configuration and customization handbook Block page.', array('@block' => 'http://drupal.org/handbook/modules/block/')) .'

'; diff --git a/modules/color/color.module b/modules/color/color.module index e5dbbaf2b73..7d7fe2af9b2 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -184,7 +184,7 @@ function theme_color_scheme_form($form) { // Preview $output .= drupal_render($form); $output .= '

'. t('Preview') .'

'; - $output .= '

Lorem ipsum dolor

Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

'; + $output .= '

Lorem ipsum dolor

Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

'; // Close wrapper $output .= ''; diff --git a/modules/help/help.admin.inc b/modules/help/help.admin.inc index 2d41ffb3255..a4a8d4bcd4f 100644 --- a/modules/help/help.admin.inc +++ b/modules/help/help.admin.inc @@ -70,11 +70,12 @@ function help_links_as_list() { sort($modules); // Output pretty four-column list - $break = ceil(count($modules) / 4); + $count = count($modules); + $break = ceil($count / 4); $output = '
    '; foreach ($modules as $i => $module) { $output .= '
  • '. l($module_info[$module]->info['name'], 'admin/help/'. $module) .'
  • '; - if (($i + 1) % $break == 0) { + if (($i + 1) % $break == 0 && ($i + 1) != $count) { $output .= '
    '; } } diff --git a/modules/node/node.module b/modules/node/node.module index b495a36abbc..71fb9a5f091 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -58,12 +58,12 @@ function node_help($path, $arg) { case 'node/%/edit': $node = node_load($arg[1]); $type = node_get_types('type', $node->type); - return '

    '. (isset($type->help) ? filter_xss_admin($type->help) : '') .'

    '; + return (!empty($type->help) ? '

    '. filter_xss_admin($type->help) .'

    ' : ''); } if ($arg[0] == 'node' && $arg[1] == 'add' && $arg[2]) { $type = node_get_types('type', str_replace('-', '_', $arg[2])); - return '

    '. (isset($type->help) ? filter_xss_admin($type->help) : '') .'

    '; + return (!empty($type->help) ? '

    '. filter_xss_admin($type->help) .'

    ' : ''); } } diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 0a0bf343688..c7d43b74a4d 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -288,7 +288,7 @@ Unless you know what you are doing, it is highly recommended that you prefix the if ($type == 'selection') { $form['fields']['options'] = array('#type' => 'textarea', '#title' => t('Selection options'), - '#default_value' => $edit['options'], + '#default_value' => isset($edit['options']) ? $edit['options'] : '', '#description' => t('A list of all options. Put each option on a separate line. Example options are "red", "blue", "green", etc.'), ); } diff --git a/modules/search/search.admin.inc b/modules/search/search.admin.inc index c19333c0ca8..ae82653c9fc 100644 --- a/modules/search/search.admin.inc +++ b/modules/search/search.admin.inc @@ -58,7 +58,7 @@ function search_admin_settings() { $form['indexing_throttle']['search_cron_limit'] = array('#type' => 'select', '#title' => t('Items to index per cron run'), '#default_value' => variable_get('search_cron_limit', 100), '#options' => $items, '#description' => t('The maximum amount of items that will be indexed in one cron run. Set this number lower if your cron is timing out or if PHP is running out of memory.')); // Indexing settings: $form['indexing_settings'] = array('#type' => 'fieldset', '#title' => t('Indexing settings')); - $form['indexing_settings']['info'] = array('#value' => ''. t('

    Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.

    The default settings should be appropriate for the majority of sites.

    ') .'
    '); + $form['indexing_settings']['info'] = array('#value' => t('

    Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.

    The default settings should be appropriate for the majority of sites.

    ')); $form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#default_value' => variable_get('minimum_word_size', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).')); $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', TRUE), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.')); diff --git a/modules/system/system.module b/modules/system/system.module index 115db85481a..8a427af6bb8 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1164,7 +1164,7 @@ function system_actions_manage() { } if ($actions_map) { - $output .= '

    '. drupal_get_form('system_actions_manage_form', $options) .'

    '; + $output .= drupal_get_form('system_actions_manage_form', $options); } return $output; diff --git a/modules/trigger/trigger.module b/modules/trigger/trigger.module index dfb2b89ccbc..8140e442a28 100644 --- a/modules/trigger/trigger.module +++ b/modules/trigger/trigger.module @@ -333,7 +333,12 @@ function theme_trigger_display($element) { } } - $output = theme('table', $header, $rows) . drupal_render($element); + if (count($rows)) { + $output = theme('table', $header, $rows) . drupal_render($element); + } + else { + $output = drupal_render($element); + } return $output; } diff --git a/themes/garland/node.tpl.php b/themes/garland/node.tpl.php index 5dbdd146313..b227d86c737 100644 --- a/themes/garland/node.tpl.php +++ b/themes/garland/node.tpl.php @@ -13,11 +13,11 @@ -
    +
    -
    +
    diff --git a/themes/garland/page.tpl.php b/themes/garland/page.tpl.php index d28f77efeca..f7e27fb5286 100644 --- a/themes/garland/page.tpl.php +++ b/themes/garland/page.tpl.php @@ -62,19 +62,17 @@
    - + '. $mission .'
    '; endif; ?> - '; endif; ?> '. $title .''; endif; ?> - '; endif; ?> - - - - + '. $tabs .'
'; endif; ?> + '. $tabs2 .''; endif; ?> + - -
+
+ +
diff --git a/themes/garland/style-rtl.css b/themes/garland/style-rtl.css index 4e3ded367de..c5930251960 100644 --- a/themes/garland/style-rtl.css +++ b/themes/garland/style-rtl.css @@ -4,32 +4,6 @@ html { direction: rtl; } -/** - * Markup free clearing - * Details: http://www.positioniseverything.net/easyclearing.html - */ -.clear-block:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - -.clear-block { - display: inline-block; -} - -/* Hides from IE-mac \*/ -* html .clear-block { - height: 1%; -} - -.clear-block { - display: block; -} -/* End hide from IE-mac */ - /** * Generic elements */ diff --git a/themes/garland/style.css b/themes/garland/style.css index df375fdb551..308d9342e26 100644 --- a/themes/garland/style.css +++ b/themes/garland/style.css @@ -971,14 +971,6 @@ tr.selected td a:link, tr.selected td a:visited, tr.selected td a:active { /** * CSS support */ -div.clear { - display: block; - clear: both; - height: 1px; - line-height: 0px; - font-size: 0px; - margin-bottom: -1px; -} /******************************************************************* * Color Module: Don't touch * diff --git a/themes/garland/template.php b/themes/garland/template.php index f40bebc11b7..0d06bb44e52 100644 --- a/themes/garland/template.php +++ b/themes/garland/template.php @@ -53,11 +53,7 @@ function phptemplate_comment_wrapper($content, $node) { * Override or insert PHPTemplate variables into the templates. */ function phptemplate_preprocess_page(&$vars) { - if ($secondary = menu_secondary_local_tasks()) { - $output = ''; - $output .= "\n"; - $vars['tabs2'] = $output; - } + $vars['tabs2'] = menu_secondary_local_tasks(); // Hook into color.module if (module_exists('color')) { @@ -67,18 +63,12 @@ function phptemplate_preprocess_page(&$vars) { /** * Returns the rendered local tasks. The default implementation renders - * them as tabs. + * them as tabs. Overridden to split the secondary tasks. * * @ingroup themeable */ function phptemplate_menu_local_tasks() { - $output = ''; - - if ($primary = menu_primary_local_tasks()) { - $output .= "\n"; - } - - return $output; + return menu_primary_local_tasks(); } function phptemplate_comment_submitted($comment) {