Commit 57fe5103 authored by Dries's avatar Dries

- Patch #252013 by Eaton, pwolanin, Susurrus et al: drupal_render() now...

- Patch #252013 by Eaton, pwolanin, Susurrus et al: drupal_render() now printes #markup, not #value.
parent 11b9f390
......@@ -2741,26 +2741,15 @@ function drupal_render(&$elements) {
// Render all the children that use a theme function.
if (isset($elements['#theme']) && empty($elements['#theme_used'])) {
$elements['#theme_used'] = TRUE;
$previous = array();
foreach (array('#value', '#type', '#prefix', '#suffix') as $key) {
$previous[$key] = isset($elements[$key]) ? $elements[$key] : NULL;
}
// If we rendered a single element, then we will skip the renderer.
if (empty($children)) {
$elements['#printed'] = TRUE;
}
else {
$elements['#value'] = '';
$elements['#markup'] = '';
}
$elements['#type'] = 'markup';
unset($elements['#prefix'], $elements['#suffix']);
$content = theme($elements['#theme'], $elements);
foreach (array('#value', '#type', '#prefix', '#suffix') as $key) {
$elements[$key] = isset($previous[$key]) ? $previous[$key] : NULL;
}
}
// Render each of the children using drupal_render and concatenate them.
if (!isset($content) || $content === '') {
......
......@@ -1836,7 +1836,7 @@ function form_expand_ahah($element) {
* @ingroup themeable
*/
function theme_item($element) {
return theme('form_element', $element, $element['#value'] . (!empty($element['#children']) ? $element['#children'] : ''));
return theme('form_element', $element, $element['#markup'] . (!empty($element['#children']) ? $element['#children'] : ''));
}
/**
......@@ -2085,7 +2085,7 @@ function theme_textarea($element) {
*/
function theme_markup($element) {
return (isset($element['#value']) ? $element['#value'] : '') . (isset($element['#children']) ? $element['#children'] : '');
return (isset($element['#markup']) ? $element['#markup'] : '') . (isset($element['#children']) ? $element['#children'] : '');
}
/**
......
......@@ -46,9 +46,9 @@ function locale_languages_overview_form() {
'#type' => 'weight',
'#default_value' => $language->weight
);
$form['name'][$langcode] = array('#value' => check_plain($language->name));
$form['native'][$langcode] = array('#value' => check_plain($language->native));
$form['direction'][$langcode] = array('#value' => ($language->direction == LANGUAGE_RTL ? t('Right to left') : t('Left to right')));
$form['name'][$langcode] = array('#markup' => check_plain($language->name));
$form['native'][$langcode] = array('#markup' => check_plain($language->native));
$form['direction'][$langcode] = array('#markup' => ($language->direction == LANGUAGE_RTL ? t('Right to left') : t('Left to right')));
}
$form['enabled'] = array('#type' => 'checkboxes',
'#options' => $options,
......@@ -230,7 +230,7 @@ function _locale_languages_common_controls(&$form, $language = NULL) {
$form['langcode_view'] = array(
'#type' => 'item',
'#title' => t('Language code'),
'#value' => $language->language
'#markup' => $language->language
);
$form['langcode'] = array(
'#type' => 'value',
......@@ -782,7 +782,7 @@ function locale_translate_edit_form(&$form_state, $lid) {
'original' => array(
'#type' => 'item',
'#title' => t('Original text'),
'#value' => check_plain(wordwrap($source->source, 0)),
'#markup' => check_plain(wordwrap($source->source, 0)),
),
'lid' => array(
'#type' => 'value',
......
......@@ -231,7 +231,7 @@ function install_settings_form(&$form_state, $profile, $install_locale, $setting
if (count($db_types) == 0) {
$form['no_db_types'] = array(
'#value' => st('Your web server does not appear to support any common database types. Check with your hosting provider to see if they offer any databases that <a href="@drupal-databases">Drupal supports</a>.', array('@drupal-databases' => 'http://drupal.org/node/270#database')),
'#markup' => st('Your web server does not appear to support any common database types. Check with your hosting provider to see if they offer any databases that <a href="@drupal-databases">Drupal supports</a>.', array('@drupal-databases' => 'http://drupal.org/node/270#database')),
);
}
else {
......@@ -995,7 +995,7 @@ function install_task_list($active = NULL) {
function install_configure_form(&$form_state, $url) {
$form['intro'] = array(
'#value' => st('To configure your website, please provide the following information.'),
'#markup' => st('To configure your website, please provide the following information.'),
'#weight' => -10,
);
$form['site_information'] = array(
......@@ -1024,7 +1024,7 @@ function install_configure_form(&$form_state, $url) {
);
$form['admin_account']['account']['#tree'] = TRUE;
$form['admin_account']['markup'] = array(
'#value' => '<p class="description">' . st('The administrator account has complete access to the site; it will automatically be granted all permissions and can perform any administrative activity. This will be the only account that can perform certain activities, so keep its credentials safe.') . '</p>',
'#markup' => '<p class="description">' . st('The administrator account has complete access to the site; it will automatically be granted all permissions and can perform any administrative activity. This will be the only account that can perform certain activities, so keep its credentials safe.') . '</p>',
'#weight' => -10,
);
......
......@@ -157,7 +157,7 @@ function aggregator_categorize_items($items, $feed_source = '') {
'#tree' => TRUE,
);
foreach ($items as $item) {
$form['items'][$item->iid] = array('#value' => theme('aggregator_item', $item));
$form['items'][$item->iid] = array('#markup' => theme('aggregator_item', $item));
$form['categories'][$item->iid] = array();
$categories_result = db_query('SELECT c.cid, c.title, ci.iid FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid AND ci.iid = %d', $item->iid);
$selected = array();
......
......@@ -53,7 +53,7 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) {
'#value' => $block['delta'],
);
$form[$key]['info'] = array(
'#value' => check_plain($block['info']),
'#markup' => check_plain($block['info']),
);
$form[$key]['theme'] = array(
'#type' => 'hidden',
......@@ -69,7 +69,7 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) {
'#options' => $block_regions,
);
$form[$key]['configure'] = array(
'#value' => l(t('configure'),
'#markup' => l(t('configure'),
'admin/build/block/configure/' . $block['module'] . '/' . $block['delta']),
);
if ($block['module'] == 'block') {
......
......@@ -49,7 +49,7 @@ function blog_user($type, &$edit, &$user) {
$user->content['summary']['blog'] = array(
'#type' => 'user_profile_item',
'#title' => t('Blog'),
'#value' => l(t('View recent blog entries'), "blog/$user->uid", array('attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => $user->name))))),
'#markup' => l(t('View recent blog entries'), "blog/$user->uid", array('attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => $user->name))))),
'#attributes' => array('class' => 'blog'),
);
}
......
......@@ -692,7 +692,7 @@ function book_nodeapi(&$node, $op, $teaser, $page) {
if (!$teaser) {
if (!empty($node->book['bid']) && $node->build_mode == NODE_BUILD_NORMAL) {
$node->content['book_navigation'] = array(
'#value' => theme('book_navigation', $node->book),
'#markup' => theme('book_navigation', $node->book),
'#weight' => 100,
);
......@@ -790,7 +790,7 @@ function book_form_node_delete_confirm_alter(&$form, $form_state) {
if (isset($node->book) && $node->book['has_children']) {
$form['book_warning'] = array(
'#value' => '<p>' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title)) . '</p>',
'#markup' => '<p>' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title)) . '</p>',
'#weight' => -10,
);
}
......
......@@ -57,7 +57,7 @@ function color_form_alter(&$form, $form_state, $form_id) {
foreach (element_children($form) as $theme) {
if ($screenshot = variable_get('color_' . $theme . '_screenshot', NULL)) {
if (isset($form[$theme]['screenshot'])) {
$form[$theme]['screenshot']['#value'] = theme('image', $screenshot, '', '', array('class' => 'screenshot'), FALSE);
$form[$theme]['screenshot']['#markup'] = theme('image', $screenshot, '', '', array('class' => 'screenshot'), FALSE);
}
}
}
......
......@@ -76,19 +76,19 @@ function comment_admin_overview($type = 'new', $arg) {
$comments[$comment->cid] = '';
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
$form['subject'][$comment->cid] = array(
'#value' => l($comment->subject, 'node/' . $comment->nid, array('attributes' => array('title' => truncate_utf8($comment->comment, 128)), 'fragment' => 'comment-' . $comment->cid))
'#markup' => l($comment->subject, 'node/' . $comment->nid, array('attributes' => array('title' => truncate_utf8($comment->comment, 128)), 'fragment' => 'comment-' . $comment->cid))
);
$form['username'][$comment->cid] = array(
'#value' => theme('username', $comment)
'#markup' => theme('username', $comment)
);
$form['node_title'][$comment->cid] = array(
'#value' => l($comment->node_title, 'node/' . $comment->nid)
'#markup' => l($comment->node_title, 'node/' . $comment->nid)
);
$form['timestamp'][$comment->cid] = array(
'#value' => format_date($comment->timestamp, 'small')
'#markup' => format_date($comment->timestamp, 'small')
);
$form['operations'][$comment->cid] = array(
'#value' => l(t('edit'), 'comment/edit/' . $comment->cid, array('query' => $destination))
'#markup' => l(t('edit'), 'comment/edit/' . $comment->cid, array('query' => $destination))
);
}
$form['comments'] = array(
......@@ -96,7 +96,7 @@ function comment_admin_overview($type = 'new', $arg) {
'#options' => isset($comments) ? $comments: array()
);
$form['pager'] = array(
'#value' => theme('pager', NULL, 50, 0)
'#markup' => theme('pager', NULL, 50, 0)
);
return $form;
......@@ -169,7 +169,7 @@ function theme_comment_admin_overview($form) {
}
$output .= theme('table', $form['header']['#value'], $rows);
if ($form['pager']['#value']) {
if ($form['pager']['#markup']) {
$output .= drupal_render($form['pager']);
}
......
......@@ -1267,7 +1267,7 @@ function comment_form(&$form_state, $edit, $title = NULL) {
$form['_author'] = array(
'#type' => 'item',
'#title' => t('Your name'),
'#value' => theme('username', $user),
'#markup' => theme('username', $user),
);
$form['author'] = array(
'#type' => 'value',
......@@ -1452,7 +1452,7 @@ function comment_form_add_preview($form, &$form_state) {
}
$form['comment_preview'] = array(
'#value' => $output,
'#markup' => $output,
'#weight' => -100,
'#prefix' => '<div class="preview">',
'#suffix' => '</div>',
......@@ -1473,7 +1473,7 @@ function comment_form_add_preview($form, &$form_state) {
}
$form['comment_preview_below'] = array(
'#value' => $output,
'#markup' => $output,
'#weight' => 100,
);
......
......@@ -38,7 +38,7 @@ function contact_mail_page() {
if (count($categories) > 0) {
$form['#token'] = $user->uid ? $user->name . $user->mail : '';
$form['contact_information'] = array('#value' => 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', t('You can leave a message using the contact form below.'))));
$form['name'] = array('#type' => 'textfield',
'#title' => t('Your name'),
'#maxlength' => 255,
......@@ -177,11 +177,11 @@ function contact_mail_user(&$form_state, $recipient) {
$form['recipient'] = array('#type' => 'value', '#value' => $recipient);
$form['from'] = array('#type' => 'item',
'#title' => t('From'),
'#value' => check_plain($user->name) . ' &lt;' . check_plain($user->mail) . '&gt;',
'#markup' => check_plain($user->name) . ' &lt;' . check_plain($user->mail) . '&gt;',
);
$form['to'] = array('#type' => 'item',
'#title' => t('To'),
'#value' => check_plain($recipient->name),
'#markup' => check_plain($recipient->name),
);
$form['subject'] = array('#type' => 'textfield',
'#title' => t('Subject'),
......
......@@ -30,10 +30,10 @@ function filter_admin_overview() {
}
$default = ($id == variable_get('filter_default_format', 1));
$options[$id] = '';
$form[$id]['name'] = array('#value' => $format->name);
$form[$id]['roles'] = array('#value' => $default ? t('All roles may use default format') : ($roles ? implode(', ', $roles) : t('No roles may use this format')));
$form[$id]['configure'] = array('#value' => l(t('configure'), 'admin/settings/filters/' . $id));
$form[$id]['delete'] = array('#value' => $default ? '' : l(t('delete'), 'admin/settings/filters/delete/' . $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')));
$form[$id]['configure'] = array('#markup' => l(t('configure'), 'admin/settings/filters/' . $id));
$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));
......@@ -166,7 +166,7 @@ function filter_admin_format_form(&$form_state, $format) {
}
$group = '<p>' . t('These are the guidelines that users will see for posting in this input format. They are automatically generated from the filter settings.') . '</p>';
$group .= $tiplist;
$form['tips'] = array('#value' => '<h2>' . t('Formatting guidelines') . '</h2>' . $group);
$form['tips'] = array('#markup' => '<h2>' . t('Formatting guidelines') . '</h2>' . $group);
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
......@@ -325,7 +325,7 @@ function filter_admin_configure(&$form_state, $format) {
$form = system_settings_form($form);
}
else {
$form['error'] = array('#value' => t('No settings are available.'));
$form['error'] = array('#markup' => t('No settings are available.'));
}
$form['format'] = array('#type' => 'hidden', '#value' => $format->format);
$form['#submit'][] = 'filter_admin_configure_submit';
......@@ -360,7 +360,7 @@ function filter_admin_order(&$form_state, $format = NULL) {
$form['weights'] = array('#tree' => TRUE);
foreach ($filters as $id => $filter) {
$form['names'][$id] = array('#value' => $filter->name);
$form['names'][$id] = array('#markup' => $filter->name);
$form['weights'][$id] = array('#type' => 'weight', '#default_value' => $filter->weight);
}
$form['format'] = array('#type' => 'hidden', '#value' => $format->format);
......
......@@ -508,10 +508,10 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents =
$tips = _filter_tips(variable_get('filter_default_format', 1), FALSE);
$form['format']['guidelines'] = array(
'#title' => t('Formatting guidelines'),
'#value' => theme('filter_tips', $tips, FALSE, $extra),
'#markup' => theme('filter_tips', $tips, FALSE, $extra),
);
}
$form[] = array('#value' => $extra);
$form[] = array('#markup' => $extra);
return $form;
}
......
......@@ -225,12 +225,12 @@ function forum_overview(&$form_state) {
foreach (element_children($form) as $key) {
if (isset($form[$key]['#term'])) {
$term = $form[$key]['#term'];
$form[$key]['view']['#value'] = l($term['name'], 'forum/' . $term['tid']);
$form[$key]['view']['#markup'] = l($term['name'], 'forum/' . $term['tid']);
if (in_array($form[$key]['#term']['tid'], variable_get('forum_containers', array()))) {
$form[$key]['edit']['#value'] = l(t('edit container'), 'admin/build/forum/edit/container/' . $term['tid']);
$form[$key]['edit']['#markup'] = l(t('edit container'), 'admin/build/forum/edit/container/' . $term['tid']);
}
else {
$form[$key]['edit']['#value'] = l(t('edit forum'), 'admin/build/forum/edit/forum/' . $term['tid']);
$form[$key]['edit']['#markup'] = l(t('edit forum'), 'admin/build/forum/edit/forum/' . $term['tid']);
}
}
}
......
......@@ -199,7 +199,7 @@ function forum_nodeapi(&$node, $op, $teaser, $page) {
if (!$teaser) {
$node->content['forum_navigation'] = array(
'#value' => theme('forum_topic_navigation', $node),
'#markup' => theme('forum_topic_navigation', $node),
'#weight' => 100,
);
}
......@@ -360,7 +360,7 @@ function forum_form_alter(&$form, $form_state, $form_id) {
// Hide critical options from forum vocabulary.
if ($form_id == 'taxonomy_form_vocabulary') {
$form['help_forum_vocab'] = array(
'#value' => t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'),
'#markup' => t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'),
'#weight' => -1,
);
$form['content_types']['nodes']['#required'] = TRUE;
......
......@@ -51,7 +51,7 @@ function menu_overview_form(&$form_state, $menu) {
);
}
else {
$form['empty_menu'] = array('#value' => t('There are no menu items yet.'));
$form['empty_menu'] = array('#markup' => t('There are no menu items yet.'));
}
return $form;
}
......@@ -69,7 +69,7 @@ function _menu_overview_tree_form($tree) {
$mlid = 'mlid:' . $item['mlid'];
$form[$mlid]['#item'] = $item;
$form[$mlid]['#attributes'] = $item['hidden'] ? array('class' => 'menu-disabled') : array('class' => 'menu-enabled');
$form[$mlid]['title']['#value'] = l($item['title'], $item['href'], $item['localized_options']) . ($item['hidden'] ? ' (' . t('disabled') . ')' : '');
$form[$mlid]['title']['#markup'] = l($item['title'], $item['href'], $item['localized_options']) . ($item['hidden'] ? ' (' . t('disabled') . ')' : '');
$form[$mlid]['hidden'] = array(
'#type' => 'checkbox',
'#default_value' => !$item['hidden'],
......@@ -106,7 +106,7 @@ function _menu_overview_tree_form($tree) {
$form[$mlid]['operations'] = array();
foreach ($operations as $op => $value) {
$form[$mlid]['operations'][$op] = array('#value' => $value);
$form[$mlid]['operations'][$op] = array('#markup' => $value);
}
}
......@@ -600,7 +600,7 @@ function menu_reset_item_confirm_submit($form, &$form_state) {
function menu_configure() {
$form['intro'] = array(
'#type' => 'item',
'#value' => t('The menu module allows on-the-fly creation of menu links in the content authoring forms. The following option sets the default menu in which a new link will be added.'),
'#markup' => t('The menu module allows on-the-fly creation of menu links in the content authoring forms. The following option sets the default menu in which a new link will be added.'),
);
$menu_options = menu_get_menus();
......@@ -635,4 +635,3 @@ function menu_configure() {
return system_settings_form($form);
}
......@@ -94,7 +94,7 @@ function node_type_form(&$form_state, $type = NULL) {
$form['identity']['type_display'] = array(
'#title' => t('Type'),
'#type' => 'item',
'#value' => theme('placeholder', $type->type),
'#markup' => theme('placeholder', $type->type),
'#description' => t('The machine-readable name of this content type. This field cannot be modified for system-defined content types.'),
);
}
......
......@@ -21,7 +21,7 @@ function node_configure() {
'#type' => 'fieldset',
'#title' => t('Node access status'),
);
$form['access']['status'] = array('#value' => $status);
$form['access']['status'] = array('#markup' => $status);
$form['access']['rebuild'] = array(
'#type' => 'submit',
'#value' => t('Rebuild permissions'),
......@@ -236,10 +236,10 @@ function node_filter_form() {
$value = $filters[$type]['options'][$value];
}
if ($i++) {
$form['filters']['current'][] = array('#value' => t('<em>and</em> where <strong>%a</strong> is <strong>%b</strong>', array('%a' => $filters[$type]['title'], '%b' => $value)));
$form['filters']['current'][] = array('#markup' => t('<em>and</em> where <strong>%a</strong> is <strong>%b</strong>', array('%a' => $filters[$type]['title'], '%b' => $value)));
}
else {
$form['filters']['current'][] = array('#value' => t('<strong>%a</strong> is <strong>%b</strong>', array('%a' => $filters[$type]['title'], '%b' => $value)));
$form['filters']['current'][] = array('#markup' => t('<strong>%a</strong> is <strong>%b</strong>', array('%a' => $filters[$type]['title'], '%b' => $value)));
}
if (in_array($type, array('type', 'language'))) {
// Remove the option if it is already being filtered on.
......@@ -495,17 +495,17 @@ function node_admin_nodes() {
while ($node = db_fetch_object($result)) {
$nodes[$node->nid] = '';
$options = empty($node->language) ? array() : array('language' => $languages[$node->language]);
$form['title'][$node->nid] = array('#value' => l($node->title, 'node/' . $node->nid, $options) . ' ' . theme('mark', node_mark($node->nid, $node->changed)));
$form['name'][$node->nid] = array('#value' => check_plain(node_get_types('name', $node)));
$form['username'][$node->nid] = array('#value' => theme('username', $node));
$form['status'][$node->nid] = array('#value' => ($node->status ? t('published') : t('not published')));
$form['title'][$node->nid] = array('#markup' => l($node->title, 'node/' . $node->nid, $options) . ' ' . theme('mark', node_mark($node->nid, $node->changed)));
$form['name'][$node->nid] = array('#markup' => check_plain(node_get_types('name', $node)));
$form['username'][$node->nid] = array('#markup' => theme('username', $node));
$form['status'][$node->nid] = array('#markup' => ($node->status ? t('published') : t('not published')));
if ($multilanguage) {
$form['language'][$node->nid] = array('#value' => empty($node->language) ? t('Language neutral') : t($languages[$node->language]->name));
$form['language'][$node->nid] = array('#markup' => empty($node->language) ? t('Language neutral') : t($languages[$node->language]->name));
}
$form['operations'][$node->nid] = array('#value' => l(t('edit'), 'node/' . $node->nid . '/edit', array('query' => $destination)));
$form['operations'][$node->nid] = array('#markup' => l(t('edit'), 'node/' . $node->nid . '/edit', array('query' => $destination)));
}
$form['nodes'] = array('#type' => 'checkboxes', '#options' => $nodes);
$form['pager'] = array('#value' => theme('pager', NULL, 50, 0));
$form['pager'] = array('#markup' => theme('pager', NULL, 50, 0));
$form['#theme'] = 'node_admin_nodes';
return $form;
}
......@@ -592,7 +592,7 @@ function theme_node_admin_nodes($form) {
}
$output .= theme('table', $header, $rows);
if ($form['pager']['#value']) {
if ($form['pager']['#markup']) {
$output .= drupal_render($form['pager']);
}
......@@ -632,4 +632,3 @@ function node_multiple_delete_confirm_submit($form, &$form_state) {
$form_state['redirect'] = 'admin/content/node';
return;
}
......@@ -1074,7 +1074,7 @@ function node_prepare($node, $teaser = FALSE) {
}
$node->content['body'] = array(
'#value' => $teaser ? $node->teaser : $node->body,
'#markup' => $teaser ? $node->teaser : $node->body,
'#weight' => 0,
);
......
......@@ -95,7 +95,7 @@ function openid_form_alter(&$form, $form_state, $form_id) {
);
$form['openid_links'] = array(
'#value' => theme('item_list', $items),
'#markup' => theme('item_list', $items),
'#weight' => 1,
);
......
......@@ -552,12 +552,12 @@ function poll_view($node, $teaser = FALSE, $page = FALSE, $block = FALSE) {
if (!empty($node->allowvotes) && ($block || empty($node->show_results))) {
$node->content['body'] = array(
'#value' => drupal_get_form('poll_view_voting', $node, $block),
'#markup' => drupal_get_form('poll_view_voting', $node, $block),
);
}
else {
$node->content['body'] = array(
'#value' => poll_view_results($node, $teaser, $page, $block),
'#markup' => poll_view_results($node, $teaser, $page, $block),
);
}
return $node;
......
......@@ -22,13 +22,13 @@ function profile_admin_overview() {
$categories[] = $field->category;
// Save all field information
$form[$field->fid]['name'] = array('#value' => check_plain($field->name));
$form[$field->fid]['title'] = array('#value' => check_plain($field->title));
$form[$field->fid]['type'] = array('#value' => $field->type);
$form[$field->fid]['name'] = array('#markup' => check_plain($field->name));
$form[$field->fid]['title'] = array('#markup' => check_plain($field->title));
$form[$field->fid]['type'] = array('#markup' => $field->type);
$form[$field->fid]['category'] = array('#type' => 'select', '#default_value' => $field->category, '#options' => array());
$form[$field->fid]['weight'] = array('#type' => 'weight', '#default_value' => $field->weight);
$form[$field->fid]['edit'] = array('#value' => l(t('edit'), "admin/user/profile/edit/$field->fid"));
$form[$field->fid]['delete'] = array('#value' => l(t('delete'), "admin/user/profile/delete/$field->fid"));
$form[$field->fid]['edit'] = array('#markup' => l(t('edit'), "admin/user/profile/edit/$field->fid"));
$form[$field->fid]['delete'] = array('#markup' => l(t('delete'), "admin/user/profile/delete/$field->fid"));
}
// Add the cateogory combo boxes
......@@ -58,7 +58,7 @@ function profile_admin_overview() {
$addnewfields .= '<li>' . l($value, "admin/user/profile/add/$key") . '</li>';
}
$addnewfields .= '</ul>';
$form['addnewfields'] = array('#value' => $addnewfields);
$form['addnewfields'] = array('#markup' => $addnewfields);
return $form;
}
......
......@@ -316,7 +316,7 @@ function profile_view_profile(&$user) {
$user->content[$field->category][$field->name] = array(
'#type' => 'user_profile_item',
'#title' => $title,
'#value' => $value,
'#markup' => $value,
'#weight' => $field->weight,
'#attributes' => array('class' => 'profile-' . $field->name),
);
......
......@@ -48,7 +48,7 @@ function search_admin_settings() {
$percentage = ((int)min(100, 100 * ($total - $remaining) / max(1, $total))) . '%';
$status = '<p><strong>' . t('%percentage of the site has been indexed.', array('%percentage' => $percentage)) . ' ' . $count . '</strong></p>';
$form['status'] = array('#type' => 'fieldset', '#title' => t('Indexing status'));
$form['status']['status'] = array('#value' => $status);
$form['status']['status'] = array('#markup' => $status);
$form['status']['wipe'] = array('#type' => 'submit', '#value' => t('Re-index site'));
$items = drupal_map_assoc(array(10, 20, 50, 100, 200, 500));
......@@ -58,7 +58,7 @@ function search_admin_settings() {
$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 <a href="@cron">cron maintenance task</a>. 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('#value' => t('<p><em>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.</em></p><p><em>The default settings should be appropriate for the majority of sites.</em></p>'));
$form['indexing_settings']['info'] = array('#markup' => t('<p><em>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.</em></p><p><em>The default settings should be appropriate for the majority of sites.</em></p>'));
$form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#default_value' => variable_get('minimum_word_size', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).'));
$form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', TRUE), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.'));
......
......@@ -125,7 +125,7 @@ function simpletest_test_form() {
'#collapsed' => $ok,
'#description' => $info['description'],
);
$element['result_table']['#value'] = theme('table', $header, $element['result_table']['#rows']);
$element['result_table']['#markup'] = theme('table', $header, $element['result_table']['#rows']);
$element['summary']['#ok'] = $ok;
$group_ok = $group_ok && $ok;
}
......
......@@ -25,7 +25,7 @@ function image_gd_settings() {
if (image_gd_check_settings()) {
$form = array();
$form['status'] = array(
'#value' => t('The GD toolkit is installed and working properly.')
'#markup' => t('The GD toolkit is installed and working properly.')
);
$form['image_jpeg_quality'] = array(
......
......@@ -196,7 +196,7 @@ function system_themes_form() {
}
$screenshot = $screenshot ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $theme->info['name'])), '', array('class' => 'screenshot'), FALSE) : t('no screenshot');
$form[$theme->name]['screenshot'] = array('#value' => $screenshot);
$form[$theme->name]['screenshot'] = array('#markup' => $screenshot);
$form[$theme->name]['info'] = array(
'#type' => 'value',
'#value' => $theme->info,
......@@ -204,7 +204,7 @@ function system_themes_form() {
$options[$theme->name] = '';
if (!empty($theme->status) || $theme->name == variable_get('admin_theme', '0')) {
$form[$theme->name]['operations'] = array('#value' => l(t('configure'), 'admin/build/themes/settings/' . $theme->name) );
$form[$theme->name]['operations'] = array('#markup' => l(t('configure'), 'admin/build/themes/settings/' . $theme->name) );
}
else {
// Dummy element for drupal_render. Cleaner than adding a check in the theme function.
......@@ -645,15 +645,15 @@ function system_modules($form_state = array()) {
$disabled = array();
// Traverse the files retrieved and build the form.
foreach ($files as $filename => $file) {
$form['name'][$filename] = array('#value' => $file->info['name']);
$form['version'][$filename] = array('#value' => $file->info['version']);
$form['description'][$filename] = array('#value' => t($file->info['description']));
$form['name'][$filename] = array('#markup' => $file->info['name']);
$form['version'][$filename] = array('#markup' => $file->info['version']);
$form['description'][$filename] = array('#markup' => t($file->info['description']));
// Generate link for module's help page, if there is one.
if ($help_arg && module_hook($filename, 'help')) {
if (module_invoke($filename, 'help', "admin/help#$filename", $help_arg)) {
// Module has a help page.
$form['help'][$filename] = array('#value' => theme('more_help_link', url("admin/help/$filename")));
$form['help'][$filename] = array('#markup' => theme('more_help_link', url("admin/help/$filename")));
}
}
......@@ -690,7 +690,7 @@ function system_modules($form_state = array()) {
// Add text for dependencies.
if (!empty($dependencies)) {
$form['description'][$filename]['dependencies'] = array(
'#value' => t('Depends on: !dependencies', array('!dependencies' => implode(', ', $dependencies))),
'#markup' => t('Depends on: !dependencies', array('!dependencies' => implode(', ', $dependencies))),
'#prefix' => '<div class="admin-dependencies">',
'#suffix' => '</div>',
);
......@@ -713,7 +713,7 @@ function system_modules($form_state = array()) {
// Add text for enabled dependents.
if (!empty($dependents)) {
$form['description'][$filename]['required'] = array(
'#value' => t('Required by: !required', array('!required' => implode(', ', $dependents))),
'#markup' => t('Required by: !required', array('!required' => implode(', ', $dependents))),
'#prefix' => '<div class="admin-required">',
'#suffix' => '</div>',
);
......@@ -811,7 +811,7 @@ function system_modules_confirm_form($modules, $storage) {
);
$items[] = format_plural(count($missing_dependencies),