| [ Index ] |
PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008] |
[Summary view] [Print] [Text view]
1 <?php /// $Id: replace.php,v 1.8.4.1 2007/12/03 04:45:49 toyomoyo Exp $ 2 /// Search and replace strings throughout all texts in the whole database 3 4 require_once ('../config.php'); 5 require_once($CFG->dirroot.'/course/lib.php'); 6 require_once($CFG->libdir.'/adminlib.php'); 7 8 admin_externalpage_setup('replace'); 9 10 $search = optional_param('search', '', PARAM_RAW); 11 $replace = optional_param('replace', '', PARAM_RAW); 12 13 ################################################################### 14 admin_externalpage_print_header(); 15 16 print_heading('Search and replace text throughout the whole database'); 17 18 19 if (!data_submitted() or !$search or !$replace or !confirm_sesskey()) { /// Print a form 20 21 print_simple_box_start('center'); 22 echo '<div align="center">'; 23 echo '<form action="replace.php" method="post">'; 24 echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />'; 25 echo 'Search whole database for: <input type="text" name="search" /><br />'; 26 echo 'Replace with this string: <input type="text" name="replace" /><br />'; 27 echo '<input type="submit" value="Yes, do it now" /><br />'; 28 echo '</form>'; 29 echo '</div>'; 30 print_simple_box_end(); 31 admin_externalpage_print_footer(); 32 die; 33 } 34 35 print_simple_box_start('center'); 36 37 if (!db_replace($search, $replace)) { 38 error('An error has occured during this process'); 39 } 40 41 print_simple_box_end(); 42 43 /// Rebuild course cache which might be incorrect now 44 notify('Rebuilding course cache...'); 45 rebuild_course_cache(); 46 notify('...finished'); 47 48 print_continue('index.php'); 49 50 admin_externalpage_print_footer(); 51 52 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Jan 14 11:33:29 2009 | Cross-referenced by PHPXref 0.7 |