Commit 3dea934d authored by Dries's avatar Dries
Browse files

- Patch #560502 by Gabor Hojtsy: created 'content authoring' category.

parent 43db68b6
......@@ -32,8 +32,8 @@ function filter_admin_overview() {
$options[$id] = '';
$form[$id]['name'] = array('#markup' => $format->name);
$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/formats/' . $id));
$form[$id]['delete'] = array('#markup' => $default ? '' : l(t('delete'), 'admin/settings/formats/delete/' . $id));
$form[$id]['configure'] = array('#markup' => l(t('configure'), 'admin/config/content/formats/' . $id));
$form[$id]['delete'] = array('#markup' => $default ? '' : l(t('delete'), 'admin/config/content/formats/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));
......@@ -225,7 +225,7 @@ function filter_admin_delete(&$form_state, $format) {
return confirm_form($form,
t('Are you sure you want to delete the text format %format?', array('%format' => $format->name)),
'admin/settings/formats',
'admin/config/content/formats',
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')
......@@ -233,7 +233,7 @@ function filter_admin_delete(&$form_state, $format) {
}
else {
drupal_set_message(t('The default format cannot be deleted.'));
drupal_goto('admin/settings/formats');
drupal_goto('admin/config/content/formats');
}
}
else {
......@@ -249,7 +249,7 @@ function filter_admin_delete_submit($form, &$form_state) {
filter_format_delete($format);
drupal_set_message(t('Deleted text format %format.', array('%format' => $format->name)));
$form_state['redirect'] = 'admin/settings/formats';
$form_state['redirect'] = 'admin/config/content/formats';
}
/**
......
......@@ -25,15 +25,15 @@ function filter_help($path, $arg) {
$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/formats':
case 'admin/config/content/formats':
$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. 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/formats/%':
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/formats/' . $arg[3] . '/order'))) . '</p>';
case 'admin/settings/formats/%/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/formats/' . $arg[3]))) . '</p>';
case 'admin/settings/formats/%/order':
case 'admin/config/content/formats/%':
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/config/content/formats/' . $arg[4] . '/order'))) . '</p>';
case 'admin/config/content/formats/%/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/config/content/formats/' . $arg[4]))) . '</p>';
case 'admin/config/content/formats/%/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;
......@@ -70,7 +70,7 @@ function filter_theme() {
* Implement hook_menu().
*/
function filter_menu() {
$items['admin/settings/formats'] = array(
$items['admin/config/content/formats'] = 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',
......@@ -78,11 +78,11 @@ function filter_menu() {
'access arguments' => array('administer filters'),
'file' => 'filter.admin.inc',
);
$items['admin/settings/formats/list'] = array(
$items['admin/config/content/formats/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/settings/formats/add'] = array(
$items['admin/config/content/formats/add'] = array(
'title' => 'Add text format',
'page callback' => 'filter_admin_format_page',
'access arguments' => array('administer filters'),
......@@ -97,42 +97,42 @@ function filter_menu() {
'type' => MENU_SUGGESTED_ITEM,
'file' => 'filter.pages.inc',
);
$items['admin/settings/formats/%filter_format'] = array(
$items['admin/config/content/formats/%filter_format'] = array(
'type' => MENU_CALLBACK,
'title callback' => 'filter_admin_format_title',
'title arguments' => array(3),
'title arguments' => array(4),
'page callback' => 'filter_admin_format_page',
'page arguments' => array(3),
'page arguments' => array(4),
'access arguments' => array('administer filters'),
'file' => 'filter.admin.inc',
);
$items['admin/settings/formats/%filter_format/edit'] = array(
$items['admin/config/content/formats/%filter_format/edit'] = array(
'title' => 'Edit',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 0,
);
$items['admin/settings/formats/%filter_format/configure'] = array(
$items['admin/config/content/formats/%filter_format/configure'] = array(
'title' => 'Configure',
'page callback' => 'filter_admin_configure_page',
'page arguments' => array(3),
'page arguments' => array(4),
'access arguments' => array('administer filters'),
'type' => MENU_LOCAL_TASK,
'weight' => 1,
'file' => 'filter.admin.inc',
);
$items['admin/settings/formats/%filter_format/order'] = array(
$items['admin/config/content/formats/%filter_format/order'] = array(
'title' => 'Rearrange',
'page callback' => 'filter_admin_order_page',
'page arguments' => array(3),
'page arguments' => array(4),
'access arguments' => array('administer filters'),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
'file' => 'filter.admin.inc',
);
$items['admin/settings/formats/%filter_format/delete'] = array(
$items['admin/config/content/formats/%filter_format/delete'] = array(
'title' => 'Delete text format',
'page callback' => 'drupal_get_form',
'page arguments' => array('filter_admin_delete', 3),
'page arguments' => array('filter_admin_delete', 4),
'access arguments' => array('administer filters'),
'type' => MENU_CALLBACK,
'file' => 'filter.admin.inc',
......
......@@ -29,15 +29,15 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Change default filter.
$edit = array();
$edit['default'] = $full;
$this->drupalPost('admin/settings/formats', $edit, t('Save changes'));
$this->drupalPost('admin/config/content/formats', $edit, t('Save changes'));
$this->assertText(t('Default format updated.'), t('Default filter updated successfully.'));
$this->assertNoRaw('admin/settings/formats/' . $full . '/delete', t('Delete link not found.'));
$this->assertNoRaw('admin/config/content/formats/' . $full . '/delete', t('Delete link not found.'));
// Add an additional tag.
$edit = array();
$edit['settings[filter_html][allowed_html]'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <quote>';
$this->drupalPost('admin/settings/formats/' . $filtered . '/configure', $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $filtered . '/configure', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'), t('Allowed HTML tag added.'));
$this->assertRaw(htmlentities($edit['settings[filter_html][allowed_html]']), t('Tag displayed.'));
......@@ -49,7 +49,7 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$edit = array();
$edit['weights[' . $second_filter . ']'] = 1;
$edit['weights[' . $first_filter . ']'] = 2;
$this->drupalPost('admin/settings/formats/' . $filtered . '/order', $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $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 = :format ORDER BY weight ASC', array(':format' => $filtered));
......@@ -67,7 +67,7 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$edit['roles[2]'] = 1;
$edit['filters[' . $second_filter . ']'] = TRUE;
$edit['filters[' . $first_filter . ']'] = TRUE;
$this->drupalPost('admin/settings/formats/add', $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/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']);
......@@ -79,23 +79,23 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$this->assertFieldByName('filters[' . $first_filter . ']', '', t('Url filter found.'));
// Delete new filter.
$this->drupalPost('admin/settings/formats/' . $format->format . '/delete', array(), t('Delete'));
$this->drupalPost('admin/config/content/formats/' . $format->format . '/delete', 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/formats', $edit, t('Save changes'));
$this->drupalPost('admin/config/content/formats', $edit, t('Save changes'));
$this->assertText(t('Default format updated.'), t('Default filter updated successfully.'));
$this->assertNoRaw('admin/settings/formats/' . $filtered . '/delete', t('Delete link not found.'));
$this->assertNoRaw('admin/config/content/formats/' . $filtered . '/delete', t('Delete link not found.'));
// Allow authenticated users on full HTML.
$edit = array();
$edit['roles[1]'] = 0;
$edit['roles[2]'] = 1;
$this->drupalPost('admin/settings/formats/' . $full, $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $full, $edit, t('Save configuration'));
$this->assertText(t('The text format settings have been updated.'), t('Full HTML format successfully updated.'));
// Switch user.
......@@ -131,20 +131,20 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Allowed tags.
$edit = array();
$edit['settings[filter_html][allowed_html]'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>';
$this->drupalPost('admin/settings/formats/' . $filtered . '/configure', $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $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/formats/' . $full, $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $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[' . $second_filter . ']'] = 2;
$edit['weights[' . $first_filter . ']'] = 1;
$this->drupalPost('admin/settings/formats/' . $filtered . '/order', $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $filtered . '/order', $edit, t('Save configuration'));
$this->assertText(t('The filter ordering has been saved.'), t('Order successfully reverted.'));
}
......@@ -773,7 +773,7 @@ class FilterHooksTestCase extends DrupalWebTestCase {
$edit = array();
$edit['name'] = $name;
$edit['roles[1]'] = 1;
$this->drupalPost('admin/settings/formats/add', $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration'));
$this->assertRaw(t('Added text format %format.', array('%format' => $name)), t('New format created.'));
$this->assertText('hook_filter_format_insert invoked.', t('hook_filter_format_insert was invoked.'));
......@@ -782,7 +782,7 @@ class FilterHooksTestCase extends DrupalWebTestCase {
// Update text format.
$edit = array();
$edit['roles[2]'] = 1;
$this->drupalPost('admin/settings/formats/' . $format, $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $format, $edit, t('Save configuration'));
$this->assertRaw(t('The text format settings have been updated.'), t('Full HTML format successfully updated.'));
$this->assertText('hook_filter_format_update invoked.', t('hook_filter_format_update() was invoked.'));
......@@ -801,7 +801,7 @@ class FilterHooksTestCase extends DrupalWebTestCase {
$this->assertNotNull($bid, t('New block found in database'));
// Delete the text format.
$this->drupalPost('admin/settings/formats/' . $format . '/delete', array(), t('Delete'));
$this->drupalPost('admin/config/content/formats/' . $format . '/delete', array(), t('Delete'));
$this->assertRaw(t('Deleted text format %format.', array('%format' => $name)), t('Format successfully deleted.'));
$this->assertText('hook_filter_format_delete invoked.', t('hook_filter_format_delete() was invoked.'));
......
......@@ -35,7 +35,7 @@ function php_install() {
))
->execute();
drupal_set_message(t('A !php-code text format has been created.', array('!php-code' => l('PHP code', 'admin/settings/formats/' . $format))));
drupal_set_message(t('A !php-code text format has been created.', array('!php-code' => l('PHP code', 'admin/config/content/formats/' . $format))));
}
}
......
......@@ -13,7 +13,7 @@ class PHPTestCase extends DrupalWebTestCase {
$this->drupalLogin($admin_user);
// Confirm that the PHP filter is #3.
$this->drupalGet('admin/settings/formats/3');
$this->drupalGet('admin/config/content/formats/3');
$this->assertText('PHP code', t('On PHP code filter page.'));
}
......
......@@ -463,7 +463,7 @@ class SearchCommentTestCase extends DrupalWebTestCase {
$edit = array(
'filters[filter_html_escape]' => 1,
);
$this->drupalPost('admin/settings/formats/1', $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/1', $edit, t('Save configuration'));
// Allow anonymous users to search content.
$edit = array(
DRUPAL_ANONYMOUS_RID . '[search content]' => 1,
......
......@@ -857,6 +857,15 @@ function system_menu() {
'type' => MENU_CALLBACK,
'file' => 'system.admin.inc',
);
$items['admin/config/content'] = array(
'title' => 'Content authoring',
'description' => 'Settings related to formatting and authoring content.',
'position' => 'right',
'weight' => 5,
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('access administration pages'),
'file' => 'system.admin.inc',
);
// Settings.
$items['admin/settings/site-information'] = array(
......
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