Commit aeed4cd8 authored by Dries's avatar Dries

- Patch #35644 by webchick: forms API simplificiations.

parent 64a617c2
......@@ -100,7 +100,7 @@ function _locale_admin_manage_add_screen() {
$form = array();
$form['header'] = array('#prefix' => '<h2>', '#value' => t('Custom language') , '#suffix' => '</h2>');
$form['langcode'] = array('#type' => 'textfield', '#title' => t('Language code'), '#default_value' => $edit['langcode'], '#size' => 12, '#maxlength' => 60, '#description' => t("Commonly this is an <a href=\"%iso-codes\">ISO 639 language code</a> with an optional country code for regional variants. Examples include 'en', 'en-US' and 'zh-cn'.", array('%iso-codes' => 'http://www.w3.org/WAI/ER/IG/ert/iso639.htm')));
$form['langname'] = array('#type' => 'textfield', '#title' => t('Language name in English'), '#default_value' => $edit['langname'], '#size' => 60, '#maxlength' => 64, '#description' => t('Name of the language. Will be available for translation in all languages.'));
$form['langname'] = array('#type' => 'textfield', '#title' => t('Language name in English'), '#default_value' => $edit['langname'], '#maxlength' => 64, '#description' => t('Name of the language. Will be available for translation in all languages.'));
$form['submit'] = array('#type' => 'submit', '#value' => t('Add custom language'));
$output .= drupal_get_form('_locale_custom_language', $form);
......@@ -980,15 +980,15 @@ function _locale_string_edit($lid) {
while ($translation = db_fetch_object($result)) {
$orig = $translation->source;
$form[$translation->locale] = (strlen($orig) > 40) ?
array('#type' => 'textarea', '#title' => $languages['name'][$translation->locale], '#default_value' => $translation->translation, '#cols' => 60, '#rows' => 15)
: array('#type' => 'textfield', '#title' => $languages['name'][$translation->locale], '#default_value' => $translation->translation, '#size' => 60, '#maxlength' => 128);
array('#type' => 'textarea', '#title' => $languages['name'][$translation->locale], '#default_value' => $translation->translation, '#rows' => 15)
: array('#type' => 'textfield', '#title' => $languages['name'][$translation->locale], '#default_value' => $translation->translation);
unset($languages['name'][$translation->locale]);
}
$form['item'] = array('#type' => 'item', '#title' => t('Original text'), '#value' => wordwrap(check_plain($orig, 0)));
foreach ($languages['name'] as $key => $lang) {
$form[$key] = (strlen($orig) > 40) ?
array('#type' => 'textarea', '#title' => $lang, '#cols' => 60, '#rows' => 15) :
array('#type' => 'textfield', '#title' => $lang, '#size' => 60, '#maxlength' => 128);
array('#type' => 'textarea', '#title' => $lang, '#rows' => 15) :
array('#type' => 'textfield', '#title' => $lang);
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Save translations'));
......
......@@ -645,8 +645,8 @@ 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['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $edit['title'], '#maxlength' => 64);
$form['description'] = array('#type' => 'textarea', '#title' => t('Description'), '#default_value' => $edit['description']);
$form['submit'] = array('#type' => 'submit', '#value' =>t('Submit'));
if ($edit['cid']) {
......@@ -679,8 +679,8 @@ 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['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $edit['title'], '#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'], '#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:
......
......@@ -645,8 +645,8 @@ 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['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $edit['title'], '#maxlength' => 64);
$form['description'] = array('#type' => 'textarea', '#title' => t('Description'), '#default_value' => $edit['description']);
$form['submit'] = array('#type' => 'submit', '#value' =>t('Submit'));
if ($edit['cid']) {
......@@ -679,8 +679,8 @@ 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['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $edit['title'], '#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'], '#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:
......
......@@ -334,7 +334,6 @@ function block_admin_configure($module = NULL, $delta = 0) {
$form['block_settings'] = array('#type' => 'fieldset',
'#title' => t('Block specific settings'),
'#collapsible' => true,
'#collapsed' => false,
'#weight' => 0);
foreach ($settings as $k => $v) {
......@@ -351,7 +350,6 @@ function block_admin_configure($module = NULL, $delta = 0) {
$form['user_vis_settings'] = array('#type' => 'fieldset',
'#title' => t('User specific visibility settings'),
'#collapsible' => true,
'#collapsed' => false,
'#weight' => 0);
$form['user_vis_settings']['custom'] = array(
......@@ -365,7 +363,6 @@ function block_admin_configure($module = NULL, $delta = 0) {
$form['page_vis_settings'] = array('#type' => 'fieldset',
'#title' => t('Page specific visibility settings'),
'#collapsible' => true,
'#collapsed' => false,
'#weight' => 0);
......@@ -380,8 +377,6 @@ function block_admin_configure($module = NULL, $delta = 0) {
'#type' => 'textarea',
'#title' => t('Pages'),
'#default_value' => $edit['pages'],
'#cols' => 60,
'#rows' => 5,
'#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '%blog' for the blog page and %blog1 for every personal blog. %front is the front page. If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.", array('%blog' => theme('placeholder', 'blog'), '%blog1' => theme('placeholder', 'blog/*'), '%front' => theme('placeholder', '<front>'), '%php' => theme('placeholder', '<?php ?>'))));
$form['submit'] = array('#type' => 'submit', '#value' => t('Save block'));
......@@ -436,10 +431,10 @@ function block_box_delete_confirm_execute($form_id, $edit) {
function block_box_form($edit = array()) {
$form['title'] = array('#type' => 'textfield', '#title' => t('Block title'), '#default_value' => $edit['title'], '#size' => 60, '#maxlength' => 64, '#description' => t('The title of the block as shown to the user.'));
$form['title'] = array('#type' => 'textfield', '#title' => t('Block title'), '#default_value' => $edit['title'], '#maxlength' => 64, '#description' => t('The title of the block as shown to the user.'));
$form['format'] = filter_form($edit['format']);
$form['body'] = array('#type' => 'textarea', '#title' => t('Block body'), '#default_value' => $edit['body'], '#cols' => 60, '#rows' => 15, '#description' => t('The content of the block as shown to the user.'));
$form['info'] = array('#type' => 'textfield', '#title' => t('Block description'), '#default_value' => $edit['info'], '#size' => 60, '#maxlength' => 64, '#description' => t('A brief description of your block. Used on the <a href="%overview">block overview page</a>.', array('%overview' => url('admin/block'))), '#required' => TRUE);
$form['body'] = array('#type' => 'textarea', '#title' => t('Block body'), '#default_value' => $edit['body'], '#rows' => 15, '#description' => t('The content of the block as shown to the user.'));
$form['info'] = array('#type' => 'textfield', '#title' => t('Block description'), '#default_value' => $edit['info'], '#maxlength' => 64, '#description' => t('A brief description of your block. Used on the <a href="%overview">block overview page</a>.', array('%overview' => url('admin/block'))), '#required' => TRUE);
return $form;
}
......@@ -489,7 +484,7 @@ function block_user($type, $edit, &$user, $category = NULL) {
case 'form':
if ($category == 'account') {
$result = db_query('SELECT * FROM {blocks} WHERE status = 1 AND custom != 0 ORDER BY weight, module, delta');
$form['block'] = array('#type' => 'fieldset', '#title' => t('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#collapsed' => FALSE, '#tree' => TRUE);
$form['block'] = array('#type' => 'fieldset', '#title' => t('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#tree' => TRUE);
while ($block = db_fetch_object($result)) {
$data = module_invoke($block->module, 'block', 'list');
if ($data[$block->delta]['info']) {
......
......@@ -334,7 +334,6 @@ function block_admin_configure($module = NULL, $delta = 0) {
$form['block_settings'] = array('#type' => 'fieldset',
'#title' => t('Block specific settings'),
'#collapsible' => true,
'#collapsed' => false,
'#weight' => 0);
foreach ($settings as $k => $v) {
......@@ -351,7 +350,6 @@ function block_admin_configure($module = NULL, $delta = 0) {
$form['user_vis_settings'] = array('#type' => 'fieldset',
'#title' => t('User specific visibility settings'),
'#collapsible' => true,
'#collapsed' => false,
'#weight' => 0);
$form['user_vis_settings']['custom'] = array(
......@@ -365,7 +363,6 @@ function block_admin_configure($module = NULL, $delta = 0) {
$form['page_vis_settings'] = array('#type' => 'fieldset',
'#title' => t('Page specific visibility settings'),
'#collapsible' => true,
'#collapsed' => false,
'#weight' => 0);
......@@ -380,8 +377,6 @@ function block_admin_configure($module = NULL, $delta = 0) {
'#type' => 'textarea',
'#title' => t('Pages'),
'#default_value' => $edit['pages'],
'#cols' => 60,
'#rows' => 5,
'#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '%blog' for the blog page and %blog1 for every personal blog. %front is the front page. If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.", array('%blog' => theme('placeholder', 'blog'), '%blog1' => theme('placeholder', 'blog/*'), '%front' => theme('placeholder', '<front>'), '%php' => theme('placeholder', '<?php ?>'))));
$form['submit'] = array('#type' => 'submit', '#value' => t('Save block'));
......@@ -436,10 +431,10 @@ function block_box_delete_confirm_execute($form_id, $edit) {
function block_box_form($edit = array()) {
$form['title'] = array('#type' => 'textfield', '#title' => t('Block title'), '#default_value' => $edit['title'], '#size' => 60, '#maxlength' => 64, '#description' => t('The title of the block as shown to the user.'));
$form['title'] = array('#type' => 'textfield', '#title' => t('Block title'), '#default_value' => $edit['title'], '#maxlength' => 64, '#description' => t('The title of the block as shown to the user.'));
$form['format'] = filter_form($edit['format']);
$form['body'] = array('#type' => 'textarea', '#title' => t('Block body'), '#default_value' => $edit['body'], '#cols' => 60, '#rows' => 15, '#description' => t('The content of the block as shown to the user.'));
$form['info'] = array('#type' => 'textfield', '#title' => t('Block description'), '#default_value' => $edit['info'], '#size' => 60, '#maxlength' => 64, '#description' => t('A brief description of your block. Used on the <a href="%overview">block overview page</a>.', array('%overview' => url('admin/block'))), '#required' => TRUE);
$form['body'] = array('#type' => 'textarea', '#title' => t('Block body'), '#default_value' => $edit['body'], '#rows' => 15, '#description' => t('The content of the block as shown to the user.'));
$form['info'] = array('#type' => 'textfield', '#title' => t('Block description'), '#default_value' => $edit['info'], '#maxlength' => 64, '#description' => t('A brief description of your block. Used on the <a href="%overview">block overview page</a>.', array('%overview' => url('admin/block'))), '#required' => TRUE);
return $form;
}
......@@ -489,7 +484,7 @@ function block_user($type, $edit, &$user, $category = NULL) {
case 'form':
if ($category == 'account') {
$result = db_query('SELECT * FROM {blocks} WHERE status = 1 AND custom != 0 ORDER BY weight, module, delta');
$form['block'] = array('#type' => 'fieldset', '#title' => t('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#collapsed' => FALSE, '#tree' => TRUE);
$form['block'] = array('#type' => 'fieldset', '#title' => t('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#tree' => TRUE);
while ($block = db_fetch_object($result)) {
$data = module_invoke($block->module, 'block', 'list');
if ($data[$block->delta]['info']) {
......
......@@ -228,7 +228,7 @@ function blog_form(&$node) {
}
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#size' => 60, '#maxlength' => 128, '#required' => TRUE, '#default_value' => $node->title);
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
$form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE);
$form = array_merge($form, filter_form($node->format));
return $form;
......
......@@ -228,7 +228,7 @@ function blog_form(&$node) {
}
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#size' => 60, '#maxlength' => 128, '#required' => TRUE, '#default_value' => $node->title);
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
$form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE);
$form = array_merge($form, filter_form($node->format));
return $form;
......
......@@ -247,7 +247,7 @@ function book_form(&$node) {
'#description' => t('The parent that this page belongs in. Note that pages whose parent is &lt;top-level&gt; are regarded as independent, top-level books.')
);
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#size' => 60, '#maxlength' => 128, '#required' => TRUE, '#default_value' => $node->title);
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
$form['body'] = array(
'#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE
);
......@@ -257,7 +257,7 @@ function book_form(&$node) {
'#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE
);
$form['log']['message'] = array(
'#type' => 'textarea', '#default_value' => $node->log, '#rows' => 5, '#weight' => 18,
'#type' => 'textarea', '#default_value' => $node->log, '#weight' => 18,
'#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.')
);
......@@ -322,7 +322,7 @@ function book_outline() {
);
$form['log'] = array(
'#type' => 'textarea', '#title' => t('Log message'), '#cols' => 60, '#rows' => 5,
'#type' => 'textarea', '#title' => t('Log message'),
'#default_value' => $node->log, '#description' => t('An explanation to help other authors understand your motivations to put this post into the book.')
);
......@@ -986,7 +986,7 @@ function book_node_visitor_opml_post($node, $depth) {
*/
function book_admin_edit_line($node, $depth = 0) {
$form['#tree'] = TRUE;
$form[$node->nid]['title'] = array('#type' => 'textfield', '#default_value' => $node->title, '#size' => 60, '#maxlength' => 255);
$form[$node->nid]['title'] = array('#type' => 'textfield', '#default_value' => $node->title, '#maxlength' => 255);
$form[$node->nid]['weight'] = array('#type' => 'weight', '#default_value' => $node->weight, '#delta' => 15);
$form['depth'] = array('#value' => $depth);
$form['nid'] = array('#value' => $node->nid);
......
......@@ -247,7 +247,7 @@ function book_form(&$node) {
'#description' => t('The parent that this page belongs in. Note that pages whose parent is &lt;top-level&gt; are regarded as independent, top-level books.')
);
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#size' => 60, '#maxlength' => 128, '#required' => TRUE, '#default_value' => $node->title);
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
$form['body'] = array(
'#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE
);
......@@ -257,7 +257,7 @@ function book_form(&$node) {
'#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE
);
$form['log']['message'] = array(
'#type' => 'textarea', '#default_value' => $node->log, '#rows' => 5, '#weight' => 18,
'#type' => 'textarea', '#default_value' => $node->log, '#weight' => 18,
'#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.')
);
......@@ -322,7 +322,7 @@ function book_outline() {
);
$form['log'] = array(
'#type' => 'textarea', '#title' => t('Log message'), '#cols' => 60, '#rows' => 5,
'#type' => 'textarea', '#title' => t('Log message'),
'#default_value' => $node->log, '#description' => t('An explanation to help other authors understand your motivations to put this post into the book.')
);
......@@ -986,7 +986,7 @@ function book_node_visitor_opml_post($node, $depth) {
*/
function book_admin_edit_line($node, $depth = 0) {
$form['#tree'] = TRUE;
$form[$node->nid]['title'] = array('#type' => 'textfield', '#default_value' => $node->title, '#size' => 60, '#maxlength' => 255);
$form[$node->nid]['title'] = array('#type' => 'textfield', '#default_value' => $node->title, '#maxlength' => 255);
$form[$node->nid]['weight'] = array('#type' => 'weight', '#default_value' => $node->weight, '#delta' => 15);
$form['depth'] = array('#value' => $depth);
$form['nid'] = array('#value' => $node->nid);
......
......@@ -249,8 +249,8 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
function comment_user($type, $edit, &$user, $category = NULL) {
if ($type == 'form' && $category == 'account') {
// when user tries to edit his own data
$form['comment_settings'] = array('#type' => 'fieldset', '#title' => t('Comment settings'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#weight' => 4);
$form['comment_settings']['signature'] = array('#type' => 'textarea', '#title' => t('Signature'), '#default_value' => $edit['comment_settings']['signature'], '#cols' => 60, '#rows' => 5, '#description' => ('Your signature will be publicly displayed at the end of your comments.'));
$form['comment_settings'] = array('#type' => 'fieldset', '#title' => t('Comment settings'), '#collapsible' => TRUE, '#weight' => 4);
$form['comment_settings']['signature'] = array('#type' => 'textarea', '#title' => t('Signature'), '#default_value' => $edit['comment_settings']['signature'], '#description' => ('Your signature will be publicly displayed at the end of your comments.'));
return $form;
}
......@@ -1108,10 +1108,10 @@ function comment_form($edit, $title = NULL) {
}
if (variable_get('comment_subject_field', 1) == 1) {
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#size' => 60, '#maxlength' => 64, '#default_value' => $edit['subject']);
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => $edit['subject']);
}
$form['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#cols' => 60, '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE
$form['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE
);
$form = array_merge($form, filter_form($node->format));
......
......@@ -249,8 +249,8 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
function comment_user($type, $edit, &$user, $category = NULL) {
if ($type == 'form' && $category == 'account') {
// when user tries to edit his own data
$form['comment_settings'] = array('#type' => 'fieldset', '#title' => t('Comment settings'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#weight' => 4);
$form['comment_settings']['signature'] = array('#type' => 'textarea', '#title' => t('Signature'), '#default_value' => $edit['comment_settings']['signature'], '#cols' => 60, '#rows' => 5, '#description' => ('Your signature will be publicly displayed at the end of your comments.'));
$form['comment_settings'] = array('#type' => 'fieldset', '#title' => t('Comment settings'), '#collapsible' => TRUE, '#weight' => 4);
$form['comment_settings']['signature'] = array('#type' => 'textarea', '#title' => t('Signature'), '#default_value' => $edit['comment_settings']['signature'], '#description' => ('Your signature will be publicly displayed at the end of your comments.'));
return $form;
}
......@@ -1108,10 +1108,10 @@ function comment_form($edit, $title = NULL) {
}
if (variable_get('comment_subject_field', 1) == 1) {
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#size' => 60, '#maxlength' => 64, '#default_value' => $edit['subject']);
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => $edit['subject']);
}
$form['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#cols' => 60, '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE
$form['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE
);
$form = array_merge($form, filter_form($node->format));
......
......@@ -70,7 +70,7 @@ function contact_menu($may_cache) {
*/
function contact_settings() {
$form['contact_form_information'] = array(
'#type' => 'textarea', '#title' => t('Additional information'), '#cols' => 60, '#rows' => 5,
'#type' => 'textarea', '#title' => t('Additional information'),
'#default_value' => variable_get('contact_form_information', t('You can leave us a message using the contact form below.')),
'#description' => t('Information to show on the <a href="%form">contact page</a>. Can be anything from submission guidelines to your postal address or telephone number.', array('%form' => url('contact')))
);
......@@ -84,8 +84,8 @@ function contact_settings() {
*/
function contact_user($type, $edit, &$user, $category = NULL) {
if ($type == 'form' && $category == 'account') {
$form['contact'] = array('#type' => 'fieldset', '#title' => t('Contact settings'), '#weight' => 5, '#collapsible' => TRUE, '#collapsed' => FALSE);
$form['contact']['contact'] = array('#type' => 'checkbox', '#title' => t('Personal contact form'), '#return_value' => 1, '#default_value' => $edit['contact'], '#description' => t('Allow other users to contact you by e-mail via <a href="%url">your personal contact form</a>. Note that your e-mail address is not made public and that privileged users such as site administrators are able to contact you even if you choose not to enable this feature.', array('%url' => url("user/$user->uid/contact"))));
$form['contact'] = array('#type' => 'fieldset', '#title' => t('Contact settings'), '#weight' => 5, '#collapsible' => TRUE);
$form['contact']['contact'] = array('#type' => 'checkbox', '#title' => t('Personal contact form'), '#default_value' => $edit['contact'], '#description' => t('Allow other users to contact you by e-mail via <a href="%url">your personal contact form</a>. Note that your e-mail address is not made public and that privileged users such as site administrators are able to contact you even if you choose not to enable this feature.', array('%url' => url("user/$user->uid/contact"))));
return $form;
//return array(array('title' => t('Contact settings'), 'data' => drupal_get_form('contact_user', $form), 'weight' => 2));
}
......@@ -116,8 +116,8 @@ function contact_mail_user() {
$form['#token'] = $user->name . $user->mail;
$form['from'] = array('#type' => 'item', '#title' => t('From'), '#value' => $user->name .' &lt;'. $user->mail .'&gt;');
$form['to'] = array('#type' => 'item', '#title' => t('To'), '#value' => $account->name);
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#size' => 60, '#maxlength' => 50, '#required' => TRUE);
$form['message'] = array('#type' => 'textarea', '#title' => t('Message'), '#cols' => 60, '#rows' => 15, '#required' => TRUE);
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 50, '#required' => TRUE);
$form['message'] = array('#type' => 'textarea', '#title' => t('Message'), '#rows' => 15, '#required' => TRUE);
$form['copy'] = array('#type' => 'checkbox', '#title' => ('Send me a copy.'));
$form['submit'] = array('#type' => 'submit', '#value' => t('Send e-mail'));
$output = drupal_get_form('contact_user_mail', $form);
......@@ -200,9 +200,9 @@ function contact_admin_edit($cid = NULL) {
$edit['reply'] = $category->reply;
}
$form['category'] = array('#type' => 'textfield', '#title' => t('Category'), '#size' => 60, '#maxlength' => 255, '#default_value' => $edit['category'], '#description' => t("Example: 'website feedback' or 'product information'."), '#required' => TRUE);
$form['recipients'] = array('#type' => 'textarea', '#title' => t('Recipients'), '#cols' => 60, '#rows' => 5, '#default_value' => $edit['recipients'], '#description' => t("Example: 'webmaster@yoursite.com' or 'sales@yoursite.com'. To specify multiple repecients, separate each e-mail address with a comma."), '#required' => TRUE);
$form['reply'] = array('#type' => 'textarea', '#title' => t('Auto-reply'), '#cols' => 60, '#rows' => 5, '#default_value' => $edit['reply'], '#description' => t("Optional auto-reply. Leave empty if you don't want to send the user an auto-reply message."));
$form['category'] = array('#type' => 'textfield', '#title' => t('Category'), '#maxlength' => 255, '#default_value' => $edit['category'], '#description' => t("Example: 'website feedback' or 'product information'."), '#required' => TRUE);
$form['recipients'] = array('#type' => 'textarea', '#title' => t('Recipients'), '#default_value' => $edit['recipients'], '#description' => t("Example: 'webmaster@yoursite.com' or 'sales@yoursite.com'. To specify multiple repecients, separate each e-mail address with a comma."), '#required' => TRUE);
$form['reply'] = array('#type' => 'textarea', '#title' => t('Auto-reply'), '#default_value' => $edit['reply'], '#description' => t("Optional auto-reply. Leave empty if you don't want to send the user an auto-reply message."));
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
return drupal_get_form('contact_admin_edit', $form);
......@@ -256,14 +256,14 @@ function contact_mail_page() {
if (count($categories) > 1) {
$form['#token'] = $user->name . $user->mail;
$form['contact_information'] = array('#type' => 'markup', '#value' => variable_get('contact_form_information', t('You can leave us a message using the contact form below.')));
$form['name'] = array('#type' => 'textfield', '#title' => t('Your name'), '#size' => 60, '#maxlength' => 255, '#default_value' => $edit['name'], '#required' => TRUE);
$form['mail'] = array('#type' => 'textfield', '#title' => t('Your e-mail address'), '#size' => 60, '#maxlength' => 255, '#default_value' => $edit['mail'], '#required' => TRUE);
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#size' => 60, '#maxlength' => 255, '#default_value' => $edit['subject'], '#required' => TRUE);
$form['name'] = array('#type' => 'textfield', '#title' => t('Your name'), '#maxlength' => 255, '#default_value' => $edit['name'], '#required' => TRUE);
$form['mail'] = array('#type' => 'textfield', '#title' => t('Your e-mail address'), '#maxlength' => 255, '#default_value' => $edit['mail'], '#required' => TRUE);
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 255, '#default_value' => $edit['subject'], '#required' => TRUE);
if (count($categories) > 2) {
$form['category'] = array('#type' => 'select', '#title' => t('Category'), '#size' => 60, '#maxlength' => 255, '#default_value' => $edit['category'], '#options' => $categories, '#required' => TRUE);
}
$form['message'] = array('#type' => 'textarea', '#title' => t('Message'), '#cols' => 60, '#rows' => 5, '#default_value' => $edit['message'], '#required' => TRUE);
$form['copy'] = array('#type' => 'checkbox', '#title' => t('Send me a copy.'), '#default_value' => $edit['copy'], '#return_value' => 1);
$form['message'] = array('#type' => 'textarea', '#title' => t('Message'), '#default_value' => $edit['message'], '#required' => TRUE);
$form['copy'] = array('#type' => 'checkbox', '#title' => t('Send me a copy.'), '#default_value' => $edit['copy']);
$form['submit'] = array('#type' => 'submit', '#value' => t('Send e-mail'));
$output = drupal_get_form('contact_mail_page', $form);
}
......
......@@ -70,7 +70,7 @@ function contact_menu($may_cache) {
*/
function contact_settings() {
$form['contact_form_information'] = array(
'#type' => 'textarea', '#title' => t('Additional information'), '#cols' => 60, '#rows' => 5,
'#type' => 'textarea', '#title' => t('Additional information'),
'#default_value' => variable_get('contact_form_information', t('You can leave us a message using the contact form below.')),
'#description' => t('Information to show on the <a href="%form">contact page</a>. Can be anything from submission guidelines to your postal address or telephone number.', array('%form' => url('contact')))
);
......@@ -84,8 +84,8 @@ function contact_settings() {
*/
function contact_user($type, $edit, &$user, $category = NULL) {
if ($type == 'form' && $category == 'account') {
$form['contact'] = array('#type' => 'fieldset', '#title' => t('Contact settings'), '#weight' => 5, '#collapsible' => TRUE, '#collapsed' => FALSE);
$form['contact']['contact'] = array('#type' => 'checkbox', '#title' => t('Personal contact form'), '#return_value' => 1, '#default_value' => $edit['contact'], '#description' => t('Allow other users to contact you by e-mail via <a href="%url">your personal contact form</a>. Note that your e-mail address is not made public and that privileged users such as site administrators are able to contact you even if you choose not to enable this feature.', array('%url' => url("user/$user->uid/contact"))));
$form['contact'] = array('#type' => 'fieldset', '#title' => t('Contact settings'), '#weight' => 5, '#collapsible' => TRUE);
$form['contact']['contact'] = array('#type' => 'checkbox', '#title' => t('Personal contact form'), '#default_value' => $edit['contact'], '#description' => t('Allow other users to contact you by e-mail via <a href="%url">your personal contact form</a>. Note that your e-mail address is not made public and that privileged users such as site administrators are able to contact you even if you choose not to enable this feature.', array('%url' => url("user/$user->uid/contact"))));
return $form;
//return array(array('title' => t('Contact settings'), 'data' => drupal_get_form('contact_user', $form), 'weight' => 2));
}
......@@ -116,8 +116,8 @@ function contact_mail_user() {
$form['#token'] = $user->name . $user->mail;
$form['from'] = array('#type' => 'item', '#title' => t('From'), '#value' => $user->name .' &lt;'. $user->mail .'&gt;');
$form['to'] = array('#type' => 'item', '#title' => t('To'), '#value' => $account->name);
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#size' => 60, '#maxlength' => 50, '#required' => TRUE);
$form['message'] = array('#type' => 'textarea', '#title' => t('Message'), '#cols' => 60, '#rows' => 15, '#required' => TRUE);
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 50, '#required' => TRUE);
$form['message'] = array('#type' => 'textarea', '#title' => t('Message'), '#rows' => 15, '#required' => TRUE);
$form['copy'] = array('#type' => 'checkbox', '#title' => ('Send me a copy.'));
$form['submit'] = array('#type' => 'submit', '#value' => t('Send e-mail'));
$output = drupal_get_form('contact_user_mail', $form);
......@@ -200,9 +200,9 @@ function contact_admin_edit($cid = NULL) {
$edit['reply'] = $category->reply;
}
$form['category'] = array('#type' => 'textfield', '#title' => t('Category'), '#size' => 60, '#maxlength' => 255, '#default_value' => $edit['category'], '#description' => t("Example: 'website feedback' or 'product information'."), '#required' => TRUE);
$form['recipients'] = array('#type' => 'textarea', '#title' => t('Recipients'), '#cols' => 60, '#rows' => 5, '#default_value' => $edit['recipients'], '#description' => t("Example: 'webmaster@yoursite.com' or 'sales@yoursite.com'. To specify multiple repecients, separate each e-mail address with a comma."), '#required' => TRUE);
$form['reply'] = array('#type' => 'textarea', '#title' => t('Auto-reply'), '#cols' => 60, '#rows' => 5, '#default_value' => $edit['reply'], '#description' => t("Optional auto-reply. Leave empty if you don't want to send the user an auto-reply message."));
$form['category'] = array('#type' => 'textfield', '#title' => t('Category'), '#maxlength' => 255, '#default_value' => $edit['category'], '#description' => t("Example: 'website feedback' or 'product information'."), '#required' => TRUE);
$form['recipients'] = array('#type' => 'textarea', '#title' => t('Recipients'), '#default_value' => $edit['recipients'], '#description' => t("Example: 'webmaster@yoursite.com' or 'sales@yoursite.com'. To specify multiple repecients, separate each e-mail address with a comma."), '#required' => TRUE);
$form['reply'] = array('#type' => 'textarea', '#title' => t('Auto-reply'), '#default_value' => $edit['reply'], '#description' => t("Optional auto-reply. Leave empty if you don't want to send the user an auto-reply message."));
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
return drupal_get_form('contact_admin_edit', $form);
......@@ -256,14 +256,14 @@ function contact_mail_page() {
if (count($categories) > 1) {
$form['#token'] = $user->name . $user->mail;
$form['contact_information'] = array('#type' => 'markup', '#value' => variable_get('contact_form_information', t('You can leave us a message using the contact form below.')));
$form['name'] = array('#type' => 'textfield', '#title' => t('Your name'), '#size' => 60, '#maxlength' => 255, '#default_value' => $edit['name'], '#required' => TRUE);
$form['mail'] = array('#type' => 'textfield', '#title' => t('Your e-mail address'), '#size' => 60, '#maxlength' => 255, '#default_value' => $edit['mail'], '#required' => TRUE);
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#size' => 60, '#maxlength' => 255, '#default_value' => $edit['subject'], '#required' => TRUE);
$form['name'] = array('#type' => 'textfield', '#title' => t('Your name'), '#maxlength' => 255, '#default_value' => $edit['name'], '#required' => TRUE);
$form['mail'] = array('#type' => 'textfield', '#title' => t('Your e-mail address'), '#maxlength' => 255, '#default_value' => $edit['mail'], '#required' => TRUE);
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 255, '#default_value' => $edit['subject'], '#required' => TRUE);
if (count($categories) > 2) {
$form['category'] = array('#type' => 'select', '#title' => t('Category'), '#size' => 60, '#maxlength' => 255, '#default_value' => $edit['category'], '#options' => $categories, '#required' => TRUE);
}
$form['message'] = array('#type' => 'textarea', '#title' => t('Message'), '#cols' => 60, '#rows' => 5, '#default_value' => $edit['message'], '#required' => TRUE);
$form['copy'] = array('#type' => 'checkbox', '#title' => t('Send me a copy.'), '#default_value' => $edit['copy'], '#return_value' => 1);
$form['message'] = array('#type' => 'textarea', '#title' => t('Message'), '#default_value' => $edit['message'], '#required' => TRUE);
$form['copy'] = array('#type' => 'checkbox', '#title' => t('Send me a copy.'), '#default_value' => $edit['copy']);
$form['submit'] = array('#type' => 'submit', '#value' => t('Send e-mail'));
$output = drupal_get_form('contact_mail_page', $form);
}
......
......@@ -59,7 +59,7 @@ function drupal_settings() {
form_set_error('drupal_directory', t('You must set your site mission on the <a href="%url">administer &raquo; settings</a> page.' , array('%url' => url('admin/settings'))));
}
$form['drupal_server'] = array('#type' => 'textfield', '#title' => t('Drupal XML-RPC server'), '#default_value' => variable_get('drupal_server', 'http://www.drupal.org/xmlrpc.php'), '#size' => 60, '#maxlength' => 128, '#description' => t('The URL of your root Drupal XML-RPC server.'));
$form['drupal_server'] = array('#type' => 'textfield', '#title' => t('Drupal XML-RPC server'), '#default_value' => variable_get('drupal_server', 'http://www.drupal.org/xmlrpc.php'), '#description' => t('The URL of your root Drupal XML-RPC server.'));
$form['drupal_directory'] = array(
'#type' => 'radios', '#title' => t('Drupal directory'), '#default_value' => variable_get('drupal_directory', 0),
......
......@@ -59,7 +59,7 @@ function drupal_settings() {
form_set_error('drupal_directory', t('You must set your site mission on the <a href="%url">administer &raquo; settings</a> page.' , array('%url' => url('admin/settings'))));
}
$form['drupal_server'] = array('#type' => 'textfield', '#title' => t('Drupal XML-RPC server'), '#default_value' => variable_get('drupal_server', 'http://www.drupal.org/xmlrpc.php'), '#size' => 60, '#maxlength' => 128, '#description' => t('The URL of your root Drupal XML-RPC server.'));
$form['drupal_server'] = array('#type' => 'textfield', '#title' => t('Drupal XML-RPC server'), '#default_value' => variable_get('drupal_server', 'http://www.drupal.org/xmlrpc.php'), '#description' => t('The URL of your root Drupal XML-RPC server.'));
$form['drupal_directory'] = array(
'#type' => 'radios', '#title' => t('Drupal directory'), '#default_value' => variable_get('drupal_directory', 0),
......
......@@ -418,7 +418,7 @@ function filter_admin_format_form($format) {
//Add the name of the object
$form['name'] = array('#type' => 'fieldset', '#title' => t('Name'));
$form['name']['name'] = array('#type' => 'textfield', '#default_value' => $format->name, '#size' => 60, '#maxlength' => 127, '#description' => t('Give the name of this filter format'), '#required' => TRUE);
$form['name']['name'] = array('#type' => 'textfield', '#default_value' => $format->name, '#description' => t('Give the name of this filter format'), '#required' => TRUE);
//Add a row of checkboxes for form group
$form['roles'] = array('#type' => 'fieldset', '#title' => t('Roles'), '#description' => $default ? $help : t('Choose which roles may use this filter format.'), '#tree' => TRUE);
......
......@@ -418,7 +418,7 @@ function filter_admin_format_form($format) {
//Add the name of the object
$form['name'] = array('#type' => 'fieldset', '#title' => t('Name'));
$form['name']['name'] = array('#type' => 'textfield', '#default_value' => $format->name, '#size' => 60, '#maxlength' => 127, '#description' => t('Give the name of this filter format'), '#required' => TRUE);
$form['name']['name'] = array('#type' => 'textfield', '#default_value' => $format->name, '#description' => t('Give the name of this filter format'), '#required' => TRUE);
//Add a row of checkboxes for form group
$form['roles'] = array('#type' => 'fieldset', '#title' => t('Roles'), '#description' => $default ? $help : t('Choose which roles may use this filter format.'), '#tree' => TRUE);
......
......@@ -182,11 +182,11 @@ function _forum_confirm_delete($tid) {
* @param $edit Associative array containing a container term to be added or edited.
*/
function forum_form_container($edit = array()) {
$form['name'] = array('#title' => t('Container name'), '#type' => 'textfield', '#default_value' => $edit['name'], '#size' => 60, '#maxlength' => 64, '#description' => t('The container name is used to identify related forums.'), '#required' => TRUE);
$form['description'] = array('#type' => 'textarea', '#title' => t('Description'), '#default_value' => $edit['description'], '#cols' => 60, '#rows' => 5, '#description' => ('The container description can give users more information about the forums it contains.'));
$form['name'] = array('#title' => t('Container name'), '#type' => 'textfield', '#default_value' => $edit['name'], '#maxlength' => 64, '#description' => t('The container name is used to identify related forums.'), '#required' => TRUE);
$form['description'] = array('#type' => 'textarea', '#title' => t('Description'), '#default_value' => $edit['description'], '#description' => ('The container description can give users more information about the forums it contains.'));
$form['parent']['#tree'] = TRUE;
$form['parent'][0] = _forum_parent_select($edit['tid'], t('Parent'), 'container');
$form['weight'] = array('#type' => 'weight', '#title' => t('Weight'), '#default_value' => $edit['weight'], '#delta' => 10, '#description' => t('When listing containers, those with with light (small) weights get listed before containers with heavier (larger) weights. Containers with equal weights are sorted alphabetically.'));
$form['weight'] = array('#type' => 'weight', '#title' => t('Weight'), '#default_value' => $edit['weight'], '#description' => t('When listing containers, those with with light (small) weights get listed before containers with heavier (larger) weights. Containers with equal weights are sorted alphabetically.'));
$form['vid'] = array('#type' => 'hidden', '#value' => _forum_get_vid());
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
......@@ -204,11 +204,11 @@ function forum_form_container($edit = array()) {
* @param $edit Associative array containing a forum term to be added or edited.
*/
function forum_form_forum($edit = array()) {
$form['name'] = array('#type' => 'textfield', '#title' => t('Forum name'), '#default_value' => $edit['name'], '#size' => 60, '#maxlength' => 64, '#description' => t('The forum name is used to identify related discussions.'), '#required' => TRUE);
$form['description'] = array('#type' => 'textarea', '#title' => t('Description'), '#default_value' => $edit['description'], '#cols' => 60, '#rows' => 5, '#description' => ('The forum description can give users more information about the discussion topics it contains.'));
$form['name'] = array('#type' => 'textfield', '#title' => t('Forum name'), '#default_value' => $edit['name'], '#maxlength' => 64, '#description' => t('The forum name is used to identify related discussions.'), '#required' => TRUE);
$form['description'] = array('#type' => 'textarea', '#title' => t('Description'), '#default_value' => $edit['description'], '#description' => ('The forum description can give users more information about the discussion topics it contains.'));
$form['parent']['#tree'] = TRUE;
$form['parent'][0] = _forum_parent_select($edit['tid'], t('Parent'), 'forum');
$form['weight'] = array('#type' => 'weight', '#title' => t('Weight'), '#default_value' => $edit['weight'], '#delta' => 10, '#description' => t('When listing forums, those with with light (small) weights get listed before containers with heavier (larger) weights. Forums with equal weights are sorted alphabetically.'));
$form['weight'] = array('#type' => 'weight', '#title' => t('Weight'), '#default_value' => $edit['weight'], '#description' => t('When listing forums, those with with light (small) weights get listed before containers with heavier (larger) weights. Forums with equal weights are sorted alphabetically.'));
$form['vid'] = array('#type' => 'hidden', '#value' => _forum_get_vid());
$form['submit' ] = array('#type' => 'submit', '#value' => t('Submit'));
......@@ -573,7 +573,7 @@ function forum_update($node) {
* Implementation of hook_form().
*/
function forum_form(&$node) {
$form['title'] = array('#type' => 'textfield', '#title' => t('Subject'), '#default_value' => $node->title, '#size' => 60, '#maxlength' => 128, '#required' => TRUE);
$form['title'] = array('#type' => 'textfield', '#title' => t('Subject'), '#default_value' => $node->title, '#required' => TRUE);
if (!$node->nid) {
// new topic
......
......@@ -182,11 +182,11 @@ function _forum_confirm_delete($tid) {
* @param $edit Associative array containing a container term to be added or edited.
*/
function forum_form_container($edit = array()) {
$form['name'] = array('#title' => t('Container name'), '#type' => 'textfield', '#default_value' => $edit['name'], '#size' => 60, '#maxlength' => 64, '#description' => t('The container name is used to identify related forums.'), '#required' => TRUE);
$form['description'] = array('#type' => 'textarea', '#title' => t('Description'), '#default_value' => $edit['description'], '#cols' => 60, '#rows' => 5, '#description' => ('The container description can give users more information about the forums it contains.'));
$form['name'] = array('#title' => t('Container name'), '#type' => 'textfield', '#default_value' => $edit['name'], '#maxlength' => 64, '#description' => t('The container name is used to identify related forums.'), '#required' => TRUE);
$form['description'] = array('#type' => 'textarea', '#title' => t('Description'), '#default_value' => $edit['description'], '#description' => ('The container description can give users more information about the forums it contains.'));