Commit 735e532b authored by Dries's avatar Dries

- Patch #508458 by catch, Gábor Hojtsy, yoroy: created 'Configuration and...

- Patch #508458 by catch, Gábor Hojtsy, yoroy: created 'Configuration and modules' section so we can start moving over configuration items. Let's see how this goes ...
parent ef5c0415
......@@ -89,7 +89,7 @@ function theme_locale_languages_overview_form($form) {
array('data' => drupal_render($form['enabled'][$key]), 'align' => 'center'),
drupal_render($form['site_default'][$key]),
drupal_render($form['weight'][$key]),
l(t('edit'), 'admin/international/language/edit/' . $key) . (($key != 'en' && $key != $default->language) ? ' ' . l(t('delete'), 'admin/international/language/delete/' . $key) : '')
l(t('edit'), 'admin/config/international/language/edit/' . $key) . (($key != 'en' && $key != $default->language) ? ' ' . l(t('delete'), 'admin/config/international/language/delete/' . $key) : '')
),
'class' => 'draggable'
);
......@@ -142,7 +142,7 @@ function locale_languages_overview_form_submit($form, &$form_state) {
// Changing the language settings impacts the interface.
cache_clear_all('*', 'cache_page', TRUE);
$form_state['redirect'] = 'admin/international/language';
$form_state['redirect'] = 'admin/config/international/language';
return;
}
/**
......@@ -345,7 +345,7 @@ function locale_languages_predefined_form_submit($form, &$form_state) {
batch_set($batch);
}
$form_state['redirect'] = 'admin/international/language';
$form_state['redirect'] = 'admin/config/international/language';
return;
}
......@@ -391,7 +391,7 @@ function locale_languages_edit_form_submit($form, &$form_state) {
}
variable_set('language_default', $default);
}
$form_state['redirect'] = 'admin/international/language';
$form_state['redirect'] = 'admin/config/international/language';
return;
}
/**
......@@ -411,12 +411,12 @@ function locale_languages_delete_form(&$form_state, $langcode) {
// Do not allow deletion of English locale.
if ($langcode == 'en') {
drupal_set_message(t('The English language cannot be deleted.'));
drupal_goto('admin/international/language');
drupal_goto('admin/config/international/language');
}
if (language_default('language') == $langcode) {
drupal_set_message(t('The default language cannot be deleted.'));
drupal_goto('admin/international/language');
drupal_goto('admin/config/international/language');
}
// For other languages, warn user that data loss is ahead.
......@@ -427,7 +427,7 @@ function locale_languages_delete_form(&$form_state, $langcode) {
}
else {
$form['langcode'] = array('#type' => 'value', '#value' => $langcode);
return confirm_form($form, t('Are you sure you want to delete the language %name?', array('%name' => t($languages[$langcode]->name))), 'admin/international/language', t('Deleting a language will remove all interface translations associated with it, and posts in this language will be set to be language neutral. This action cannot be undone.'), t('Delete'), t('Cancel'));
return confirm_form($form, t('Are you sure you want to delete the language %name?', array('%name' => t($languages[$langcode]->name))), 'admin/config/international/language', t('Deleting a language will remove all interface translations associated with it, and posts in this language will be set to be language neutral. This action cannot be undone.'), t('Delete'), t('Cancel'));
}
}
......@@ -460,7 +460,7 @@ function locale_languages_delete_form_submit($form, &$form_state) {
// Changing the language settings impacts the interface:
cache_clear_all('*', 'cache_page', TRUE);
$form_state['redirect'] = 'admin/international/language';
$form_state['redirect'] = 'admin/config/international/language';
return;
}
/**
......@@ -500,7 +500,7 @@ function locale_languages_configure_form() {
function locale_languages_configure_form_submit($form, &$form_state) {
variable_set('language_negotiation', $form_state['values']['language_negotiation']);
drupal_set_message(t('Language negotiation configuration saved.'));
$form_state['redirect'] = 'admin/international/language';
$form_state['redirect'] = 'admin/config/international/language';
return;
}
/**
......@@ -687,7 +687,7 @@ function locale_translation_filter_form_submit($form, &$form_state) {
break;
}
$form_state['redirect'] = 'admin/international/translate/translate';
$form_state['redirect'] = 'admin/config/international/translate/translate';
}
/**
......@@ -777,11 +777,11 @@ function locale_translate_import_form_submit($form, &$form_state) {
}
else {
drupal_set_message(t('File to import not found.'), 'error');
$form_state['redirect'] = 'admin/international/translate/import';
$form_state['redirect'] = 'admin/config/international/translate/import';
return;
}
$form_state['redirect'] = 'admin/international/translate';
$form_state['redirect'] = 'admin/config/international/translate';
return;
}
/**
......@@ -886,7 +886,7 @@ function locale_translate_edit_form(&$form_state, $lid) {
$source = db_query('SELECT source, context, textgroup, location FROM {locales_source} WHERE lid = :lid', array(':lid' => $lid))->fetchObject();
if (!$source) {
drupal_set_message(t('String not found.'), 'error');
drupal_goto('admin/international/translate/translate');
drupal_goto('admin/config/international/translate/translate');
}
// Add original text to the top and some values for form altering.
......@@ -1024,7 +1024,7 @@ function locale_translate_edit_form_submit($form, &$form_state) {
_locale_invalidate_js();
cache_clear_all('locale:', 'cache', TRUE);
$form_state['redirect'] = 'admin/international/translate/translate';
$form_state['redirect'] = 'admin/config/international/translate/translate';
return;
}
/**
......@@ -1053,7 +1053,7 @@ function locale_translate_delete_page($lid) {
*/
function locale_translate_delete_form(&$form_state, $source) {
$form['lid'] = array('#type' => 'value', '#value' => $source->lid);
return confirm_form($form, t('Are you sure you want to delete the string "%source"?', array('%source' => $source->source)), 'admin/international/translate/translate', t('Deleting the string will remove all translations of this string in all languages. This action cannot be undone.'), t('Delete'), t('Cancel'));
return confirm_form($form, t('Are you sure you want to delete the string "%source"?', array('%source' => $source->source)), 'admin/config/international/translate/translate', t('Deleting the string will remove all translations of this string in all languages. This action cannot be undone.'), t('Delete'), t('Cancel'));
}
/**
......@@ -1070,7 +1070,7 @@ function locale_translate_delete_form_submit($form, &$form_state) {
_locale_invalidate_js();
cache_clear_all('locale:', 'cache', TRUE);
drupal_set_message(t('The string has been removed.'));
$form_state['redirect'] = 'admin/international/translate/translate';
$form_state['redirect'] = 'admin/config/international/translate/translate';
}
/**
* @} End of "locale-translate-delete"
......@@ -2303,8 +2303,8 @@ function _locale_translate_seek() {
array('data' => check_plain(truncate_utf8($string['source'], 150, FALSE, TRUE)) . '<br /><small>' . $string['location'] . '</small>'),
$string['context'],
array('data' => _locale_translate_language_list($string['languages'], $limit_language), 'align' => 'center'),
array('data' => l(t('edit'), "admin/international/translate/edit/$lid", array('query' => drupal_get_destination())), 'class' => 'nowrap'),
array('data' => l(t('delete'), "admin/international/translate/delete/$lid", array('query' => drupal_get_destination())), 'class' => 'nowrap'),
array('data' => l(t('edit'), "admin/config/international/translate/edit/$lid", array('query' => drupal_get_destination())), 'class' => 'nowrap'),
array('data' => l(t('delete'), "admin/config/international/translate/delete/$lid", array('query' => drupal_get_destination())), 'class' => 'nowrap'),
);
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -179,7 +179,7 @@ class PathLanguageTestCase extends DrupalWebTestCase {
$edit = array();
$edit['langcode'] = 'fr';
$this->drupalPost('admin/international/language/add', $edit, t('Add language'));
$this->drupalPost('admin/config/international/language/add', $edit, t('Add language'));
// Set language negotiation to "Path prefix with fallback".
variable_set('language_negotiation', LANGUAGE_NEGOTIATION_PATH);
......
......@@ -1112,7 +1112,7 @@ class FormatDateUnitTest extends DrupalWebTestCase {
'direction' => LANGUAGE_LTR,
'prefix' => self::LANGCODE,
);
$this->drupalPost('admin/international/language/add', $edit, t('Add custom language'));
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
// Create a test user to carry out the tests.
$test_user = $this->drupalCreateUser();
......
......@@ -59,6 +59,51 @@ function system_main_admin_page($arg = NULL) {
}
}
/**
* Menu callback; Provide the administration overview page.
*/
function system_admin_config_page() {
// Check for status report errors.
if (system_status(TRUE) && user_access('administer site configuration')) {
drupal_set_message(t('One or more problems were detected with your Drupal installation. Check the <a href="@status">status report</a> for more information.', array('@status' => url('admin/reports/status'))), 'error');
}
$blocks = array();
if ($admin = db_query("SELECT menu_name, mlid FROM {menu_links} WHERE link_path = 'admin/config' AND module = 'system'")->fetchAssoc()) {
$result = db_query("
SELECT m.*, ml.*
FROM {menu_links} ml
INNER JOIN {menu_router} m ON ml.router_path = m.path
WHERE ml.link_path != 'admin/help' AND menu_name = :menu_name AND ml.plid = :mlid AND hidden = 0", $admin, array('fetch' => PDO::FETCH_ASSOC));
foreach ($result as $item) {
_menu_link_translate($item);
if (!$item['access']) {
continue;
}
// The link 'description' either derived from the hook_menu 'description'
// or entered by the user via menu module is saved as the title attribute.
if (!empty($item['localized_options']['attributes']['title'])) {
$item['description'] = $item['localized_options']['attributes']['title'];
}
$block = $item;
$block['content'] = '';
if ($item['block_callback'] && function_exists($item['block_callback'])) {
$function = $item['block_callback'];
$block['content'] .= $function();
}
$block['content'] .= theme('admin_block_content', system_admin_menu_block($item));
// Prepare for sorting as in function _menu_tree_check_access().
// The weight is offset so it is always positive, with a uniform 5-digits.
$blocks[(50000 + $item['weight']) . ' ' . $item['title'] . ' ' . $item['mlid']] = $block;
}
}
if ($blocks) {
ksort($blocks);
return theme('admin_page', $blocks);
}
else {
return t('You do not have any administrative items.');
}
}
/**
* Provide a single block from the administration menu as a page.
......
......@@ -525,6 +525,13 @@ function system_menu() {
'access callback' => 'system_admin_menu_block_access',
'access arguments' => array('admin/settings', 'access administration pages'),
);
$items['admin/config'] = array(
'title' => 'Configuration and modules',
'page callback' => 'system_admin_config_page',
'position' => 'right',
'access callback' => array('system_admin_menu_block_access'),
'access arguments' => array('admin/config', 'access administration pages'),
);
$items['admin/structure'] = array(
'title' => 'Structure',
'description' => 'Control how your site looks and feels.',
......
......@@ -92,13 +92,13 @@ class TranslationTestCase extends DrupalWebTestCase {
*/
function addLanguage($language_code) {
// Check to make sure that language has not already been installed.
$this->drupalGet('admin/international/language');
$this->drupalGet('admin/config/international/language');
if (strpos($this->drupalGetContent(), 'enabled[' . $language_code . ']') === FALSE) {
// Doesn't have language installed so add it.
$edit = array();
$edit['langcode'] = $language_code;
$this->drupalPost('admin/international/language/add', $edit, t('Add language'));
$this->drupalPost('admin/config/international/language/add', $edit, t('Add language'));
// Make sure we're not using a stale list.
drupal_static_reset('language_list');
......
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