Skip to content

Commit

Permalink
Started to work on GUI improvements. Menu tabs introduced. Heading to…
Browse files Browse the repository at this point in the history
… fix MDL-8012
  • Loading branch information
mudrd8mz committed Jun 17, 2007
1 parent 706ea2f commit 9b7d5f1
Showing 1 changed file with 34 additions and 19 deletions.
53 changes: 34 additions & 19 deletions admin/lang.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
$strfilecreated = get_string('filecreated', 'admin'); $strfilecreated = get_string('filecreated', 'admin');
$strprev = get_string('previous'); $strprev = get_string('previous');
$strnext = get_string('next'); $strnext = get_string('next');

$strlocalstringcustomization = 'Local string customization'; // TODO / FIXME

$strlangpackmaintaining = 'Language pack maintaining'; // TODO / FIXME
$currentlang = current_language(); $currentlang = current_language();


switch ($mode) { switch ($mode) {
Expand Down Expand Up @@ -79,14 +79,39 @@


admin_externalpage_print_header($adminroot); 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&currentfile=$currentfile&uselocal=1",
$strlocalstringcustomization );
$firstrow[] = new tabobject('usemaster',
$CFG->wwwroot."/admin/lang.php?mode=$mode&currentfile=$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) { if (!$mode) {
print_box_start(); print_box_start();
$currlang = current_language(); $currlang = current_language();
$langs = get_list_of_languages(false, true); $langs = get_list_of_languages(false, true);
popup_form ("$CFG->wwwroot/$CFG->admin/lang.php?lang=", $langs, "chooselang", $currlang, "", "", "", false, 'self', $strcurrentlanguage.':'); popup_form ("$CFG->wwwroot/$CFG->admin/lang.php?lang=", $langs, "chooselang", $currlang, "", "", "", false, 'self', $strcurrentlanguage.':');
print_heading("<a href=\"lang.php?mode=missing\">$strmissingstrings</a>");
print_heading("<a href=\"lang.php?mode=compare\">$streditstrings</a>");
print_heading("<a href=\"langdoc.php\">$stredithelpdocs</a>");
print_box_end(); print_box_end();
admin_externalpage_print_footer($adminroot); admin_externalpage_print_footer($adminroot);
exit; exit;
Expand Down Expand Up @@ -279,31 +304,21 @@
unset($packstring); unset($packstring);
} }


print_heading_with_help($streditstrings, "langedit");

print_box_start('generalbox editstrings'); print_box_start('generalbox editstrings');
$menufiles = array(); $menufiles = array();
foreach ($stringfiles as $file) { foreach ($stringfiles as $file) {
$menufiles[$file] = $file; $menufiles[$file] = $file;
} }
popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=compare&amp;currentfile=", $menufiles, "choosefile", popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=compare&amp;currentfile=", $menufiles, "choosefile",
$currentfile, $strchoosefiletoedit); $currentfile, $strchoosefiletoedit);
print_box_end();

print_heading("<a href=\"lang.php?mode=missing\">$strmissingstrings</a>", "center", 4); // one-click way back


print_box_start(); echo '<div class="filestorageinfobox">';
echo $strfilestoredin; echo $strfilestoredin;
echo '<code class="path">';
echo $uselocal ? "{$currentlang}_local" : $currentlang; echo $uselocal ? "{$currentlang}_local" : $currentlang;
echo '</code>';
helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle'); helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle');

echo '</div>';
echo '<form '.$CFG->frametarget.' method="get" action="'.$CFG->wwwroot.'/'.$CFG->admin.'/lang.php">'.
'<div>'.
'<input type="hidden" name="mode" value="compare" />'.
'<input type="hidden" name="currentfile" value="'.$currentfile.'" />'.
'<input type="hidden" name="uselocal" value="'.(1 - $uselocal % 2).'" />'.
'<input type="submit" value="'.$strswitchlang.'" />'.
'</div></form>';
print_box_end(); print_box_end();


if ($currentfile <> '') { if ($currentfile <> '') {
Expand Down

0 comments on commit 9b7d5f1

Please sign in to comment.