' . t('Allowed HTML tags: @tags', array('@tags' => $allowed_html)) . ' ' . t('This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML "tags" is very easy. This table provides examples for each tag that is enabled on this site.') . ' ' . t('For more information see W3C\'s HTML Specifications or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) . ' ' . t('Paragraph one.') . ' ' . t('Paragraph two.') . ' ' . t('A forum holds related or similar forum topics (a forum topic is the initial post to a threaded discussion). For example, a forum named "Fruit" may contain forum topics titled "Apples" and "Bananas", respectively.') . ' ' . t('These settings allow you to adjust the display of your forum topics. The content types available for use within a forum may be selected by editing the Content types on the forum vocabulary page.', array('@forum-vocabulary' => url('admin/content/taxonomy/edit/vocabulary/' . variable_get('forum_nav_vocabulary', '')))) . ' ' . t('These settings allow you to adjust the display of your forum topics. The content types available for use within a forum may be selected by editing the Content types on the forum vocabulary page.', array('@forum-vocabulary' => url('admin/content/taxonomy/edit/vocabulary/' . variable_get('forum_nav_vocabulary')))) . ' 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. ' . t('There are currently no posts in this category.') . ' Your password is %pass. You may change your password below.'),
'#description' => t('A space-separated list of HTML tags allowed in the content of feed items. (Tags in this list are not removed by Drupal.)'),
);
$form['aggregator_summary_items'] = array(
'#type' => 'select', '#title' => t('Items shown in sources and categories pages') ,
- '#default_value' => variable_get('aggregator_summary_items', 3), '#options' => $items,
+ '#options' => $items,
'#description' => t('Number of feed items displayed in feed and category summary pages.'),
);
$form['aggregator_clear'] = array(
'#type' => 'select', '#title' => t('Discard items older than'),
- '#default_value' => variable_get('aggregator_clear', 9676800), '#options' => $period,
+ '#options' => $period,
'#description' => t('The length of time to retain feed items before discarding. (Requires a correctly configured cron maintenance task.)', array('@cron' => url('admin/reports/status'))),
);
$form['aggregator_category_selector'] = array(
- '#type' => 'radios', '#title' => t('Category selection type'), '#default_value' => variable_get('aggregator_category_selector', 'checkboxes'),
+ '#type' => 'radios', '#title' => t('Category selection type'),
'#options' => array('checkboxes' => t('checkboxes'), 'select' => t('multiple selector')),
'#description' => t('The type of category selection widget displayed on categorization pages. (For a small number of categories, checkboxes are easier to use, while a multiple selector work well with large numbers of categories.)'),
);
Index: modules/aggregator/aggregator.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.install,v
retrieving revision 1.16
diff -u -p -r1.16 aggregator.install
--- modules/aggregator/aggregator.install 15 May 2008 21:27:32 -0000 1.16
+++ modules/aggregator/aggregator.install 26 Jul 2008 01:21:10 -0000
@@ -15,11 +15,6 @@ function aggregator_install() {
function aggregator_uninstall() {
// Remove tables.
drupal_uninstall_schema('aggregator');
-
- variable_del('aggregator_allowed_html_tags');
- variable_del('aggregator_summary_items');
- variable_del('aggregator_clear');
- variable_del('aggregator_category_selector');
}
/**
Index: modules/aggregator/aggregator.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v
retrieving revision 1.382
diff -u -p -r1.382 aggregator.module
--- modules/aggregator/aggregator.module 5 Jul 2008 05:57:00 -0000 1.382
+++ modules/aggregator/aggregator.module 25 Jul 2008 06:04:42 -0000
@@ -7,6 +7,20 @@
*/
/**
+ * Implementation of hook_variables().
+ */
+function aggregator_variables() {
+ return array(
+ 'aggregator_allowed_html_tags' => '
',
+ 'aggregator_summary_items' => 3,
+ 'aggregator_clear' => 9676800,
+ 'aggregator_category_selector' => 'checkboxes',
+ 'feed_default_items' => 10,
+ 'feed_item_length' => 'teaser',
+ );
+}
+
+/**
* Implementation of hook_help().
*/
function aggregator_help($path, $arg) {
@@ -787,7 +801,7 @@ function aggregator_parse_feed(&$data, $
}
// Remove all items that are older than flush item timer.
- $age = time() - variable_get('aggregator_clear', 9676800);
+ $age = time() - variable_get('aggregator_clear');
$result = db_query('SELECT iid FROM {aggregator_item} WHERE fid = %d AND timestamp < %d', $feed['fid'], $age);
$items = array();
@@ -899,7 +913,7 @@ function theme_aggregator_block_item($it
* The filtered content.
*/
function aggregator_filter_xss($value) {
- return filter_xss($value, preg_split('/\s+|<|>/', variable_get('aggregator_allowed_html_tags', '
'), -1, PREG_SPLIT_NO_EMPTY));
+ return filter_xss($value, preg_split('/\s+|<|>/', variable_get('aggregator_allowed_html_tags'), -1, PREG_SPLIT_NO_EMPTY));
}
/**
Index: modules/aggregator/aggregator.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.pages.inc,v
retrieving revision 1.15
diff -u -p -r1.15 aggregator.pages.inc
--- modules/aggregator/aggregator.pages.inc 16 Jul 2008 21:59:25 -0000 1.15
+++ modules/aggregator/aggregator.pages.inc 25 Jul 2008 05:34:21 -0000
@@ -13,7 +13,7 @@
* The items HTML.
*/
function aggregator_page_last() {
- drupal_add_feed(url('aggregator/rss'), variable_get('site_name', 'Drupal') . ' ' . t('aggregator'));
+ drupal_add_feed(url('aggregator/rss'), variable_get('site_name') . ' ' . t('aggregator'));
$items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC');
@@ -65,7 +65,7 @@ function aggregator_page_category($arg1,
// $form_state and $arg2 is $category. Otherwise, $arg1 is $category.
$category = is_array($arg2) ? $arg2 : $arg1;
- drupal_add_feed(url('aggregator/rss/' . $category['cid']), variable_get('site_name', 'Drupal') . ' ' . t('aggregator - @title', array('@title' => $category['title'])));
+ drupal_add_feed(url('aggregator/rss/' . $category['cid']), variable_get('site_name') . ' ' . t('aggregator - @title', array('@title' => $category['title'])));
// It is safe to include the cid in the query because it's loaded from the
// database by aggregator_category_load.
@@ -171,7 +171,7 @@ function aggregator_categorize_items($it
}
$done = TRUE;
$form['categories'][$item->iid] = array(
- '#type' => variable_get('aggregator_category_selector', 'checkboxes'),
+ '#type' => variable_get('aggregator_category_selector'),
'#default_value' => $selected,
'#options' => $categories,
'#size' => 10,
@@ -269,7 +269,7 @@ function template_preprocess_aggregator_
$variables['source_date'] = t('%ago ago', array('%ago' => format_interval(time() - $item->timestamp)));
}
else {
- $variables['source_date'] = format_date($item->timestamp, 'custom', variable_get('date_format_medium', 'D, m/d/Y - H:i'));
+ $variables['source_date'] = format_date($item->timestamp, 'custom', variable_get('date_format_medium'));
}
$variables['categories'] = array();
@@ -288,8 +288,8 @@ function aggregator_page_sources() {
while ($feed = db_fetch_object($result)) {
// Most recent items:
$summary_items = array();
- if (variable_get('aggregator_summary_items', 3)) {
- $items = db_query_range('SELECT i.title, i.timestamp, i.link FROM {aggregator_item} i WHERE i.fid = %d ORDER BY i.timestamp DESC', $feed->fid, 0, variable_get('aggregator_summary_items', 3));
+ if (variable_get('aggregator_summary_items')) {
+ $items = db_query_range('SELECT i.title, i.timestamp, i.link FROM {aggregator_item} i WHERE i.fid = %d ORDER BY i.timestamp DESC', $feed->fid, 0, variable_get('aggregator_summary_items'));
while ($item = db_fetch_object($items)) {
$summary_items[] = theme('aggregator_summary_item', $item);
}
@@ -310,9 +310,9 @@ function aggregator_page_categories() {
$output = '';
while ($category = db_fetch_object($result)) {
- if (variable_get('aggregator_summary_items', 3)) {
+ if (variable_get('aggregator_summary_items')) {
$summary_items = array();
- $items = db_query_range('SELECT i.title, i.timestamp, i.link, f.title as feed_title, f.link as feed_link FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON i.iid = ci.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE ci.cid = %d ORDER BY i.timestamp DESC', $category->cid, 0, variable_get('aggregator_summary_items', 3));
+ $items = db_query_range('SELECT i.title, i.timestamp, i.link, f.title as feed_title, f.link as feed_link FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON i.iid = ci.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE ci.cid = %d ORDER BY i.timestamp DESC', $category->cid, 0, variable_get('aggregator_summary_items'));
while ($item = db_fetch_object($items)) {
$summary_items[] = theme('aggregator_summary_item', $item);
}
@@ -333,13 +333,13 @@ function aggregator_page_rss() {
if (arg(2)) {
$category = db_fetch_object(db_query('SELECT cid, title FROM {aggregator_category} WHERE cid = %d', arg(2)));
$sql = 'SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = %d ORDER BY timestamp DESC, i.iid DESC';
- $result = db_query_range($sql, $category->cid, 0, variable_get('feed_default_items', 10));
+ $result = db_query_range($sql, $category->cid, 0, variable_get('feed_default_items'));
}
// Or, get the default aggregator items.
else {
$category = NULL;
$sql = 'SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC';
- $result = db_query_range($sql, 0, variable_get('feed_default_items', 10));
+ $result = db_query_range($sql, 0, variable_get('feed_default_items'));
}
$feeds = array();
@@ -363,7 +363,7 @@ function theme_aggregator_page_rss($feed
drupal_set_header('Content-Type: application/rss+xml; charset=utf-8');
$items = '';
- $feed_length = variable_get('feed_item_length', 'teaser');
+ $feed_length = variable_get('feed_item_length');
foreach ($feeds as $feed) {
switch ($feed_length) {
case 'teaser':
@@ -380,7 +380,7 @@ function theme_aggregator_page_rss($feed
$items .= format_rss_item($feed->ftitle . ': ' . $feed->title, $feed->link, $feed->description, array('pubDate' => date('r', $feed->timestamp)));
}
- $site_name = variable_get('site_name', 'Drupal');
+ $site_name = variable_get('site_name');
$url = url((isset($category) ? 'aggregator/categories/' . $category->cid : 'aggregator'), array('absolute' => TRUE));
$description = isset($category) ? t('@site_name - aggregated feeds in category @title', array('@site_name' => $site_name, '@title' => $category->title)) : t('@site_name - aggregated feeds', array('@site_name' => $site_name));
@@ -429,7 +429,7 @@ function theme_aggregator_page_opml($fee
$output = "\n";
$output .= "
' . t('@time ago', array('@time' => format_interval(time() - $comment->timestamp)));
}
@@ -566,7 +583,7 @@ function comment_nodeapi(&$node, $op, $a
case 'prepare':
if (!isset($node->comment)) {
- $node->comment = variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE);
+ $node->comment = variable_get("comment_$node->type");
}
break;
@@ -1281,7 +1298,7 @@ function comment_form(&$form_state, $edi
'#title' => t('Your name'),
'#maxlength' => 60,
'#size' => 30,
- '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous', t('Anonymous')),
+ '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous'),
);
$form['mail'] = array(
'#type' => 'textfield',
@@ -1304,7 +1321,7 @@ function comment_form(&$form_state, $edi
'#title' => t('Your name'),
'#maxlength' => 60,
'#size' => 30,
- '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous', t('Anonymous')),
+ '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous'),
'#required' => TRUE,
);
$form['mail'] = array(
@@ -1444,7 +1461,7 @@ function comment_form_add_preview($form,
$comment->name = check_plain($account->name);
}
elseif (empty($comment->name)) {
- $comment->name = variable_get('anonymous', t('Anonymous'));
+ $comment->name = variable_get('anonymous');
}
$comment->timestamp = !empty($edit['timestamp']) ? $edit['timestamp'] : time();
@@ -1708,7 +1725,7 @@ function theme_comment_post_forbidden($n
$destination = 'destination=' . drupal_urlencode("node/$node->nid#comment-form");
}
- if (variable_get('user_register', 1)) {
+ if (variable_get('user_register')) {
// Users can register themselves.
return t('Login or register to post comments', array('@login' => url('user/login', array('query' => $destination)), '@register' => url('user/register', array('query' => $destination))));
}
@@ -1993,7 +2010,7 @@ function comment_ranking() {
'join' => 'LEFT JOIN {node_comment_statistics} node_comment_statistics ON node_comment_statistics.nid = i.sid',
// Inverse law that maps the highest reply count on the site to 1 and 0 to 0.
'score' => '2.0 - 2.0 / (1.0 + node_comment_statistics.comment_count * %f)',
- 'arguments' => array(variable_get('node_cron_comments_scale', 0)),
+ 'arguments' => array(variable_get('node_cron_comments_scale')),
),
);
}
Index: modules/contact/contact.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.admin.inc,v
retrieving revision 1.5
diff -u -p -r1.5 contact.admin.inc
--- modules/contact/contact.admin.inc 2 Jul 2008 20:05:11 -0000 1.5
+++ modules/contact/contact.admin.inc 31 Jul 2008 19:39:29 -0000
@@ -146,19 +146,16 @@ function contact_admin_delete_submit($fo
function contact_admin_settings() {
$form['contact_form_information'] = array('#type' => 'textarea',
'#title' => t('Additional information'),
- '#default_value' => variable_get('contact_form_information', t('You can leave a message using the contact form below.')),
'#description' => t('Information to show on the contact page. Can be anything from submission guidelines to your postal address or telephone number.', array('@form' => url('contact'))),
);
$form['contact_hourly_threshold'] = array('#type' => 'select',
'#title' => t('Hourly threshold'),
'#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50)),
- '#default_value' => variable_get('contact_hourly_threshold', 3),
'#description' => t('The maximum number of contact form submissions a user can perform per hour.'),
);
$form['contact_default_status'] = array(
'#type' => 'checkbox',
'#title' => t('Enable personal contact form by default'),
- '#default_value' => variable_get('contact_default_status', 1),
'#description' => t('Default status of the personal contact form for new users.'),
);
return system_settings_form($form);
Index: modules/contact/contact.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.install,v
retrieving revision 1.10
diff -u -p -r1.10 contact.install
--- modules/contact/contact.install 18 Dec 2007 12:59:21 -0000 1.10
+++ modules/contact/contact.install 26 Jul 2008 01:22:17 -0000
@@ -15,10 +15,6 @@ function contact_install() {
function contact_uninstall() {
// Remove tables.
drupal_uninstall_schema('contact');
-
- variable_del('contact_default_status');
- variable_del('contact_form_information');
- variable_del('contact_hourly_threshold');
}
/**
Index: modules/contact/contact.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v
retrieving revision 1.108
diff -u -p -r1.108 contact.module
--- modules/contact/contact.module 24 Jul 2008 16:25:17 -0000 1.108
+++ modules/contact/contact.module 31 Jul 2008 18:34:37 -0000
@@ -7,6 +7,17 @@
*/
/**
+ * Implementation of hook_variables().
+ */
+function contact_variables() {
+ return array(
+ 'contact_form_information' => t('You can leave a message using the contact form below.'),
+ 'contact_hourly_threshold' => 3,
+ 'contact_default_status' => 1,
+ );
+}
+
+/**
* Implementation of hook_help().
*/
function contact_help($path, $arg) {
@@ -152,7 +163,7 @@ function contact_user($type, &$edit, &$u
return array('contact' => isset($edit['contact']) ? $edit['contact'] : FALSE);
}
elseif ($type == 'insert') {
- $edit['contact'] = variable_get('contact_default_status', 1);
+ $edit['contact'] = variable_get('contact_default_status');
}
}
@@ -178,9 +189,9 @@ function contact_mail($key, &$message, $
case 'user_copy':
$user = $params['user'];
$account = $params['account'];
- $message['subject'] .= '[' . variable_get('site_name', 'Drupal') . '] ' . $params['subject'];
+ $message['subject'] .= '[' . variable_get('site_name') . '] ' . $params['subject'];
$message['body'][] = "$account->name,";
- $message['body'][] = t("!name (!name-url) has sent you a message via your contact form (!form-url) at !site.", array('!name' => $user->name, '!name-url' => url("user/$user->uid", array('absolute' => TRUE, 'language' => $language)), '!form-url' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language)), '!site' => variable_get('site_name', 'Drupal')), $language->language);
+ $message['body'][] = t("!name (!name-url) has sent you a message via your contact form (!form-url) at !site.", array('!name' => $user->name, '!name-url' => url("user/$user->uid", array('absolute' => TRUE, 'language' => $language)), '!form-url' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language)), '!site' => variable_get('site_name')), $language->language);
$message['body'][] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", array('absolute' => TRUE, 'language' => $language))), $language->language);
$message['body'][] = t('Message:', NULL, $language->language);
$message['body'][] = $params['message'];
Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.11
diff -u -p -r1.11 contact.pages.inc
--- modules/contact/contact.pages.inc 16 Jul 2008 21:59:26 -0000 1.11
+++ modules/contact/contact.pages.inc 25 Jul 2008 08:18:40 -0000
@@ -13,8 +13,8 @@
function contact_site_page() {
global $user;
- if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold', 3)) && !user_access('administer site-wide contact form')) {
- $output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold', 3)));
+ if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold')) && !user_access('administer site-wide contact form')) {
+ $output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold')));
}
else {
$output = drupal_get_form('contact_mail_page');
@@ -38,7 +38,7 @@ function contact_mail_page() {
if (count($categories) > 0) {
$form['#token'] = $user->uid ? $user->name . $user->mail : '';
- $form['contact_information'] = array('#markup' => filter_xss_admin(variable_get('contact_form_information', t('You can leave a message using the contact form below.'))));
+ $form['contact_information'] = array('#markup' => filter_xss_admin(variable_get('contact_form_information')));
$form['name'] = array('#type' => 'textfield',
'#title' => t('Your name'),
'#maxlength' => 255,
@@ -160,8 +160,8 @@ function contact_user_page($account) {
if (!valid_email_address($user->mail)) {
$output = t('You need to provide a valid e-mail address to contact other users. Please update your user information and try again.', array('@url' => url("user/$user->uid/edit", array('query' => 'destination=' . drupal_get_destination()))));
}
- else if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold', 3)) && !user_access('administer site-wide contact form')) {
- $output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold', 3)));
+ else if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold')) && !user_access('administer site-wide contact form')) {
+ $output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold')));
}
else {
drupal_set_title(check_plain($account->name));
Index: modules/dblog/dblog.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.admin.inc,v
retrieving revision 1.8
diff -u -p -r1.8 dblog.admin.inc
--- modules/dblog/dblog.admin.inc 19 Jul 2008 07:44:45 -0000 1.8
+++ modules/dblog/dblog.admin.inc 31 Jul 2008 19:39:41 -0000
@@ -16,7 +16,6 @@ function dblog_admin_settings() {
$form['dblog_row_limit'] = array(
'#type' => 'select',
'#title' => t('Discard log entries above the following row limit'),
- '#default_value' => variable_get('dblog_row_limit', 1000),
'#options' => drupal_map_assoc(array(100, 1000, 10000, 100000, 1000000)),
'#description' => t('The maximum number of rows to keep in the database log. Older entries will be automatically discarded. (Requires a correctly configured cron maintenance task.)', array('@cron' => url('admin/reports/status')))
);
Index: modules/dblog/dblog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v
retrieving revision 1.26
diff -u -p -r1.26 dblog.module
--- modules/dblog/dblog.module 24 Jul 2008 16:25:17 -0000 1.26
+++ modules/dblog/dblog.module 25 Jul 2008 06:27:39 -0000
@@ -13,6 +13,15 @@
*/
/**
+ * Implementation of hook_variables().
+ */
+function dblog_variables() {
+ return array(
+ 'dblog_row_limit' => 1000,
+ );
+}
+
+/**
* Implementation of hook_help().
*/
function dblog_help($path, $arg) {
@@ -97,7 +106,7 @@ function dblog_init() {
function dblog_cron() {
// Cleanup the watchdog table
$max = db_result(db_query('SELECT MAX(wid) FROM {watchdog}'));
- db_query('DELETE FROM {watchdog} WHERE wid <= %d', $max - variable_get('dblog_row_limit', 1000));
+ db_query('DELETE FROM {watchdog} WHERE wid <= %d', $max - variable_get('dblog_row_limit'));
}
/**
Index: modules/dblog/dblog.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.test,v
retrieving revision 1.5
diff -u -p -r1.5 dblog.test
--- modules/dblog/dblog.test 30 May 2008 07:30:50 -0000 1.5
+++ modules/dblog/dblog.test 1 Aug 2008 02:27:20 -0000
@@ -57,7 +57,7 @@ class DBLogTestCase extends DrupalWebTes
$this->assertResponse(200);
// Check row limit variable.
- $current_limit = variable_get('dblog_row_limit', 1000);
+ $current_limit = variable_get('dblog_row_limit');
$this->assertTrue($current_limit == $row_limit, t('[Cache] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
// Verify dblog row limit equals specified row limit.
$current_limit = unserialize(db_result(db_query("SELECT value FROM {variable} WHERE name = '%s'", 'dblog_row_limit')));
Index: modules/filter/filter.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.admin.inc,v
retrieving revision 1.13
diff -u -p -r1.13 filter.admin.inc
--- modules/filter/filter.admin.inc 24 Jul 2008 16:27:51 -0000 1.13
+++ modules/filter/filter.admin.inc 25 Jul 2008 05:34:27 -0000
@@ -28,7 +28,7 @@ function filter_admin_overview() {
$roles[] = $name;
}
}
- $default = ($id == variable_get('filter_default_format', 1));
+ $default = ($id == variable_get('filter_default_format'));
$options[$id] = '';
$form[$id]['name'] = array('#markup' => $format->name);
$form[$id]['roles'] = array('#markup' => $default ? t('All roles may use default format') : ($roles ? implode(', ', $roles) : t('No roles may use this format')));
@@ -36,7 +36,7 @@ function filter_admin_overview() {
$form[$id]['delete'] = array('#markup' => $default ? '' : l(t('delete'), 'admin/settings/filters/delete/' . $id));
$form[$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight);
}
- $form['default'] = array('#type' => 'radios', '#options' => $options, '#default_value' => variable_get('filter_default_format', 1));
+ $form['default'] = array('#type' => 'radios', '#options' => $options, '#default_value' => variable_get('filter_default_format'));
$form['submit'] = array('#type' => 'submit', '#value' => t('Save changes'));
return $form;
}
@@ -108,7 +108,7 @@ function filter_admin_format_page($forma
* @see filter_admin_format_form_submit()
*/
function filter_admin_format_form(&$form_state, $format) {
- $default = ($format->format == variable_get('filter_default_format', 1));
+ $default = ($format->format == variable_get('filter_default_format'));
if ($default) {
$help = t('All roles for the default format must be enabled and cannot be changed.');
$form['default_format'] = array('#type' => 'hidden', '#value' => 1);
@@ -261,7 +261,7 @@ function filter_admin_delete() {
$format = db_fetch_object(db_query('SELECT * FROM {filter_formats} WHERE format = %d', $format));
if ($format) {
- if ($format->format != variable_get('filter_default_format', 1)) {
+ if ($format->format != variable_get('filter_default_format')) {
$form['format'] = array('#type' => 'hidden', '#value' => $format->format);
$form['name'] = array('#type' => 'hidden', '#value' => $format->name);
@@ -284,7 +284,7 @@ function filter_admin_delete_submit($for
db_query("DELETE FROM {filter_formats} WHERE format = %d", $form_state['values']['format']);
db_query("DELETE FROM {filters} WHERE format = %d", $form_state['values']['format']);
- $default = variable_get('filter_default_format', 1);
+ $default = variable_get('filter_default_format');
// Replace existing instances of the deleted format with the default format.
db_query("UPDATE {node_revisions} SET format = %d WHERE format = %d", $default, $form_state['values']['format']);
db_query("UPDATE {comments} SET format = %d WHERE format = %d", $default, $form_state['values']['format']);
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.217
diff -u -p -r1.217 filter.module
--- modules/filter/filter.module 24 Jul 2008 16:25:17 -0000 1.217
+++ modules/filter/filter.module 31 Jul 2008 20:10:27 -0000
@@ -15,6 +15,19 @@
define('FILTER_FORMAT_DEFAULT', 0);
/**
+ * Implementation of hook_variables().
+ */
+function filter_variables() {
+ return array(
+ 'filter_default_format' => 1,
+ 'allowed_html' => '
line break')),
'p' => array( t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '
' . t('Welcome to your new Drupal website!') . '
';
@@ -1828,7 +1841,7 @@ function node_page_view($node, $cid = NU
* Implementation of hook_update_index().
*/
function node_update_index() {
- $limit = (int)variable_get('search_cron_limit', 100);
+ $limit = (int)variable_get('search_cron_limit');
// Store the maximum possible comments per thread (used for ranking by reply count)
variable_set('node_cron_comments_scale', 1.0 / max(1, db_result(db_query('SELECT MAX(comment_count) FROM {node_comment_statistics}'))));
@@ -2327,7 +2340,7 @@ function node_access_write_grants($node,
*/
function node_access_needs_rebuild($rebuild = NULL) {
if (!isset($rebuild)) {
- return variable_get('node_access_needs_rebuild', FALSE);
+ return variable_get('node_access_needs_rebuild');
}
elseif ($rebuild) {
variable_set('node_access_needs_rebuild', TRUE);
Index: modules/node/node.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v
retrieving revision 1.31
diff -u -p -r1.31 node.pages.inc
--- modules/node/node.pages.inc 10 Jul 2008 11:12:02 -0000 1.31
+++ modules/node/node.pages.inc 25 Jul 2008 08:18:58 -0000
@@ -67,7 +67,7 @@ function node_form_validate($form, &$for
function node_object_prepare(&$node) {
// Set up default values, if required.
- $node_options = variable_get('node_options_' . $node->type, array('status', 'promote'));
+ $node_options = variable_get('node_options_' . $node->type, array('status'));
// If this is a new node, fill in the default values.
if (!isset($node->nid)) {
foreach (array('status', 'promote', 'sticky') as $key) {
@@ -180,7 +180,7 @@ function node_form(&$form_state, $node)
'#autocomplete_path' => 'user/autocomplete',
'#default_value' => $node->name ? $node->name : '',
'#weight' => -1,
- '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))),
+ '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous'))),
);
$form['author']['date'] = array(
'#type' => 'textfield',
Index: modules/openid/openid.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v
retrieving revision 1.27
diff -u -p -r1.27 openid.module
--- modules/openid/openid.module 24 Jul 2008 16:25:18 -0000 1.27
+++ modules/openid/openid.module 25 Jul 2008 05:34:31 -0000
@@ -63,7 +63,7 @@ function openid_help($path, $arg) {
function openid_user($op, &$edit, &$account, $category = NULL) {
if ($op == 'insert' && isset($_SESSION['openid']['values'])) {
// The user has registered after trying to login via OpenID.
- if (variable_get('user_email_verification', TRUE)) {
+ if (variable_get('user_email_verification')) {
drupal_set_message(t('Once you have verified your email address, you may log in via OpenID.'));
}
unset($_SESSION['openid']);
@@ -118,7 +118,7 @@ function openid_form_alter(&$form, $form
$form['mail']['#default_value'] = $_SESSION['openid']['values']['mail'];
// If user_email_verification is off, hide the password field and just fill
// with random password to avoid confusion.
- if (!variable_get('user_email_verification', TRUE)) {
+ if (!variable_get('user_email_verification')) {
$form['pass']['#type'] = 'hidden';
$form['pass']['#value'] = user_password();
}
@@ -387,20 +387,20 @@ function openid_authentication($response
$account = user_external_load($identity);
if (isset($account->uid)) {
- if (!variable_get('user_email_verification', TRUE) || $account->login) {
+ if (!variable_get('user_email_verification') || $account->login) {
user_external_login($account, $_SESSION['openid']['user_login_values']);
}
else {
drupal_set_message(t('You must validate your email address for this account before logging in via OpenID'));
}
}
- elseif (variable_get('user_register', 1)) {
+ elseif (variable_get('user_register')) {
// Register new user
$form_state['redirect'] = NULL;
$form_state['values']['name'] = (empty($response['openid.sreg.nickname'])) ? $identity : $response['openid.sreg.nickname'];
$form_state['values']['mail'] = (empty($response['openid.sreg.email'])) ? '' : $response['openid.sreg.email'];
$form_state['values']['pass'] = user_password();
- $form_state['values']['status'] = variable_get('user_register', 1) == 1;
+ $form_state['values']['status'] = variable_get('user_register') == 1;
$form_state['values']['response'] = $response;
$form = drupal_retrieve_form('user_register', $form_state);
drupal_prepare_form('user_register', $form, $form_state);
Index: modules/path/path.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.admin.inc,v
retrieving revision 1.8
diff -u -p -r1.8 path.admin.inc
--- modules/path/path.admin.inc 14 Apr 2008 17:48:38 -0000 1.8
+++ modules/path/path.admin.inc 25 Jul 2008 05:34:31 -0000
@@ -95,7 +95,7 @@ function path_admin_form(&$form_state, $
'#maxlength' => 64,
'#size' => 45,
'#description' => t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1+2.'),
- '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),
+ '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url') ? '' : '?q='),
'#required' => TRUE,
);
$form['dst'] = array(
@@ -105,7 +105,7 @@ function path_admin_form(&$form_state, $
'#maxlength' => 64,
'#size' => 45,
'#description' => t('Specify an alternative path by which this data can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
- '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),
+ '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url') ? '' : '?q='),
'#required' => TRUE,
);
// This will be a hidden value unless locale module is enabled
Index: modules/profile/profile.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.install,v
retrieving revision 1.13
diff -u -p -r1.13 profile.install
--- modules/profile/profile.install 15 Mar 2008 12:31:29 -0000 1.13
+++ modules/profile/profile.install 26 Jul 2008 01:23:27 -0000
@@ -15,8 +15,6 @@ function profile_install() {
function profile_uninstall() {
// Remove tables
drupal_uninstall_schema('profile');
-
- variable_del('profile_block_author_fields');
}
/**
Index: modules/profile/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v
retrieving revision 1.243
diff -u -p -r1.243 profile.module
--- modules/profile/profile.module 24 Jul 2008 16:25:18 -0000 1.243
+++ modules/profile/profile.module 31 Jul 2008 18:09:15 -0000
@@ -27,6 +27,15 @@ define('PROFILE_PUBLIC_LISTINGS', 3);
define('PROFILE_HIDDEN', 4);
/**
+ * Implementation of hook_variables().
+ */
+function profile_variables() {
+ return array(
+ 'profile_block_author_fields' => array(),
+ );
+}
+
+/**
* Implementation of hook_help().
*/
function profile_help($path, $arg) {
@@ -146,7 +155,7 @@ function profile_block($op = 'list', $de
$form['profile_block_author_fields'] = array(
'#type' => 'checkboxes',
'#title' => t('Profile fields to display'),
- '#default_value' => variable_get('profile_block_author_fields', array()),
+ '#default_value' => variable_get('profile_block_author_fields'),
'#options' => $fields,
'#description' => t('Select which profile fields you wish to display in the block. Only fields designated as public in the profile field configuration are available.', array('@profile-admin' => url('admin/user/profile'))),
);
@@ -162,7 +171,7 @@ function profile_block($op = 'list', $de
$node = node_load(arg(1));
$account = user_load(array('uid' => $node->uid));
- if ($use_fields = variable_get('profile_block_author_fields', array())) {
+ if ($use_fields = variable_get('profile_block_author_fields')) {
// Compile a list of fields to show.
$fields = array();
$result = db_query('SELECT name, title, type, visibility, weight FROM {profile_fields} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS);
@@ -261,7 +270,7 @@ function profile_view_field($user, $fiel
case 'url':
return '' . check_plain($value) . '';
case 'date':
- $format = substr(variable_get('date_format_short', 'm/d/Y - H:i'), 0, 5);
+ $format = substr(variable_get('date_format_short'), 0, 5);
// Note: Avoid PHP's date() because it does not handle dates before
// 1970 on Windows. This would make the date field useless for e.g.
// birthdays.
Index: modules/search/search.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.admin.inc,v
retrieving revision 1.6
diff -u -p -r1.6 search.admin.inc
--- modules/search/search.admin.inc 16 Jul 2008 21:59:27 -0000 1.6
+++ modules/search/search.admin.inc 31 Jul 2008 19:46:21 -0000
@@ -55,12 +55,12 @@ function search_admin_settings() {
// Indexing throttle:
$form['indexing_throttle'] = array('#type' => 'fieldset', '#title' => t('Indexing throttle'));
- $form['indexing_throttle']['search_cron_limit'] = array('#type' => 'select', '#title' => t('Number of items to index per cron run'), '#default_value' => variable_get('search_cron_limit', 100), '#options' => $items, '#description' => t('The maximum number of items indexed in each pass of a cron maintenance task. If necessary, reduce the number of items to prevent timeouts and memory errors while indexing.', array('@cron' => url('admin/reports/status'))));
+ $form['indexing_throttle']['search_cron_limit'] = array('#type' => 'select', '#title' => t('Number of items to index per cron run'), '#options' => $items, '#description' => t('The maximum number of items indexed in each pass of a cron maintenance task. If necessary, reduce the number of items to prevent timeouts and memory errors while indexing.', array('@cron' => url('admin/reports/status'))));
// Indexing settings:
$form['indexing_settings'] = array('#type' => 'fieldset', '#title' => t('Indexing settings'));
$form['indexing_settings']['info'] = array('#markup' => t('?q=
in the URL).'),
);
- if (!variable_get('clean_url', 0)) {
+ if (!variable_get('clean_url')) {
if (strpos(request_uri(), '?q=') !== FALSE) {
drupal_add_js(drupal_get_path('module', 'system') . '/system.js', 'module');
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.258
diff -u -p -r1.258 system.install
--- modules/system/system.install 2 Aug 2008 19:01:02 -0000 1.258
+++ modules/system/system.install 3 Aug 2008 03:22:30 -0000
@@ -126,19 +126,19 @@ function system_requirements($phase) {
// Report cron status.
if ($phase == 'runtime') {
// Cron warning threshold defaults to two days.
- $threshold_warning = variable_get('cron_threshold_warning', 172800);
+ $threshold_warning = variable_get('cron_threshold_warning');
// Cron error threshold defaults to two weeks.
- $threshold_error = variable_get('cron_threshold_error', 1209600);
+ $threshold_error = variable_get('cron_threshold_error');
// Cron configuration help text.
$help = $t('For more information, see the online handbook entry for configuring cron jobs.', array('@cron-handbook' => 'http://drupal.org/cron'));
// Determine when cron last ran. If never, use the install time to
// determine the warning or error status.
- $cron_last = variable_get('cron_last', NULL);
+ $cron_last = variable_get('cron_last');
$never_run = FALSE;
if (!is_numeric($cron_last)) {
$never_run = TRUE;
- $cron_last = variable_get('install_time', 0);
+ $cron_last = variable_get('install_time');
}
// Determine severity based on time since cron last ran.
@@ -171,7 +171,7 @@ function system_requirements($phase) {
}
$description .= ' ' . $t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron')));
- $description .= '
' . $t('To run cron from outside the site, go to !cron', array('!cron' => url('cron.php', array('absolute' => true, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal')))));
+ $description .= '
' . $t('To run cron from outside the site, go to !cron', array('!cron' => url('cron.php', array('absolute' => true, 'query' => 'cron_key=' . variable_get('cron_key')))));
$requirements['cron'] = array(
'title' => $t('Cron maintenance tasks'),
@@ -219,7 +219,7 @@ function system_requirements($phase) {
}
}
else {
- if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC) {
+ if (variable_get('file_downloads') == FILE_DOWNLOADS_PUBLIC) {
$requirements['file system']['value'] = $t('Writable (public download method)');
}
else {
@@ -284,7 +284,7 @@ function system_requirements($phase) {
$requirements['update status'] = array(
'value' => $t('Enabled'),
);
- if (variable_get('drupal_http_request_fails', FALSE)) {
+ if (variable_get('drupal_http_request_fails')) {
$requirements['http requests'] = array(
'title' => $t('HTTP request status'),
'value' => $t('Fails'),
@@ -2022,7 +2022,7 @@ function system_update_6021() {
$ret[] = update_sql("DELETE FROM {menu_links} WHERE menu_name IN ('" . implode("', '", $_SESSION['menu_bogus_menus']) . "')");
}
- $menu_primary_menu = variable_get('menu_primary_menu', 0);
+ $menu_primary_menu = variable_get('menu_primary_menu');
// Ensure that we wind up with a system menu named 'primary-links'.
if (isset($_SESSION['menu_menu_map'][2])) {
// The primary links menu that ships with Drupal 5 has mid = 2. If this
@@ -2049,7 +2049,7 @@ function system_update_6021() {
$_SESSION['menu_menu_map'][$updated_primary_links_menu] = 'primary-links';
}
- $menu_secondary_menu = variable_get('menu_secondary_menu', 0);
+ $menu_secondary_menu = variable_get('menu_secondary_menu');
// Ensure that we wind up with a system menu named 'secondary-links'.
if (isset($_SESSION['menu_menu_map'][$menu_secondary_menu]) && $menu_secondary_menu > 1 && $menu_secondary_menu != $updated_primary_links_menu) {
// We use the menu that is currently assigned to the secondary links
@@ -2074,7 +2074,7 @@ function system_update_6021() {
}
// Update menu OTF preferences.
- $mid = variable_get('menu_parent_items', 0);
+ $mid = variable_get('menu_parent_items');
$menu_name = ($mid && isset($_SESSION['menu_menu_map'][$mid])) ? $_SESSION['menu_menu_map'][$mid] : 'navigation';
variable_set('menu_default_node_menu', $menu_name);
variable_del('menu_parent_items');
@@ -2497,7 +2497,7 @@ function system_update_6040() {
function system_update_6041() {
$weight = intval((db_result(db_query("SELECT weight FROM {system} WHERE name = 'taxonomy'"))) + 1);
$ret = array();
- $vid = intval(variable_get('forum_nav_vocabulary', ''));
+ $vid = intval(variable_get('forum_nav_vocabulary'));
if (db_table_exists('vocabulary') && $vid) {
$ret[] = update_sql("UPDATE {vocabulary} SET required = 0 WHERE vid = " . $vid);
$ret[] = update_sql("UPDATE {system} SET weight = " . $weight . " WHERE name = 'forum'");
@@ -2510,7 +2510,7 @@ function system_update_6041() {
*/
function system_update_6042() {
foreach (list_themes() as $theme) {
- $stylesheet = variable_get('color_' . $theme->name . '_stylesheet', NULL);
+ $stylesheet = variable_get('color_' . $theme->name . '_stylesheet');
if (!empty($stylesheet)) {
variable_set('color_' . $theme->name . '_stylesheets', array($stylesheet));
variable_del('color_' . $theme->name . '_stylesheet');
@@ -2625,7 +2625,7 @@ function system_update_6044() {
$ret[] = update_sql("DELETE FROM {term_node} WHERE vid = 0");
// Only execute the rest of this function if 6043 was run in RC1 or before.
- if (variable_get('system_update_6043_RC2', FALSE)) {
+ if (variable_get('system_update_6043_RC2')) {
variable_del('system_update_6043_RC2');
return $ret;
}
@@ -2689,7 +2689,7 @@ function system_update_6045() {
*/
function system_update_6046() {
$ret = array();
- if (!variable_get('file_directory_path', FALSE)) {
+ if (!variable_get('file_directory_path')) {
variable_set('file_directory_path', 'files');
$ret[] = array('success' => TRUE, 'query' => "variable_set('file_directory_path')");
}
@@ -2860,12 +2860,12 @@ function system_update_7004(&$sandbox) {
}
}
// Rename forum module's block variables.
- $forum_block_num_0 = variable_get('forum_block_num_0', NULL);
+ $forum_block_num_0 = variable_get('forum_block_num_0');
if (isset($forum_block_num_0)) {
variable_set('forum_block_num_active', $forum_block_num_0);
variable_del('forum_block_num_0');
}
- $forum_block_num_1 = variable_get('forum_block_num_1', NULL);
+ $forum_block_num_1 = variable_get('forum_block_num_1');
if (isset($forum_block_num_1)) {
variable_set('forum_block_num_new', $forum_block_num_1);
variable_del('forum_block_num_1');
@@ -3042,6 +3042,38 @@ function system_update_7009() {
}
/**
+ * Update lots of variables for the variable renaming that comes along with the
+ * new hook_variables().
+ */
+function system_update_7010() {
+ $ret = array();
+ $renamings = array(
+ 'color_%_screenshot' => 'color_screenshot_%',
+ 'color_%_stylesheets' => 'color_stylesheets_%',
+ 'color_%_logo' => 'color_logo_%',
+ 'color_%_palette' => 'color_palette_%',
+ 'color_%_files' => 'color_files_%',
+ 'upload_extensions_default' => 'upload_extensions',
+ 'upload_uploadsize_default' => 'upload_uploadsize',
+ 'upload_usersize_default' => 'upload_usersize',
+ 'user_mail_status_%_notify' => 'user_mail_notify_status_%',
+ );
+ foreach ($renamings as $variable => $renamed) {
+ $parts = explode('%', $variable);
+ // Escape the % for db_query().
+ $sql_variable = str_replace('%', '%%', $variable);
+ $result = db_query("SELECT name FROM {variable} WHERE name LIKE '$sql_variable'");
+ while ($data = db_fetch_array($result)) {
+ $old_name = $data['name'];
+ $name = str_replace($parts, '', $data['name']);
+ $renamed_variable = str_replace('%', $name, $renamed);
+ $ret[] = update_sql("UPDATE {variable} SET name = '$renamed_variable' WHERE name = '$old_name'");
+ }
+ }
+ return $ret;
+}
+
+/**
* @} End of "defgroup updates-6.x-to-7.x"
* The next series of updates should start at 8000.
*/
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.612
diff -u -p -r1.612 system.module
--- modules/system/system.module 2 Aug 2008 19:01:02 -0000 1.612
+++ modules/system/system.module 3 Aug 2008 03:22:31 -0000
@@ -42,6 +42,86 @@ define('DRUPAL_MINIMUM_PGSQL', '8.1');
define('DRUPAL_MAXIMUM_TEMP_FILE_AGE', 1440);
/**
+ * Implementation of hook_variables().
+ */
+function system_variables() {
+ return array(
+ 'cron_key' => 'drupal',
+ 'install_profile_modules' => array(),
+ 'site_name' => 'Drupal',
+ 'site_mail' => ini_get('sendmail_from'),
+ 'install_locale_batch_components' => array(),
+ 'update_d6_requirements' => FALSE,
+ 'actions_max_stack' => 35,
+ 'page_compression' => TRUE,
+ 'cache_flush' => 0,
+ 'cache_lifetime' => 0,
+ 'site_404' => '',
+ 'site_403' => '',
+ 'drupal_http_request_fails' => FALSE,
+ 'error_level' => 1,
+ 'configurable_timezones' => 1,
+ 'date_default_timezone' => 0,
+ 'date_format_short' => 'm/d/Y - H:i',
+ 'date_format_long' => 'l, F j, Y - H:i',
+ 'date_format_medium' => 'D, m/d/Y - H:i',
+ 'clean_url' => '0',
+ 'preprocess_css' => FALSE,
+ 'file_downloads' => FILE_DOWNLOADS_PUBLIC,
+ 'css_js_query_string' => '0',
+ 'preprocess_js' => FALSE,
+ 'drupal_private_key' => '',
+ 'cron_semaphore' => FALSE,
+ 'install_profile' => 'default',
+ 'anonymous' => 'Anonymous',
+ 'allow_insecure_uploads' => 0,
+ 'upload_extensions_default' => 'jpg jpeg gif png txt html doc xls pdf ppt pps odt ods odp',
+ 'file_directory_temp' => NULL,
+ 'file_directory_path' => conf_path() . '/files',
+ 'image_toolkit' => 'gd',
+ 'language_negotiation' => LANGUAGE_NEGOTIATION_NONE,
+ 'javascript_parsed' => array(),
+ 'locale_js_directory' => 'languages',
+ 'smtp_library' => '',
+ 'menu_masks' => array(),
+ 'menu_rebuild_needed' => FALSE,
+ 'menu_expanded' => array(),
+ 'menu_main_menu_source' => 'main-menu',
+ 'menu_secondary_menu_source' => 'secondary-menu',
+ 'site_offline' => 0,
+ 'theme_default' => 'garland',
+ 'theme_settings' => array(),
+ 'site_mission' => '',
+ 'site_slogan' => '',
+ 'site_footer' => '',
+ 'maintenance_theme' => 'minnelli',
+ 'site_slogan' => '',
+ 'admin_theme' => 0,
+ 'node_admin_theme' => 0,
+ 'image_jpeg_quality' => 75,
+ 'date_first_day' => 0,
+ 'date_format_short_custom' => '',
+ 'date_format_medium_custom' => '',
+ 'date_format_long_custom' => '',
+ 'site_offline_message' => '@site is currently under maintenance. We should be back shortly. Thank you for your patience.',
+ 'cron_threshold_warning' => 172800,
+ 'cron_threshold_error' => 1209600,
+ 'cron_last' => NULL,
+ 'install_time' => 0,
+ 'menu_primary_menu' => 0,
+ 'menu_secondary_menu' => 0,
+ 'menu_parent_items' => 0,
+ 'system_update_6043_RC2' => FALSE,
+ 'forum_block_num_0' => NULL,
+ 'forum_block_num_1' => NULL,
+ 'drupal_badge_color' => 'powered-blue',
+ 'drupal_badge_size' => '80x15',
+ 'admin_compact_mode' => FALSE,
+ 'locale_custom_strings' => array(),
+ );
+}
+
+/**
* Implementation of hook_help().
*/
function system_help($path, $arg) {
@@ -674,7 +754,7 @@ function blocked_ip_load($iid) {
* Menu item access callback - only admin or enabled themes can be accessed.
*/
function _system_themes_access($theme) {
- return user_access('administer site configuration') && ($theme->status || $theme->name == variable_get('admin_theme', '0'));
+ return user_access('administer site configuration') && ($theme->status || $theme->name == variable_get('admin_theme'));
}
/**
@@ -682,9 +762,9 @@ function _system_themes_access($theme) {
*/
function system_init() {
// Use the administrative theme if the user is looking at a page in the admin/* path.
- if (arg(0) == 'admin' || (variable_get('node_admin_theme', '0') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) {
+ if (arg(0) == 'admin' || (variable_get('node_admin_theme') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) {
global $custom_theme;
- $custom_theme = variable_get('admin_theme', '0');
+ $custom_theme = variable_get('admin_theme');
drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', 'module');
}
@@ -712,7 +792,7 @@ function system_user($type, $edit, &$use
if ($type == 'form' && $category == 'account') {
$form['theme_select'] = system_theme_select_form(t('Selecting a different theme will change the look and feel of the site.'), isset($edit['theme']) ? $edit['theme'] : NULL, 2);
- if (variable_get('configurable_timezones', 1)) {
+ if (variable_get('configurable_timezones')) {
$zones = _system_zonelist();
$form['timezone'] = array(
'#type' => 'fieldset',
@@ -723,7 +803,7 @@ function system_user($type, $edit, &$use
$form['timezone']['timezone'] = array(
'#type' => 'select',
'#title' => t('Time zone'),
- '#default_value' => strlen($edit['timezone']) ? $edit['timezone'] : variable_get('date_default_timezone', 0),
+ '#default_value' => strlen($edit['timezone']) ? $edit['timezone'] : variable_get('date_default_timezone'),
'#options' => $zones,
'#description' => t('Select your current local time. Dates and times throughout this site will be displayed using this time zone.'),
);
@@ -753,13 +833,13 @@ function system_block($op = 'list', $del
$form['wrapper']['color'] = array(
'#type' => 'select',
'#title' => t('Badge color'),
- '#default_value' => variable_get('drupal_badge_color', 'powered-blue'),
+ '#default_value' => variable_get('drupal_badge_color'),
'#options' => array('powered-black' => t('Black'), 'powered-blue' => t('Blue'), 'powered-gray' => t('Gray')),
);
$form['wrapper']['size'] = array(
'#type' => 'select',
'#title' => t('Badge size'),
- '#default_value' => variable_get('drupal_badge_size', '80x15'),
+ '#default_value' => variable_get('drupal_badge_size'),
'#options' => array('80x15' => t('Small'), '88x31' => t('Medium'), '135x42' => t('Large')),
);
return $form;
@@ -768,7 +848,7 @@ function system_block($op = 'list', $del
variable_set('drupal_badge_size', $edit['size']);
break;
case 'view':
- $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png';
+ $image_path = 'misc/' . variable_get('drupal_badge_color') . '-' . variable_get('drupal_badge_size') . '.png';
$block['subject'] = NULL; // Don't display a title
$block['content'] = theme('system_powered_by', $image_path);
return $block;
@@ -814,7 +894,7 @@ function system_admin_menu_block($item)
*/
function system_admin_theme_submit($form, &$form_state) {
// If we're changing themes, make sure the theme has its blocks initialized.
- if ($form_state['values']['admin_theme'] && $form_state['values']['admin_theme'] != variable_get('admin_theme', '0')) {
+ if ($form_state['values']['admin_theme'] && $form_state['values']['admin_theme'] != variable_get('admin_theme')) {
$result = db_result(db_query("SELECT COUNT(*) FROM {blocks} WHERE theme = '%s'", $form_state['values']['admin_theme']));
if (!$result) {
system_initialize_theme_blocks($form_state['values']['admin_theme']);
@@ -858,7 +938,7 @@ function system_theme_select_form($descr
foreach ($enabled as $info) {
// For the default theme, revert to an empty string so the user's theme updates when the site theme is changed.
- $info->key = $info->name == variable_get('theme_default', 'garland') ? '' : $info->name;
+ $info->key = $info->name == variable_get('theme_default') ? '' : $info->name;
$screenshot = NULL;
$theme_key = $info->name;
@@ -873,7 +953,7 @@ function system_theme_select_form($descr
$screenshot = $screenshot ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot');
$form['themes'][$info->key]['screenshot'] = array('#markup' => $screenshot);
- $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#markup' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'garland') ? '
' . t('(site default theme)') . '' : ''));
+ $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#markup' => dirname($info->filename) . ($info->name == variable_get('theme_default') ? '
' . t('(site default theme)') . '' : ''));
$options[$info->key] = '';
}
@@ -1157,7 +1237,7 @@ function system_default_region($theme) {
function system_initialize_theme_blocks($theme) {
// Initialize theme's blocks if none already registered.
if (!(db_result(db_query("SELECT COUNT(*) FROM {blocks} WHERE theme = '%s'", $theme)))) {
- $default_theme = variable_get('theme_default', 'garland');
+ $default_theme = variable_get('theme_default');
$regions = system_region_list($theme);
$result = db_query("SELECT * FROM {blocks} WHERE theme = '%s'", $default_theme);
while ($block = db_fetch_array($result)) {
@@ -1182,6 +1262,8 @@ function system_initialize_theme_blocks(
* The form structure.
*/
function system_settings_form($form) {
+ $form = _system_settings_form_variable_defaults($form);
+
$form['buttons']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration') );
$form['buttons']['reset'] = array('#type' => 'submit', '#value' => t('Reset to defaults') );
@@ -1194,6 +1276,32 @@ function system_settings_form($form) {
}
/**
+ * Helper function for system_settings_form() - fill in default values for
+ * variable derived form items recursively.
+ *
+ * @param $form
+ * The form to fill in default values of.
+ * @return
+ * The form with filled-in default values.
+ */
+function _system_settings_form_variable_defaults($form) {
+ foreach (element_children($form) as $child) {
+ if (isset($form[$child]['#type'])) {
+ $info = _element_info($form[$child]['#type']);
+ // Only add the default value if #variable is not FALSE and the form item
+ // is used for input and it doesn't already have a #value or a
+ // #default_value.
+ if (isset($info['#input']) && $info['#input'] && (!isset($form[$child]['#variable']) || !$form[$child]['#variable']) && !isset($form[$child]['#value']) && !isset($form[$child]['#default_value'])) {
+ $form[$child]['#default_value'] = variable_get($child);
+ }
+ }
+ // Recursively do this for all children.
+ $form[$child] = _system_settings_form_variable_defaults($form[$child]);
+ }
+ return $form;
+}
+
+/**
* Execute the system_settings_form.
*
* If you want node type configure style handling of your checkboxes,
@@ -1250,7 +1358,7 @@ function system_node_type($op, $info) {
$old = 'toggle_node_info_' . $info->old_type;
$new = 'toggle_node_info_' . $info->type;
- $theme_settings = variable_get('theme_settings', array());
+ $theme_settings = variable_get('theme_settings');
if (isset($theme_settings[$old])) {
$theme_settings[$new] = $theme_settings[$old];
unset($theme_settings[$old]);
@@ -1324,7 +1432,7 @@ function confirm_form($form, $question,
*/
function system_admin_compact_mode() {
global $user;
- return (isset($user->admin_compact_mode)) ? $user->admin_compact_mode : variable_get('admin_compact_mode', FALSE);
+ return (isset($user->admin_compact_mode)) ? $user->admin_compact_mode : variable_get('admin_compact_mode');
}
/**
@@ -1882,7 +1990,7 @@ function system_mail($key, &$message, $p
$account = $params['account'];
$context = $params['context'];
$variables = array(
- '%site_name' => variable_get('site_name', 'Drupal'),
+ '%site_name' => variable_get('site_name'),
'%username' => $account->name,
);
if ($context['hook'] == 'taxonomy') {
@@ -1938,8 +2046,8 @@ function system_message_action_submit($f
function system_message_action(&$object, $context = array()) {
global $user;
$variables = array(
- '%site_name' => variable_get('site_name', 'Drupal'),
- '%username' => $user->name ? $user->name : variable_get('anonymous', t('Anonymous')),
+ '%site_name' => variable_get('site_name'),
+ '%username' => $user->name ? $user->name : variable_get('anonymous'),
);
// This action can be called in any context, but if placeholders
@@ -2032,7 +2140,7 @@ function _system_zonelist() {
$zones = array();
foreach ($zonelist as $offset) {
$zone = $offset * 3600;
- $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long', 'l, F j, Y - H:i') . ' O', $zone);
+ $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long') . ' O', $zone);
}
return $zones;
}
Index: modules/system/system.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.test,v
retrieving revision 1.9
diff -u -p -r1.9 system.test
--- modules/system/system.test 23 Jul 2008 07:37:06 -0000 1.9
+++ modules/system/system.test 25 Jul 2008 05:34:37 -0000
@@ -222,7 +222,7 @@ class CronRunTestCase extends DrupalWebT
$this->assertResponse(403);
// Run cron anonymously with the valid cron key.
- $key = variable_get('cron_key', 'drupal');
+ $key = variable_get('cron_key');
$this->drupalGet('cron.php', array('query' => 'cron_key=' . $key));
$this->assertResponse(200);
Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.27
diff -u -p -r1.27 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc 16 Jul 2008 21:59:28 -0000 1.27
+++ modules/taxonomy/taxonomy.admin.inc 25 Jul 2008 05:34:37 -0000
@@ -689,7 +689,7 @@ function taxonomy_form_term(&$form_state
// items so we check for taxonomy_override_selector before loading the
// full vocabulary. Contrib modules can then intercept before
// hook_form_alter to provide scalable alternatives.
- if (!variable_get('taxonomy_override_selector', FALSE)) {
+ if (!variable_get('taxonomy_override_selector')) {
$parent = array_keys(taxonomy_get_parents($edit['tid']));
$children = taxonomy_get_tree($vocabulary->vid, $edit['tid']);
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.425
diff -u -p -r1.425 taxonomy.module
--- modules/taxonomy/taxonomy.module 24 Jul 2008 16:25:19 -0000 1.425
+++ modules/taxonomy/taxonomy.module 25 Jul 2008 06:56:57 -0000
@@ -7,6 +7,15 @@
*/
/**
+ * Implementation of hook_variables().
+ */
+function taxonomy_variables() {
+ return array(
+ 'taxonomy_override_selector' => FALSE,
+ );
+}
+
+/**
* Implementation of hook_perm().
*/
function taxonomy_perm() {
@@ -484,7 +493,7 @@ function taxonomy_get_vocabularies($type
* and provide scalable alternatives.
*/
function taxonomy_form_alter(&$form, $form_state, $form_id) {
- if (isset($form['type']) && isset($form['#node']) && (!variable_get('taxonomy_override_selector', FALSE)) && $form['type']['#value'] . '_node_form' == $form_id) {
+ if (isset($form['type']) && isset($form['#node']) && (!variable_get('taxonomy_override_selector')) && $form['type']['#value'] . '_node_form' == $form_id) {
$node = $form['#node'];
if (!isset($node->taxonomy)) {
@@ -1106,10 +1115,10 @@ function taxonomy_select_nodes($tids = a
$sql = db_rewrite_sql($sql);
$sql_count = db_rewrite_sql($sql_count);
if ($pager) {
- $result = pager_query($sql, variable_get('default_nodes_main', 10), 0, $sql_count, $args);
+ $result = pager_query($sql, variable_get('default_nodes_main'), 0, $sql_count, $args);
}
else {
- $result = db_query_range($sql, $args, 0, variable_get('feed_default_items', 10));
+ $result = db_query_range($sql, $args, 0, variable_get('feed_default_items'));
}
}
@@ -1128,7 +1137,7 @@ function taxonomy_render_nodes($result)
$has_rows = TRUE;
}
if ($has_rows) {
- $output .= theme('pager', NULL, variable_get('default_nodes_main', 10), 0);
+ $output .= theme('pager', NULL, variable_get('default_nodes_main'), 0);
}
else {
$output .= '
';
$more_info = t("Depending on your server environment, these settings may be changed in the system-wide php.ini file, a php.ini file in your Drupal root directory, in your Drupal site's settings.php file, or in the .htaccess file in your Drupal root directory.");
if (!is_numeric($default_uploadsize) || ($default_uploadsize <= 0)) {
- form_set_error('upload_uploadsize_default', t('The %role file size limit must be a number and greater than zero.', array('%role' => t('default'))));
+ form_set_error('upload_uploadsize', t('The %role file size limit must be a number and greater than zero.', array('%role' => t('default'))));
}
if (!is_numeric($default_usersize) || ($default_usersize < 0)) {
- form_set_error('upload_usersize_default', t('The %role file size limit must be a number zero or greater.', array('%role' => t('default'))));
+ form_set_error('upload_usersize', t('The %role file size limit must be a number zero or greater.', array('%role' => t('default'))));
}
if ($default_uploadsize * 1024 * 1024 > file_upload_max_size()) {
- form_set_error('upload_uploadsize_default', $exceed_max_msg . $more_info);
+ form_set_error('upload_uploadsize', $exceed_max_msg . $more_info);
$more_info = '';
}
if ($default_usersize && $default_uploadsize > $default_usersize) {
- form_set_error('upload_uploadsize_default', t('The %role maximum file size per upload is greater than the total file size allowed per user', array('%role' => t('default'))));
+ form_set_error('upload_uploadsize', t('The %role maximum file size per upload is greater than the total file size allowed per user', array('%role' => t('default'))));
}
foreach ($form_state['values']['roles'] as $rid => $role) {
@@ -55,10 +55,6 @@ function upload_admin_settings_validate(
* Menu callback for the upload settings form.
*/
function upload_admin_settings() {
- $upload_extensions_default = variable_get('upload_extensions_default', 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp');
- $upload_uploadsize_default = variable_get('upload_uploadsize_default', 1);
- $upload_usersize_default = variable_get('upload_usersize_default', 1);
-
$form['settings_general'] = array(
'#type' => 'fieldset',
'#title' => t('General settings'),
@@ -67,7 +63,6 @@ function upload_admin_settings() {
$form['settings_general']['upload_max_resolution'] = array(
'#type' => 'textfield',
'#title' => t('Maximum resolution for uploaded images'),
- '#default_value' => variable_get('upload_max_resolution', 0),
'#size' => 15,
'#maxlength' => 10,
'#description' => t('The maximum allowed image size (e.g. 640x480). Set to 0 for no restriction. If an image toolkit is installed, files exceeding this value will be scaled down to fit.', array('!image-toolkit-link' => url('admin/settings/image-toolkit'))),
@@ -76,31 +71,27 @@ function upload_admin_settings() {
$form['settings_general']['upload_list_default'] = array(
'#type' => 'select',
'#title' => t('List files by default'),
- '#default_value' => variable_get('upload_list_default', 1),
'#options' => array(0 => t('No'), 1 => t('Yes')),
'#description' => t('Display attached files when viewing a post.'),
);
- $form['settings_general']['upload_extensions_default'] = array(
+ $form['settings_general']['upload_extensions'] = array(
'#type' => 'textfield',
'#title' => t('Default permitted file extensions'),
- '#default_value' => $upload_extensions_default,
'#maxlength' => 255,
'#description' => t('Default extensions that users can upload. Separate extensions with a space and do not include the leading dot.'),
);
- $form['settings_general']['upload_uploadsize_default'] = array(
+ $form['settings_general']['upload_uploadsize'] = array(
'#type' => 'textfield',
'#title' => t('Default maximum file size per upload'),
- '#default_value' => $upload_uploadsize_default,
'#size' => 5,
'#maxlength' => 5,
'#description' => t('The default maximum file size a user can upload. If an image is uploaded and a maximum resolution is set, the size will be checked after the file has been resized.'),
'#field_suffix' => t('MB'),
);
- $form['settings_general']['upload_usersize_default'] = array(
+ $form['settings_general']['upload_usersize'] = array(
'#type' => 'textfield',
'#title' => t('Default total file size per user'),
- '#default_value' => $upload_usersize_default,
'#size' => 7,
'#maxlength' => 7,
'#description' => t('The default maximum size of all files a user can have on the site. Set to 0 for no restriction. The least restrictive limit is used, so setting this to 0 will disable any role-specific total file size limits.'),
@@ -122,14 +113,12 @@ function upload_admin_settings() {
$form['settings_role_' . $rid]['upload_extensions_' . $rid] = array(
'#type' => 'textfield',
'#title' => t('Permitted file extensions'),
- '#default_value' => variable_get('upload_extensions_' . $rid, $upload_extensions_default),
'#maxlength' => 255,
'#description' => t('Extensions that users in this role can upload. Separate extensions with a space and do not include the leading dot.'),
);
$form['settings_role_' . $rid]['upload_uploadsize_' . $rid] = array(
'#type' => 'textfield',
'#title' => t('Maximum file size per upload'),
- '#default_value' => variable_get('upload_uploadsize_' . $rid, $upload_uploadsize_default),
'#size' => 5,
'#maxlength' => 5,
'#description' => t('The maximum size of a file a user can upload. If an image is uploaded and a maximum resolution is set, the size will be checked after the file has been resized.'),
@@ -138,7 +127,6 @@ function upload_admin_settings() {
$form['settings_role_' . $rid]['upload_usersize_' . $rid] = array(
'#type' => 'textfield',
'#title' => t('Total file size per user'),
- '#default_value' => variable_get('upload_usersize_' . $rid, $upload_usersize_default),
'#size' => 7,
'#maxlength' => 7,
'#description' => t('The maximum size of all files a user can have on the site. Set to 0 for no restriction.'),
Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.205
diff -u -p -r1.205 upload.module
--- modules/upload/upload.module 24 Jul 2008 16:25:19 -0000 1.205
+++ modules/upload/upload.module 1 Aug 2008 02:42:37 -0000
@@ -8,6 +8,20 @@
*/
/**
+ * Implementation of hook_variables().
+ */
+function upload_variables() {
+ return array(
+ 'upload_max_resolution' => 0,
+ 'upload_list_default' => 1,
+ 'upload_extensions' => 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp',
+ 'upload_uploadsize' => 1,
+ 'upload_usersize' => 1,
+ 'upload' => 1,
+ );
+}
+
+/**
* Implementation of hook_help().
*/
function upload_help($path, $arg) {
@@ -120,18 +134,18 @@ function upload_menu_alter(&$items) {
* A string specifying the maximum resolution of images.
*/
function _upload_file_limits($user) {
- $file_limit = variable_get('upload_uploadsize_default', 1);
- $user_limit = variable_get('upload_usersize_default', 1);
- $all_extensions = explode(' ', variable_get('upload_extensions_default', 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'));
+ $file_limit = variable_get('upload_uploadsize');
+ $user_limit = variable_get('upload_usersize');
+ $all_extensions = explode(' ', variable_get('upload_extensions'));
foreach ($user->roles as $rid => $name) {
- $extensions = variable_get("upload_extensions_$rid", variable_get('upload_extensions_default', 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'));
+ $extensions = variable_get("upload_extensions_$rid");
$all_extensions = array_merge($all_extensions, explode(' ', $extensions));
// A zero value indicates no limit, take the least restrictive limit.
- $file_size = variable_get("upload_uploadsize_$rid", variable_get('upload_uploadsize_default', 1)) * 1024 * 1024;
+ $file_size = variable_get("upload_uploadsize_$rid") * 1024 * 1024;
$file_limit = ($file_limit && $file_size) ? max($file_limit, $file_size) : 0;
- $user_size = variable_get("upload_usersize_$rid", variable_get('upload_usersize_default', 1)) * 1024 * 1024;
+ $user_size = variable_get("upload_usersize_$rid") * 1024 * 1024;
$user_limit = ($user_limit && $user_size) ? max($user_limit, $user_size) : 0;
}
$all_extensions = implode(' ', array_unique($all_extensions));
@@ -139,7 +153,7 @@ function _upload_file_limits($user) {
'extensions' => $all_extensions,
'file_size' => $file_limit,
'user_size' => $user_limit,
- 'resolution' => variable_get('upload_max_resolution', 0),
+ 'resolution' => variable_get('upload_max_resolution'),
);
}
@@ -179,7 +193,7 @@ function upload_node_form_submit($form,
// Save new file uploads.
if (($user->uid != 1 || user_access('upload files')) && ($file = file_save_upload('upload', $validators, file_directory_path()))) {
- $file->list = variable_get('upload_list_default', 1);
+ $file->list = variable_get('upload_list_default');
$file->description = $file->filename;
$file->weight = 0;
$_SESSION['upload_files'][$file->fid] = $file;
@@ -212,14 +226,14 @@ function upload_form_alter(&$form, $form
$form['workflow']['upload'] = array(
'#type' => 'radios',
'#title' => t('Attachments'),
- '#default_value' => variable_get('upload_' . $form['#node_type']->type, 1),
+ '#default_value' => variable_get('upload_' . $form['#node_type']->type),
'#options' => array(t('Disabled'), t('Enabled')),
);
}
if (isset($form['type']) && isset($form['#node'])) {
$node = $form['#node'];
- if ($form['type']['#value'] . '_node_form' == $form_id && variable_get("upload_$node->type", TRUE)) {
+ if ($form['type']['#value'] . '_node_form' == $form_id && variable_get("upload_$node->type")) {
// Attachments fieldset
$form['attachments'] = array(
'#type' => 'fieldset',
@@ -270,7 +284,7 @@ function upload_nodeapi(&$node, $op, $te
case 'load':
$output = '';
- if (variable_get("upload_$node->type", 1) == 1) {
+ if (variable_get("upload_$node->type") == 1) {
$output['files'] = upload_load($node);
return $output;
}
Index: modules/upload/upload.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.test,v
retrieving revision 1.3
diff -u -p -r1.3 upload.test
--- modules/upload/upload.test 6 Jun 2008 10:36:44 -0000 1.3
+++ modules/upload/upload.test 1 Aug 2008 01:01:25 -0000
@@ -29,9 +29,9 @@ class UploadTestCase extends DrupalWebTe
// Setup upload settings.
$edit = array();
$edit['upload_list_default'] = '1'; // Yes.
- $edit['upload_extensions_default'] = 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp';
- $edit['upload_uploadsize_default'] = '1.5';
- $edit['upload_usersize_default'] = '1.5';
+ $edit['upload_extensions'] = 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp';
+ $edit['upload_uploadsize'] = '1.5';
+ $edit['upload_usersize'] = '1.5';
$this->drupalPost('admin/settings/uploads', $edit, t('Save configuration'));
$this->assertText('The configuration options have been saved.', 'Upload setting saved.');
@@ -149,7 +149,12 @@ class UploadTestCase extends DrupalWebTe
function setUploadSettings($settings, $rid = NULL) {
$edit = array();
foreach ($settings as $key => $value) {
- $edit[$key . '_default'] = $value;
+ if ($key != 'upload_list') {
+ $edit[$key] = $value;
+ }
+ else {
+ $edit['upload_list_default'] = $value;
+ }
if ($rid !== NULL && $key != 'upload_list' && $key != 'upload_max_resolution') {
$edit[$key . '_' . $rid] = $value;
}
Index: modules/user/user.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v
retrieving revision 1.24
diff -u -p -r1.24 user.admin.inc
--- modules/user/user.admin.inc 24 Jul 2008 16:28:52 -0000 1.24
+++ modules/user/user.admin.inc 31 Jul 2008 20:04:21 -0000
@@ -231,9 +231,9 @@ function user_admin_account_validate($fo
function user_admin_settings() {
// User registration settings.
$form['registration'] = array('#type' => 'fieldset', '#title' => t('User registration settings'));
- $form['registration']['user_register'] = array('#type' => 'radios', '#title' => t('Public registrations'), '#default_value' => variable_get('user_register', 1), '#options' => array(t('Only site administrators can create new user accounts.'), t('Visitors can create accounts and no administrator approval is required.'), t('Visitors can create accounts but administrator approval is required.')));
- $form['registration']['user_email_verification'] = array('#type' => 'checkbox', '#title' => t('Require e-mail verification when a visitor creates an account'), '#default_value' => variable_get('user_email_verification', TRUE), '#description' => t('If this box is checked, new users will be required to validate their e-mail address prior to logging into the site, and will be assigned a system-generated password. With it unchecked, users will be logged in immediately upon registering, and may select their own passwords during registration.'));
- $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#default_value' => variable_get('user_registration_help', ''), '#description' => t('This text is displayed at the top of the user registration form and is useful for helping or instructing your users.'));
+ $form['registration']['user_register'] = array('#type' => 'radios', '#title' => t('Public registrations'), '#options' => array(t('Only site administrators can create new user accounts.'), t('Visitors can create accounts and no administrator approval is required.'), t('Visitors can create accounts but administrator approval is required.')));
+ $form['registration']['user_email_verification'] = array('#type' => 'checkbox', '#title' => t('Require e-mail verification when a visitor creates an account'), '#description' => t('If this box is checked, new users will be required to validate their e-mail address prior to logging into the site, and will be assigned a system-generated password. With it unchecked, users will be logged in immediately upon registering, and may select their own passwords during registration.'));
+ $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#description' => t('This text is displayed at the top of the user registration form and is useful for helping or instructing your users.'));
// User e-mail settings.
$form['email'] = array(
@@ -249,7 +249,7 @@ function user_admin_settings() {
'#type' => 'fieldset',
'#title' => t('Welcome, new user created by administrator'),
'#collapsible' => TRUE,
- '#collapsed' => (variable_get('user_register', 1) != 0),
+ '#collapsed' => (variable_get('user_register') != 0),
'#description' => t('Customize welcome e-mail messages sent to new member accounts created by an administrator.') . ' ' . $email_token_help,
);
$form['email']['admin_created']['user_mail_register_admin_created_subject'] = array(
@@ -269,7 +269,7 @@ function user_admin_settings() {
'#type' => 'fieldset',
'#title' => t('Welcome, no approval required'),
'#collapsible' => TRUE,
- '#collapsed' => (variable_get('user_register', 1) != 1),
+ '#collapsed' => (variable_get('user_register') != 1),
'#description' => t('Customize welcome e-mail messages sent to new members upon registering, when no administrator approval is required.') . ' ' . $email_token_help
);
$form['email']['no_approval_required']['user_mail_register_no_approval_required_subject'] = array(
@@ -289,7 +289,7 @@ function user_admin_settings() {
'#type' => 'fieldset',
'#title' => t('Welcome, awaiting administrator approval'),
'#collapsible' => TRUE,
- '#collapsed' => (variable_get('user_register', 1) != 2),
+ '#collapsed' => (variable_get('user_register') != 2),
'#description' => t('Customize welcome e-mail messages sent to new members upon registering, when administrative approval is required.') . ' ' . $email_token_help,
);
$form['email']['pending_approval']['user_mail_register_pending_approval_subject'] = array(
@@ -335,7 +335,6 @@ function user_admin_settings() {
$form['email']['activated']['user_mail_status_activated_notify'] = array(
'#type' => 'checkbox',
'#title' => t('Notify user when account is activated.'),
- '#default_value' => variable_get('user_mail_status_activated_notify', TRUE),
);
$form['email']['activated']['user_mail_status_activated_subject'] = array(
'#type' => 'textfield',
@@ -360,7 +359,6 @@ function user_admin_settings() {
$form['email']['blocked']['user_mail_status_blocked_notify'] = array(
'#type' => 'checkbox',
'#title' => t('Notify user when account is blocked.'),
- '#default_value' => variable_get('user_mail_status_blocked_notify', FALSE),
);
$form['email']['blocked']['user_mail_status_blocked_subject'] = array(
'#type' => 'textfield',
@@ -385,7 +383,6 @@ function user_admin_settings() {
$form['email']['deleted']['user_mail_status_deleted_notify'] = array(
'#type' => 'checkbox',
'#title' => t('Notify user when account is deleted.'),
- '#default_value' => variable_get('user_mail_status_deleted_notify', FALSE),
);
$form['email']['deleted']['user_mail_status_deleted_subject'] = array(
'#type' => 'textfield',
@@ -408,13 +405,12 @@ function user_admin_settings() {
$form['signatures']['user_signatures'] = array(
'#type' => 'radios',
'#title' => t('Signature support'),
- '#default_value' => variable_get('user_signatures', 0),
'#options' => array(t('Disabled'), t('Enabled')),
);
// If picture support is enabled, check whether the picture directory exists:
- if (variable_get('user_pictures', 0)) {
- $picture_path = file_create_path(variable_get('user_picture_path', 'pictures'));
+ if (variable_get('user_pictures')) {
+ $picture_path = file_create_path(variable_get('user_picture_path'));
file_check_directory($picture_path, 1, 'user_picture_path');
}
@@ -422,11 +418,10 @@ function user_admin_settings() {
'#type' => 'fieldset',
'#title' => t('Pictures'),
);
- $picture_support = variable_get('user_pictures', 0);
+ $picture_support = variable_get('user_pictures');
$form['pictures']['user_pictures'] = array(
'#type' => 'radios',
'#title' => t('Picture support'),
- '#default_value' => $picture_support,
'#options' => array(t('Disabled'), t('Enabled')),
'#prefix' => '" . l(variable_get('site_name', 'drupal'), "") . "
";
+ $output .= " " . l(variable_get('site_name'), "") . "
";
}
if (theme_get_setting('toggle_slogan')) {
- $output .= "