Skip to content

Commit

Permalink
MDL-19789 Upgraded calls to helpbutton, print_simple_box* and notify
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Aug 18, 2009
1 parent db636fd commit 9549b98
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 102 deletions.
10 changes: 5 additions & 5 deletions backup/backup.php
Expand Up @@ -73,14 +73,14 @@

if ($courses = get_courses('all','c.shortname','c.id,c.shortname,c.fullname')) {
echo $OUTPUT->heading(get_string("choosecourse"));
print_simple_box_start("center");
echo $OUTPUT->box_start();
foreach ($courses as $course) {
echo '<a href="backup.php?id='.$course->id.'">'.format_string($course->fullname).' ('.format_string($course->shortname).')</a><br />'."\n";
}
print_simple_box_end();
echo $OUTPUT->box_end();
} else {
echo $OUTPUT->heading(get_string("nocoursesyet"));
print_continue("$CFG->wwwroot/$CFG->admin/index.php");
echo $OUTPUT->continue_button("$CFG->wwwroot/$CFG->admin/index.php");
}
echo $OUTPUT->footer();
exit;
Expand Down Expand Up @@ -108,7 +108,7 @@

//Print form
echo $OUTPUT->heading(format_string("$strcoursebackup: $course->fullname ($course->shortname)"));
print_simple_box_start("center");
echo $OUTPUT->box_start();

//Adjust some php variables to the execution of this script
@ini_set("max_execution_time","3000");
Expand All @@ -126,7 +126,7 @@
} else if ($launch == "execute") {
include_once("backup_execute.html");
}
print_simple_box_end();
echo $OUTPUT->box_end();

//Print footer
echo $OUTPUT->footer();
Expand Down
2 changes: 1 addition & 1 deletion backup/backup_check.html
Expand Up @@ -119,7 +119,7 @@
$backupprefs->backup_blogs = 0;
$backupprefs->backuproleassignments = array();

print_simple_box("<font color=\"red\">".get_string("backupnoneusersinfo")."</font>","center", "70%", '', "20", "noticebox");
echo $OUTPUT->box(get_string("backupnoneusersinfo"), "noticebox");
echo "<hr />";
}

Expand Down
8 changes: 4 additions & 4 deletions backup/backup_execute.html
Expand Up @@ -76,19 +76,19 @@

if (empty($to)) {
//Print final message
print_simple_box(get_string("backupfinished"),"center");
echo $OUTPUT->box(get_string("backupfinished"));
$context = get_context_instance(CONTEXT_COURSE, $course->id);
print_continue("$CFG->wwwroot/files/index.php?contextid=".$context->id."&amp;filearea=course_backup&amp;itemid=0");
echo $OUTPUT->continue_button("$CFG->wwwroot/files/index.php?contextid=".$context->id."&filearea=course_backup&itemid=0");
} else {
print_simple_box(get_string('importdataexported'),"CENTER");
echo $OUTPUT->box(get_string('importdataexported'));
if (!empty($preferences->backup_destination)) {
$filename = $preferences->backup_destination."/".$preferences->backup_name;
} else {
$filename = $preferences->backup_course."/backupdata/".$preferences->backup_name;
}
error_log($filename);
$SESSION->import_preferences = $preferences;
print_continue($CFG->wwwroot.'/course/import/activities/index.php?id='.$to.'&fromcourse='.$id.'&filename='.$filename);
echo $OUTPUT->continue_button($CFG->wwwroot.'/course/import/activities/index.php?id='.$to.'&fromcourse='.$id.'&filename='.$filename);
}

$SESSION->backupprefs[$course->id] = null; // unset it so we're clear next time.
Expand Down
2 changes: 1 addition & 1 deletion backup/backup_form.html
Expand Up @@ -270,7 +270,7 @@
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo '<label for="menubackup_site_files">'.get_string ("sitefilesused").'</label>';
helpbutton('sitefilesused', get_string('sitefilesused'));
echo $OUTPUT->help_icon(moodle_help_icon::make('sitefilesused', get_string('sitefilesused')));
echo "</b></td><td colspan=\"2\">";
$course_file_options[0] = get_string("no");
$course_file_options[1] = get_string("yes");
Expand Down
62 changes: 31 additions & 31 deletions backup/backuplib.php
Expand Up @@ -2267,7 +2267,7 @@ function backup_modules_end ($bf,$preferences) {
//This function makes all the necesary calls to every mod
//to export itself and its files !!!
function backup_module($bf,$preferences,$module) {
global $CFG, $DB;
global $CFG, $DB, $OUTPUT;

$status = true;
$statusm = true;
Expand All @@ -2285,7 +2285,7 @@ function backup_module($bf,$preferences,$module) {
$errorstr = 'backup of '.$module.'-'.$object->name.' failed.';
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
}
$status = false;
}
Expand Down Expand Up @@ -2970,7 +2970,7 @@ function write_local_filter_settings($bf, $preferences, $context, $startlevel) {
}

function backup_execute(&$preferences, &$errorstr) {
global $CFG, $DB;
global $CFG, $DB, $OUTPUT;
$status = true;

//Check for temp and backup and backup_unique_code directory
Expand All @@ -2994,7 +2994,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred deleting old backup data";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify ($errorstr);
echo $OUTPUT->notification($errorstr);
}
}

Expand All @@ -3017,7 +3017,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up general info";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3035,7 +3035,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up course start";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3050,7 +3050,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up metacourse info";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3065,7 +3065,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up course blocks";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3080,7 +3080,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up course sections";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3101,7 +3101,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up user info";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3118,7 +3118,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up messages";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3135,7 +3135,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up blogs";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3153,7 +3153,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up quiz categories";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3170,7 +3170,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up log info";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3187,7 +3187,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up scales";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3203,7 +3203,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errostr = "An error occurred while backing up groups";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errostr);
echo $OUTPUT->notification($errostr);
} else {
return false;
}
Expand All @@ -3219,7 +3219,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up groupings";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3235,7 +3235,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up groupings groups";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3251,7 +3251,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up events";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3267,7 +3267,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up gradebook";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3294,7 +3294,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up module info";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3313,7 +3313,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up '$module->name'";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3329,7 +3329,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while finishing the module backups";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3346,7 +3346,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while backing up the course format data";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3359,7 +3359,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while closing the course backup";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3386,7 +3386,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while copying user files";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3404,7 +3404,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while copying course files";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3421,7 +3421,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while copying site files";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3437,7 +3437,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while zipping the backup";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3453,7 +3453,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while copying the zip file to the course directory";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand All @@ -3469,7 +3469,7 @@ function backup_execute(&$preferences, &$errorstr) {
$errorstr = "An error occurred while cleaning up temporary data";
add_to_backup_log(time(),$preferences->backup_course,$errorstr,'manual');
if (!defined('BACKUP_SILENTLY')) {
notify($errorstr);
echo $OUTPUT->notification($errorstr);
} else {
return false;
}
Expand Down

0 comments on commit 9549b98

Please sign in to comment.