Commit 6fe3c7c0 authored by Dries's avatar Dries

- Patch #244904 by keith.smith, edmund.kwok, xano, David_Rothstein: rename 'input formats'.

parent a8ad5a78
......@@ -1825,7 +1825,7 @@ function form_process_radios($element) {
*
* @see system_elements(), filter_form()
*/
function form_process_input_format($element) {
function form_process_text_format($element) {
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
......@@ -2283,11 +2283,9 @@ function theme_textarea($element) {
/**
* Format HTML markup for use in forms.
*
* This is used in more advanced forms, such as theme selection and filter format.
*
* @param $element
* An associative array containing the properties of the element.
* Properties used: value, children.
* Properties used: markup, children.
* @return
* A themed HTML string representing the HTML markup.
*
......
......@@ -67,7 +67,7 @@ function block_help($path, $arg) {
switch ($path) {
case 'admin/help#block':
$output = '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The <a href="@blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/build/block'))) . '</p>';
$output .= '<p>' . t('Although blocks are usually generated automatically by modules (like the <em>User login</em> block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available <a href="@input-format">input format</a>.', array('@input-format' => url('admin/settings/filters'))) . '</p>';
$output .= '<p>' . t('Although blocks are usually generated automatically by modules (like the <em>User login</em> block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available <a href="@text-format">text format</a>.', array('@text-format' => url('admin/settings/filter'))) . '</p>';
$output .= '<p>' . t('When working with blocks, remember that:') . '</p>';
$output .= '<ul><li>' . t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') . '</li>';
$output .= '<li>' . t('disabled blocks, or blocks not in a region, are never shown.') . '</li>';
......
......@@ -97,7 +97,7 @@ function comment_help($path, $arg) {
switch ($path) {
case 'admin/help#comment':
$output = '<p>' . t('The comment module allows visitors to comment on your posts, creating ad hoc discussion boards. Any <a href="@content-type">content type</a> may have its <em>Default comment setting</em> set to <em>Read/Write</em> to allow comments, or <em>Disabled</em>, to prevent comments. Comment display settings and other controls may also be customized for each content type.', array('@content-type' => url('admin/build/types'))) . '</p>';
$output .= '<p>' . t('Comment permissions are assigned to user roles, and are used to determine whether anonymous users (or other roles) are allowed to comment on posts. If anonymous users are allowed to comment, their individual contact information may be retained in cookies stored on their local computer for use in later comment submissions. When a comment has no replies, it may be (optionally) edited by its author. The comment module uses the same input formats and HTML tags available when creating other forms of content.') . '</p>';
$output .= '<p>' . t('Comment permissions are assigned to user roles, and are used to determine whether anonymous users (or other roles) are allowed to comment on posts. If anonymous users are allowed to comment, their individual contact information may be retained in cookies stored on their local computer for use in later comment submissions. When a comment has no replies, it may be (optionally) edited by its author. The comment module uses the same text formats and HTML tags available when creating other forms of content.') . '</p>';
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@comment">Comment module</a>.', array('@comment' => 'http://drupal.org/handbook/modules/comment/')) . '</p>';
return $output;
......@@ -1597,7 +1597,7 @@ function comment_form_add_preview($form, &$form_state) {
// Invoke full validation for the form, to protect against cross site
// request forgeries (CSRF) and setting arbitrary values for fields such as
// the input format. Preview the comment only when form validation does not
// the text format. Preview the comment only when form validation does not
// set any errors.
drupal_validate_form($form['form_id']['#value'], $form, $form_state);
if (!form_get_errors()) {
......
......@@ -65,7 +65,7 @@ function theme_filter_admin_overview($form) {
$rows = array();
foreach ($form as $id => $element) {
if (isset($element['roles']) && is_array($element['roles'])) {
$element['weight']['#attributes']['class'] = 'input-format-order-weight';
$element['weight']['#attributes']['class'] = 'text-format-order-weight';
$rows[] = array(
'data' => array(
check_plain($element['name']['#markup']),
......@@ -81,16 +81,16 @@ function theme_filter_admin_overview($form) {
}
}
$header = array(t('Name'), t('Roles'), t('Default'), t('Weight'), array('data' => t('Operations'), 'colspan' => 2));
$output = theme('table', $header, $rows, array('id' => 'input-format-order'));
$output = theme('table', $header, $rows, array('id' => 'text-format-order'));
$output .= drupal_render_children($form);
drupal_add_tabledrag('input-format-order', 'order', 'sibling', 'input-format-order-weight');
drupal_add_tabledrag('text-format-order', 'order', 'sibling', 'text-format-order-weight');
return $output;
}
/**
* Menu callback; Display a filter format form.
* Menu callback; Display a text format form.
*/
function filter_admin_format_page($format = NULL) {
if (!isset($format->name)) {
......@@ -101,7 +101,7 @@ function filter_admin_format_page($format = NULL) {
}
/**
* Generate a filter format form.
* Generate a text format form.
*
* @ingroup forms
* @see filter_admin_format_form_validate()
......@@ -117,14 +117,14 @@ function filter_admin_format_form(&$form_state, $format) {
$form['name'] = array('#type' => 'textfield',
'#title' => t('Name'),
'#default_value' => $format->name,
'#description' => t('Specify a unique name for this filter format.'),
'#description' => t('Specify a unique name for this text format.'),
'#required' => TRUE,
);
// Add a row of checkboxes for form group.
$form['roles'] = array('#type' => 'fieldset',
'#title' => t('Roles'),
'#description' => $default ? $help : t('Choose which roles may use this filter format. Note that roles with the "administer filters" permission can always use all the filter formats.'),
'#description' => $default ? $help : t('Choose which roles may use this text format. Note that roles with the "administer filters" permission can always use all text formats.'),
'#tree' => TRUE,
);
......@@ -144,7 +144,7 @@ function filter_admin_format_form(&$form_state, $format) {
$form['filters'] = array('#type' => 'fieldset',
'#title' => t('Filters'),
'#description' => t('Choose the filters that will be used in this filter format.'),
'#description' => t('Choose the filters that will be used in this text format.'),
'#tree' => TRUE,
);
foreach ($all as $id => $filter) {
......@@ -176,20 +176,20 @@ function filter_admin_format_form(&$form_state, $format) {
}
/**
* Validate filter format form submissions.
* Validate text format form submissions.
*/
function filter_admin_format_form_validate($form, &$form_state) {
if (!isset($form_state['values']['format'])) {
$name = trim($form_state['values']['name']);
$result = db_fetch_object(db_query("SELECT format FROM {filter_format} WHERE name='%s'", $name));
if ($result) {
form_set_error('name', t('Filter format names need to be unique. A format named %name already exists.', array('%name' => $name)));
form_set_error('name', t('Text format names must be unique. A format named %name already exists.', array('%name' => $name)));
}
}
}
/**
* Process filter format form submissions.
* Process text format form submissions.
*/
function filter_admin_format_form_submit($form, &$form_state) {
$format = isset($form_state['values']['format']) ? $form_state['values']['format'] : NULL;
......@@ -197,7 +197,7 @@ function filter_admin_format_form_submit($form, &$form_state) {
$name = trim($form_state['values']['name']);
$cache = TRUE;
// Add a new filter format.
// Add a new text format.
if (!$format) {
$new = TRUE;
db_query("INSERT INTO {filter_format} (name) VALUES ('%s')", $name);
......
......@@ -46,7 +46,7 @@
* the content: transforming URLs into hyperlinks, converting smileys into
* images, etc.
*
* An important aspect of the filtering system are 'text formats'. Every input
* An important aspect of the filtering system is 'text formats'. Every text
* 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.
......
......@@ -138,7 +138,7 @@ function filter_format_load($arg) {
}
/**
* Display a filter format form title.
* Display a text format form title.
*/
function filter_admin_format_title($format) {
return $format->name;
......
......@@ -27,7 +27,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
* 'module-name/filter-id' (only used when $long is TRUE) for each
* filter in one or more text formats. Example:
* @code
* array(
......
......@@ -288,7 +288,7 @@ function system_elements() {
'#size' => 60,
'#maxlength' => 128,
'#autocomplete_path' => FALSE,
'#process' => array('form_process_input_format', 'form_process_ahah'),
'#process' => array('form_process_text_format', 'form_process_ahah'),
'#theme' => 'textfield',
'#theme_wrapper' => 'form_element',
);
......@@ -313,7 +313,7 @@ function system_elements() {
'#cols' => 60,
'#rows' => 5,
'#resizable' => TRUE,
'#process' => array('form_process_input_format', 'form_process_ahah'),
'#process' => array('form_process_text_format', 'form_process_ahah'),
'#theme' => 'textarea',
'#theme_wrapper' => 'form_element',
);
......
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