summaryrefslogtreecommitdiff
path: root/modules/aggregator.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-10-11 19:44:35 +0000
committerDries Buytaert <dries@buytaert.net>2005-10-11 19:44:35 +0000
commit75fe6b6c0ae85d2b53cb803d5b028b050fd6d454 (patch)
tree70ea02551300ed5a696b4d289cfc4722924d58ca /modules/aggregator.module
parentecf5ed57d66a182ae0e269942169e0a6cf3a3912 (diff)
downloadbrdo-75fe6b6c0ae85d2b53cb803d5b028b050fd6d454.tar.gz
brdo-75fe6b6c0ae85d2b53cb803d5b028b050fd6d454.tar.bz2
- Patch #33752 by chx, adrian, et al: another batch of form API changes/fixes.
Diffstat (limited to 'modules/aggregator.module')
-rw-r--r--modules/aggregator.module80
1 files changed, 40 insertions, 40 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module
index 2efcf03b0..58a5ef224 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -73,27 +73,27 @@ function aggregator_settings() {
$period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval');
$form['aggregator_allowed_html_tags'] = array(
- type => 'textfield', title => t('Allowed HTML tags'), size => 80, maxlength => 255,
- default_value => variable_get('aggregator_allowed_html_tags', '<a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>'),
- description => t('The list of tags which are allowed in feeds, i.e., which will not be removed by Drupal.')
+ '#type' => 'textfield', '#title' => t('Allowed HTML tags'), '#size' => 80, '#maxlength' => 255,
+ '#default_value' => variable_get('aggregator_allowed_html_tags', '<a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>'),
+ '#description' => t('The list of tags which are allowed in feeds, i.e., which will not be 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,
- description => t('The number of items which will be shown with each feed or category in the feed and category summary pages.')
+ '#type' => 'select', '#title' => t('Items shown in sources and categories pages') ,
+ '#default_value' => variable_get('aggregator_summary_items', 3), '#options' => $items,
+ '#description' => t('The number of items which will be shown with each feed or category in the feed and category summary pages.')
);
$form['aggregator_clear'] = array(
- type => 'select', title => t('Discard news items older than'),
- default_value => variable_get('aggregator_clear', 9676800), options => $period,
- description => t('Older news items will be automatically discarded. Requires crontab.')
+ '#type' => 'select', '#title' => t('Discard news items older than'),
+ '#default_value' => variable_get('aggregator_clear', 9676800), '#options' => $period,
+ '#description' => t('Older news items will be automatically discarded. Requires crontab.')
);
$form['aggregator_category_selector'] = array(
- type => 'radios', title => t('Category selection type'), default_value => variable_get('aggregator_category_selector', 'check'),
- options => array('check' => t('checkboxes'), 'select' => t('multiple selector')),
- description => t('The type of category selection widget which is shown on categorization pages. Checkboxes are easier to use; a multiple selector is good for working with large numbers of categories.')
+ '#type' => 'radios', '#title' => t('Category selection type'), '#default_value' => variable_get('aggregator_category_selector', 'check'),
+ '#options' => array('check' => t('checkboxes'), 'select' => t('multiple selector')),
+ '#description' => t('The type of category selection widget which is shown on categorization pages. Checkboxes are easier to use; a multiple selector is good for working with large numbers of categories.')
);
return $form;
}
@@ -237,7 +237,7 @@ function aggregator_block($op, $delta = 0, $edit = array()) {
else {
$value = db_result(db_query('SELECT block FROM {aggregator_feed} WHERE fid = %d', $id));
}
- $form['block'] = array(type => 'select', title => t('Number of news items in block'), default_value => $value, options => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
+ $form['block'] = array('#type' => 'select', '#title' => t('Number of news items in block'), '#default_value' => $value, '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
return $form;
}
else if ($op == 'save') {
@@ -471,8 +471,8 @@ function aggregator_refresh($feed) {
cache_clear_all();
- watchdog('aggregator', t('There is new syndicated content from %site.', array('%site' => theme('placeholder', $feed[title]))));
- drupal_set_message(t('There is new syndicated content from %site.', array('%site' => theme('placeholder', $feed[title]))));
+ watchdog('aggregator', t('There is new syndicated content from %site.', array('%site' => theme('placeholder', $feed['#title']))));
+ drupal_set_message(t('There is new syndicated content from %site.', array('%site' => theme('placeholder', $feed['#title']))));
}
break;
default:
@@ -675,13 +675,13 @@ function aggregator_save_item($edit) {
}
function aggregator_form_category($edit = array()) {
- $form['title'] = array(type => 'textfield', title => t('Title'), default_value => $edit['title'], size => 60, maxlength => 64);
- $form['description'] = array(type => 'textarea', title => t('Description'), default_value => $edit['description'], cols => 60, rows => 5);
- $form['submit'] = array(type => 'submit', value =>t('Submit'));
+ $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $edit['title'], '#size' => 60, '#maxlength' => 64);
+ $form['description'] = array('#type' => 'textarea', '#title' => t('Description'), '#default_value' => $edit['description'], '#cols' => 60, '#rows' => 5);
+ $form['submit'] = array('#type' => 'submit', '#value' =>t('Submit'));
if ($edit['cid']) {
- $form['delete'] = array(type => 'submit', value =>t('Delete'));
- $form['cid'] = array(type => 'hidden', value => $edit['cid']);
+ $form['delete'] = array('#type' => 'submit', '#value' =>t('Delete'));
+ $form['cid'] = array('#type' => 'hidden', '#value' => $edit['cid']);
}
return drupal_get_form('aggregator_form_category', $form);
@@ -709,9 +709,9 @@ function aggregator_form_feed($edit = array()) {
}
- $form['title'] = array(type => 'textfield', title => t('Title'), default_value => $edit['title'], size => 60, maxlength => 64, description => t('The name of the feed; typically the name of the web site you syndicate content from.'));
- $form['url'] = array(type => 'textfield', title => t('URL'), default_value => $edit['url'], size => 60, maxlength => 255, description => t('The fully-qualified URL of the feed.'));
- $form['refresh'] = array(type => 'select', title => t('Update interval'), default_value => $edit['refresh'], options => $period, description => t('The refresh interval indicating how often you want to update this feed. Requires crontab.'));
+ $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $edit['title'], '#size' => 60, '#maxlength' => 64, '#description' => t('The name of the feed; typically the name of the web site you syndicate content from.'));
+ $form['url'] = array('#type' => 'textfield', '#title' => t('URL'), '#default_value' => $edit['url'], '#size' => 60, '#maxlength' => 255, '#description' => t('The fully-qualified URL of the feed.'));
+ $form['refresh'] = array('#type' => 'select', '#title' => t('Update interval'), '#default_value' => $edit['refresh'], '#options' => $period, '#description' => t('The refresh interval indicating how often you want to update this feed. Requires crontab.'));
// Handling of categories:
$options = array();
@@ -722,13 +722,13 @@ function aggregator_form_feed($edit = array()) {
if ($category->fid) $values[] = check_plain($category->cid);
}
if ($options) {
- $form['category'] = array(type => 'checkboxes', title => t('Categorize news items'), default_value => $values, options => $options, description => t('New items in this feed will be automatically filed in the checked categories as they are received.'));
+ $form['category'] = array('#type' => 'checkboxes', '#title' => t('Categorize news items'), '#default_value' => $values, '#options' => $options, '#description' => t('New items in this feed will be automatically filed in the checked categories as they are received.'));
}
- $form['submit'] = array(type => 'submit', value =>t('Submit'));
+ $form['submit'] = array('#type' => 'submit', '#value' =>t('Submit'));
if ($edit['fid']) {
- $form['delete'] = array(type => 'submit', value =>t('Delete'));
- $form['fid'] = array(type => 'hidden', value => $edit['fid']);
+ $form['delete'] = array('#type' => 'submit', '#value' =>t('Delete'));
+ $form['fid'] = array('#type' => 'hidden', '#value' => $edit['fid']);
}
return drupal_get_form('aggregator_form_feed', $form);
@@ -961,14 +961,14 @@ function _aggregator_page_list($sql, $op, $header = '') {
$output = '<div id="aggregator">';
- $form['header'] = array(value => $header);
- $output .= $form['header'][value];
+ $form['header'] = array('#value' => $header);
+ $output .= $form['header']['#value'];
$result = pager_query($sql, 20);
$categories = array();
while ($item = db_fetch_object($result)) {
- $form['items'][$item->iid] = array(value => theme('aggregator_page_item', $item));
- $output .= $form['items'][$item->iid][value];
+ $form['items'][$item->iid] = array('#value' => theme('aggregator_page_item', $item));
+ $output .= $form['items'][$item->iid]['#value'];
$form['categories'][$item->iid] = array();
if ($categorize) {
@@ -985,26 +985,26 @@ function _aggregator_page_list($sql, $op, $header = '') {
}
$done = true;
$form['categories'][$item->iid] = array(
- type => variable_get('aggregator_category_selector', 'checkboxes'),
- default_value => $selected, options => $categories,
- size => 10, multiple => true
+ '#type' => variable_get('aggregator_category_selector', 'checkboxes'),
+ '#default_value' => $selected, '#options' => $categories,
+ '#size' => 10, '#multiple' => true
);
}
}
$output .= '</div>';
- $form['submit'] = array(type => 'submit', value => t('Save categories'));
- $form['pager'] = array(value => theme('pager', NULL, 20, 0));
- $output .= $form['pager'][value];
+ $form['submit'] = array('#type' => 'submit', '#value' => t('Save categories'));
+ $form['pager'] = array('#value' => theme('pager', NULL, 20, 0));
+ $output .= $form['pager']['#value'];
// arg(1) is undefined if we are at the top aggregator URL
// is there a better way to do this?
if (!arg(1)) {
- $form['xml_icon'] = array(value => theme('xml_icon', url('aggregator/rss')));
+ $form['xml_icon'] = array('#value' => theme('xml_icon', url('aggregator/rss')));
}
elseif (arg(1) == 'categories' && arg(2) && !arg(3)) {
- $form['xml_icon'] = array(value => theme('xml_icon', url('aggregator/rss/' . arg(2))));
+ $form['xml_icon'] = array('#value' => theme('xml_icon', url('aggregator/rss/' . arg(2))));
}
- $output .= $form['xml_icon'][value];
+ $output .= $form['xml_icon']['#value'];
return ($categorize) ? drupal_get_form('aggregator_page_list', $form) : $output;
}