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)
* 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
......
......@@ -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;
......
......@@ -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,
......
......@@ -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.'));
}
......
......@@ -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
......
......@@ -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,
);
......
......@@ -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;
}
......
......@@ -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').
......
......@@ -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;
}
......
This diff is collapsed.
......@@ -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)) {
......
......@@ -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'));
}
}
}
......@@ -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,
......
......@@ -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;
......
......@@ -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>",
"<",
......
......@@ -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))));
}
}
......
......@@ -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>';
......
......@@ -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
}
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment