Commit b138793b authored by Dries's avatar Dries

- Patch #72079 by Earl et al: give Drupal an overall administration page ... :-)

parent 3a7b64ae
......@@ -2,6 +2,8 @@
Drupal x.x.x, xxxx-xx-xx (development version)
------------------------
- completely retooled the administration page
* /admin now contains an administration page which may be themed
- added web-based installer which can:
* automatically generate the database configuration file
* install pre-made 'install profiles' or distributions
......
......@@ -86,7 +86,7 @@ function theme_locale_admin_manage_screen($form) {
foreach ($form['name'] as $key => $element) {
// Do not take form control structures.
if (is_array($element) && element_child($key)) {
$rows[] = array(check_plain($key), form_render($form['name'][$key]), form_render($form['enabled'][$key]), form_render($form['site_default'][$key]), ($key != 'en' ? form_render($form['translation'][$key]) : t('n/a')), ($key != 'en' ? l(t('delete'), 'admin/locale/language/delete/'. $key) : ''));
$rows[] = array(check_plain($key), form_render($form['name'][$key]), form_render($form['enabled'][$key]), form_render($form['site_default'][$key]), ($key != 'en' ? form_render($form['translation'][$key]) : t('n/a')), ($key != 'en' ? l(t('delete'), 'admin/settings/locale/language/delete/'. $key) : ''));
}
}
$header = array(array('data' => t('Code')), array('data' => t('English name')), array('data' => t('Enabled')), array('data' => t('Default')), array('data' => t('Translated')), array('data' => t('Operations')));
......@@ -120,7 +120,7 @@ function _locale_admin_manage_screen_submit($form_id, $form_values) {
// Changing the locale settings impacts the interface:
cache_clear_all();
return 'admin/locale/language/overview';
return 'admin/settings/locale/language/overview';
}
/**
......@@ -377,7 +377,7 @@ function _locale_string_edit($lid) {
// Handle erroneous lid.
if (!isset($orig)){
drupal_set_message(t('String not found.'));
drupal_goto('admin/locale/string/search');
drupal_goto('admin/settings/locale/string/search');
}
// Add original text. Assign negative weight so that it floats to the top.
......@@ -424,7 +424,7 @@ function _locale_string_edit_submit($form_id, $form_values) {
// Rebuild the menu, strings may have changed.
menu_rebuild();
return 'admin/locale/string/search';
return 'admin/settings/locale/string/search';
}
/**
......@@ -436,7 +436,7 @@ function _locale_string_delete($lid) {
locale_refresh_cache();
drupal_set_message(t('The string has been removed.'));
drupal_goto('admin/locale/string/search');
drupal_goto('admin/settings/locale/string/search');
}
/**
......@@ -1314,7 +1314,7 @@ function _locale_string_seek() {
$arr[$locale->lid]['source'] = $locale->source;
}
foreach ($arr as $lid => $value) {
$rows[] = array(array('data' => check_plain(truncate_utf8($value['source'], 150, FALSE, TRUE)) .'<br /><small>'. $value['location'] .'</small>'), array('data' => _locale_string_language_list($value['locales']), 'align' => 'center'), array('data' => l(t('edit'), "admin/locale/string/edit/$lid"), 'class' => 'nowrap'), array('data' => l(t('delete'), "admin/locale/string/delete/$lid"), 'class' => 'nowrap'));
$rows[] = array(array('data' => check_plain(truncate_utf8($value['source'], 150, FALSE, TRUE)) .'<br /><small>'. $value['location'] .'</small>'), array('data' => _locale_string_language_list($value['locales']), 'align' => 'center'), array('data' => l(t('edit'), "admin/settings/locale/string/edit/$lid"), 'class' => 'nowrap'), array('data' => l(t('delete'), "admin/settings/locale/string/delete/$lid"), 'class' => 'nowrap'));
}
$request = array();
......
......@@ -866,11 +866,11 @@ function menu_primary_links($start_level = 1, $pid = 0) {
}
}
// Special case - provide link to admin/menu if primary links is empty.
// Special case - provide link to admin/build/menu if primary links is empty.
if (empty($links) && $start_level == 1 && $pid == variable_get('menu_primary_menu', 0)) {
$links['1-1'] = array(
'title' => t('edit primary links'),
'href' => 'admin/menu'
'href' => 'admin/build/menu'
);
}
......
......@@ -674,3 +674,55 @@ html.js fieldset.collapsed legend a {
display: block;
padding: 1.5em 0 .5em;
}
/*
** Formatting for administration page -- this should probably be its own file
*/
div.admin-panel {
margin: 0px 0px 0px 0px;
padding: 5px 5px 15px 5px;
}
div.admin-panel .description {
margin: 0px 0px 3px;
padding: 2px 0 3px 0;
font-weight: normal;
text-align: left;
color: #999;
}
div.admin-panel .body {
padding: 0 4px 2px 8px;
background-color: #f4f4f4;
line-height: 1.2em;
}
div.admin-panel .head {
background-color: #6699CC;
color: #FFFFFF;
font-weight: bold;
font-size: 14px;
margin: 0px 0px 0px 0px;
padding: 4px 4px 4px 8px;
}
div.admin {
padding-top: 15px;
}
div.admin .left {
float: left;
width: 47%;
margin-left: 1em;
}
div.admin .right {
float: right;
width: 47%;
margin-right: 1em;
}
div.admin .expert-link {
text-align: right;
margin-right: 1em;
padding-right: 4px;
}
......@@ -13,7 +13,7 @@ function aggregator_help($section) {
switch ($section) {
case 'admin/help#aggregator':
$output = '<p>'. t('The news aggregator is a powerful on-site RSS syndicator/news reader that can gather fresh content from news sites and weblogs around the web.') .'</p>';
$output .= '<p>'. t('Users can view the latest news chronologically in the <a href="%aggregator">main news aggregator display</a> or by <a href="%aggregator-sources">source</a>. Administrators can add, edit and delete feeds and choose how often to check for newly updated news for each individual feed. Administrators can also tag individual feeds with categories, offering selective grouping of some feeds into separate displays. Listings of the latest news for individual sources or categorized sources can be enabled as blocks for display in the sidebar through the <a href="%admin-block">block administration page</a>. The news aggregator requires cron to check for the latest news from the sites to which you have subscribed. Drupal also provides a <a href="%aggregator-opml">machine-readable OPML file</a> of all of your subscribed feeds.', array('%aggregator' => url('aggregator'), '%aggregator-sources' => url('aggregator/sources'), '%admin-block' => url('admin/block'), '%aggregator-opml' => url('aggregator/opml'))) .'</p>';
$output .= '<p>'. t('Users can view the latest news chronologically in the <a href="%aggregator">main news aggregator display</a> or by <a href="%aggregator-sources">source</a>. Administrators can add, edit and delete feeds and choose how often to check for newly updated news for each individual feed. Administrators can also tag individual feeds with categories, offering selective grouping of some feeds into separate displays. Listings of the latest news for individual sources or categorized sources can be enabled as blocks for display in the sidebar through the <a href="%admin-block">block administration page</a>. The news aggregator requires cron to check for the latest news from the sites to which you have subscribed. Drupal also provides a <a href="%aggregator-opml">machine-readable OPML file</a> of all of your subscribed feeds.', array('%aggregator' => url('aggregator'), '%aggregator-sources' => url('aggregator/sources'), '%admin-block' => url('admin/build/block'), '%aggregator-opml' => url('aggregator/opml'))) .'</p>';
$output .= t('<p>You can</p>
<ul>
<li>administer your list of news feeds <a href="%admin-aggregator">administer &gt;&gt; aggregator</a>.</li>
......@@ -24,16 +24,16 @@ function aggregator_help($section) {
<li>set permissions to access new feeds for user roles such as anonymous users at <a href="%admin-access">administer &gt;&gt; access control</a>.</li>
<li>view the <a href="%aggregator">aggregator page</a>.</li>
</ul>
', array('%admin-aggregator' => url('admin/aggregator'), '%admin-aggregator-add-feed' => url('admin/aggregator/add/feed'), '%admin-aggregator-add-category' => url('admin/aggregator/add/category'), '%admin-settings-aggregator' => url('admin/settings/aggregator'), '%admin-access' => url('admin/access'), '%aggregator' => url('aggregator')));
', array('%admin-aggregator' => url('admin/content/aggregator'), '%admin-aggregator-add-feed' => url('admin/content/aggregator/add/feed'), '%admin-aggregator-add-category' => url('admin/content/aggregator/add/category'), '%admin-settings-aggregator' => url('admin/settings/aggregator'), '%admin-access' => url('admin/access'), '%aggregator' => url('aggregator')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%aggregator">Aggregator page</a>.', array('%aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) .'</p>';
return $output;
case 'admin/modules#description':
case 'admin/settings/modules#description':
return t('Aggregates syndicated content (RSS, RDF, and Atom feeds).');
case 'admin/aggregator':
return t('<p>Thousands of sites (particularly news sites and weblogs) publish their latest headlines and/or stories in a machine-readable format so that other sites can easily link to them. This content is usually in the form of an <a href="http://blogs.law.harvard.edu/tech/rss">RSS</a> feed (which is an XML-based syndication standard). To display the feed or category in a block you must decide how many items to show by editing the feed or block and turning on the <a href="%block">feed\'s block</a>.</p>', array('%block' => url('admin/block')));
case 'admin/aggregator/add/feed':
case 'admin/content/aggregator':
return t('<p>Thousands of sites (particularly news sites and weblogs) publish their latest headlines and/or stories in a machine-readable format so that other sites can easily link to them. This content is usually in the form of an <a href="http://blogs.law.harvard.edu/tech/rss">RSS</a> feed (which is an XML-based syndication standard). To display the feed or category in a block you must decide how many items to show by editing the feed or block and turning on the <a href="%block">feed\'s block</a>.</p>', array('%block' => url('admin/build/block')));
case 'admin/content/aggregator/add/feed':
return t('<p>Add a site that has an RSS/RDF/Atom feed. The URL is the full path to the feed file. For the feed to update automatically you must run "cron.php" on a regular basis. If you already have a feed with the URL you are planning to use, the system will not accept another feed with the same URL.</p>');
case 'admin/aggregator/add/category':
case 'admin/content/aggregator/add/category':
return t('<p>Categories provide a way to group items from different news feeds together. Each news category has its own feed page and block. For example, you could tag various sport-related feeds as belonging to a category called <em>Sports</em>. News items can be added to a category automatically by setting a feed to automatically place its item into that category, or by using the categorize items link in any listing of news items.</p>');
}
}
......@@ -47,38 +47,40 @@ function aggregator_menu($may_cache) {
$view = user_access('access news feeds');
if ($may_cache) {
$items[] = array('path' => 'admin/aggregator',
'title' => t('aggregator'),
$items[] = array('path' => 'admin/content/aggregator',
'title' => t('RSS aggregator'),
'description' => t('Configure which content your site aggregates from other sites, how often it polls them, and how they\'re categorized.'),
'callback' => 'aggregator_admin_overview',
'access' => $edit);
$items[] = array('path' => 'admin/aggregator/add/feed',
$items[] = array('path' => 'admin/content/aggregator/add/feed',
'title' => t('add feed'),
'callback' => 'aggregator_form_feed',
'access' => $edit,
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/aggregator/add/category',
$items[] = array('path' => 'admin/content/aggregator/add/category',
'title' => t('add category'),
'callback' => 'aggregator_form_category',
'access' => $edit,
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/aggregator/remove',
$items[] = array('path' => 'admin/content/aggregator/remove',
'title' => t('remove items'),
'callback' => 'aggregator_admin_remove_feed',
'access' => $edit,
'type' => MENU_CALLBACK);
$items[] = array('path' => 'admin/aggregator/update',
$items[] = array('path' => 'admin/content/aggregator/update',
'title' => t('update items'),
'callback' => 'aggregator_admin_refresh_feed',
'access' => $edit,
'type' => MENU_CALLBACK);
$items[] = array('path' => 'admin/aggregator/list',
$items[] = array('path' => 'admin/content/aggregator/list',
'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10);
$items[] = array('path' => 'admin/settings/aggregator',
'title' => t('RSS aggregator'),
$items[] = array('path' => 'admin/content/aggregator/settings',
'title' => t('settings'),
'callback' => 'aggregator_admin_settings',
'type' => MENU_NORMAL_ITEM,
'type' => MENU_LOCAL_TASK,
'weight' => 10,
'access' => $edit);
$items[] = array('path' => 'aggregator',
......@@ -168,7 +170,7 @@ function aggregator_menu($may_cache) {
if (arg(3) == 'feed') {
$feed = aggregator_get_feed(arg(4));
if ($feed) {
$items[] = array('path' => 'admin/aggregator/edit/feed/'. $feed['fid'],
$items[] = array('path' => 'admin/content/aggregator/edit/feed/'. $feed['fid'],
'title' => t('edit feed'),
'callback' => 'aggregator_form_feed',
'callback arguments' => array($feed),
......@@ -179,7 +181,7 @@ function aggregator_menu($may_cache) {
else {
$category = aggregator_get_category(arg(4));
if ($category) {
$items[] = array('path' => 'admin/aggregator/edit/category/'. $category['cid'],
$items[] = array('path' => 'admin/content/aggregator/edit/category/'. $category['cid'],
'title' => t('edit category'),
'callback' => 'aggregator_form_category',
'callback arguments' => array($category),
......@@ -367,7 +369,7 @@ function aggregator_form_category_submit($form_id, $form_values) {
if (isset($form_values['title'])) {
drupal_set_message(t('The category %category has been updated.', array('%category' => theme('placeholder', $form_values['title']))));
if (arg(0) == 'admin') {
return 'admin/aggregator/';
return 'admin/content/aggregator/';
}
else {
return 'aggregator/categories/'. $form_values['cid'];
......@@ -377,7 +379,7 @@ function aggregator_form_category_submit($form_id, $form_values) {
watchdog('aggregator', t('Category %category deleted.', array('%category' => theme('placeholder', $title))));
drupal_set_message(t('The category %category has been deleted.', array('%category' => theme('placeholder', $title))));
if (arg(0) == 'admin') {
return 'admin/aggregator/';
return 'admin/content/aggregator/';
}
else {
return 'aggregator/categories/';
......@@ -385,7 +387,7 @@ function aggregator_form_category_submit($form_id, $form_values) {
}
}
else {
watchdog('aggregator', t('Category %category added.', array('%category' => theme('placeholder', $form_values['title']))), WATCHDOG_NOTICE, l(t('view'), 'admin/aggregator'));
watchdog('aggregator', t('Category %category added.', array('%category' => theme('placeholder', $form_values['title']))), WATCHDOG_NOTICE, l(t('view'), 'admin/content/aggregator'));
drupal_set_message(t('The category %category has been added.', array('%category' => theme('placeholder', $form_values['title']))));
}
}
......@@ -500,7 +502,7 @@ function aggregator_form_feed_submit($form_id, $form_values) {
if (isset($form_values['title'])) {
drupal_set_message(t('The feed %feed has been updated.', array('%feed' => theme('placeholder', $form_values['title']))));
if (arg(0) == 'admin') {
return 'admin/aggregator/';
return 'admin/content/aggregator/';
}
else {
return 'aggregator/sources/'. $form_values['fid'];
......@@ -510,7 +512,7 @@ function aggregator_form_feed_submit($form_id, $form_values) {
watchdog('aggregator', t('Feed %feed deleted.', array('%feed' => theme('placeholder', $title))));
drupal_set_message(t('The feed %feed has been deleted.', array('%feed' => theme('placeholder', $title))));
if (arg(0) == 'admin') {
return 'admin/aggregator/';
return 'admin/content/aggregator/';
}
else {
return 'aggregator/sources/';
......@@ -518,7 +520,7 @@ function aggregator_form_feed_submit($form_id, $form_values) {
}
}
else {
watchdog('aggregator', t('Feed %feed added.', array('%feed' => theme('placeholder', $form_values['title']))), WATCHDOG_NOTICE, l(t('view'), 'admin/aggregator'));
watchdog('aggregator', t('Feed %feed added.', array('%feed' => theme('placeholder', $form_values['title']))), WATCHDOG_NOTICE, l(t('view'), 'admin/content/aggregator'));
drupal_set_message(t('The feed %feed has been added.', array('%feed' => theme('placeholder', $form_values['title']))));
}
}
......@@ -974,7 +976,7 @@ function aggregator_view() {
$header = array(t('Title'), t('Items'), t('Last update'), t('Next update'), array('data' => t('Operations'), 'colspan' => '3'));
$rows = array();
while ($feed = db_fetch_object($result)) {
$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(time() - $feed->checked))) : t('never')), ($feed->checked ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - time()))) : t('never')), l(t('edit'), "admin/aggregator/edit/feed/$feed->fid"), l(t('remove items'), "admin/aggregator/remove/$feed->fid"), l(t('update items'), "admin/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(time() - $feed->checked))) : t('never')), ($feed->checked ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - 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"));
}
$output .= theme('table', $header, $rows);
......@@ -985,7 +987,7 @@ function aggregator_view() {
$header = array(t('Title'), t('Items'), t('Operations'));
$rows = array();
while ($category = db_fetch_object($result)) {
$rows[] = array(l($category->title, "aggregator/categories/$category->cid"), format_plural($category->items, '1 item', '%count items'), l(t('edit'), "admin/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/content/aggregator/edit/category/$category->cid"));
}
$output .= theme('table', $header, $rows);
......@@ -997,7 +999,7 @@ function aggregator_view() {
*/
function aggregator_admin_remove_feed($feed) {
aggregator_remove(aggregator_get_feed($feed));
drupal_goto('admin/aggregator');
drupal_goto('admin/content/aggregator');
}
/**
......@@ -1005,7 +1007,7 @@ function aggregator_admin_remove_feed($feed) {
*/
function aggregator_admin_refresh_feed($feed) {
aggregator_refresh(aggregator_get_feed($feed));
drupal_goto('admin/aggregator');
drupal_goto('admin/content/aggregator');
}
/**
......@@ -1290,7 +1292,7 @@ function theme_aggregator_feed($feed) {
}
if (user_access('administer news feeds')) {
$updated = l($updated, 'admin/aggregator');
$updated = l($updated, 'admin/content/aggregator');
}
$output .= '<div class="feed-updated"><em>'. t('Updated:') . "</em> $updated</div>";
......
......@@ -19,10 +19,10 @@ function archive_help($section) {
<li>view your <a href="%archive">archive by day</a>.</li>
<li>enable the <em>browse archives</em> block at <a href="%admin-block">administer &gt;&gt; block</a>.</li>
</ul>
', array('%archive' => url('archive'), '%admin-block' => url('admin/block')));
', array('%archive' => url('archive'), '%admin-block' => url('admin/build/block')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%archive">Archive page</a>.', array('%archive' => 'http://drupal.org/handbook/modules/archive/')) .'</p>';
return $output;
case 'admin/modules#description':
case 'admin/settings/modules#description':
return t('Displays a calendar for navigating older content.');
}
}
......
......@@ -27,7 +27,7 @@ function block_help($section) {
</ul>
');
$output .= '<h3>'. t('Module blocks') .'</h3>';
$output .= '<p>'. t('Some modules generate blocks that become available when the modules are enabled. These blocks can be administered via the <a href="%admin-block">blocks administration page</a>.</p>', array('%admin-block' => url('admin/block'))) .'</p>';
$output .= '<p>'. t('Some modules generate blocks that become available when the modules are enabled. These blocks can be administered via the <a href="%admin-block">blocks administration page</a>.</p>', array('%admin-block' => url('admin/build/block'))) .'</p>';
$output .= '<h3>'. t('Administrator defined blocks') .'</h3>';
$output .= '<p>'. t('Administrators can also define custom blocks. These blocks consist of a title, a description, and a body which can be as long as you wish. Block content can be in any of the input formats supported for other content.') .'</p>';
$output .= t('<p>You can</p>
......@@ -35,20 +35,20 @@ function block_help($section) {
<li>enable, throttle and configure blocks at <a href="%admin-block">administer &gt;&gt; blocks</a>.</li>
<li>add an administrator-defined block at <a href="%admin-block-add">administer &gt;&gt; blocks &gt;&gt; add block</a>.</li>
</ul>
', array('%admin-block' => url('admin/block'), '%admin-block-add' => url('admin/block/add')));
', array('%admin-block' => url('admin/build/block'), '%admin-block-add' => url('admin/build/block/add')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%block">Block page</a>.', array('%block' => 'http://drupal.org/handbook/modules/block/')) .'</p>';
return $output;
case 'admin/modules#description':
case 'admin/settings/modules#description':
return t('Controls the boxes that are displayed around the main content.');
case 'admin/block':
case 'admin/build/block':
return t("
<p>Blocks are boxes of content that may be rendered into certain regions of your web pages, for example, into sidebars. They are usually generated automatically by modules, but administrators can create blocks manually.</p>
<p>Only enabled blocks are shown. You can position blocks by specifying which area of the page they should appear in (e.g., a sidebar). Highlighted labels on this page show the regions into which blocks can be rendered. You can specify where within a region a block will appear by adjusting its weight.</p>
<p>If you want certain blocks to disable themselves temporarily during high server loads, check the 'Throttle' box. You can configure the auto-throttle on the <a href=\"%throttle\">throttle configuration page</a> after having enabled the throttle module.</p>
<p>You can configure the behaviour of each block (for example, specifying on which pages and for what users it will appear) by clicking the 'configure' link for each block.</p>
", array('%throttle' => url('admin/settings/throttle')));
case 'admin/block/add':
return t('<p>Here you can create a new block. Once you have created this block you must make it active and give it a place on the page using <a href="%overview">blocks</a>. The title is used when displaying the block. The description is used in the "block" column on the <a href="%overview">blocks</a> page.</p>', array('%overview' => url('admin/block')));
case 'admin/build/block/add':
return t('<p>Here you can create a new block. Once you have created this block you must make it active and give it a place on the page using <a href="%overview">blocks</a>. The title is used when displaying the block. The description is used in the "block" column on the <a href="%overview">blocks</a> page.</p>', array('%overview' => url('admin/build/block')));
}
}
......@@ -66,31 +66,34 @@ function block_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array('path' => 'admin/block', 'title' => t('blocks'),
$items[] = array(
'path' => 'admin/build/block',
'title' => t('blocks'),
'access' => user_access('administer blocks'),
'description' => t('Configure what block content appears in your site\'s sidebars and other regions.'),
'callback' => 'block_admin_display');
$items[] = array('path' => 'admin/block/list', 'title' => t('list'),
$items[] = array('path' => 'admin/build/block/list', 'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/block/configure', 'title' => t('configure block'),
$items[] = array('path' => 'admin/build/block/configure', 'title' => t('configure block'),
'access' => user_access('administer blocks'),
'callback' => 'block_admin_configure',
'type' => MENU_CALLBACK);
$items[] = array('path' => 'admin/block/delete', 'title' => t('delete block'),
$items[] = array('path' => 'admin/build/block/delete', 'title' => t('delete block'),
'access' => user_access('administer blocks'),
'callback' => 'block_box_delete',
'type' => MENU_CALLBACK);
$items[] = array('path' => 'admin/block/add', 'title' => t('add block'),
$items[] = array('path' => 'admin/build/block/add', 'title' => t('add block'),
'access' => user_access('administer blocks'),
'callback' => 'block_box_add',
'type' => MENU_LOCAL_TASK);
foreach (list_themes() as $key => $theme) {
if ($theme->status) {
if ($key == variable_get('theme_default', 'bluemarine')) {
$items[] = array('path' => 'admin/block/list/' . $key, 'title' => t('%key settings', array('%key' => $key)),
$items[] = array('path' => 'admin/build/block/list/' . $key, 'title' => t('%key settings', array('%key' => $key)),
'access' => user_access('administer blocks'), 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
}
else {
$items[] = array('path' => 'admin/block/list/' . $key, 'title' => t('%key settings', array('%key' => $key)),
$items[] = array('path' => 'admin/build/block/list/' . $key, 'title' => t('%key settings', array('%key' => $key)),
'access' => user_access('administer blocks'), 'type' => MENU_LOCAL_TASK);
}
}
......@@ -193,12 +196,12 @@ function _block_rehash() {
/**
* Generate main block administration form.
*/
function block_admin_display() {
function block_admin_display($theme = NULL) {
global $theme_key, $custom_theme;
// If non-default theme configuration has been selected, set the custom theme.
if (arg(3)) {
$custom_theme = arg(3);
if ($theme) {
$custom_theme = $theme;
}
else {
$custom_theme = variable_get('theme_default', 'bluemarine');
......@@ -213,7 +216,7 @@ function block_admin_display() {
$block_regions = system_region_list($theme_key);
// Build form tree
$form['#action'] = arg(3) ? url('admin/block/list/' . $theme_key) : url('admin/block');
$form['#action'] = arg(3) ? url('admin/build/block/list/' . $theme_key) : url('admin/build/block');
$form['#tree'] = TRUE;
foreach ($blocks as $i => $block) {
$form[$i]['module'] = array('#type' => 'value', '#value' => $block['module']);
......@@ -230,9 +233,9 @@ function block_admin_display() {
if ($throttle) {
$form[$i]['throttle'] = array('#type' => 'checkbox', '#default_value' => $block['throttle']);
}
$form[$i]['configure'] = array('#value' => l(t('configure'), 'admin/block/configure/'. $block['module'] .'/'. $block['delta']));
$form[$i]['configure'] = array('#value' => l(t('configure'), 'admin/build/block/configure/'. $block['module'] .'/'. $block['delta']));
if ($block['module'] == 'block') {
$form[$i]['delete'] = array('#value' => l(t('delete'), 'admin/block/delete/'. $block['delta']));
$form[$i]['delete'] = array('#value' => l(t('delete'), 'admin/build/block/delete/'. $block['delta']));
}
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Save blocks'));
......@@ -241,7 +244,7 @@ function block_admin_display() {
}
/**
* Helper function for sorting blocks on admin/block.
* Helper function for sorting blocks on admin/build/block.
*
* Active blocks are sorted by region, then by weight.
* Disabled blocks are sorted by name.
......@@ -481,7 +484,7 @@ function block_admin_configure_submit($form_id, $form_values) {
module_invoke($form_values['module'], 'block', 'save', $form_values['delta'], $form_values);
drupal_set_message(t('The block configuration has been saved.'));
cache_clear_all();
return 'admin/block';
return 'admin/build/block';
}
}
......@@ -505,7 +508,7 @@ function block_box_add_submit($form_id, $form_values) {
if (!form_get_errors()) {
if (block_box_save($form_values)) {
drupal_set_message(t('The block has been created.'));
return 'admin/block';
return 'admin/build/block';
}
}
}
......@@ -518,7 +521,7 @@ function block_box_delete($bid = 0) {
$form['info'] = array('#type' => 'hidden', '#value' => $box['info'] ? $box['info'] : $box['title']);
$form['bid'] = array('#type' => 'hidden', '#value' => $bid);
return confirm_form('block_box_delete_confirm', $form, t('Are you sure you want to delete the block %name?', array('%name' => theme('placeholder', $box['info']))), 'admin/block', '', t('Delete'), t('Cancel'));
return confirm_form('block_box_delete_confirm', $form, t('Are you sure you want to delete the block %name?', array('%name' => theme('placeholder', $box['info']))), 'admin/build/block', '', t('Delete'), t('Cancel'));
}
/**
......@@ -528,7 +531,7 @@ function block_box_delete_confirm_submit($form_id, $form_values) {
db_query('DELETE FROM {boxes} WHERE bid = %d', $form_values['bid']);
drupal_set_message(t('The block %name has been removed.', array('%name' => theme('placeholder', $form_values['info']))));
cache_clear_all();
return 'admin/block';
return 'admin/build/block';
};
function block_box_form($edit = array()) {
......@@ -537,7 +540,7 @@ function block_box_form($edit = array()) {
'#title' => t('Block description'),
'#default_value' => $edit['info'],
'#maxlength' => 64,
'#description' => t('A brief description of your block. Used on the <a href="%overview">block overview page</a>.', array('%overview' => url('admin/block'))),
'#description' => t('A brief description of your block. Used on the <a href="%overview">block overview page</a>.', array('%overview' => url('admin/build/block'))),
'#required' => TRUE,
'#weight' => -19,
);
......
......@@ -67,10 +67,10 @@ function blog_help($section) {
<li>administer blog api at <a href="%admin-settings-blogapi">administer &gt;&gt; settings &gt;&gt; blogapi</a>.</li>
<li>enable the "recent blog posts" block at <a href="%admin-block">administer &gt;&gt; blocks</a> to show the 10 most recent blog posts.</li>
</ul>
', array('%user' => url('user'), '%node-add-blog' => url('node/add/blog'), '%admin-node-configure-types-blog' => url('admin/settings/content-types/blog'), '%admin-settings-blogapi' => url('admin/settings/blogapi'), '%admin-block' => url('admin/block')));
', array('%user' => url('user'), '%node-add-blog' => url('node/add/blog'), '%admin-node-configure-types-blog' => url('admin/content/types/blog'), '%admin-settings-blogapi' => url('admin/settings/blogapi'), '%admin-block' => url('admin/build/block')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%blog">Blog page</a>.', array('%blog' => 'http://drupal.org/handbook/modules/blog/')) .'</p>';
return $output;
case 'admin/modules#description':
case 'admin/settings/modules#description':
return t('Enables keeping an easily and regularly updated web page or a blog.');
case 'node/add#blog':
return t("A blog is a regularly updated journal or diary made up of individual posts shown in reversed chronological order. Each member of the site may create and maintain a blog.");
......
......@@ -23,7 +23,7 @@ function blogapi_help($section) {
', array('%file-xmlrpc' => 'xmlrpc.php', '%admin-settings-blogapi' => url('admin/settings/blogapi')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%blogapi">BlogApi page</a>.', array('%blogapi' => 'http://drupal.org/handbook/modules/blogapi/')) .'</p>';
return $output;
case 'admin/modules#description':
case 'admin/settings/modules#description':
return t('Allows users to post content using applications that support XML-RPC blog APIs.');
}
}
......@@ -587,6 +587,7 @@ function blogapi_menu($may_cache) {
$items[] = array(
'path' => 'admin/settings/blogapi',
'title' => t('blog APIs'),
'description' => t('Configure which content types and engines external blog clients can use.'),
'callback' => 'blogapi_admin_settings',
'access' => user_access('administer site configuration'),
'type' => MENU_NORMAL_ITEM
......
......@@ -88,18 +88,17 @@ function book_menu($may_cache) {
'title' => t('book page'),
'access' => user_access('create book pages'));
$items[] = array(
'path' => 'admin/node/book',
'path' => 'admin/content/book',
'title' => t('books'),
'description' => t('Manage site\'s books and orphaned book pages.'),
'callback' => 'book_admin',
'access' => user_access('administer nodes'),
'type' => MENU_LOCAL_TASK,
'weight' => -1);
'access' => user_access('administer nodes'));
$items[] = array(
'path' => 'admin/node/book/list',
'path' => 'admin/content/book/list',
'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK);
$items[] = array(
'path' => 'admin/node/book/orphan',
'path' => 'admin/content/book/orphan',
'title' => t('orphan pages'),
'callback' => 'book_admin_orphan',
'type' => MENU_LOCAL_TASK,
......@@ -873,7 +872,7 @@ function theme_book_admin_table($form) {
form_render($form[$key]['weight']),
l(t('view'), 'node/'. $nid),
l(t('edit'), 'node/'. $nid .'/edit'),
l(t('delete'), 'node/'. $nid .'/delete', NULL, 'destination=admin/node/book'. (arg(3) == 'orphan' ? '/orphan' : '') . ($pid != $nid ? '/'.$pid : ''))
l(t('delete'), 'node/'. $nid .'/delete', NULL, 'destination=admin/content/book'. (arg(3) == 'orphan' ? '/orphan' : '') . ($pid != $nid ? '/'.$pid : ''))
);
}
......@@ -980,7 +979,7 @@ function book_admin($nid = 0) {
function book_admin_overview() {
$result = db_query(db_rewrite_sql('SELECT n.nid, n.title, b.weight FROM {node} n INNER JOIN {book} b ON n.vid = b.vid WHERE b.parent = 0 ORDER BY b.weight, n.title'));
while ($book = db_fetch_object($result)) {
$rows[] = array(l($book->title, "node/$book->nid"), l(t('outline'), "admin/node/book/$book->nid"));
$rows[] = array(l($book->title, "node/$book->nid"), l(t('outline'), "admin/content/book/$book->nid"));
}
$headers = array(t('Book'), t('Operations'));
......@@ -994,7 +993,7 @@ function book_help($section) {
switch ($section) {
case 'admin/help#book':
$output = '<p>'. t('The <em>book</em> content type is suited for creating structured, multi-page hypertexts such as site resource guides, manuals, and Frequently Asked Questions (FAQs). It permits a document to have chapters, sections, subsections, etc. Authors with suitable permissions can add pages to a collaborative book, placing them into the existing document by adding them to a table of contents menu. ') .'</p>';
$output .= '<p>'. t('Books have additional <em>previous</em>, <em>up</em>, and <em>next</em> navigation elements at the bottom of each page for moving through the text. Additional navigation may be provided by enabling the <em>book navigation block</em> on the <a href="%admin-block">block administration page</a>.', array('%admin-block' => url('admin/block'))) .'</p>';
$output .= '<p>'. t('Books have additional <em>previous</em>, <em>up</em>, and <em>next</em> navigation elements at the bottom of each page for moving through the text. Additional navigation may be provided by enabling the <em>book navigation block</em> on the <a href="%admin-block">block administration page</a>.', array('%admin-block' => url('admin/build/block'))) .'</p>';
$output .= '<p>'. t('Users can select the <em>printer-friendly version</em> link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. ') .'</p>';
$output .= '<p>'. t('Administrators can view a book outline, from which is it possible to change the titles of sections, and their <i>weight</i> (thus reordering sections). From this outline, it is also possible to edit and/or delete book pages. Many content types besides pages (for example, blog entries, stories, and polls) can be added to a collaborative book by choosing the <em>outline</em> tab when viewing the post.') .'</p>';
$output .= t('<p>You can</p>
......@@ -1005,14 +1004,14 @@ function book_help($section) {
<li>enable the book navigation block: <a href="%admin-block">administer &gt;&gt; blocks</a>.</li>
<li>control who can create, edit, and outline posts in books by setting access permissions: <a href="%admin-access">administer &gt;&gt; access control</a>.</li>
</ul>
', array('%node-add-book' => url('node/add/book'), '%admin-node-book' => url('admin/node/book'), '%admin-settings-content-types-book-page' => url('admin/settings/content-types/book'), '%admin-block' => url('admin/block'), '%admin-access' => url('admin/access')));
', array('%node-add-book' => url('node/add/book'), '%admin-node-book' => url('admin/content/book'), '%admin-settings-content-types-book-page' => url('admin/content/types/book'), '%admin-block' => url('admin/build/block'), '%admin-access' => url('admin/access')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%book">Book page</a>.', array('%book' => 'http://drupal.org/handbook/modules/book/')) .'</p>';
return $output;
case 'admin/modules#description':
case 'admin/settings/modules#description':
return t('Allows users to collaboratively author a book.');
case 'admin/node/book':
case 'admin/content/book':