Fixing some of the standard notice functions, adding styles and buttons
This commit is contained in:
+3
-3
@@ -84,7 +84,7 @@ function upgrade_enrol_plugins($return) {
|
||||
$db->debug=false;
|
||||
// OK so far, now update the modules record
|
||||
set_config($moduleversion, $module->version);
|
||||
notify(get_string('modulesuccess', '', $module->name), 'green');
|
||||
notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');
|
||||
echo '<hr />';
|
||||
} else {
|
||||
$db->debug=false;
|
||||
@@ -180,7 +180,7 @@ function upgrade_activity_modules($return) {
|
||||
if (! update_record('modules', $module)) {
|
||||
error('Could not update '. $module->name .' record in modules table!');
|
||||
}
|
||||
notify(get_string('modulesuccess', '', $module->name), 'green');
|
||||
notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');
|
||||
echo '<hr />';
|
||||
} else {
|
||||
$db->debug=false;
|
||||
@@ -204,7 +204,7 @@ function upgrade_activity_modules($return) {
|
||||
if (modify_database($fullmod .'/db/'. $CFG->dbtype .'.sql')) {
|
||||
$db->debug = false;
|
||||
if ($module->id = insert_record('modules', $module)) {
|
||||
notify(get_string('modulesuccess', '', $module->name), 'green');
|
||||
notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');
|
||||
echo '<hr />';
|
||||
} else {
|
||||
error($module->name .' module could not be added to the module list!');
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ function execute_sql($command, $feedback=true) {
|
||||
|
||||
if ($result) {
|
||||
if ($feedback) {
|
||||
echo '<p><font color="green"><strong>'. get_string('success') .'</strong></font></p>';
|
||||
notify(get_string('success'), 'notifysuccess');
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
|
||||
+21
-13
@@ -1944,7 +1944,9 @@ function print_continue($link) {
|
||||
$link = $_SERVER['HTTP_REFERER'];
|
||||
}
|
||||
|
||||
print_heading('<a target="'. $CFG->framename .'" href="'. $link .'">'. get_string('continue').'</a>');
|
||||
echo '<div class="continuebutton">';
|
||||
print_single_button($link, NULL, get_string('continue'), 'post', $CFG->framename);
|
||||
echo '</div>'."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3234,7 +3236,7 @@ function notice ($message, $link='') {
|
||||
|
||||
echo '<br />';
|
||||
print_simple_box($message, 'center', '50%', '', '20', 'noticebox');
|
||||
print_heading('<a href="'. $link .'">'. get_string('continue') .'</a>');
|
||||
print_continue($link);
|
||||
print_footer(get_site());
|
||||
die;
|
||||
}
|
||||
@@ -3248,17 +3250,19 @@ function notice ($message, $link='') {
|
||||
*/
|
||||
function notice_yesno ($message, $linkyes, $linkno) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$message = clean_text($message);
|
||||
$linkyes = clean_text($linkyes);
|
||||
$linkno = clean_text($linkno);
|
||||
|
||||
print_simple_box_start('center', '60%');
|
||||
echo '<p align="center"><font size="3">'. $message .'</font></p>';
|
||||
echo '<p align="center"><font size="3"><strong>';
|
||||
echo '<a href="'. $linkyes .'">'. get_string('yes') .'</a>';
|
||||
echo ' ';
|
||||
echo '<a href="'. $linkno .'">'. get_string('no') .'</a>';
|
||||
echo '</strong></font></p>';
|
||||
print_simple_box_start('center', '60%', '', 5, 'noticebox', 'notice');
|
||||
echo '<p align="center">'. $message .'</p>';
|
||||
echo '<table align="center" cellpadding="20"><tr><td>';
|
||||
print_single_button($linkyes, NULL, get_string('yes'), 'post', $CFG->framename);
|
||||
echo '</td><td>';
|
||||
print_single_button($linkno, NULL, get_string('no'), 'post', $CFG->framename);
|
||||
echo '</td></tr></table>';
|
||||
print_simple_box_end();
|
||||
}
|
||||
|
||||
@@ -3305,14 +3309,18 @@ function redirect($url, $message='', $delay='0') {
|
||||
* Print a bold message in an optional color.
|
||||
*
|
||||
* @param string $message The message to print out
|
||||
* @param string $color Optional color to display message text in
|
||||
* @param string $align Paragraph alignment option
|
||||
* @param string $style Optional style to display message text in
|
||||
* @param string $align Alignment option
|
||||
*/
|
||||
function notify ($message, $color='red', $align='center') {
|
||||
function notify ($message, $style='notifyproblem', $align='center') {
|
||||
|
||||
if ($style == 'green') {
|
||||
$style = 'notifysuccess'; // backward compatible with old color system
|
||||
}
|
||||
|
||||
$message = clean_text($message);
|
||||
|
||||
echo '<p align="'. $align .'"><strong><font color="'. $color .'">'. $message .'</font></strong></p>' . "\n";
|
||||
echo '<div class="'.$style.'" align="'. $align .'">'. $message .'</div>' . "\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user