. /** * Search and replace strings throughout all texts in the whole database * * @package tool * @subpackage replace * @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ define('NO_OUTPUT_BUFFERING', true); require_once('../../../config.php'); require_once($CFG->dirroot.'/course/lib.php'); require_once($CFG->libdir.'/adminlib.php'); admin_externalpage_setup('toolreplace'); $search = optional_param('search', '', PARAM_RAW); $replace = optional_param('replace', '', PARAM_RAW); $sure = optional_param('sure', 0, PARAM_BOOL); ################################################################### echo $OUTPUT->header(); 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(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(get_string('notsupported', 'tool_replace')); echo $OUTPUT->notification(get_string('excludedtables', 'tool_replace')); echo $OUTPUT->box_start(); echo '