Refactor Translation Wizard markup by NB-Core · Pull Request #27 · NB-Core/modules · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions systems/translationwizard/translationwizard/WizardService.php
57 changes: 31 additions & 26 deletions systems/translationwizard/translationwizard/pages/central_pull.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
output("Choose a mirror if you don't want to use the normal central DB:");
output_notl("`n");debug($mymirror);
output("Select a mirror and directory to pull from:");
rawoutput("<form action='runmodule.php?module=translationwizard&op=pull' name='listenauswahl' method='post'>");
tw_form_open('pull');
addnav("", "runmodule.php?module=translationwizard&op=pull");
rawoutput("<select name='mirror' onchange='this.form.submit()'>");
rawoutput("<option value=''>---</option>");
Expand Down Expand Up @@ -153,38 +153,43 @@
output("Following namespace were found on your LotGD:`n");
rawoutput("<input type='submit' name='pulluntranslated' value='". translate_inline("Pull only for those in the untranslated") ."' class='button'>");
rawoutput("<input type='submit' name='pullchecked' value='". translate_inline("Pull checked") ."' class='button'>");
rawoutput("<table border='0' cellpadding='2' cellspacing='0'>");
rawoutput("<tr class='trhead'><td></td><td>". translate_inline("Namespace") ."</td><td>".translate_inline("Moduledate")."</td><td>".translate_inline("Last Pulled")."</td><td>".translate_inline("Server Date")."</td><td>".translate_inline("Actions")."</td><td></td><td></td></tr>");
tw_table_open([
'',
translate_inline("Namespace"),
translate_inline("Moduledate"),
translate_inline("Last Pulled"),
translate_inline("Server Date"),
translate_inline("Actions"),
'',
''
]);
$i=0;
$rmymirror=rawurlencode($mymirror);
$rselecteddir=rawurlencode($selecteddir);
foreach ($listing as $val) {
$i=!$i;
$rval=rawurlencode($val);
rawoutput("<tr class='".($i%2?"trlight":"trdark")."'><td>");
rawoutput("<input type='checkbox' name='moduletext[]' value='".$rval."' >");
rawoutput("</td><td>");
rawoutput($val);
rawoutput("</td><td>");
rawoutput(get_module_objpref("namespaces", 1, $val, "translationwizard"));
rawoutput("</td><td>");
rawoutput(get_module_objpref("namespaces", 0, $val, "translationwizard"));
rawoutput("</td><td>");
rawoutput(get_module_objpref("namespaces", 2, $val, "translationwizard"));
rawoutput("</td><td>");
rawoutput("<a href='runmodule.php?module=translationwizard&op=pull&mode=pull&pulldir=".$rselecteddir."&mirror=".$rmymirror."&ns=".$rval."'>". translate_inline("Pull")."</a>");
addnav("", "runmodule.php?module=translationwizard&op=pull&mode=pull&pulldir=".$rselecteddir."&mirror=".$rmymirror."&ns=".$rval);
rawoutput("</td><td>");
rawoutput("<a href='runmodule.php?module=translationwizard&op=push&mode=push&ns=". $rval."'>". translate_inline("Push")."</a>");
addnav("", "runmodule.php?module=translationwizard&op=push&mode=push&ns=". $rval);
rawoutput("</td><td>");
rawoutput("<a href='runmodule.php?module=translationwizard&op=pull&pulldir=".$rselecteddir."&mirror=".$rmymirror."&getdate=1&ns=". $rval."'>". translate_inline("Pull Date")."</a>");
addnav("", "runmodule.php?module=translationwizard&op=pull&pulldir=".$rselecteddir."&mirror=".$rmymirror."&getdate=1&ns=". $rval);
rawoutput("</td></tr>");
}
rawoutput("</table>");
$checkbox = "<input type='checkbox' name='moduletext[]' value='$rval' >";
$pull = "<a href='runmodule.php?module=translationwizard&op=pull&mode=pull&pulldir=$rselecteddir&mirror=$rmymirror&ns=$rval'>" . translate_inline("Pull") . "</a>";
addnav('', "runmodule.php?module=translationwizard&op=pull&mode=pull&pulldir=".$rselecteddir."&mirror=".$rmymirror."&ns=".$rval);
$push = "<a href='runmodule.php?module=translationwizard&op=push&mode=push&ns=$rval'>" . translate_inline("Push") . "</a>";
addnav('', "runmodule.php?module=translationwizard&op=push&mode=push&ns=".$rval);
$date = "<a href='runmodule.php?module=translationwizard&op=pull&pulldir=$rselecteddir&mirror=$rmymirror&getdate=1&ns=$rval'>" . translate_inline("Pull Date") . "</a>";
addnav('', "runmodule.php?module=translationwizard&op=pull&pulldir=".$rselecteddir."&mirror=".$rmymirror."&getdate=1&ns=".$rval);
tw_table_row([
$checkbox,
$val,
get_module_objpref("namespaces", 1, $val, "translationwizard"),
get_module_objpref("namespaces", 0, $val, "translationwizard"),
get_module_objpref("namespaces", 2, $val, "translationwizard"),
$pull,
$push,
$date
], $i%2==1);
}
tw_table_close();
rawoutput("<input type='submit' name='pulluntranslated' value='". translate_inline("Pull only for those in the untranslated") ."' class='button'>");
rawoutput("<input type='submit' name='pullchecked' value='". translate_inline("Pull checked") ."' class='button'>");
rawoutput("</form>");
tw_form_close();
}
?>
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
output("Choose the language you want to push:");
output_notl("`n");
output("Select language and namespaces to push:");
rawoutput("<form action='runmodule.php?module=translationwizard&op=push' name='pushi' method='post'>");
tw_form_open('push');
addnav("", "runmodule.php?module=translationwizard&op=push");
rawoutput("<select name='pushlanguage' onChange='this.form.submit()'>");
$sql = "SELECT language,count(*) AS c FROM " . db_prefix("translations") . " GROUP BY language ORDER BY language ASC";
Expand Down Expand Up @@ -145,6 +145,6 @@
], $i%2==1);
}
tw_table_close();
rawoutput("</form>");
tw_form_close();
}
?>
26 changes: 15 additions & 11 deletions systems/translationwizard/translationwizard/pages/default.php
Loading