diff --git a/admin/lang.php b/admin/lang.php
index 7bb9bf97a5e..78c45952498 100644
--- a/admin/lang.php
+++ b/admin/lang.php
@@ -5,8 +5,8 @@
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
-
- admin_externalpage_setup('langedit');
+ $adminroot = admin_get_root();
+ admin_externalpage_setup('langedit', $adminroot);
define('LANG_SUBMIT_REPEAT', 1); // repeat displaying submit button?
define('LANG_SUBMIT_REPEAT_EVERY', 20); // if so, after how many lines?
@@ -46,8 +46,12 @@
$strfilecreated = get_string('filecreated', 'admin');
$strprev = get_string('previous');
$strnext = get_string('next');
-
-
+ $strlocalstringcustomization = 'Local string customization'; // TODO / FIXME
+ $strlangpackmaintaining = 'Language pack maintaining'; // TODO / FIXME
+ $strnomissingstrings = 'No missing strings'; // TODO / FIXME
+ // TODO/FIXME add into en_utf8/admin.php:
+ // $string['numberofmissingstrings'] = 'Number of missing strings: $a';
+
$currentlang = current_language();
switch ($mode) {
@@ -77,18 +81,43 @@
}
- admin_externalpage_print_header();
+ admin_externalpage_print_header($adminroot);
+
+ // Prepare and render menu tabs
+ $firstrow = array();
+ $secondrow = array();
+ $inactive = NULL;
+ $activated = NULL;
+ $currenttab = $mode;
+ if ($uselocal) {
+ $inactive = array('uselocal');
+ $activated = array('uselocal');
+ } else {
+ $inactive = array('usemaster');
+ $activated = array('usemaster');
+ }
+ $firstrow[] = new tabobject('uselocal',
+ $CFG->wwwroot."/admin/lang.php?mode=$mode¤tfile=$currentfile&uselocal=1",
+ $strlocalstringcustomization );
+ $firstrow[] = new tabobject('usemaster',
+ $CFG->wwwroot."/admin/lang.php?mode=$mode¤tfile=$currentfile&uselocal=0",
+ $strlangpackmaintaining );
+ $secondrow[] = new tabobject('missing', $CFG->wwwroot.'/admin/lang.php?mode=missing', $strmissingstrings );
+ $secondrow[] = new tabobject('compare', $CFG->wwwroot.'/admin/lang.php?mode=compare', $streditstrings );
+ // TODO
+ // langdoc.php functionality is planned to be merged into lang.php
+ $secondrow[] = new tabobject('langdoc', $CFG->wwwroot.'/admin/langdoc.php', $stredithelpdocs );
+ $tabs = array($firstrow, $secondrow);
+ print_tabs($tabs, $currenttab, $inactive, $activated);
+
if (!$mode) {
print_box_start();
$currlang = current_language();
$langs = get_list_of_languages(false, true);
popup_form ("$CFG->wwwroot/$CFG->admin/lang.php?lang=", $langs, "chooselang", $currlang, "", "", "", false, 'self', $strcurrentlanguage.':');
- print_heading("$strmissingstrings");
- print_heading("$streditstrings");
- print_heading("$stredithelpdocs");
print_box_end();
- admin_externalpage_print_footer();
+ admin_externalpage_print_footer($adminroot);
exit;
}
@@ -191,7 +220,7 @@
foreach ($files as $filekey => $file) { // check all the help files.
if (!file_exists("$langdir/help/$file")) {
- echo "wwwroot/$CFG->admin/langdoc.php?sesskey=$USER->sesskey¤tfile=help/$file\">" .get_string("filemissing", "", "$currentlang/help/$file") . "" . "
\n";
+ echo "
".get_string("filemissing", "", "$langdir/help/$file")."
"; $somethingfound = true; continue; } @@ -202,7 +231,7 @@ } foreach ($files as $filekey => $file) { // check all the docs files. if (!file_exists("$langdir/docs/$file")) { - echo "wwwroot/$CFG->admin/langdoc.php?sesskey=$USER->sesskey¤tfile=docs/$file\">" .get_string("filemissing", "", "$currentlang/docs/$file") . "" . "".get_string("filemissing", "", "$langdir/docs/$file")."
"; $somethingfound = true; continue; } @@ -211,7 +240,7 @@ if (!empty($somethingfound)) { print_continue("lang.php"); } else { - notice(get_string("languagegood"), "lang.php"); + notice(get_string("languagegood"), "lang.php", '', $adminroot); } } else if ($mode == "compare") { @@ -279,32 +308,21 @@ unset($packstring); } - print_heading_with_help($streditstrings, "langedit"); - print_box_start('generalbox editstrings'); + $menufiles = array(); foreach ($stringfiles as $file) { - if ($file == $currentfile) { - echo "$file "; - } else { - echo "$file "; - } + $menufiles[$file] = $file; } - print_box_end(); + popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=compare¤tfile=", $menufiles, "choosefile", + $currentfile, $strchoosefiletoedit); - print_heading("$strmissingstrings", "center", 4); // one-click way back - - print_box_start(); + echo '';
echo $uselocal ? "{$currentlang}_local" : $currentlang;
+ echo '';
helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle');
-
- echo '';
+ echo '