diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/block/block.admin.inc | 12 | ||||
-rw-r--r-- | modules/comment/comment.admin.inc | 26 | ||||
-rw-r--r-- | modules/field_ui/field_ui.admin.inc | 22 | ||||
-rw-r--r-- | modules/filter/filter.admin.inc | 4 | ||||
-rw-r--r-- | modules/image/image.admin.inc | 10 | ||||
-rw-r--r-- | modules/menu/menu.admin.inc | 12 | ||||
-rw-r--r-- | modules/node/node.admin.inc | 19 | ||||
-rw-r--r-- | modules/profile/profile.admin.inc | 5 | ||||
-rw-r--r-- | modules/system/system.admin.inc | 9 | ||||
-rw-r--r-- | modules/system/system.module | 7 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.admin.inc | 10 | ||||
-rw-r--r-- | modules/user/user.admin.inc | 2 |
12 files changed, 93 insertions, 45 deletions
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index d08d87f6e..e6b737c8f 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -87,14 +87,16 @@ function block_admin_display_form($form, &$form_state, $blocks, $theme) { '#options' => $block_regions, ); $form[$key]['configure'] = array( - '#markup' => l(t('configure'), - 'admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/configure'), + '#type' => 'link', + '#title' => t('configure'), + '#href' => 'admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/configure', ); if ($block['module'] == 'block') { $form[$key]['delete'] = array( - '#markup' => l(t('delete'), - 'admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/delete'), - ); + '#type' => 'link', + '#title' => t('delete'), + '#href' => 'admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/delete', + ); } } // Do not allow disabling the main system content block. diff --git a/modules/comment/comment.admin.inc b/modules/comment/comment.admin.inc index ddabc017c..59a9717f8 100644 --- a/modules/comment/comment.admin.inc +++ b/modules/comment/comment.admin.inc @@ -86,11 +86,31 @@ function comment_admin_overview($form, &$form_state, $arg) { foreach ($result as $comment) { $options[$comment->cid] = array( - 'subject' => l($comment->subject, 'comment/' . $comment->cid, array('attributes' => array('title' => truncate_utf8($comment->comment, 128)), 'fragment' => 'comment-' . $comment->cid)), + 'subject' => array( + 'data' => array( + '#type' => 'link', + '#title' => $comment->subject, + '#href' => 'comment/' . $comment->cid, + '#options' => array('attributes' => array('title' => truncate_utf8($comment->comment, 128)), 'fragment' => 'comment-' . $comment->cid), + ), + ), 'author' => theme('username', array('account' => $comment)), - 'posted_in' => l($comment->node_title, 'node/' . $comment->nid), + 'posted_in' => array( + 'data' => array( + '#type' => 'link', + '#title' => $comment->node_title, + '#href' => 'node/' . $comment->nid, + ), + ), 'changed' => format_date($comment->changed, 'short'), - 'operations' => l(t('edit'), 'comment/' . $comment->cid .'/edit', array('query' => $destination)), + 'operations' => array( + 'data' => array( + '#type' => 'link', + '#title' => t('edit'), + '#href' => 'comment/' . $comment->cid . '/edit', + '#options' => array('query' => $destination), + ), + ), ); } diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc index b422288b9..b22390551 100644 --- a/modules/field_ui/field_ui.admin.inc +++ b/modules/field_ui/field_ui.admin.inc @@ -110,17 +110,29 @@ function field_ui_field_overview_form($form, &$form_state, $obj_type, $bundle) { '#markup' => $instance['field_name'], ), 'type' => array( - '#markup' => l(t($field_types[$field['type']]['label']), $admin_field_path . '/field-settings', array('attributes' => array('title' => t('Edit field settings.')))), + '#type' => 'link', + '#title' => t($field_types[$field['type']]['label']), + '#href' => $admin_field_path . '/field-settings', + '#options' => array('attributes' => array('title' => t('Edit field settings.'))), ), 'widget_type' => array( - '#markup' => l(t($widget_types[$instance['widget']['type']]['label']), $admin_field_path . '/widget-type', array('attributes' => array('title' => t('Change widget type.')))), + '#type' => 'link', + '#title' => t($widget_types[$instance['widget']['type']]['label']), + '#href' => $admin_field_path . '/widget-type', + '#options' => array('attributes' => array('title' => t('Change widget type.'))), ), 'edit' => array( - '#markup' => l(t('edit'), $admin_field_path, array('attributes' => array('title' => t('Edit instance settings.')))), + '#type' => 'link', + '#title' => t('edit'), + '#href' => $admin_field_path, + '#options' => array('attributes' => array('title' => t('Edit instance settings.'))), ), 'delete' => array( - '#markup' => l(t('delete'), $admin_field_path . '/delete', array('attributes' => array('title' => t('Delete instance.')))), - ), + '#type' => 'link', + '#title' => t('delete'), + '#href' => $admin_field_path . '/delete', + '#options' => array('attributes' => array('title' => t('Delete instance.'))), + ), 'weight' => array( '#type' => 'textfield', '#default_value' => $weight, diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc index da3ef5beb..a8a98d4bb 100644 --- a/modules/filter/filter.admin.inc +++ b/modules/filter/filter.admin.inc @@ -32,8 +32,8 @@ function filter_admin_overview($form) { $roles_markup = $roles ? implode(', ', $roles) : t('No roles may use this format'); } $form['formats'][$id]['roles'] = array('#markup' => $roles_markup); - $form['formats'][$id]['configure'] = array('#markup' => l(t('configure'), 'admin/config/content/formats/' . $id)); - $form['formats'][$id]['delete'] = array('#markup' => $form['formats'][$id]['#is_fallback'] ? '' : l(t('delete'), 'admin/config/content/formats/' . $id . '/delete')); + $form['formats'][$id]['configure'] = array('#type' => 'link', '#title' => t('configure'), '#href' => 'admin/config/content/formats/' . $id); + $form['formats'][$id]['delete'] = array('#type' => 'link', '#title' => t('delete'), '#href' => 'admin/config/content/formats/' . $id . '/delete', '#access' => !$form['formats'][$id]['#is_fallback']); $form['formats'][$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight); } $form['submit'] = array('#type' => 'submit', '#value' => t('Save changes')); diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index d392632e7..a860be8c5 100644 --- a/modules/image/image.admin.inc +++ b/modules/image/image.admin.inc @@ -97,11 +97,15 @@ function image_style_form($form, &$form_state, $style) { '#access' => $editable, ); $form['effects'][$ieid]['configure'] = array( - '#markup' => isset($effect['form callback']) ? l(t('edit'), 'admin/config/media/image-styles/edit/' . $style['name'] . '/effects/' . $effect['ieid'] ) : '', - '#access' => $editable, + '#type' => 'link', + '#title' => t('edit'), + '#href' => 'admin/config/media/image-styles/edit/' . $style['name'] . '/effects/' . $effect['ieid'], + '#access' => $editable && isset($effect['form callback']), ); $form['effects'][$ieid]['remove'] = array( - '#markup' => l(t('delete'), 'admin/config/media/image-styles/edit/' . $style['name'] . '/effects/' . $effect['ieid'] . '/delete'), + '#type' => 'link', + '#title' => t('delete'), + '#href' => 'admin/config/media/image-styles/edit/' . $style['name'] . '/effects/' . $effect['ieid'] . '/delete', '#access' => $editable, ); } diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc index 16fcadf7c..efda2de64 100644 --- a/modules/menu/menu.admin.inc +++ b/modules/menu/menu.admin.inc @@ -109,20 +109,16 @@ function _menu_overview_tree_form($tree) { ); // Build a list of operations. $operations = array(); - $operations['edit'] = l(t('edit'), 'admin/structure/menu/item/' . $item['mlid'] . '/edit'); + $operations['edit'] = array('#type' => 'link', '#title' => t('edit'), '#href' => 'admin/structure/menu/item/' . $item['mlid'] . '/edit'); // Only items created by the menu module can be deleted. if ($item['module'] == 'menu' || $item['updated'] == 1) { - $operations['delete'] = l(t('delete'), 'admin/structure/menu/item/' . $item['mlid'] . '/delete'); + $operations['delete'] = array('#type' => 'link', '#title' => t('delete'), '#href' => 'admin/structure/menu/item/' . $item['mlid'] . '/delete'); } // Set the reset column. elseif ($item['module'] == 'system' && $item['customized']) { - $operations['reset'] = l(t('reset'), 'admin/structure/menu/item/' . $item['mlid'] . '/reset'); - } - - $form[$mlid]['operations'] = array(); - foreach ($operations as $op => $value) { - $form[$mlid]['operations'][$op] = array('#markup' => $value); + $operations['reset'] = array('#type' => 'link', '#title' => t('reset'), '#href' => 'admin/structure/menu/item/' . $item['mlid'] . '/reset'); } + $form[$mlid]['operations'] = $operations; } if ($data['below']) { diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index 3256aaa7c..9079936b2 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -466,7 +466,15 @@ function node_admin_nodes() { foreach ($result as $node) { $l_options = empty($node->language) ? array() : array('language' => $languages[$node->language]); $options[$node->nid] = array( - 'title' => l($node->title, 'node/' . $node->nid, $l_options) . ' ' . theme('mark', array('type' => node_mark($node->nid, $node->changed))), + 'title' => array( + 'data' => array( + '#type' => 'link', + '#title' => $node->title, + '#href' => 'node/' . $node->nid, + '#options' => $l_options, + '#suffix' => ' ' . theme('mark', array('type' => node_mark($node->nid, $node->changed))), + ), + ), 'type' => check_plain(node_type_get_name($node)), 'author' => theme('username', array('account' => $node)), 'status' => $node->status ? t('published') : t('not published'), @@ -475,7 +483,14 @@ function node_admin_nodes() { if ($multilanguage) { $options[$node->nid]['language'] = empty($node->language) ? t('Language neutral') : t($languages[$node->language]->name); } - $options[$node->nid]['operations'] = l(t('edit'), 'node/' . $node->nid . '/edit', array('query' => $destination)); + $options[$node->nid]['operations'] = array( + 'data' => array( + '#type' => 'link', + '#title' => t('edit'), + '#href' => 'node/' . $node->nid . '/edit', + '#options' => array('query' => $destination), + ), + ); } $form['nodes'] = array( '#type' => 'tableselect', diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc index 227e10881..90bc39f85 100644 --- a/modules/profile/profile.admin.inc +++ b/modules/profile/profile.admin.inc @@ -26,8 +26,8 @@ function profile_admin_overview($form) { $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('#markup' => l(t('edit'), "admin/config/people/profile/edit/$field->fid")); - $form[$field->fid]['delete'] = array('#markup' => l(t('delete'), "admin/config/people/profile/delete/$field->fid")); + $form[$field->fid]['edit'] = array('#type' => 'link', '#title' => t('edit'), '#href' => "admin/config/people/profile/edit/$field->fid"); + $form[$field->fid]['delete'] = array('#type' => 'link', '#title' => t('delete'), '#href' => "admin/config/people/profile/delete/$field->fid"); } // Add the category combo boxes @@ -51,6 +51,7 @@ function profile_admin_overview($form) { } $form['#tree'] = TRUE; + // @todo: Any reason this isn't done using an element with #theme = 'links'? $addnewfields = '<h2>' . t('Add new field') . '</h2>'; $addnewfields .= '<ul>'; foreach (_profile_field_types() as $key => $value) { diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 9f13a60b4..877598119 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -240,13 +240,8 @@ function system_themes_form() { ); $options[$theme->name] = $theme->info['name']; - if (drupal_theme_access($theme)) { - $form[$theme->name]['operations'] = array('#markup' => l(t('configure'), 'admin/appearance/settings/' . $theme->name) ); - } - else { - // Dummy element for drupal_render. Cleaner than adding a check in the theme function. - $form[$theme->name]['operations'] = array(); - } + $form[$theme->name]['operations'] = drupal_theme_access($theme) ? array('#type' => 'link', '#title' => t('configure'), '#href' => 'admin/appearance/settings/' . $theme->name) : array(); + if (!empty($theme->status)) { $status[] = $theme->name; } diff --git a/modules/system/system.module b/modules/system/system.module index 9ec9e942f..0b587db77 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -445,7 +445,7 @@ function system_element_info() { // Form structure. $types['item'] = array( '#markup' => '', - '#theme' => 'markup', + '#pre_render' => array('drupal_pre_render_markup'), '#theme_wrappers' => array('form_element'), ); $types['hidden'] = array( @@ -458,7 +458,10 @@ function system_element_info() { ); $types['markup'] = array( '#markup' => '', - '#theme' => 'markup', + '#pre_render' => array('drupal_pre_render_markup'), + ); + $types['link'] = array( + '#pre_render' => array('drupal_pre_render_link', 'drupal_pre_render_markup'), ); $types['fieldset'] = array( '#collapsible' => FALSE, diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index 6aed48909..f3550464f 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -20,9 +20,9 @@ function taxonomy_overview_vocabularies($form) { $form[$vocabulary->vid]['#vocabulary'] = $vocabulary; $form[$vocabulary->vid]['name'] = array('#markup' => check_plain($vocabulary->name)); $form[$vocabulary->vid]['weight'] = array('#type' => 'weight', '#delta' => 10, '#default_value' => $vocabulary->weight); - $form[$vocabulary->vid]['edit'] = array('#markup' => l(t('edit vocabulary'), "admin/structure/taxonomy/$vocabulary->vid")); - $form[$vocabulary->vid]['list'] = array('#markup' => l(t('list terms'), "admin/structure/taxonomy/$vocabulary->vid/list")); - $form[$vocabulary->vid]['add'] = array('#markup' => l(t('add terms'), "admin/structure/taxonomy/$vocabulary->vid/list/add")); + $form[$vocabulary->vid]['edit'] = array('#type' => 'link', '#title' => t('edit vocabulary'), '#href' => "admin/structure/taxonomy/$vocabulary->vid"); + $form[$vocabulary->vid]['list'] = array('#type' => 'link', '#title' => t('list terms'), '#href' => "admin/structure/taxonomy/$vocabulary->vid/list"); + $form[$vocabulary->vid]['add'] = array('#type' => 'link', '#title' => t('add terms'), '#href' => "admin/structure/taxonomy/$vocabulary->vid/list/add"); } // Only make this form include a submit button and weight if more than one @@ -354,7 +354,7 @@ function taxonomy_overview_terms($form, &$form_state, $vocabulary) { unset($form[$key]['#term']['parents'], $term->parents); } - $form[$key]['view'] = array('#markup' => l($term->name, "taxonomy/term/$term->tid")); + $form[$key]['view'] = array('#type' => 'link', '#title' => $term->name, '#href' => "taxonomy/term/$term->tid"); if ($vocabulary->hierarchy < 2 && count($tree) > 1) { $form['#parent_fields'] = TRUE; $form[$key]['tid'] = array( @@ -372,7 +372,7 @@ function taxonomy_overview_terms($form, &$form_state, $vocabulary) { '#default_value' => $term->depth, ); } - $form[$key]['edit'] = array('#markup' => l(t('edit'), 'taxonomy/term/' . $term->tid . '/edit', array('query' => drupal_get_destination()))); + $form[$key]['edit'] = array('#type' => 'link', '#title' => t('edit'), '#href' => 'taxonomy/term/' . $term->tid . '/edit', '#options' => array('query' => drupal_get_destination())); } $form['#total_entries'] = $total_entries; diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index 5273d19d7..bbc633436 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -192,7 +192,7 @@ function user_admin_account() { 'roles' => theme('item_list', array('items' => $users_roles)), 'member_for' => format_interval(REQUEST_TIME - $account->created), 'access' => $account->access ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $account->access))) : t('never'), - 'operations' => l(t('edit'), "user/$account->uid/edit", array('query' => $destination)), + 'operations' => array('data' => array('#link' => array('title' => t('edit'), 'href' => "user/$account->uid/edit", 'query' => $destination))), ); } |