Commit 926606ee authored by Dries's avatar Dries
Browse files

- Patch #535564 by Gábor Hojtsy: the D7UX mockups call for a top level Content...

- Patch #535564 by Gábor Hojtsy: the D7UX mockups call for a top level Content item, which would immediatey lead to the "Find content" screen. The current Drupal 7 code is almost there, but still has an RSS settings item blocking the implementation of this by default and aggregator and book also add subitems.
parent 8c852108
......@@ -289,7 +289,7 @@ function drupal_get_destination() {
* destination in either the $_REQUEST-array (i.e. by using
* the query string of an URI) This is used to direct the user back to
* the proper page after completing a form. For example, after editing
* a post on the 'admin/content/node'-page or after having logged on using the
* a post on the 'admin/content'-page or after having logged on using the
* 'user login'-block in a sidebar. The function drupal_get_destination()
* can be used to help set the destination URL.
*
......@@ -1988,7 +1988,7 @@ function _format_date_callback(array $matches = NULL, $new_langcode = NULL) {
* Generate a URL from a Drupal menu path. Will also pass-through existing URLs.
*
* @param $path
* The Drupal path being linked to, such as "admin/content/node", or an
* The Drupal path being linked to, such as "admin/content", or an
* existing URL like "http://drupal.org/". The special path
* '<front>' may also be given and will generate the site's base URL.
* @param $options
......@@ -2160,10 +2160,10 @@ function drupal_attributes(array $attributes = array()) {
* @param $text
* The text to be enclosed with the anchor tag.
* @param $path
* The Drupal path being linked to, such as "admin/content/node". Can be an
* The Drupal path being linked to, such as "admin/content". Can be an
* external or internal URL.
* - If you provide the full URL, it will be considered an external URL.
* - If you provide only the path (e.g. "admin/content/node"), it is
* - If you provide only the path (e.g. "admin/content"), it is
* considered an internal link. In this case, it must be a system URL
* as the url() function will generate the alias.
* - If you provide '<front>', it generates a link to the site's
......
......@@ -27,10 +27,10 @@ function aggregator_view() {
$header = array(t('Title'), t('Items'), t('Last update'), t('Next update'), array('data' => t('Operations'), 'colspan' => '3'));
$rows = array();
foreach ($result as $feed) {
$rows[] = array(l($feed->title, "aggregator/sources/$feed->fid"), format_plural($feed->items, '1 item', '@count items'), ($feed->checked ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $feed->checked))) : t('never')), ($feed->checked && $feed->refresh ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - REQUEST_TIME))) : t('never')), l(t('edit'), "admin/content/aggregator/edit/feed/$feed->fid"), l(t('remove items'), "admin/content/aggregator/remove/$feed->fid"), l(t('update items'), "admin/content/aggregator/update/$feed->fid"));
$rows[] = array(l($feed->title, "aggregator/sources/$feed->fid"), format_plural($feed->items, '1 item', '@count items'), ($feed->checked ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $feed->checked))) : t('never')), ($feed->checked && $feed->refresh ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - REQUEST_TIME))) : t('never')), l(t('edit'), "admin/settings/aggregator/edit/feed/$feed->fid"), l(t('remove items'), "admin/settings/aggregator/remove/$feed->fid"), l(t('update items'), "admin/settings/aggregator/update/$feed->fid"));
}
if (empty($rows)) {
$rows[] = array(array('data' => t('No feeds available. <a href="@link">Add feed</a>.', array('@link' => url('admin/content/aggregator/add/feed'))), 'colspan' => '5', 'class' => 'message'));
$rows[] = array(array('data' => t('No feeds available. <a href="@link">Add feed</a>.', array('@link' => url('admin/settings/aggregator/add/feed'))), 'colspan' => '5', 'class' => 'message'));
}
$output .= theme('table', $header, $rows);
......@@ -41,10 +41,10 @@ function aggregator_view() {
$header = array(t('Title'), t('Items'), t('Operations'));
$rows = array();
foreach ($result as $category) {
$rows[] = array(l($category->title, "aggregator/categories/$category->cid"), format_plural($category->items, '1 item', '@count items'), l(t('edit'), "admin/content/aggregator/edit/category/$category->cid"));
$rows[] = array(l($category->title, "aggregator/categories/$category->cid"), format_plural($category->items, '1 item', '@count items'), l(t('edit'), "admin/settings/aggregator/edit/category/$category->cid"));
}
if (empty($rows)) {
$rows[] = array(array('data' => t('No categories available. <a href="@link">Add category</a>.', array('@link' => url('admin/content/aggregator/add/category'))), 'colspan' => '5', 'class' => 'message'));
$rows[] = array(array('data' => t('No categories available. <a href="@link">Add category</a>.', array('@link' => url('admin/settings/aggregator/add/category'))), 'colspan' => '5', 'class' => 'message'));
}
$output .= theme('table', $header, $rows);
......@@ -169,7 +169,7 @@ function aggregator_form_feed_submit($form, &$form_state) {
if (isset($form_state['values']['title'])) {
drupal_set_message(t('The feed %feed has been updated.', array('%feed' => $form_state['values']['title'])));
if (arg(0) == 'admin') {
$form_state['redirect'] = 'admin/content/aggregator/';
$form_state['redirect'] = 'admin/settings/aggregator/';
return;
}
else {
......@@ -181,7 +181,7 @@ function aggregator_form_feed_submit($form, &$form_state) {
watchdog('aggregator', 'Feed %feed deleted.', array('%feed' => $title));
drupal_set_message(t('The feed %feed has been deleted.', array('%feed' => $title)));
if (arg(0) == 'admin') {
$form_state['redirect'] = 'admin/content/aggregator/';
$form_state['redirect'] = 'admin/settings/aggregator/';
return;
}
else {
......@@ -191,7 +191,7 @@ function aggregator_form_feed_submit($form, &$form_state) {
}
}
else {
watchdog('aggregator', 'Feed %feed added.', array('%feed' => $form_state['values']['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/content/aggregator'));
watchdog('aggregator', 'Feed %feed added.', array('%feed' => $form_state['values']['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/settings/aggregator'));
drupal_set_message(t('The feed %feed has been added.', array('%feed' => $form_state['values']['title'])));
}
}
......@@ -205,7 +205,7 @@ function aggregator_admin_remove_feed($form_state, $feed) {
),
),
t('Are you sure you want to remove all items from the feed %feed?', array('%feed' => $feed->title)),
'admin/content/aggregator',
'admin/settings/aggregator',
t('This action cannot be undone.'),
t('Remove items'),
t('Cancel')
......@@ -220,7 +220,7 @@ function aggregator_admin_remove_feed($form_state, $feed) {
*/
function aggregator_admin_remove_feed_submit($form, &$form_state) {
aggregator_remove($form_state['values']['feed']);
$form_state['redirect'] = 'admin/content/aggregator';
$form_state['redirect'] = 'admin/settings/aggregator';
}
/**
......@@ -339,7 +339,7 @@ function aggregator_form_opml_submit($form, &$form_state) {
drupal_form_submit('aggregator_form_feed', $form_state);
}
$form_state['redirect'] = 'admin/content/aggregator';
$form_state['redirect'] = 'admin/settings/aggregator';
}
/**
......@@ -382,7 +382,7 @@ function _aggregator_parse_opml($opml) {
*/
function aggregator_admin_refresh_feed($feed) {
aggregator_refresh($feed);
drupal_goto('admin/content/aggregator');
drupal_goto('admin/settings/aggregator');
}
/**
......@@ -552,7 +552,7 @@ function aggregator_form_category_submit($form, &$form_state) {
if (isset($form_state['values']['title'])) {
drupal_set_message(t('The category %category has been updated.', array('%category' => $form_state['values']['title'])));
if (arg(0) == 'admin') {
$form_state['redirect'] = 'admin/content/aggregator/';
$form_state['redirect'] = 'admin/settings/aggregator/';
return;
}
else {
......@@ -564,7 +564,7 @@ function aggregator_form_category_submit($form, &$form_state) {
watchdog('aggregator', 'Category %category deleted.', array('%category' => $title));
drupal_set_message(t('The category %category has been deleted.', array('%category' => $title)));
if (arg(0) == 'admin') {
$form_state['redirect'] = 'admin/content/aggregator/';
$form_state['redirect'] = 'admin/settings/aggregator/';
return;
}
else {
......@@ -574,7 +574,7 @@ function aggregator_form_category_submit($form, &$form_state) {
}
}
else {
watchdog('aggregator', 'Category %category added.', array('%category' => $form_state['values']['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/content/aggregator'));
watchdog('aggregator', 'Category %category added.', array('%category' => $form_state['values']['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/settings/aggregator'));
drupal_set_message(t('The category %category has been added.', array('%category' => $form_state['values']['title'])));
}
}
......@@ -18,18 +18,18 @@ function aggregator_help($path, $arg) {
switch ($path) {
case 'admin/help#aggregator':
$output = '<p>' . t('The aggregator is a powerful on-site syndicator and news reader that gathers fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include <a href="@rss">RSS</a>, <a href="@rdf">RDF</a>, and <a href="@atom">Atom</a>.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '</p>';
$output .= '<p>' . t('Feeds contain feed items, or individual posts published by the site providing the feed. Feeds may be grouped in categories, generally by topic. Users view feed items in the <a href="@aggregator">main aggregator display</a> or by <a href="@aggregator-sources">their source</a>. Administrators can <a href="@feededit">add, edit and delete feeds</a> and choose how often to check each feed for newly updated items. The most recent items in either a feed or category can be displayed as a block through the <a href="@admin-block">blocks administration page</a>. A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. A correctly configured <a href="@cron">cron maintenance task</a> is required to update feeds automatically.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@feededit' => url('admin/content/aggregator'), '@admin-block' => url('admin/structure/block'), '@aggregator-opml' => url('aggregator/opml'), '@cron' => url('admin/reports/status'))) . '</p>';
$output .= '<p>' . t('Feeds contain feed items, or individual posts published by the site providing the feed. Feeds may be grouped in categories, generally by topic. Users view feed items in the <a href="@aggregator">main aggregator display</a> or by <a href="@aggregator-sources">their source</a>. Administrators can <a href="@feededit">add, edit and delete feeds</a> and choose how often to check each feed for newly updated items. The most recent items in either a feed or category can be displayed as a block through the <a href="@admin-block">blocks administration page</a>. A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. A correctly configured <a href="@cron">cron maintenance task</a> is required to update feeds automatically.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@feededit' => url('admin/settings/aggregator'), '@admin-block' => url('admin/structure/block'), '@aggregator-opml' => url('aggregator/opml'), '@cron' => url('admin/reports/status'))) . '</p>';
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@aggregator">Aggregator module</a>.', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) . '</p>';
return $output;
case 'admin/content/aggregator':
case 'admin/settings/aggregator':
$output = '<p>' . t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include <a href="@rss">RSS</a>, <a href="@rdf">RDF</a>, and <a href="@atom">Atom</a>.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '</p>';
$output .= '<p>' . t('Current feeds are listed below, and <a href="@addfeed">new feeds may be added</a>. For each feed or feed category, the <em>latest items</em> block may be enabled at the <a href="@block">blocks administration page</a>.', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/structure/block'))) . '</p>';
$output .= '<p>' . t('Current feeds are listed below, and <a href="@addfeed">new feeds may be added</a>. For each feed or feed category, the <em>latest items</em> block may be enabled at the <a href="@block">blocks administration page</a>.', array('@addfeed' => url('admin/settings/aggregator/add/feed'), '@block' => url('admin/structure/block'))) . '</p>';
return $output;
case 'admin/content/aggregator/add/feed':
case 'admin/settings/aggregator/add/feed':
return '<p>' . t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') . '</p>';
case 'admin/content/aggregator/add/category':
case 'admin/settings/aggregator/add/category':
return '<p>' . t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named <em>Sports</em>. Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the <em>Categorize</em> page available from feed item listings). Each category provides its own feed page and block.') . '</p>';
case 'admin/content/aggregator/add/opml':
case 'admin/settings/aggregator/add/opml':
return '<p>' . t('<acronym title="Outline Processor Markup Language">OPML</acronym> is an XML format used to exchange multiple feeds between aggregators. A single OPML document may contain a collection of many feeds. Drupal can parse such a file and import all feeds at once, saving you the effort of adding them manually. You may either upload a local file from your computer or enter a URL where Drupal can download it.') . '</p>';
}
}
......@@ -86,51 +86,51 @@ function aggregator_theme() {
* Implement hook_menu().
*/
function aggregator_menu() {
$items['admin/content/aggregator'] = array(
$items['admin/settings/aggregator'] = array(
'title' => 'Feed aggregator',
'description' => "Configure which content your site aggregates from other sites, how often it polls them, and how they're categorized.",
'page callback' => 'aggregator_admin_overview',
'access arguments' => array('administer news feeds'),
);
$items['admin/content/aggregator/add/feed'] = array(
$items['admin/settings/aggregator/add/feed'] = array(
'title' => 'Add feed',
'page callback' => 'drupal_get_form',
'page arguments' => array('aggregator_form_feed'),
'access arguments' => array('administer news feeds'),
'type' => MENU_LOCAL_TASK,
'parent' => 'admin/content/aggregator',
'parent' => 'admin/settings/aggregator',
);
$items['admin/content/aggregator/add/category'] = array(
$items['admin/settings/aggregator/add/category'] = array(
'title' => 'Add category',
'page callback' => 'drupal_get_form',
'page arguments' => array('aggregator_form_category'),
'access arguments' => array('administer news feeds'),
'type' => MENU_LOCAL_TASK,
'parent' => 'admin/content/aggregator',
'parent' => 'admin/settings/aggregator',
);
$items['admin/content/aggregator/add/opml'] = array(
$items['admin/settings/aggregator/add/opml'] = array(
'title' => 'Import OPML',
'page callback' => 'drupal_get_form',
'page arguments' => array('aggregator_form_opml'),
'access arguments' => array('administer news feeds'),
'type' => MENU_LOCAL_TASK,
'parent' => 'admin/content/aggregator',
'parent' => 'admin/settings/aggregator',
);
$items['admin/content/aggregator/remove/%aggregator_feed'] = array(
$items['admin/settings/aggregator/remove/%aggregator_feed'] = array(
'title' => 'Remove items',
'page callback' => 'drupal_get_form',
'page arguments' => array('aggregator_admin_remove_feed', 4),
'access arguments' => array('administer news feeds'),
'type' => MENU_CALLBACK,
);
$items['admin/content/aggregator/update/%aggregator_feed'] = array(
$items['admin/settings/aggregator/update/%aggregator_feed'] = array(
'title' => 'Update items',
'page callback' => 'aggregator_admin_refresh_feed',
'page arguments' => array(4),
'access arguments' => array('administer news feeds'),
'type' => MENU_CALLBACK,
);
$items['admin/content/aggregator/list'] = array(
$items['admin/settings/aggregator/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
......@@ -224,14 +224,14 @@ function aggregator_menu() {
'type' => MENU_LOCAL_TASK,
'weight' => 1,
);
$items['admin/content/aggregator/edit/feed/%aggregator_feed'] = array(
$items['admin/settings/aggregator/edit/feed/%aggregator_feed'] = array(
'title' => 'Edit feed',
'page callback' => 'drupal_get_form',
'page arguments' => array('aggregator_form_feed', 5),
'access arguments' => array('administer news feeds'),
'type' => MENU_CALLBACK,
);
$items['admin/content/aggregator/edit/category/%aggregator_category'] = array(
$items['admin/settings/aggregator/edit/category/%aggregator_category'] = array(
'title' => 'Edit category',
'page callback' => 'drupal_get_form',
'page arguments' => array('aggregator_form_category', 5),
......
......@@ -499,6 +499,6 @@ function template_preprocess_aggregator_feed_source(&$variables) {
}
if (user_access('administer news feeds')) {
$variables['last_checked'] = l($variables['last_checked'], 'admin/content/aggregator');
$variables['last_checked'] = l($variables['last_checked'], 'admin/settings/aggregator');
}
}
......@@ -14,7 +14,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
}
/**
* Create an aggregator feed (simulate form submission on admin/content/aggregator/add/feed).
* Create an aggregator feed (simulate form submission on admin/settings/aggregator/add/feed).
*
* @param $feed_url
* If given, feed will be created with this URL, otherwise /rss.xml will be used.
......@@ -25,7 +25,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
*/
function createFeed($feed_url = NULL) {
$edit = $this->getFeedEditArray($feed_url);
$this->drupalPost('admin/content/aggregator/add/feed', $edit, t('Save'));
$this->drupalPost('admin/settings/aggregator/add/feed', $edit, t('Save'));
$this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), t('The feed !name has been added.', array('!name' => $edit['title'])));
$feed = db_query("SELECT * FROM {aggregator_feed} WHERE title = :title AND url = :url", array(':title' => $edit['title'], ':url' => $edit['url']))->fetch();
......@@ -40,7 +40,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
* Feed object representing the feed.
*/
function deleteFeed($feed) {
$this->drupalPost('admin/content/aggregator/edit/feed/' . $feed->fid, array(), t('Delete'));
$this->drupalPost('admin/settings/aggregator/edit/feed/' . $feed->fid, array(), t('Delete'));
$this->assertRaw(t('The feed %title has been deleted.', array('%title' => $feed->title)), t('Feed deleted successfully.'));
}
......@@ -81,7 +81,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
}
/**
* Update feed items (simulate click to admin/content/aggregator/update/$fid).
* Update feed items (simulate click to admin/settings/aggregator/update/$fid).
*
* @param $feed
* Feed object representing the feed.
......@@ -94,7 +94,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
$this->assertResponse(200, t('!url is reachable.', array('!url' => $feed->url)));
// Refresh the feed (simulated link click).
$this->drupalGet('admin/content/aggregator/update/' . $feed->fid);
$this->drupalGet('admin/settings/aggregator/update/' . $feed->fid);
// Ensure we have the right number of items.
$result = db_query('SELECT iid FROM {aggregator_item} WHERE fid = :fid', array(':fid' => $feed->fid));
......@@ -114,7 +114,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
* Feed object representing the feed.
*/
function removeFeedItems($feed) {
$this->drupalPost('admin/content/aggregator/remove/' . $feed->fid, array(), t('Remove items'));
$this->drupalPost('admin/settings/aggregator/remove/' . $feed->fid, array(), t('Remove items'));
$this->assertRaw(t('The news items from %title have been removed.', array('%title' => $feed->title)), t('Feed items removed.'));
}
......@@ -274,7 +274,7 @@ class AddFeedTestCase extends AggregatorTestCase {
$feed = $this->createFeed();
// Check feed data.
$this->assertEqual($this->getUrl(), url('admin/content/aggregator/add/feed', array('absolute' => TRUE)), t('Directed to correct url.'));
$this->assertEqual($this->getUrl(), url('admin/settings/aggregator/add/feed', array('absolute' => TRUE)), t('Directed to correct url.'));
$this->assertTrue($this->uniqueFeed($feed->title, $feed->url), t('The feed is unique.'));
// Check feed source.
......@@ -310,11 +310,11 @@ class UpdateFeedTestCase extends AggregatorTestCase {
if (isset($feed->{$same_field})) {
$edit[$same_field] = $feed->{$same_field};
}
$this->drupalPost('admin/content/aggregator/edit/feed/' . $feed->fid, $edit, t('Save'));
$this->drupalPost('admin/settings/aggregator/edit/feed/' . $feed->fid, $edit, t('Save'));
$this->assertRaw(t('The feed %name has been updated.', array('%name' => $edit['title'])), t('The feed %name has been updated.', array('%name' => $edit['title'])));
// Check feed data.
$this->assertEqual($this->getUrl(), url('admin/content/aggregator/', array('absolute' => TRUE)));
$this->assertEqual($this->getUrl(), url('admin/settings/aggregator/', array('absolute' => TRUE)));
$this->assertTrue($this->uniqueFeed($edit['title'], $edit['url']), t('The feed is unique.'));
// Check feed source.
......@@ -367,7 +367,7 @@ class UpdateFeedItemTestCase extends AggregatorTestCase {
}
/**
* Test running "update items" from the 'admin/content/aggregator' page.
* Test running "update items" from the 'admin/settings/aggregator' page.
*/
function testUpdateFeedItem() {
$this->createSampleNodes();
......@@ -391,11 +391,11 @@ class UpdateFeedItemTestCase extends AggregatorTestCase {
$this->drupalGet($edit['url']);
$this->assertResponse(array(200), t('URL !url is accessible', array('!url' => $edit['url'])));
$this->drupalPost('admin/content/aggregator/add/feed', $edit, t('Save'));
$this->drupalPost('admin/settings/aggregator/add/feed', $edit, t('Save'));
$this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), t('The feed !name has been added.', array('!name' => $edit['title'])));
$feed = db_query("SELECT * FROM {aggregator_feed} WHERE url = :url", array(':url' => $edit['url']))->fetchObject();
$this->drupalGet('admin/content/aggregator/update/' . $feed->fid);
$this->drupalGet('admin/settings/aggregator/update/' . $feed->fid);
$before = db_query('SELECT timestamp FROM {aggregator_item} WHERE fid = :fid', array(':fid' => $feed->fid))->fetchField();
......@@ -410,7 +410,7 @@ class UpdateFeedItemTestCase extends AggregatorTestCase {
'modified' => 0,
))
->execute();
$this->drupalGet('admin/content/aggregator/update/' . $feed->fid);
$this->drupalGet('admin/settings/aggregator/update/' . $feed->fid);
$after = db_query('SELECT timestamp FROM {aggregator_item} WHERE fid = :fid', array(':fid' => $feed->fid))->fetchField();
......@@ -428,7 +428,7 @@ class RemoveFeedItemTestCase extends AggregatorTestCase {
}
/**
* Test running "remove items" from the 'admin/content/aggregator' page.
* Test running "remove items" from the 'admin/settings/aggregator' page.
*/
function testRemoveFeedItem() {
// Create a bunch of test feeds.
......@@ -472,9 +472,9 @@ class CategorizeFeedItemTestCase extends AggregatorTestCase {
function testCategorizeFeedItem() {
$this->createSampleNodes();
// Simulate form submission on "admin/content/aggregator/add/category".
// Simulate form submission on "admin/settings/aggregator/add/category".
$edit = array('title' => $this->randomName(10), 'description' => '');
$this->drupalPost('admin/content/aggregator/add/category', $edit, t('Save'));
$this->drupalPost('admin/settings/aggregator/add/category', $edit, t('Save'));
$this->assertRaw(t('The category %title has been added.', array('%title' => $edit['title'])), t('The category %title has been added.', array('%title' => $edit['title'])));
$category = db_query("SELECT * FROM {aggregator_category} WHERE title = :title", array(':title' => $edit['title']))->fetch();
......@@ -536,7 +536,7 @@ class ImportOPMLTestCase extends AggregatorTestCase {
))
->execute();
$this->drupalGet('admin/content/aggregator/add/opml');
$this->drupalGet('admin/settings/aggregator/add/opml');
$this->assertText('A single OPML document may contain a collection of many feeds.', t('Looking for help text.'));
$this->assertFieldByName('files[upload]', '', t('Looking for file upload field.'));
$this->assertFieldByName('remote', '', t('Looking for remote URL field.'));
......@@ -551,7 +551,7 @@ class ImportOPMLTestCase extends AggregatorTestCase {
$before = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
$form = array();
$this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
$this->drupalPost('admin/settings/aggregator/add/opml', $form, t('Import'));
$this->assertRaw(t('You must <em>either</em> upload a file or enter a URL.'), t('Error if no fields are filled.'));
$path = $this->getEmptyOpml();
......@@ -559,11 +559,11 @@ class ImportOPMLTestCase extends AggregatorTestCase {
'files[upload]' => $path,
'remote' => file_create_url($path),
);
$this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
$this->drupalPost('admin/settings/aggregator/add/opml', $form, t('Import'));
$this->assertRaw(t('You must <em>either</em> upload a file or enter a URL.'), t('Error if both fields are filled.'));
$form = array('remote' => 'invalidUrl://empty');
$this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
$this->drupalPost('admin/settings/aggregator/add/opml', $form, t('Import'));
$this->assertText(t('This URL is not valid.'), t('Error if the URL is invalid.'));
$after = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
......@@ -577,11 +577,11 @@ class ImportOPMLTestCase extends AggregatorTestCase {
$before = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
$form['files[upload]'] = $this->getInvalidOpml();
$this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
$this->drupalPost('admin/settings/aggregator/add/opml', $form, t('Import'));
$this->assertText(t('No new feed has been added.'), t('Attempting to upload invalid XML.'));
$form = array('remote' => file_create_url($this->getEmptyOpml()));
$this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
$this->drupalPost('admin/settings/aggregator/add/opml', $form, t('Import'));
$this->assertText(t('No new feed has been added.'), t('Attempting to load empty OPML from remote URL.'));
$after = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
......@@ -608,7 +608,7 @@ class ImportOPMLTestCase extends AggregatorTestCase {
'refresh' => '900',
'category[1]' => $category,
);
$this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
$this->drupalPost('admin/settings/aggregator/add/opml', $form, t('Import'));
$this->assertRaw(t('A feed with the URL %url already exists.', array('%url' => $feeds[0]['url'])), t('Verifying that a duplicate URL was identified'));
$this->assertRaw(t('A feed named %title already exists.', array('%title' => $feeds[1]['title'])), t('Verifying that a duplicate title was identified'));
......
......@@ -102,9 +102,9 @@ function book_node_view_link($node, $build_mode) {
function book_menu() {
$items['admin/content/book'] = array(
'title' => 'Books',
'description' => "Manage your site's book outlines.",
'page callback' => 'book_admin_overview',
'access arguments' => array('administer book outlines'),
'type' => MENU_LOCAL_TASK,
);
$items['admin/content/book/list'] = array(
'title' => 'List',
......
......@@ -114,7 +114,7 @@ function comment_admin_overview_validate($form, &$form_state) {
// We can't execute any 'Update options' if no comments were selected.
if (count($form_state['values']['comments']) == 0) {
form_set_error('', t('Please select one or more comments to perform the update on.'));
drupal_goto('admin/content/content/comment');
drupal_goto('admin/content/comment');
}
}
......@@ -145,7 +145,7 @@ function comment_admin_overview_submit($form, &$form_state) {
}
cache_clear_all();
drupal_set_message(t('The update has been performed.'));
$form_state['redirect'] = 'admin/content/content/comment';
$form_state['redirect'] = 'admin/content/comment';
}
}
......@@ -181,12 +181,12 @@ function comment_multiple_delete_confirm(&$form_state) {
if (!$comment_counter) {
drupal_set_message(t('There do not appear to be any comments to delete, or your selected comment was deleted by another administrator.'));
drupal_goto('admin/content/content/comment');
drupal_goto('admin/content/comment');
}
else {
return confirm_form($form,
t('Are you sure you want to delete these comments and all their children?'),
'admin/content/content/comment', t('This action cannot be undone.'),
'admin/content/comment', t('This action cannot be undone.'),
t('Delete comments'), t('Cancel'));
}
}
......@@ -205,7 +205,7 @@ function comment_multiple_delete_confirm_submit($form, &$form_state) {
cache_clear_all();
drupal_set_message(t('The comments have been deleted.'));
}
$form_state['redirect'] = 'admin/content/content/comment';
$form_state['redirect'] = 'admin/content/comment';
}
/**
......
......@@ -127,7 +127,7 @@ function comment_theme() {
* Implement hook_menu().
*/
function comment_menu() {
$items['admin/content/content/comment'] = array(
$items['admin/content/comment'] = array(
'title' => 'Comments',
'description' => 'List and edit site comments and the comment approval queue.',
'page callback' => 'comment_admin',
......@@ -135,12 +135,12 @@ function comment_menu() {
'type' => MENU_LOCAL_TASK,
);
// Tabs begin here.
$items['admin/content/content/comment/new'] = array(
$items['admin/content/comment/new'] = array(
'title' => 'Published comments',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['admin/content/content/comment/approval'] = array(
$items['admin/content/comment/approval'] = array(
'title' => 'Approval queue',
'page arguments' => array('approval'),
'access arguments' => array('administer comments'),
......@@ -2351,6 +2351,6 @@ function comment_ranking() {
* Implement hook_menu_alter().
*/
function comment_menu_alter(&$items) {
// Add comments to the description for admin/content/content.
// Add comments to the description for admin/content.
$items['admin/content/content']['description'] = "View, edit, and delete your site's content and comments.";
}
......@@ -203,7 +203,7 @@ class CommentHelperCase extends DrupalWebTestCase {
$edit = array();
$edit['operation'] = $operation;
$edit['comments[' . $comment->id . ']'] = TRUE;
$this->drupalPost('admin/content/content/comment' . ($approval ? '/approval' : ''), $edit, t('Update'));
$this->drupalPost('admin/content/comment' . ($approval ? '/approval' : ''), $edit, t('Update'));
if ($operation == 'delete') {
$this->drupalPost(NULL, array(), t('Delete comments'));
......@@ -223,7 +223,7 @@ class CommentHelperCase extends DrupalWebTestCase {
* Comment id.
*/
function getUnapprovedComment($subject) {
$this->drupalGet('admin/content/content/comment/approval');
$this->drupalGet('admin/content/comment/approval');
preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->drupalGetContent(), $match);
return $match[2];
......@@ -422,19 +422,19 @@ class CommentAnonymous extends CommentHelperCase {
$this->drupalLogin($this->admin_user);
$this->performCommentOperation($anonymous_comment3, 'unpublish');
$this->drupalGet('admin/content/content/comment/approval');
$this->drupalGet('admin/content/comment/approval');
$this->assertRaw('comments[' . $anonymous_comment3->id . ']', t('Comment was unpublished.'));
// Publish comment.
$this->performCommentOperation($anonymous_comment3, 'publish', TRUE);
$this->drupalGet('admin/content/content/comment');
$this->drupalGet('admin/content/comment');
$this->assertRaw('comments[' . $anonymous_comment3->id . ']', t('Comment was published.'));
// Delete comment.
$this->performCommentOperation($anonymous_comment3, 'delete');
$this->drupalGet('admin/content/content/comment');
$this->drupalGet('admin/content/comment');
$this->assertNoRaw('comments[' . $anonymous_comment3->id . ']', t('Comment was deleted.'));
// Reset.
......@@ -562,7 +562,7 @@ class CommentApprovalTest extends CommentHelperCase {
}
/**
* Test comment approval functionality through admin/content/content/comment.
* Test comment approval functionality through admin/content/comment.
*/
function testApprovalAdminInterface() {
$this->drupalLogin($this->admin_user);
......
......@@ -166,7 +166,7 @@ function forum_confirm_delete(&$form_state, $tid) {
$form['tid'] = array('#type' => 'value', '#value' => $tid);
$form['name'] = array('#type' => 'value', '#value' => $term->name);
return confirm_form($form, t('Are you sure you want to delete the forum %name?', array('%name' => $term->name)), 'admin/structure/forum', t('Deleting a forum or container will also delete its sub-forums, if any. To delete posts in this forum, visit <a href="@content">content administration</a> first. This action cannot be undone.', array('@content' => url('admin/content/node'))), t('Delete'), t('Cancel'));
return confirm_form($form, t('Are you sure you want to delete the forum %name?', array('%name' => $term->name)), 'admin/structure/forum', t('Deleting a forum or container will also delete its sub-forums, if any. To delete posts in this forum, visit <a href="@content">content administration</a> first. This action cannot be undone.', array('@content' => url('admin/content'))), t('Delete'), t('Cancel'));
}
/**
......
......@@ -578,7 +578,7 @@ function node_multiple_delete_confirm(&$form_state, $nodes) {
'Are you sure you want to delete these items?');
return confirm_form($form,
$confirm_question,
'admin/content/node', t('This action cannot be undone.'),
'admin/content', t('This action cannot be undone.'),
t('Delete'), t('Cancel'));
}
......@@ -589,7 +589,7 @@ function node_multiple_delete_confirm_submit($form, &$form_state) {
watchdog('content', 'Deleted @count posts.', array('@count' => $count));
drupal_set_message(t('Deleted @count posts.', array('@count' => $count)));
}
$form_state['redirect'] = 'admin/content/node';
$form_state['redirect'] = 'admin/content';
return;
}
...