Permalink
Browse files

Merge branch 'wip-mdl-33943-m23' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_23_STABLE
  • Loading branch information...
2 parents 918f6d2 + a838071 commit 41bb2c3a593b60ef33b30f95fcb6703a7d71f24b @danpoltawski danpoltawski committed Jul 9, 2012
Showing with 22 additions and 8 deletions.
  1. +12 −8 admin/tool/replace/index.php
  2. +10 −0 admin/tool/replace/lang/en/tool_replace.php
View
20 admin/tool/replace/index.php
@@ -38,25 +38,29 @@
###################################################################
echo $OUTPUT->header();
-echo $OUTPUT->heading('Search and replace text throughout the whole database');
+echo $OUTPUT->heading(get_string('pageheader', 'tool_replace'));
if ($DB->get_dbfamily() !== 'mysql' and $DB->get_dbfamily() !== 'postgres') {
//TODO: add $DB->text_replace() to DML drivers
- echo $OUTPUT->notification('Sorry, this feature is implemented only for MySQL and PostgreSQL databases.');
+ echo $OUTPUT->notification(get_string('notimplemented', 'tool_replace'));
echo $OUTPUT->footer();
die;
}
if (!data_submitted() or !$search or !$replace or !confirm_sesskey() or !$sure) { /// Print a form
- echo $OUTPUT->notification('This script is not supported, always make complete backup before proceeding!<br />This operation can not be reverted!');
+ echo $OUTPUT->notification(get_string('notsupported', 'tool_replace'));
echo $OUTPUT->box_start();
echo '<div class="mdl-align">';
echo '<form action="index.php" method="post"><div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
- echo '<div><label for="search">Search whole database for: </label><input id="search" type="text" name="search" size="40" /> (usually previous server URL)</div>';
- echo '<div><label for="replace">Replace with this string: </label><input type="text" id="replace" name="replace" size="40" /> (usually new server URL)</div>';
- echo '<div><label for="sure">I understand the risks of this operation: </label><input type="checkbox" id="sure" name="sure" value="1" /></div>';
+ echo '<div><label for="search">'.get_string('searchwholedb', 'tool_replace').
+ ' </label><input id="search" type="text" name="search" size="40" /> ('.
+ get_string('searchwholedbhelp', 'tool_replace').')</div>';
+ echo '<div><label for="replace">'.get_string('replacewith', 'tool_replace').
+ ' </label><input type="text" id="replace" name="replace" size="40" /> ('.
+ get_string('replacewithhelp', 'tool_replace').')</div>';
+ echo '<div><label for="sure">'.get_string('disclaimer', 'tool_replace').' </label><input type="checkbox" id="sure" name="sure" value="1" /></div>';
echo '<div class="buttons"><input type="submit" class="singlebutton" value="Yes, do it now" /></div>';
echo '</div></form>';
echo '</div>';
@@ -70,9 +74,9 @@
echo $OUTPUT->box_end();
/// Rebuild course cache which might be incorrect now
-echo $OUTPUT->notification('Rebuilding course cache...', 'notifysuccess');
+echo $OUTPUT->notification(get_string('notifyrebuilding', 'tool_replace'), 'notifysuccess');
rebuild_course_cache();
-echo $OUTPUT->notification('...finished', 'notifysuccess');
+echo $OUTPUT->notification(get_string('notifyfinished', 'tool_replace'), 'notifysuccess');
echo $OUTPUT->continue_button(new moodle_url('/admin/index.php'));
View
10 admin/tool/replace/lang/en/tool_replace.php
@@ -23,4 +23,14 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['disclaimer'] = 'I understand the risks of this operation:';
+$string['pageheader'] = 'Search and replace text throughout the whole database';
+$string['notifyfinished'] = '...finished';
+$string['notifyrebuilding'] = 'Rebuilding course cache...';
+$string['notimplemented'] = 'Sorry, this feature is implemented only for MySQL and PostgreSQL databases.';
+$string['notsupported'] ='This script is not supported, always make complete backup before proceeding!<br />This operation can not be reverted!';
$string['pluginname'] = 'DB search and replace';
+$string['replacewith'] = 'Replace with this string:';
+$string['replacewithhelp'] = 'usually new server URL';
+$string['searchwholedb'] = 'Search whole database for:';
+$string['searchwholedbhelp'] = 'usually previous server URL';

0 comments on commit 41bb2c3

Please sign in to comment.