Commit a86223cd authored by Dries's avatar Dries

- Patch #428800 by Gabor Hojtsy: convert the mission statement to a block so...

- Patch #428800 by Gabor Hojtsy: convert the mission statement to a block so we have more flexibility to place it.
parent a81eaade
......@@ -109,7 +109,9 @@ Drupal 7.0, xxxx-xx-xx (development version)
* Provides a subset of the features of the Content Construction
Kit (CCK) module.
- Page organization
* Made the help text area a full featured region with blocks.
* Made the help text area a full featured region with blocks.
* Site mission is replaced with the highlighted content block region and
separate RSS feed description settings.
- Upgraded the core JavaScript library to jQuery version 1.3.2.
- Upgraded the jQuery Forms library to 2.21.
......
......@@ -906,7 +906,6 @@ function drupal_find_theme_templates($cache, $extension, $path) {
*/
function theme_get_settings($key = NULL) {
$defaults = array(
'mission' => '',
'default_logo' => 1,
'logo_path' => '',
'default_favicon' => 1,
......@@ -918,7 +917,6 @@ function theme_get_settings($key = NULL) {
'toggle_name' => 1,
'toggle_search' => 0,
'toggle_slogan' => 0,
'toggle_mission' => 1,
'toggle_node_user_picture' => 0,
'toggle_comment_user_picture' => 0,
'toggle_comment_user_verification' => 1,
......@@ -966,14 +964,6 @@ function theme_get_setting($setting_name, $refresh = FALSE) {
$themes = list_themes();
$theme_object = $themes[$theme_key];
if ($settings['mission'] == '') {
$settings['mission'] = variable_get('site_mission', '');
}
if (!$settings['toggle_mission']) {
$settings['mission'] = '';
}
if ($settings['toggle_logo']) {
if ($settings['default_logo']) {
$settings['logo'] = base_path() . dirname($theme_object->filename) . '/logo.png';
......@@ -1811,11 +1801,6 @@ function template_preprocess_page(&$variables) {
$variables['layout'] = ($variables['layout'] == 'left') ? 'both' : 'right';
}
// Set mission when viewing the frontpage.
if (drupal_is_front_page()) {
$mission = filter_xss_admin(theme_get_setting('mission'));
}
// Construct page title
if (drupal_get_title()) {
$head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal'));
......@@ -1837,7 +1822,6 @@ function template_preprocess_page(&$variables) {
$variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr';
$variables['logo'] = theme_get_setting('logo');
$variables['messages'] = $variables['show_messages'] ? theme('status_messages') : '';
$variables['mission'] = isset($mission) ? $mission : '';
$variables['main_menu'] = theme_get_setting('toggle_main_menu') ? menu_main_menu() : array();
$variables['secondary_menu'] = theme_get_setting('toggle_secondary_menu') ? menu_secondary_menu() : array();
$variables['search_box'] = (theme_get_setting('toggle_search') ? drupal_get_form('search_theme_form') : '');
......
......@@ -252,7 +252,6 @@ function template_preprocess_maintenance_page(&$variables) {
$variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr';
$variables['logo'] = theme_get_setting('logo');
$variables['messages'] = $variables['show_messages'] ? theme('status_messages') : '';
$variables['mission'] = '';
$variables['main_menu'] = array();
$variables['secondary_menu'] = array();
$variables['search_box'] = '';
......
......@@ -1988,7 +1988,7 @@ function node_feed($nids = FALSE, $channel = array()) {
'version' => '2.0',
'title' => variable_get('site_name', 'Drupal'),
'link' => $base_url,
'description' => variable_get('site_mission', ''),
'description' => variable_get('feed_description', ''),
'language' => $language->language
);
$channel = array_merge($channel_defaults, $channel);
......
......@@ -41,8 +41,6 @@
* in theme settings.
* - $site_slogan: The slogan of the site, empty when display has been disabled
* in theme settings.
* - $mission: The text of the site mission, empty when display has been disabled
* in theme settings.
*
* Navigation:
* - $search_box: HTML to display the search box, empty if search has been disabled.
......@@ -62,6 +60,7 @@
* - $feed_icons: A string of all feed icons for the current page.
* - $left: The HTML for the left sidebar.
* - $right: The HTML for the right sidebar.
* - $highlight: The HTML for the highlighted content region.
*
* Footer/closing data:
* - $footer_message: The footer message as defined in the admin settings.
......@@ -138,7 +137,7 @@
<div id="content" class="column"><div class="section">
<?php if ($breadcrumb): ?><div id="breadcrumb"><?php print $breadcrumb; ?></div><?php endif; ?>
<?php if ($mission): ?><div id="mission"><?php print $mission; ?></div><?php endif; ?>
<?php if ($highlight): ?><div id="highlight"><?php print $highlight; ?></div><?php endif; ?>
<?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
<?php print $messages; ?>
<?php if ($tabs): ?><div class="tabs"><?php print $tabs; ?></div><?php endif; ?>
......
......@@ -357,7 +357,6 @@ function system_theme_settings(&$form_state, $key = '') {
'logo' => t('Logo'),
'name' => t('Site name'),
'slogan' => t('Site slogan'),
'mission' => t('Mission statement'),
'node_user_picture' => t('User pictures in posts'),
'comment_user_picture' => t('User pictures in comments'),
'comment_user_verification' => t('User verification status in comments'),
......@@ -1189,12 +1188,6 @@ function system_site_information_settings() {
'#default_value' => '',
'#description' => t("Your site's motto, tag line, or catchphrase (often displayed alongside the title of the site).")
);
$form['site_mission'] = array(
'#type' => 'textarea',
'#title' => t('Mission'),
'#default_value' => '',
'#description' => t("Your site's mission or focus statement (often prominently displayed on the front page).")
);
$form['site_footer'] = array(
'#type' => 'textarea',
'#title' => t('Footer message'),
......@@ -1467,6 +1460,12 @@ function system_image_toolkit_settings() {
*/
function system_rss_feeds_settings() {
$form['feed_description'] = array(
'#type' => 'textarea',
'#title' => t('Feed description'),
'#default_value' => '',
'#description' => t('Description of your site, included in each feed.')
);
$form['feed_default_items'] = array(
'#type' => 'select',
'#title' => t('Number of items in each feed'),
......
......@@ -3330,31 +3330,46 @@ function system_update_7021() {
$ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('system', 'help', '" . $theme->name . "', 1, 0, 'help', '', 1)");
}
// Migrate contact form information and user register help to blocks.
$bid_max = db_query("SELECT MAX(bid) FROM {box}")->fetchField();
// Migrate contact form information.
if ($contact_help = variable_get('contact_form_information', '')) {
db_insert('box')->fields(array('body' => $contact_help, 'info' => 'Contact page help', 'format' => FILTER_FORMAT_DEFAULT))->execute();
$bid = db_insert('box')->fields(array('body' => $contact_help, 'info' => 'Contact page help', 'format' => FILTER_FORMAT_DEFAULT))->execute();
foreach ($themes_with_blocks as $theme) {
// Add contact help block for themes, which had blocks.
$ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, visibility, pages, cache) VALUES ('block', '" . ($bid_max + 1) . "', '" . $theme . "', 1, 5, 'help', 1, 'contact', -1)");
$ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, visibility, pages, cache) VALUES ('block', '" . $bid . "', '" . $theme . "', 1, 5, 'help', 1, 'contact', -1)");
}
drupal_set_message('The contact form information setting was migrated to <a href="' . url('admin/build/block/configure/block/' . ($bid_max + 1)) . '">a custom block</a> and set up to only show on the site-wide contact page. The block was set to use the default text format, which might differ from the HTML based format used before. Please check the block and ensure that the output is right.');
drupal_set_message('The contact form information setting was migrated to <a href="' . url('admin/build/block/configure/block/' . $bid) . '">a custom block</a> and set up to only show on the site-wide contact page. The block was set to use the default text format, which might differ from the HTML based format used before. Please check the block and ensure that the output is right.');
}
// Migrate user help setting.
if ($user_help = variable_get('user_registration_help', '')) {
db_insert('box')->fields(array('body' => $user_help, 'info' => 'User registration guidelines', 'format' => FILTER_FORMAT_DEFAULT))->execute();
$bid = db_insert('box')->fields(array('body' => $user_help, 'info' => 'User registration guidelines', 'format' => FILTER_FORMAT_DEFAULT))->execute();
foreach ($themes_with_blocks as $theme) {
// Add user registration help block for themes, which had blocks.
$ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, visibility, pages, cache) VALUES ('block', '" . ($bid_max + 2) . "', '" . $theme . "', 1, 5, 'help', 1, 'user/register', -1)");
$ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, visibility, pages, cache) VALUES ('block', '" . $bid . "', '" . $theme . "', 1, 5, 'help', 1, 'user/register', -1)");
}
drupal_set_message('The user registration guidelines were migrated to <a href="' . url('admin/build/block/configure/block/' . ($bid_max + 2)) . '">a custom block</a> and set up to only show on the user registration page. The block was set to use the default text format, which might differ from the HTML based format used before. Please check the block and ensure that the output is right.');
drupal_set_message('The user registration guidelines were migrated to <a href="' . url('admin/build/block/configure/block/' . $bid) . '">a custom block</a> and set up to only show on the user registration page. The block was set to use the default text format, which might differ from the HTML based format used before. Please check the block and ensure that the output is right.');
}
// Remove the two variables (even if they were saved empty on the admin interface),
// Migrate site mission setting.
if ($mission = variable_get('site_mission')) {
$bid = db_insert('box')->fields(array('body' => $mission, 'info' => 'Site mission', 'format' => FILTER_FORMAT_DEFAULT))->execute();
foreach ($themes_with_blocks as $theme) {
// Add mission block for themes, which had blocks.
$ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, visibility, pages, cache) VALUES ('block', '" . $bid . "', '" . $theme . "', 1, 0, 'highlight', 1, '<front>', -1)");
}
drupal_set_message('The site mission was migrated to <a href="' . url('admin/build/block/configure/block/' . $bid) . '">a custom block</a> and set up to only show on the front page in the highlighted content region. The block was set to use the default text format, which might differ from the HTML based format used before. Please check the block and ensure that the output is right. If your theme does not have a highlighted content region, you might need to <a href="' . url('admin/build/block') . '">relocate the block</a>.');
// Migrate mission to RSS site description.
variable_set('feed_description', $mission);
}
// Remove the variables (even if they were saved empty on the admin interface),
// to avoid keeping clutter in the variables table.
variable_del('contact_form_information');
variable_del('user_registration_help');
variable_del('site_mission');
// Rebuild theme data, so the new 'help' region is identified.
_system_theme_data();
system_theme_data();
return $ret;
}
......
......@@ -681,7 +681,7 @@ function system_menu() {
);
$items['admin/content/rss-publishing'] = array(
'title' => 'RSS publishing',
'description' => 'Configure the number of items per feed and whether feeds should be titles/teasers/full-text.',
'description' => 'Configure the site description, the number of items per feed and whether feeds should be titles/teasers/full-text.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_rss_feeds_settings'),
'access arguments' => array('administer site configuration'),
......@@ -1127,6 +1127,7 @@ function system_theme_default() {
'content' => 'Content',
'header' => 'Header',
'footer' => 'Footer',
'highlight' => 'Highlighted content',
'help' => 'Help',
),
'description' => '',
......@@ -1134,7 +1135,6 @@ function system_theme_default() {
'comment_user_picture',
'comment_user_verification',
'favicon',
'mission',
'logo',
'name',
'node_user_picture',
......
......@@ -45,7 +45,7 @@
<div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
<?php print $breadcrumb; ?>
<?php if ($mission): ?><div id="mission"><?php print $mission ?></div><?php endif; ?>
<?php if ($highlight): ?><div id="highlight"><?php print $highlight ?></div><?php endif; ?>
<?php if ($tabs): ?><div id="tabs-wrapper" class="clearfix"><?php endif; ?>
<?php if ($title): ?><h2<?php print $tabs ? ' class="with-tabs"' : '' ?>><?php print $title ?></h2><?php endif; ?>
<?php if ($tabs): ?><ul class="tabs primary"><?php print $tabs ?></ul></div><?php endif; ?>
......
......@@ -520,7 +520,7 @@ body.two-sidebars #footer {
color: #529ad6;
}
#mission {
#highlight {
padding: 1em;
background-color: #fff;
border: 1px solid #e0e5fb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment