diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5a9fd7377372578c3414828f4d886cb36fef41b0..bc1ac08457f1e692f914be2f5e0121a0a0377bf5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -32,6 +32,7 @@ Drupal 7.0, xxxx-xx-xx (development version) * Redesigned password strength validator. * Redesigned the add content type screen. * Highlight duplicate URL aliases. + * Renamed "input formats" to "text formats". * Added configurable ability for users to cancel their own accounts. - Performance: * Improved performance on uncached page views by loading multiple core diff --git a/includes/form.inc b/includes/form.inc index 740a21d62c3c1bfa06713b7a5b18af2f53b5896e..af42e8e272225a350b0ee791ad6663a79d42a2cf 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -1782,14 +1782,14 @@ function form_process_radios($element) { } /** - * Add input format selector to text elements with the #input_format property. + * Add text format selector to text elements with the #text_format property. * - * The #input_format property should be the ID of an input format, found in + * The #text_format property should be the ID of an text format, found in * {filter_format}.format, which gets passed to filter_form(). * - * If the property #input_format is set, the form element will be expanded into + * If the property #text_format is set, the form element will be expanded into * two separate form elements, one holding the content of the element, and the - * other holding the input format selector. The original element is shifted into + * other holding the text format selector. The original element is shifted into * a child element, but is otherwise unaltered, so that the format selector is * at the same level as the text field which it affects. * @@ -1799,7 +1799,7 @@ function form_process_radios($element) { * $form['body'] = array( * '#type' => 'textarea', * '#title' => t('Body'), - * '#input_format' => isset($node->format) ? $node->format : FILTER_FORMAT_DEFAULT, + * '#text_format' => isset($node->format) ? $node->format : FILTER_FORMAT_DEFAULT, * ); * @endcode * @@ -1814,7 +1814,7 @@ function form_process_radios($element) { * '#title' => t('Body'), * '#parents' => array('body'), * ), - * // 'format' holds the input format selector. + * // 'format' holds the text format selector. * 'format' => array( * '#parents' => array('body_format'), * ... @@ -1826,14 +1826,14 @@ function form_process_radios($element) { * @code * // Original, unaltered form element value. * $form_state['values']['body'] = 'Example content'; - * // Chosen input format. + * // Chosen text format. * $form_state['values']['body_format'] = 1; * @endcode * * @see system_elements(), filter_form() */ function form_process_input_format($element) { - if (isset($element['#input_format'])) { + if (isset($element['#text_format'])) { // Determine the form element parents and element name to use for the input // format widget. This simulates the 'element' and 'element_format' pair of // parents that filter_form() expects. @@ -1844,11 +1844,11 @@ function form_process_input_format($element) { // We need to break references, otherwise form_builder recurses infinitely. $element['value'] = (array)$element; $element['#type'] = 'markup'; - $element['format'] = filter_form($element['#input_format'], 1, $element_parents); + $element['format'] = filter_form($element['#text_format'], 1, $element_parents); - // We need to clear the #input_format from the new child otherwise we + // We need to clear the #text_format from the new child otherwise we // would get into an infinite loop. - unset($element['value']['#input_format']); + unset($element['value']['#text_format']); $element['value']['#weight'] = 0; } return $element; diff --git a/modules/block/block.module b/modules/block/block.module index 25e8796bea3b6e0a60afedcf705454986ee016c4..318617e8bfe47a83561fd4e446e3c979512cecd4 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -328,7 +328,7 @@ function block_box_form($edit = array()) { '#type' => 'textarea', '#title' => t('Block body'), '#default_value' => $edit['body'], - '#input_format' => isset($edit['format']) ? $edit['format'] : FILTER_FORMAT_DEFAULT, + '#text_format' => isset($edit['format']) ? $edit['format'] : FILTER_FORMAT_DEFAULT, '#rows' => 15, '#description' => t('The content of the block as shown to the user.'), '#weight' => -17, diff --git a/modules/block/block.test b/modules/block/block.test index d7688a16e54370a526e60a6c157487bdc5c257aa..3fff643de0c56bc227c337b573783f07994b7b8f 100644 --- a/modules/block/block.test +++ b/modules/block/block.test @@ -77,7 +77,7 @@ class BlockTestCase extends DrupalWebTestCase { $edit['block_' . $bid . '[region]'] = 'left'; $this->drupalPost('admin/build/block', $edit, t('Save blocks')); - // Confirm that the box is being displayed using configured input format. + // Confirm that the box is being displayed using configured text format. $this->assertRaw('<h1>Full HTML</h1>', t('Box successfully being displayed using Full HTML.')); } diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module index ba47b0527f4cfeb5c1e83a05f559aa83c1eda8e8..763d39f10fad4adb50ac32ddd5422395e34a79bf 100644 --- a/modules/blogapi/blogapi.module +++ b/modules/blogapi/blogapi.module @@ -617,7 +617,7 @@ function blogapi_mt_validate_terms($node) { } /** - * Blogging API callback. Sends a list of available input formats. + * Blogging API callback. Sends a list of available text formats. */ function blogapi_mt_supported_text_filters() { // NOTE: we're only using anonymous' formats because the MT spec diff --git a/modules/comment/comment.module b/modules/comment/comment.module index df966be921e2745fa2f9b00110b4e1fae3fc4d70..45cad76eb416796a97cfb57b4d8935db6e5eb31d 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1518,7 +1518,7 @@ function comment_form(&$form_state, $edit, $title = NULL) { '#title' => t('Comment'), '#rows' => 15, '#default_value' => $default, - '#input_format' => isset($edit['format']) ? $edit['format'] : FILTER_FORMAT_DEFAULT, + '#text_format' => isset($edit['format']) ? $edit['format'] : FILTER_FORMAT_DEFAULT, '#required' => TRUE, ); diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc index d3e46113c57877b988e60eb3252893b39048433f..24879538d51425b0f9ff3b53cf3d6c45fbcba56b 100644 --- a/modules/filter/filter.admin.inc +++ b/modules/filter/filter.admin.inc @@ -7,7 +7,7 @@ */ /** - * Menu callback; Displays a list of all input formats and which + * Menu callback; Displays a list of all text formats and which * one is the default. * * @ingroup forms @@ -31,9 +31,9 @@ function filter_admin_overview() { $default = ($id == variable_get('filter_default_format', 1)); $options[$id] = ''; $form[$id]['name'] = array('#markup' => $format->name); - $form[$id]['roles'] = array('#markup' => $default ? t('All roles may use default format') : ($roles ? implode(', ', $roles) : t('No roles may use this format'))); - $form[$id]['edit'] = array('#markup' => l(t('edit'), 'admin/settings/filters/' . $id)); - $form[$id]['delete'] = array('#markup' => $default ? '' : l(t('delete'), 'admin/settings/filters/delete/' . $id)); + $form[$id]['roles'] = array('#markup' => $default ? t('All roles may use the default format') : ($roles ? implode(', ', $roles) : t('No roles may use this format'))); + $form[$id]['configure'] = array('#markup' => l(t('configure'), 'admin/settings/filter/' . $id)); + $form[$id]['delete'] = array('#markup' => $default ? '' : l(t('delete'), 'admin/settings/filter/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)); @@ -53,7 +53,7 @@ function filter_admin_overview_submit($form, &$form_state) { db_query("UPDATE {filter_format} SET weight = %d WHERE format = %d", $data['weight'], $id); } } - drupal_set_message(t('The input format ordering has been saved.')); + drupal_set_message(t('The text format ordering has been saved.')); } /** @@ -94,7 +94,7 @@ function theme_filter_admin_overview($form) { */ function filter_admin_format_page($format = NULL) { if (!isset($format->name)) { - drupal_set_title(t('Add input format'), PASS_THROUGH); + drupal_set_title(t('Add text format'), PASS_THROUGH); $format = (object)array('name' => '', 'roles' => '', 'format' => ''); } return drupal_get_form('filter_admin_format_form', $format); @@ -166,7 +166,7 @@ function filter_admin_format_form(&$form_state, $format) { else { $tiplist .= theme('filter_tips_more_info'); } - $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 = '<p>' . t('These are the guidelines that users will see for posting in this text format. They are automatically generated from the filter settings.') . '</p>'; $group .= $tiplist; $form['tips'] = array('#markup' => '<h2>' . t('Formatting guidelines') . '</h2>' . $group); } @@ -202,10 +202,10 @@ function filter_admin_format_form_submit($form, &$form_state) { $new = TRUE; db_query("INSERT INTO {filter_format} (name) VALUES ('%s')", $name); $format = db_result(db_query("SELECT MAX(format) AS format FROM {filter_format}")); - drupal_set_message(t('Added input format %format.', array('%format' => $name))); + drupal_set_message(t('Added text format %format.', array('%format' => $name))); } else { - drupal_set_message(t('The input format settings have been updated.')); + drupal_set_message(t('The text format settings have been updated.')); } db_query("DELETE FROM {filter} WHERE format = %d", $format); @@ -244,7 +244,7 @@ function filter_admin_format_form_submit($form, &$form_state) { cache_clear_all($format . ':', 'cache_filter', TRUE); // If a new filter was added, return to the main list of filters. Otherwise, stay on edit filter page to show new changes. - $return = 'admin/settings/filters'; + $return = 'admin/settings/filter'; if (!empty($new)) { $return .= '/' . $format; } @@ -267,11 +267,11 @@ function filter_admin_delete() { $form['format'] = array('#type' => 'hidden', '#value' => $format->format); $form['name'] = array('#type' => 'hidden', '#value' => $format->name); - return confirm_form($form, t('Are you sure you want to delete the input format %format?', array('%format' => $format->name)), 'admin/settings/filters', t('If you have any content left in this input format, it will be switched to the default input format. This action cannot be undone.'), t('Delete'), t('Cancel')); + return confirm_form($form, t('Are you sure you want to delete the text format %format?', array('%format' => $format->name)), 'admin/settings/filter', t('If you have any content left in this text format, it will be switched to the default text format. This action cannot be undone.'), t('Delete'), t('Cancel')); } else { drupal_set_message(t('The default format cannot be deleted.')); - drupal_goto('admin/settings/filters'); + drupal_goto('admin/settings/filter'); } } else { @@ -293,9 +293,9 @@ function filter_admin_delete_submit($form, &$form_state) { db_query("UPDATE {box} SET format = %d WHERE format = %d", $default, $form_state['values']['format']); cache_clear_all($form_state['values']['format'] . ':', 'cache_filter', TRUE); - drupal_set_message(t('Deleted input format %format.', array('%format' => $form_state['values']['name']))); + drupal_set_message(t('Deleted text format %format.', array('%format' => $form_state['values']['name']))); - $form_state['redirect'] = 'admin/settings/filters'; + $form_state['redirect'] = 'admin/settings/filter'; return; } diff --git a/modules/filter/filter.api.php b/modules/filter/filter.api.php index ffd942c75c8b5d14ed67b5be59cf114b80f13ad6..2d7406e8bcf3ef008b6653aa57da65d475f00a87 100644 --- a/modules/filter/filter.api.php +++ b/modules/filter/filter.api.php @@ -46,7 +46,7 @@ * the content: transforming URLs into hyperlinks, converting smileys into * images, etc. * - * An important aspect of the filtering system are 'input formats'. Every input + * An important aspect of the filtering system are 'text formats'. Every input * format is an entire filter setup: which filters to enable, in what order * and with what settings. Filters that provide settings should usually store * these settings per format. @@ -61,7 +61,7 @@ * in the cache table and retrieved the next time the piece of content is * displayed. If a filter's output is dynamic it can override the cache * mechanism, but obviously this feature should be used with caution: having one - * 'no cache' filter in a particular input format disables caching for the + * 'no cache' filter in a particular text format disables caching for the * entire format, not just for one filter. * * Beware of the filter cache when developing your module: it is advised to set @@ -82,12 +82,12 @@ * - settings: Return HTML form controls for the filter's settings. These * settings are stored with variable_set() when the form is submitted. * Remember to use the $format identifier in the variable and control names - * to store settings per input format (e.g. "mymodule_setting_$format"). + * to store settings per text format (e.g. "mymodule_setting_$format"). * @param $delta * Which of the module's filters to use (applies to every operation except * 'list'). Modules that only contain one filter can ignore this parameter. * @param $format - * Which input format the filter is being used in (applies to 'prepare', + * Which text format the filter is being used in (applies to 'prepare', * 'process' and 'settings'). * @param $text * The content to filter (applies to 'prepare' and 'process'). diff --git a/modules/filter/filter.install b/modules/filter/filter.install index fb0bf3e43b06f0ca54a78a64598127afe7ffef4a..bc8a63d69172ef50f9301b74a51da5696b806e9d 100644 --- a/modules/filter/filter.install +++ b/modules/filter/filter.install @@ -6,7 +6,7 @@ */ function filter_schema() { $schema['filter'] = array( - 'description' => 'Table that maps filters (HTML corrector) to input formats (Filtered HTML).', + 'description' => 'Table that maps filters (HTML corrector) to text formats (Filtered HTML).', 'fields' => array( 'fid' => array( 'type' => 'serial', @@ -50,7 +50,7 @@ function filter_schema() { ), ); $schema['filter_format'] = array( - 'description' => 'Stores input formats: custom groupings of filters, such as Filtered HTML.', + 'description' => 'Stores text formats: custom groupings of filters, such as Filtered HTML.', 'fields' => array( 'format' => array( 'type' => 'serial', @@ -62,7 +62,7 @@ function filter_schema() { 'length' => 255, 'not null' => TRUE, 'default' => '', - 'description' => 'Name of the input format (Filtered HTML).', + 'description' => 'Name of the text format (Filtered HTML).', ), 'roles' => array( 'type' => 'varchar', @@ -83,7 +83,7 @@ function filter_schema() { 'not null' => TRUE, 'default' => 0, 'size' => 'tiny', - 'description' => 'Weight of input format to use when listing.', + 'description' => 'Weight of text format to use when listing.', ) ), 'primary key' => array('format'), @@ -93,7 +93,7 @@ function filter_schema() { ); $schema['cache_filter'] = drupal_get_schema_unprocessed('system', 'cache'); - $schema['cache_filter']['description'] = 'Cache table for the Filter module to store already filtered pieces of text, identified by input format and md5 hash of the text.'; + $schema['cache_filter']['description'] = 'Cache table for the Filter module to store already filtered pieces of text, identified by text format and md5 hash of the text.'; return $schema; } diff --git a/modules/filter/filter.module b/modules/filter/filter.module index e6adb324a32eb2e88ad9b720d1210b8b65aa9cde..a98423418bd542a1c686a0eb57597efe2b0aed7e 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -20,20 +20,20 @@ function filter_help($path, $arg) { switch ($path) { case 'admin/help#filter': - $output = '<p>' . t("The filter module allows administrators to configure text input formats for use on your site. An input format defines the HTML tags, codes, and other input allowed in both content and comments, and is a key feature in guarding against potentially damaging input from malicious users. Two input formats included by default are <em>Filtered HTML</em> (which allows only an administrator-approved subset of HTML tags) and <em>Full HTML</em> (which allows the full set of HTML tags). Additional input formats may be created by an administrator.") . '</p>'; - $output .= '<p>' . t('Each input format uses filters to manipulate text, and most input formats apply several different filters to text in a specific order. Each filter is designed for a specific purpose, and generally either adds, removes or transforms elements within user-entered text before it is displayed. A filter does not change the actual content of a post, but instead, modifies it temporarily before it is displayed. A filter may remove unapproved HTML tags, for instance, while another automatically adds HTML to make links referenced in text clickable.') . '</p>'; - $output .= '<p>' . t('Users with access to more than one input format can use the <em>Input format</em> fieldset to choose between available input formats when creating or editing multi-line content. Administrators determine the input formats available to each user role, select a default input format, and control the order of formats listed in the <em>Input format</em> fieldset.') . '</p>'; + $output = '<p>' . t("The filter module allows administrators to configure text formats for use on your site. A text format defines the HTML tags, codes, and other input allowed in both content and comments, and is a key feature in guarding against potentially damaging input from malicious users. Two formats included by default are <em>Filtered HTML</em> (which allows only an administrator-approved subset of HTML tags) and <em>Full HTML</em> (which allows the full set of HTML tags). Additional formats may be created by an administrator.") . '</p>'; + $output .= '<p>' . t('Each text format uses filters to manipulate text, and most formats apply several different filters to text in a specific order. Each filter is designed for a specific purpose, and generally either adds, removes or transforms elements within user-entered text before it is displayed. A filter does not change the actual content of a post, but instead, modifies it temporarily before it is displayed. A filter may remove unapproved HTML tags, for instance, while another automatically adds HTML to make links referenced in text clickable.') . '</p>'; + $output .= '<p>' . t('Users with access to more than one text format can use the <em>Text format</em> fieldset to choose between available text formats when creating or editing multi-line content. Administrators determine the text formats available to each user role, select a default text format, and control the order of formats listed in the <em>Text format</em> fieldset.') . '</p>'; $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@filter">Filter module</a>.', array('@filter' => 'http://drupal.org/handbook/modules/filter/')) . '</p>'; return $output; - case 'admin/settings/filters': - $output = '<p>' . t('Use the list below to review the input formats available to each user role, to select a default input format, and to control the order of formats listed in the <em>Input format</em> fieldset. (The <em>Input format</em> fieldset is displayed below textareas when users with access to more than one input format create multi-line content.) The input format selected as <em>Default</em> is available to all users and, unless another format is selected, is applied to all content. All input formats are available to users in roles with the "administer filters" permission.') . '</p>'; - $output .= '<p>' . t('Since input formats, if available, are presented in the same order as the list below, it may be helpful to arrange the formats in descending order of your preference for their use. To change the order of an input format, grab a drag-and-drop handle under the <em>Name</em> column and drag to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save changes</em> button at the bottom of the page.') . '</p>'; + case 'admin/settings/filter': + $output = '<p>' . t('Use the list below to review the text formats available to each user role, to select a default text format, and to control the order of formats listed in the <em>Text format</em> fieldset. (The <em>Text format</em> fieldset is displayed below textareas when users with access to more than one text format create multi-line content.) The text format selected as <em>Default</em> is available to all users and, unless another format is selected, is applied to all content. All text formats are available to users in roles with the "administer filters" permission.') . '</p>'; + $output .= '<p>' . t('Since text formats, if available, are presented in the same order as the list below, it may be helpful to arrange the formats in descending order of your preference for their use. To change the order of an text format, grab a drag-and-drop handle under the <em>Name</em> column and drag to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save changes</em> button at the bottom of the page.') . '</p>'; return $output; - case 'admin/settings/filters/%': - return '<p>' . t('Every <em>filter</em> performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this input format. If you notice some filters are causing conflicts in the output, you can <a href="@rearrange">rearrange them</a>.', array('@rearrange' => url('admin/settings/filters/' . $arg[3] . '/order'))) . '</p>'; - case 'admin/settings/filters/%/configure': - return '<p>' . t('If you cannot find the settings for a certain filter, make sure you have enabled it on the <a href="@url">edit tab</a> first.', array('@url' => url('admin/settings/filters/' . $arg[3]))) . '</p>'; - case 'admin/settings/filters/%/order': + case 'admin/settings/filter/%': + return '<p>' . t('Every <em>filter</em> performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this format. If you notice some filters are causing conflicts in the output, you can <a href="@rearrange">rearrange them</a>.', array('@rearrange' => url('admin/settings/filter/' . $arg[3] . '/order'))) . '</p>'; + case 'admin/settings/filter/%/configure': + return '<p>' . t('If you cannot find the settings for a certain filter, make sure you have enabled it on the <a href="@url">edit tab</a> first.', array('@url' => url('admin/settings/filter/' . $arg[3]))) . '</p>'; + case 'admin/settings/filter/%/order': $output = '<p>' . t('Because of the flexible filtering system, you might encounter a situation where one filter prevents another from doing its job. For example: a word in an URL gets converted into a glossary term, before the URL can be converted to a clickable link. When this happens, rearrange the order of the filters.') . '</p>'; $output .= '<p>' . t("Filters are executed from top-to-bottom. To change the order of the filters, modify the values in the <em>Weight</em> column or grab a drag-and-drop handle under the <em>Name</em> column and drag filters to new locations in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save configuration</em> button at the bottom of the page.") . '</p>'; return $output; @@ -67,26 +67,26 @@ function filter_theme() { * Implementation of hook_menu(). */ function filter_menu() { - $items['admin/settings/filters'] = array( - 'title' => 'Input formats', + $items['admin/settings/filter'] = array( + 'title' => 'Text formats', 'description' => 'Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters.', 'page callback' => 'drupal_get_form', 'page arguments' => array('filter_admin_overview'), 'access arguments' => array('administer filters'), ); - $items['admin/settings/filters/list'] = array( + $items['admin/settings/filter/list'] = array( 'title' => 'List', 'type' => MENU_DEFAULT_LOCAL_TASK, ); - $items['admin/settings/filters/add'] = array( - 'title' => 'Add input format', + $items['admin/settings/filter/add'] = array( + 'title' => 'Add text format', 'page callback' => 'filter_admin_format_page', 'access arguments' => array('administer filters'), 'type' => MENU_LOCAL_TASK, 'weight' => 1, ); - $items['admin/settings/filters/delete'] = array( - 'title' => 'Delete input format', + $items['admin/settings/filter/delete'] = array( + 'title' => 'Delete text format', 'page callback' => 'drupal_get_form', 'page arguments' => array('filter_admin_delete'), 'access arguments' => array('administer filters'), @@ -98,7 +98,7 @@ function filter_menu() { 'access callback' => TRUE, 'type' => MENU_SUGGESTED_ITEM, ); - $items['admin/settings/filters/%filter_format'] = array( + $items['admin/settings/filter/%filter_format'] = array( 'type' => MENU_CALLBACK, 'title callback' => 'filter_admin_format_title', 'title arguments' => array(3), @@ -106,12 +106,12 @@ function filter_menu() { 'page arguments' => array(3), 'access arguments' => array('administer filters'), ); - $items['admin/settings/filters/%filter_format/edit'] = array( + $items['admin/settings/filter/%filter_format/edit'] = array( 'title' => 'Edit', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => 0, ); - $items['admin/settings/filters/%filter_format/configure'] = array( + $items['admin/settings/filter/%filter_format/configure'] = array( 'title' => 'Configure', 'page callback' => 'filter_admin_configure_page', 'page arguments' => array(3), @@ -119,7 +119,7 @@ function filter_menu() { 'type' => MENU_LOCAL_TASK, 'weight' => 1, ); - $items['admin/settings/filters/%filter_format/order'] = array( + $items['admin/settings/filter/%filter_format/order'] = array( 'title' => 'Rearrange', 'page callback' => 'filter_admin_order_page', 'page arguments' => array(3), @@ -148,7 +148,7 @@ function filter_perm() { return array( 'administer filters' => array( 'title' => t('Administer filters'), - 'description' => t('Manage input formats and filters, and select which roles may use them. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))), + 'description' => t('Manage text formats and filters, and select which roles may use them. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))), ), ); } @@ -283,13 +283,13 @@ function filter_filter_tips($delta, $format, $long = FALSE) { } /** - * Retrieve a list of input formats. + * Retrieve a list of text formats. */ function filter_formats($index = NULL) { global $user; static $formats; - // Administrators can always use all input formats. + // Administrators can always use all text formats. $all = user_access('administer filters'); if (!isset($formats)) { @@ -355,7 +355,7 @@ function filter_resolve_format($format) { return $format == FILTER_FORMAT_DEFAULT ? variable_get('filter_default_format', 1) : $format; } /** - * Check if text in a certain input format is allowed to be cached. + * Check if text in a certain text format is allowed to be cached. */ function filter_format_allowcache($format) { static $cache = array(); @@ -472,9 +472,9 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $langcode = '', $c * @param $value * The ID of the format that is currently selected. * @param $weight - * The weight of the input format. + * The weight of the text format. * @param $parents - * Required when defining multiple input formats on a single node or having a different parent than 'format'. + * Required when defining multiple text formats on a single node or having a different parent than 'format'. * @return * HTML for the form element. */ @@ -487,7 +487,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents = if (count($formats) > 1) { $form = array( '#type' => 'fieldset', - '#title' => t('Input format'), + '#title' => t('Text format'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => $weight, @@ -952,7 +952,7 @@ function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite', if (!drupal_validate_utf8($string)) { return ''; } - // Store the input format + // Store the text format _filter_xss_split($allowed_tags, TRUE); // Remove NULL characters (ignored by some browsers) $string = str_replace(chr(0), '', $string); diff --git a/modules/filter/filter.pages.inc b/modules/filter/filter.pages.inc index 4a1512ff19f3b31adbfa6d4fa697eea32f65346a..0297a940cdb251032fa2b022ee1d17292cf3b322 100644 --- a/modules/filter/filter.pages.inc +++ b/modules/filter/filter.pages.inc @@ -28,7 +28,7 @@ function filter_tips_long() { * @param $tips * An array containing descriptions and a CSS id in the form of * 'module-name/filter-id' (only used when $long is TRUE) for each input - * filter in one or more input formats. Example: + * filter in one or more text formats. Example: * @code * array( * 'Full HTML' => array( @@ -53,7 +53,7 @@ function theme_filter_tips($tips, $long = FALSE) { $multiple = count($tips) > 1; if ($multiple) { - $output = t('Input formats') . ':'; + $output = t('Text formats') . ':'; } if (count($tips)) { diff --git a/modules/filter/filter.test b/modules/filter/filter.test index 48444ebcb50065a16e23a184fca0432422d6e099..ba95188519538bf008533562a350a5203c95842c 100644 --- a/modules/filter/filter.test +++ b/modules/filter/filter.test @@ -28,15 +28,15 @@ class FilterAdminTestCase extends DrupalWebTestCase { // Change default filter. $edit = array(); $edit['default'] = $full; - $this->drupalPost('admin/settings/filters', $edit, t('Save changes')); + $this->drupalPost('admin/settings/filter', $edit, t('Save changes')); $this->assertText(t('Default format updated.'), t('Default filter updated successfully.')); - $this->assertNoRaw('admin/settings/filters/delete/' . $full, t('Delete link not found.')); + $this->assertNoRaw('admin/settings/filter/delete/' . $full, t('Delete link not found.')); // Add an additional tag. $edit = array(); $edit['allowed_html_1'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>' . ' <quote>'; // Adding <quote> tag. - $this->drupalPost('admin/settings/filters/' . $filtered . '/configure', $edit, t('Save configuration')); + $this->drupalPost('admin/settings/filter/' . $filtered . '/configure', $edit, t('Save configuration')); $this->assertText(t('The configuration options have been saved.'), t('Allowed HTML tag added.')); $this->assertRaw(htmlentities($edit['allowed_html_1']), t('Tag displayed.')); @@ -48,7 +48,7 @@ class FilterAdminTestCase extends DrupalWebTestCase { $edit = array(); $edit['weights[filter/' . $second_filter . ']'] = 1; $edit['weights[filter/' . $first_filter . ']'] = 2; - $this->drupalPost('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration')); + $this->drupalPost('admin/settings/filter/' . $filtered . '/order', $edit, t('Save configuration')); $this->assertText(t('The filter ordering has been saved.'), t('Order saved successfully.')); $result = db_query('SELECT * FROM {filter} WHERE format = %d ORDER BY weight ASC', $filtered); @@ -66,8 +66,8 @@ class FilterAdminTestCase extends DrupalWebTestCase { $edit['roles[2]'] = TRUE; $edit['filters[filter/' . $second_filter . ']'] = TRUE; $edit['filters[filter/' . $first_filter . ']'] = TRUE; - $this->drupalPost('admin/settings/filters/add', $edit, t('Save configuration')); - $this->assertRaw(t('Added input format %format.', array('%format' => $edit['name'])), t('New filter created.')); + $this->drupalPost('admin/settings/filter/add', $edit, t('Save configuration')); + $this->assertRaw(t('Added text format %format.', array('%format' => $edit['name'])), t('New filter created.')); $format = $this->getFilter($edit['name']); $this->assertNotNull($format, t('Format found in database.')); @@ -78,23 +78,23 @@ class FilterAdminTestCase extends DrupalWebTestCase { $this->assertFieldByName('filters[filter/' . $first_filter . ']', '', t('Url filter found.')); // Delete new filter. - $this->drupalPost('admin/settings/filters/delete/' . $format->format, array(), t('Delete')); - $this->assertRaw(t('Deleted input format %format.', array('%format' => $edit['name'])), t('Format successfully deleted.')); + $this->drupalPost('admin/settings/filter/delete/' . $format->format, array(), t('Delete')); + $this->assertRaw(t('Deleted text format %format.', array('%format' => $edit['name'])), t('Format successfully deleted.')); } // Change default filter back. $edit = array(); $edit['default'] = $filtered; - $this->drupalPost('admin/settings/filters', $edit, t('Save changes')); + $this->drupalPost('admin/settings/filter', $edit, t('Save changes')); $this->assertText(t('Default format updated.'), t('Default filter updated successfully.')); - $this->assertNoRaw('admin/settings/filters/delete/' . $filtered, t('Delete link not found.')); + $this->assertNoRaw('admin/settings/filter/delete/' . $filtered, t('Delete link not found.')); // Allow authenticated users on full HTML. $edit = array(); $edit['roles[2]'] = TRUE; - $this->drupalPost('admin/settings/filters/' . $full, $edit, t('Save configuration')); - $this->assertText(t('The input format settings have been updated.'), t('Full HTML format successfully updated.')); + $this->drupalPost('admin/settings/filter/' . $full, $edit, t('Save configuration')); + $this->assertText(t('The text format settings have been updated.'), t('Full HTML format successfully updated.')); // Switch user. $this->drupalLogout(); @@ -128,20 +128,20 @@ class FilterAdminTestCase extends DrupalWebTestCase { // Allowed tags. $edit = array(); $edit['allowed_html_1'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>'; - $this->drupalPost('admin/settings/filters/' . $filtered . '/configure', $edit, t('Save configuration')); + $this->drupalPost('admin/settings/filter/' . $filtered . '/configure', $edit, t('Save configuration')); $this->assertText(t('The configuration options have been saved.'), t('Changes reverted.')); // Full HTML. $edit = array(); $edit['roles[2]'] = FALSE; - $this->drupalPost('admin/settings/filters/' . $full, $edit, t('Save configuration')); - $this->assertText(t('The input format settings have been updated.'), t('Full HTML format successfully reverted.')); + $this->drupalPost('admin/settings/filter/' . $full, $edit, t('Save configuration')); + $this->assertText(t('The text format settings have been updated.'), t('Full HTML format successfully reverted.')); // Filter order. $edit = array(); $edit['weights[filter/' . $second_filter . ']'] = 2; $edit['weights[filter/' . $first_filter . ']'] = 1; - $this->drupalPost('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration')); + $this->drupalPost('admin/settings/filter/' . $filtered . '/order', $edit, t('Save configuration')); $this->assertText(t('The filter ordering has been saved.'), t('Order successfully reverted.')); } @@ -223,14 +223,14 @@ class FilterTestCase extends DrupalWebTestCase { 'roles[2]' => TRUE, 'filters[filter/' . $filter . ']' => TRUE, ); - $this->drupalPost('admin/settings/filters/add', $edit, t('Save configuration')); + $this->drupalPost('admin/settings/filter/add', $edit, t('Save configuration')); return db_fetch_object(db_query("SELECT * FROM {filter_format} WHERE name = '%s'", $edit['name'])); } function deleteFormat($format) { if ($format !== NULL) { // Delete new filter. - $this->drupalPost('admin/settings/filters/delete/' . $format->format, array(), t('Delete')); + $this->drupalPost('admin/settings/filter/delete/' . $format->format, array(), t('Delete')); } } } diff --git a/modules/node/node.install b/modules/node/node.install index 23775827e90f3d80add828b3a23a17d8fe9e4053..d0867f32809456d98a0719b91c5cfebb907abea4 100644 --- a/modules/node/node.install +++ b/modules/node/node.install @@ -264,7 +264,7 @@ function node_schema() { 'default' => 0, ), 'format' => array( - 'description' => "The input format used by this version's body.", + 'description' => "The text format used by this version's body.", 'type' => 'int', 'not null' => TRUE, 'default' => 0, diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index a989fa790cd7ad824ff00935e36eb288e3352bc7..194b385518c4558f777f830dd3c7cafe03f23ef1 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -297,7 +297,7 @@ function node_body_field(&$node, $label, $word_count) { '#default_value' => $include ? $node->body : ($node->teaser . $node->body), '#rows' => 20, '#required' => ($word_count > 0), - '#input_format' => isset($node->format) ? $node->format : FILTER_FORMAT_DEFAULT, + '#text_format' => isset($node->format) ? $node->format : FILTER_FORMAT_DEFAULT, ); return $form; diff --git a/modules/node/node.test b/modules/node/node.test index 42294f721927cc86aa9feb6e73bed52fbca93504..420499c7febb79a01be019035cdab81caa365d3a 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -210,7 +210,7 @@ class NodeTeaserTestCase extends DrupalWebTestCase { // The teasers we expect node_teaser() to return when $size is the index // of each array item. - // Using an input format with no line-break filter: + // Using an text format with no line-break filter: $teasers = array( "<p>\nHi\n</p>\n<p>\nfolks\n<br />\n!\n</p>", "<", @@ -252,7 +252,7 @@ class NodeTeaserTestCase extends DrupalWebTestCase { "<p>\nHi\n</p>\n<p>\nfolks\n<br />\n!\n</p>", ); - // And Using an input format WITH the line-break filter. + // And Using an text format WITH the line-break filter. $teasers_lb = array( "<p>\nHi\n</p>\n<p>\nfolks\n<br />\n!\n</p>", "<", diff --git a/modules/php/php.install b/modules/php/php.install index e65607019ea118152f239fe71d4640fb256ee70b..e8641e7d9baee5a25c61fde54b51416d6512314f 100644 --- a/modules/php/php.install +++ b/modules/php/php.install @@ -6,7 +6,7 @@ */ function php_install() { $format_exists = db_result(db_query("SELECT COUNT(*) FROM {filter_format} WHERE name = 'PHP code'")); - // Add a PHP code input format, if it does not exist. Do this only for the + // Add a PHP code text format, if it does not exist. Do this only for the // first install (or if the format has been manually deleted) as there is no // reliable method to identify the format in an uninstall hook or in // subsequent clean installs. @@ -17,7 +17,7 @@ function php_install() { // Enable the PHP evaluator filter. db_query("INSERT INTO {filter} (format, module, delta, weight) VALUES (%d, 'php', 0, 0)", $format); - drupal_set_message(t('A !php-code input format has been created.', array('!php-code' => l('PHP code', 'admin/settings/filters/' . $format)))); + drupal_set_message(t('A !php-code text format has been created.', array('!php-code' => l('PHP code', 'admin/settings/filter/' . $format)))); } } diff --git a/modules/php/php.module b/modules/php/php.module index cf7dea43d3eb09c3e9a82de7f163b0330509aa23..de7371b7f34a0ae963a4090f25d1f890ba94af65 100644 --- a/modules/php/php.module +++ b/modules/php/php.module @@ -44,7 +44,7 @@ function php_filter_tips($delta, $format, $long = FALSE) { $output .= '<li>' . t('Consider including your custom PHP code within a site-specific module or <code>template.php</code> file rather than embedding it directly into a post or block.') . '</li>'; $output .= '<li>' . t('Be aware that the ability to embed PHP code within content is provided by the PHP Filter module. If this module is disabled or deleted, then blocks and posts with embedded PHP may display, rather than execute, the PHP code.') . '</li></ul>'; $output .= '<p>' . t('A basic example: <em>Creating a "Welcome" block that greets visitors with a simple message.</em>') . '</p>'; - $output .= '<ul><li>' . t('<p>Add a custom block to your site, named "Welcome" . With its input format set to "PHP code" (or another format supporting PHP input), add the following in the Block body:</p> + $output .= '<ul><li>' . t('<p>Add a custom block to your site, named "Welcome" . With its text format set to "PHP code" (or another format supporting PHP input), add the following in the Block body:</p> <pre> print t(\'Welcome visitor! Thank you for visiting.\'); </pre>') . '</li>'; diff --git a/modules/php/php.test b/modules/php/php.test index 6ee4f3a5964487861014597afa10acf1b2ec2e08..84ddb6c554c6f8e58c794aa7d79e0eee0206ddc8 100644 --- a/modules/php/php.test +++ b/modules/php/php.test @@ -13,7 +13,7 @@ class PHPTestCase extends DrupalWebTestCase { $this->drupalLogin($admin_user); // Confirm that the PHP filter is #3. - $this->drupalGet('admin/settings/filters/3'); + $this->drupalGet('admin/settings/filter/3'); $this->assertText('PHP code', t('On PHP code filter page.')); } @@ -53,7 +53,7 @@ class PHPFilterTestCase extends PHPTestCase { $edit = array(); $edit['roles[2]'] = TRUE; // Set authenticated users to have permission to use filter. $this->drupalPost(NULL, $edit, 'Save configuration'); - $this->assertText(t('The input format settings have been updated.'), t('PHP format available to authenticated users.')); + $this->assertText(t('The text format settings have been updated.'), t('PHP format available to authenticated users.')); // Create node with PHP filter enabled. $web_user = $this->drupalCreateUser(array('access content', 'create page content', 'edit own page content')); @@ -105,4 +105,4 @@ class PHPAccessTestCase extends PHPTestCase { $this->drupalGet('node/' . $node->nid . '/edit'); $this->assertNoFieldByName('body_format', '3', t('Format not available.')); } -} \ No newline at end of file +} diff --git a/modules/system/system.install b/modules/system/system.install index d24af92893bd6a11e70397240ab062cf73a4141c..5e2f5395fb410743c6449b7f1a0e4d9990b4a8d8 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -375,11 +375,11 @@ function system_install() { db_query("INSERT INTO {node_access} (nid, gid, realm, grant_view, grant_update, grant_delete) VALUES (%d, %d, '%s', %d, %d, %d)", 0, 0, 'all', 1, 0, 0); - // Add input formats. + // Add text formats. db_query("INSERT INTO {filter_format} (name, roles, cache) VALUES ('%s', '%s', %d)", 'Filtered HTML', ',1,2,', 1); db_query("INSERT INTO {filter_format} (name, roles, cache) VALUES ('%s', '%s', %d)", 'Full HTML', '', 1); - // Enable filters for each input format. + // Enable filters for each text format. // Filtered HTML: // URL filter. @@ -1470,7 +1470,7 @@ function system_update_6008() { function system_update_6009() { $ret = array(); - // If any input format used the Drupal 5 PHP filter. + // If any text format used the Drupal 5 PHP filter. if (db_result(db_query("SELECT COUNT(format) FROM {filters} WHERE module = 'filter' AND delta = 1"))) { // Enable the PHP filter module. $ret[] = update_sql("UPDATE {system} SET status = 1 WHERE name = 'php' AND type = 'module'"); @@ -1670,7 +1670,7 @@ function system_update_6018() { while ($format = db_fetch_object($result)) { $weight = db_result(db_query("SELECT MAX(weight) FROM {filters} WHERE format = %d", $format->format)); db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, '%s', %d, %d)", $format->format, 'filter', 3, max(10, $weight + 1)); - $ret[] = array('success' => TRUE, 'query' => "HTML corrector filter added to the '" . $format->name . "' input format."); + $ret[] = array('success' => TRUE, 'query' => "HTML corrector filter added to the '" . $format->name . "' text format."); } return $ret;