Commit 3dc1157a authored by Dries's avatar Dries

- Patch #244904 by edkwh, keith.smith: renamed 'input format' to 'text format'...

- Patch #244904 by edkwh, keith.smith: renamed 'input format' to 'text format' based on UMN usability study.
parent 2c570795
...@@ -32,6 +32,7 @@ Drupal 7.0, xxxx-xx-xx (development version) ...@@ -32,6 +32,7 @@ Drupal 7.0, xxxx-xx-xx (development version)
* Redesigned password strength validator. * Redesigned password strength validator.
* Redesigned the add content type screen. * Redesigned the add content type screen.
* Highlight duplicate URL aliases. * Highlight duplicate URL aliases.
* Renamed "input formats" to "text formats".
* Added configurable ability for users to cancel their own accounts. * Added configurable ability for users to cancel their own accounts.
- Performance: - Performance:
* Improved performance on uncached page views by loading multiple core * Improved performance on uncached page views by loading multiple core
......
...@@ -1782,14 +1782,14 @@ function form_process_radios($element) { ...@@ -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(). * {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 * 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 * a child element, but is otherwise unaltered, so that the format selector is
* at the same level as the text field which it affects. * at the same level as the text field which it affects.
* *
...@@ -1799,7 +1799,7 @@ function form_process_radios($element) { ...@@ -1799,7 +1799,7 @@ function form_process_radios($element) {
* $form['body'] = array( * $form['body'] = array(
* '#type' => 'textarea', * '#type' => 'textarea',
* '#title' => t('Body'), * '#title' => t('Body'),
* '#input_format' => isset($node->format) ? $node->format : FILTER_FORMAT_DEFAULT, * '#text_format' => isset($node->format) ? $node->format : FILTER_FORMAT_DEFAULT,
* ); * );
* @endcode * @endcode
* *
...@@ -1814,7 +1814,7 @@ function form_process_radios($element) { ...@@ -1814,7 +1814,7 @@ function form_process_radios($element) {
* '#title' => t('Body'), * '#title' => t('Body'),
* '#parents' => array('body'), * '#parents' => array('body'),
* ), * ),
* // 'format' holds the input format selector. * // 'format' holds the text format selector.
* 'format' => array( * 'format' => array(
* '#parents' => array('body_format'), * '#parents' => array('body_format'),
* ... * ...
...@@ -1826,14 +1826,14 @@ function form_process_radios($element) { ...@@ -1826,14 +1826,14 @@ function form_process_radios($element) {
* @code * @code
* // Original, unaltered form element value. * // Original, unaltered form element value.
* $form_state['values']['body'] = 'Example content'; * $form_state['values']['body'] = 'Example content';
* // Chosen input format. * // Chosen text format.
* $form_state['values']['body_format'] = 1; * $form_state['values']['body_format'] = 1;
* @endcode * @endcode
* *
* @see system_elements(), filter_form() * @see system_elements(), filter_form()
*/ */
function form_process_input_format($element) { 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 // Determine the form element parents and element name to use for the input
// format widget. This simulates the 'element' and 'element_format' pair of // format widget. This simulates the 'element' and 'element_format' pair of
// parents that filter_form() expects. // parents that filter_form() expects.
...@@ -1844,11 +1844,11 @@ function form_process_input_format($element) { ...@@ -1844,11 +1844,11 @@ function form_process_input_format($element) {
// We need to break references, otherwise form_builder recurses infinitely. // We need to break references, otherwise form_builder recurses infinitely.
$element['value'] = (array)$element; $element['value'] = (array)$element;
$element['#type'] = 'markup'; $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. // would get into an infinite loop.
unset($element['value']['#input_format']); unset($element['value']['#text_format']);
$element['value']['#weight'] = 0; $element['value']['#weight'] = 0;
} }
return $element; return $element;
......
...@@ -328,7 +328,7 @@ function block_box_form($edit = array()) { ...@@ -328,7 +328,7 @@ function block_box_form($edit = array()) {
'#type' => 'textarea', '#type' => 'textarea',
'#title' => t('Block body'), '#title' => t('Block body'),
'#default_value' => $edit['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, '#rows' => 15,
'#description' => t('The content of the block as shown to the user.'), '#description' => t('The content of the block as shown to the user.'),
'#weight' => -17, '#weight' => -17,
......
...@@ -77,7 +77,7 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -77,7 +77,7 @@ class BlockTestCase extends DrupalWebTestCase {
$edit['block_' . $bid . '[region]'] = 'left'; $edit['block_' . $bid . '[region]'] = 'left';
$this->drupalPost('admin/build/block', $edit, t('Save blocks')); $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.')); $this->assertRaw('<h1>Full HTML</h1>', t('Box successfully being displayed using Full HTML.'));
} }
......
...@@ -617,7 +617,7 @@ function blogapi_mt_validate_terms($node) { ...@@ -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() { function blogapi_mt_supported_text_filters() {
// NOTE: we're only using anonymous' formats because the MT spec // NOTE: we're only using anonymous' formats because the MT spec
......
...@@ -1518,7 +1518,7 @@ function comment_form(&$form_state, $edit, $title = NULL) { ...@@ -1518,7 +1518,7 @@ function comment_form(&$form_state, $edit, $title = NULL) {
'#title' => t('Comment'), '#title' => t('Comment'),
'#rows' => 15, '#rows' => 15,
'#default_value' => $default, '#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, '#required' => TRUE,
); );
......
...@@ -7,7 +7,7 @@ ...@@ -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. * one is the default.
* *
* @ingroup forms * @ingroup forms
...@@ -31,9 +31,9 @@ function filter_admin_overview() { ...@@ -31,9 +31,9 @@ function filter_admin_overview() {
$default = ($id == variable_get('filter_default_format', 1)); $default = ($id == variable_get('filter_default_format', 1));
$options[$id] = ''; $options[$id] = '';
$form[$id]['name'] = array('#markup' => $format->name); $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]['roles'] = array('#markup' => $default ? t('All roles may use the 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]['configure'] = array('#markup' => l(t('configure'), 'admin/settings/filter/' . $id));
$form[$id]['delete'] = array('#markup' => $default ? '' : l(t('delete'), 'admin/settings/filters/delete/' . $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[$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight);
} }
$form['default'] = array('#type' => 'radios', '#options' => $options, '#default_value' => variable_get('filter_default_format', 1)); $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) { ...@@ -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); 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) { ...@@ -94,7 +94,7 @@ function theme_filter_admin_overview($form) {
*/ */
function filter_admin_format_page($format = NULL) { function filter_admin_format_page($format = NULL) {
if (!isset($format->name)) { 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' => ''); $format = (object)array('name' => '', 'roles' => '', 'format' => '');
} }
return drupal_get_form('filter_admin_format_form', $format); return drupal_get_form('filter_admin_format_form', $format);
...@@ -166,7 +166,7 @@ function filter_admin_format_form(&$form_state, $format) { ...@@ -166,7 +166,7 @@ function filter_admin_format_form(&$form_state, $format) {
else { else {
$tiplist .= theme('filter_tips_more_info'); $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; $group .= $tiplist;
$form['tips'] = array('#markup' => '<h2>' . t('Formatting guidelines') . '</h2>' . $group); $form['tips'] = array('#markup' => '<h2>' . t('Formatting guidelines') . '</h2>' . $group);
} }
...@@ -202,10 +202,10 @@ function filter_admin_format_form_submit($form, &$form_state) { ...@@ -202,10 +202,10 @@ function filter_admin_format_form_submit($form, &$form_state) {
$new = TRUE; $new = TRUE;
db_query("INSERT INTO {filter_format} (name) VALUES ('%s')", $name); db_query("INSERT INTO {filter_format} (name) VALUES ('%s')", $name);
$format = db_result(db_query("SELECT MAX(format) AS format FROM {filter_format}")); $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 { 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); db_query("DELETE FROM {filter} WHERE format = %d", $format);
...@@ -244,7 +244,7 @@ function filter_admin_format_form_submit($form, &$form_state) { ...@@ -244,7 +244,7 @@ function filter_admin_format_form_submit($form, &$form_state) {
cache_clear_all($format . ':', 'cache_filter', TRUE); 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. // 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)) { if (!empty($new)) {
$return .= '/' . $format; $return .= '/' . $format;
} }
...@@ -267,11 +267,11 @@ function filter_admin_delete() { ...@@ -267,11 +267,11 @@ function filter_admin_delete() {
$form['format'] = array('#type' => 'hidden', '#value' => $format->format); $form['format'] = array('#type' => 'hidden', '#value' => $format->format);
$form['name'] = array('#type' => 'hidden', '#value' => $format->name); $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 { else {
drupal_set_message(t('The default format cannot be deleted.')); drupal_set_message(t('The default format cannot be deleted.'));
drupal_goto('admin/settings/filters'); drupal_goto('admin/settings/filter');
} }
} }
else { else {
...@@ -293,9 +293,9 @@ function filter_admin_delete_submit($form, &$form_state) { ...@@ -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']); 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); 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; return;
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
* the content: transforming URLs into hyperlinks, converting smileys into * the content: transforming URLs into hyperlinks, converting smileys into
* images, etc. * 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 * format is an entire filter setup: which filters to enable, in what order
* and with what settings. Filters that provide settings should usually store * and with what settings. Filters that provide settings should usually store
* these settings per format. * these settings per format.
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
* in the cache table and retrieved the next time the piece of content is * 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 * 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 * 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. * entire format, not just for one filter.
* *
* Beware of the filter cache when developing your module: it is advised to set * Beware of the filter cache when developing your module: it is advised to set
...@@ -82,12 +82,12 @@ ...@@ -82,12 +82,12 @@
* - settings: Return HTML form controls for the filter's settings. These * - settings: Return HTML form controls for the filter's settings. These
* settings are stored with variable_set() when the form is submitted. * settings are stored with variable_set() when the form is submitted.
* Remember to use the $format identifier in the variable and control names * 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 * @param $delta
* Which of the module's filters to use (applies to every operation except * Which of the module's filters to use (applies to every operation except
* 'list'). Modules that only contain one filter can ignore this parameter. * 'list'). Modules that only contain one filter can ignore this parameter.
* @param $format * @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'). * 'process' and 'settings').
* @param $text * @param $text
* The content to filter (applies to 'prepare' and 'process'). * The content to filter (applies to 'prepare' and 'process').
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
*/ */
function filter_schema() { function filter_schema() {
$schema['filter'] = array( $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( 'fields' => array(
'fid' => array( 'fid' => array(
'type' => 'serial', 'type' => 'serial',
...@@ -50,7 +50,7 @@ function filter_schema() { ...@@ -50,7 +50,7 @@ function filter_schema() {
), ),
); );
$schema['filter_format'] = array( $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( 'fields' => array(
'format' => array( 'format' => array(
'type' => 'serial', 'type' => 'serial',
...@@ -62,7 +62,7 @@ function filter_schema() { ...@@ -62,7 +62,7 @@ function filter_schema() {
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => '', 'default' => '',
'description' => 'Name of the input format (Filtered HTML).', 'description' => 'Name of the text format (Filtered HTML).',
), ),
'roles' => array( 'roles' => array(
'type' => 'varchar', 'type' => 'varchar',
...@@ -83,7 +83,7 @@ function filter_schema() { ...@@ -83,7 +83,7 @@ function filter_schema() {
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'tiny', 'size' => 'tiny',
'description' => 'Weight of input format to use when listing.', 'description' => 'Weight of text format to use when listing.',
) )
), ),
'primary key' => array('format'), 'primary key' => array('format'),
...@@ -93,7 +93,7 @@ function filter_schema() { ...@@ -93,7 +93,7 @@ function filter_schema() {
); );
$schema['cache_filter'] = drupal_get_schema_unprocessed('system', 'cache'); $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; return $schema;
} }
......
This diff is collapsed.
...@@ -28,7 +28,7 @@ function filter_tips_long() { ...@@ -28,7 +28,7 @@ function filter_tips_long() {
* @param $tips * @param $tips
* An array containing descriptions and a CSS id in the form of * 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 * '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 * @code
* array( * array(
* 'Full HTML' => array( * 'Full HTML' => array(
...@@ -53,7 +53,7 @@ function theme_filter_tips($tips, $long = FALSE) { ...@@ -53,7 +53,7 @@ function theme_filter_tips($tips, $long = FALSE) {
$multiple = count($tips) > 1; $multiple = count($tips) > 1;
if ($multiple) { if ($multiple) {
$output = t('Input formats') . ':'; $output = t('Text formats') . ':';
} }
if (count($tips)) { if (count($tips)) {
......
...@@ -28,15 +28,15 @@ class FilterAdminTestCase extends DrupalWebTestCase { ...@@ -28,15 +28,15 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Change default filter. // Change default filter.
$edit = array(); $edit = array();
$edit['default'] = $full; $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->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. // Add an additional tag.
$edit = array(); $edit = array();
$edit['allowed_html_1'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>' . ' <quote>'; // Adding <quote> tag. $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->assertText(t('The configuration options have been saved.'), t('Allowed HTML tag added.'));
$this->assertRaw(htmlentities($edit['allowed_html_1']), t('Tag displayed.')); $this->assertRaw(htmlentities($edit['allowed_html_1']), t('Tag displayed.'));
...@@ -48,7 +48,7 @@ class FilterAdminTestCase extends DrupalWebTestCase { ...@@ -48,7 +48,7 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$edit = array(); $edit = array();
$edit['weights[filter/' . $second_filter . ']'] = 1; $edit['weights[filter/' . $second_filter . ']'] = 1;
$edit['weights[filter/' . $first_filter . ']'] = 2; $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.')); $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); $result = db_query('SELECT * FROM {filter} WHERE format = %d ORDER BY weight ASC', $filtered);
...@@ -66,8 +66,8 @@ class FilterAdminTestCase extends DrupalWebTestCase { ...@@ -66,8 +66,8 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$edit['roles[2]'] = TRUE; $edit['roles[2]'] = TRUE;
$edit['filters[filter/' . $second_filter . ']'] = TRUE; $edit['filters[filter/' . $second_filter . ']'] = TRUE;
$edit['filters[filter/' . $first_filter . ']'] = TRUE; $edit['filters[filter/' . $first_filter . ']'] = TRUE;
$this->drupalPost('admin/settings/filters/add', $edit, t('Save configuration')); $this->drupalPost('admin/settings/filter/add', $edit, t('Save configuration'));
$this->assertRaw(t('Added input format %format.', array('%format' => $edit['name'])), t('New filter created.')); $this->assertRaw(t('Added text format %format.', array('%format' => $edit['name'])), t('New filter created.'));
$format = $this->getFilter($edit['name']); $format = $this->getFilter($edit['name']);
$this->assertNotNull($format, t('Format found in database.')); $this->assertNotNull($format, t('Format found in database.'));
...@@ -78,23 +78,23 @@ class FilterAdminTestCase extends DrupalWebTestCase { ...@@ -78,23 +78,23 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$this->assertFieldByName('filters[filter/' . $first_filter . ']', '', t('Url filter found.')); $this->assertFieldByName('filters[filter/' . $first_filter . ']', '', t('Url filter found.'));
// Delete new filter. // 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'));
$this->assertRaw(t('Deleted input format %format.', array('%format' => $edit['name'])), t('Format successfully deleted.')); $this->assertRaw(t('Deleted text format %format.', array('%format' => $edit['name'])), t('Format successfully deleted.'));
} }
// Change default filter back. // Change default filter back.
$edit = array(); $edit = array();
$edit['default'] = $filtered; $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->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. // Allow authenticated users on full HTML.
$edit = array(); $edit = array();
$edit['roles[2]'] = TRUE; $edit['roles[2]'] = TRUE;
$this->drupalPost('admin/settings/filters/' . $full, $edit, t('Save configuration')); $this->drupalPost('admin/settings/filter/' . $full, $edit, t('Save configuration'));
$this->assertText(t('The input format settings have been updated.'), t('Full HTML format successfully updated.')); $this->assertText(t('The text format settings have been updated.'), t('Full HTML format successfully updated.'));
// Switch user. // Switch user.
$this->drupalLogout(); $this->drupalLogout();
...@@ -128,20 +128,20 @@ class FilterAdminTestCase extends DrupalWebTestCase { ...@@ -128,20 +128,20 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Allowed tags. // Allowed tags.
$edit = array(); $edit = array();
$edit['allowed_html_1'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>'; $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.')); $this->assertText(t('The configuration options have been saved.'), t('Changes reverted.'));
// Full HTML. // Full HTML.
$edit = array(); $edit = array();
$edit['roles[2]'] = FALSE; $edit['roles[2]'] = FALSE;
$this->drupalPost('admin/settings/filters/' . $full, $edit, t('Save configuration')); $this->drupalPost('admin/settings/filter/' . $full, $edit, t('Save configuration'));
$this->assertText(t('The input format settings have been updated.'), t('Full HTML format successfully reverted.')); $this->assertText(t('The text format settings have been updated.'), t('Full HTML format successfully reverted.'));
// Filter order. // Filter order.
$edit = array(); $edit = array();
$edit['weights[filter/' . $second_filter . ']'] = 2; $edit['weights[filter/' . $second_filter . ']'] = 2;
$edit['weights[filter/' . $first_filter . ']'] = 1; $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.')); $this->assertText(t('The filter ordering has been saved.'), t('Order successfully reverted.'));
} }
...@@ -223,14 +223,14 @@ class FilterTestCase extends DrupalWebTestCase { ...@@ -223,14 +223,14 @@ class FilterTestCase extends DrupalWebTestCase {
'roles[2]' => TRUE, 'roles[2]' => TRUE,
'filters[filter/' . $filter . ']' => 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'])); return db_fetch_object(db_query("SELECT * FROM {filter_format} WHERE name = '%s'", $edit['name']));
} }
function deleteFormat($format) { function deleteFormat($format) {
if ($format !== NULL) { if ($format !== NULL) {
// Delete new filter. // 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'));
} }
} }
} }
...@@ -264,7 +264,7 @@ function node_schema() { ...@@ -264,7 +264,7 @@ function node_schema() {
'default' => 0, 'default' => 0,
), ),
'format' => array( 'format' => array(
'description' => "The input format used by this version's body.", 'description' => "The text format used by this version's body.",
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
......
...@@ -297,7 +297,7 @@ function node_body_field(&$node, $label, $word_count) { ...@@ -297,7 +297,7 @@ function node_body_field(&$node, $label, $word_count) {
'#default_value' => $include ? $node->body : ($node->teaser . $node->body), '#default_value' => $include ? $node->body : ($node->teaser . $node->body),
'#rows' => 20, '#rows' => 20,
'#required' => ($word_count > 0), '#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; return $form;
......
...@@ -210,7 +210,7 @@ class NodeTeaserTestCase extends DrupalWebTestCase { ...@@ -210,7 +210,7 @@ class NodeTeaserTestCase extends DrupalWebTestCase {
// The teasers we expect node_teaser() to return when $size is the index // The teasers we expect node_teaser() to return when $size is the index
// of each array item. // of each array item.
// Using an input format with no line-break filter: // Using an text format with no line-break filter:
$teasers = array( $teasers = array(
"<p>\nHi\n</p>\n<p>\nfolks\n<br />\n!\n</p>", "<p>\nHi\n</p>\n<p>\nfolks\n<br />\n!\n</p>",
"<", "<",
...@@ -252,7 +252,7 @@ class NodeTeaserTestCase extends DrupalWebTestCase { ...@@ -252,7 +252,7 @@ class NodeTeaserTestCase extends DrupalWebTestCase {
"<p>\nHi\n</p>\n<p>\nfolks\n<br />\n!\n</p>", "<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(