]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19815 Upgraded calls to helpbutton, print_simple_box* and notify
authornicolasconnault <nicolasconnault>
Tue, 18 Aug 2009 05:16:50 +0000 (05:16 +0000)
committernicolasconnault <nicolasconnault>
Tue, 18 Aug 2009 05:16:50 +0000 (05:16 +0000)
mod/scorm/datamodels/sequencinglib.php
mod/scorm/db/upgrade.php
mod/scorm/locallib.php
mod/scorm/mod_form.php
mod/scorm/player.php
mod/scorm/report.php
mod/scorm/view.php

index a06cddb0d7b3ff15a7c838507c08bec7fc654ef2..bba997ad632f6ff892168478b17c1547709ac2e4 100755 (executable)
@@ -2186,181 +2186,182 @@ function scorm_terminate_descendent_attempts ($activity,$userid,$seq){
 }
 
 function scorm_sequencing_exception($seq){
+    global $OUTPUT;
     if($seq->exception != null){
         switch($seq->exception){
 
             case 'NB.2.1-1':
-                notify("Sequencing session has already begun");
+                echo $OUTPUT->notification("Sequencing session has already begun");
             break;
             case 'NB.2.1-2':
-                notify("Sequencing session has not begun");
+                echo $OUTPUT->notification("Sequencing session has not begun");
             break;
             case 'NB.2.1-3':
-                notify("Suspended activity is not defined");
+                echo $OUTPUT->notification("Suspended activity is not defined");
             break;
             case 'NB.2.1-4':
-                notify("Flow Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Flow Sequencing Control Model Violation");
             break;
             case 'NB.2.1-5':
-                notify("Flow or Forward only Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Flow or Forward only Sequencing Control Model Violation");
             break;
             case 'NB.2.1-6':
-                notify("No activity is previous to the root");
+                echo $OUTPUT->notification("No activity is previous to the root");
             break;
             case 'NB.2.1-7':
-                notify("Unsupported Navigation Request");
+                echo $OUTPUT->notification("Unsupported Navigation Request");
             break;
             case 'NB.2.1-8':
-                notify("Choice Exit Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Choice Exit Sequencing Control Model Violation");
             break;
             case 'NB.2.1-9':
-                notify("No activities to consider");
+                echo $OUTPUT->notification("No activities to consider");
             break;
             case 'NB.2.1-10':
-                notify("Choice Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Choice Sequencing Control Model Violation");
             break;
             case 'NB.2.1-11':
-                notify("Target Activity does not exist");
+                echo $OUTPUT->notification("Target Activity does not exist");
             break;
             case 'NB.2.1-12':
-                notify("Current Activity already terminated");
+                echo $OUTPUT->notification("Current Activity already terminated");
             break;
             case 'NB.2.1-13':
-                notify("Undefined Navigation Request");
+                echo $OUTPUT->notification("Undefined Navigation Request");
             break;
 
             case 'TB.2.3-1':
-                notify("Current Activity already terminated");
+                echo $OUTPUT->notification("Current Activity already terminated");
             break;
             case 'TB.2.3-2':
-                notify("Current Activity already terminated");
+                echo $OUTPUT->notification("Current Activity already terminated");
             break;
             case 'TB.2.3-4':
-                notify("Current Activity already terminated");
+                echo $OUTPUT->notification("Current Activity already terminated");
             break;
             case 'TB.2.3-5':
-                notify("Nothing to suspend; No active activities");
+                echo $OUTPUT->notification("Nothing to suspend; No active activities");
             break;
             case 'TB.2.3-6':
-                notify("Nothing to abandon; No active activities");
+                echo $OUTPUT->notification("Nothing to abandon; No active activities");
             break;
 
             case 'SB.2.1-1':
-                notify("Last activity in the tree");
+                echo $OUTPUT->notification("Last activity in the tree");
             break;
             case 'SB.2.1-2':
-                notify("Cluster has no available children");
+                echo $OUTPUT->notification("Cluster has no available children");
             break;
             case 'SB.2.1-3':
-                notify("No activity is previous to the root");
+                echo $OUTPUT->notification("No activity is previous to the root");
             break;
             case 'SB.2.1-4':
-                notify("Forward Only Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Forward Only Sequencing Control Model Violation");
             break;
 
             case 'SB.2.2-1':
-                notify("Flow Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Flow Sequencing Control Model Violation");
             break;
             case 'SB.2.2-2':
-                notify("Activity unavailable");
+                echo $OUTPUT->notification("Activity unavailable");
             break;
 
             case 'SB.2.3-1':
-                notify("Forward Traversal Blocked");
+                echo $OUTPUT->notification("Forward Traversal Blocked");
             break;
             case 'SB.2.3-2':
-                notify("Forward Only Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Forward Only Sequencing Control Model Violation");
             break;
             case 'SB.2.3-3':
-                notify("No activity is previous to the root");
+                echo $OUTPUT->notification("No activity is previous to the root");
             break;
 
             case 'SB.2.5-1':
-                notify("Sequencing session has already begun");
+                echo $OUTPUT->notification("Sequencing session has already begun");
             break;
 
             case 'SB.2.6-1':
-                notify("Sequencing session has already begun");
+                echo $OUTPUT->notification("Sequencing session has already begun");
             break;
             case 'SB.2.6-2':
-                notify("No Suspended activity is defined");
+                echo $OUTPUT->notification("No Suspended activity is defined");
             break;
 
             case 'SB.2.7-1':
-                notify("Sequencing session has not begun");
+                echo $OUTPUT->notification("Sequencing session has not begun");
             break;
             case 'SB.2.7-2':
-                notify("Flow Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Flow Sequencing Control Model Violation");
             break;
 
             case 'SB.2.8-1':
-                notify("Sequencing session has not begun");
+                echo $OUTPUT->notification("Sequencing session has not begun");
             break;
             case 'SB.2.8-2':
-                notify("Flow Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Flow Sequencing Control Model Violation");
             break;
 
             case 'SB.2.9-1':
-                notify("No target for Choice");
+                echo $OUTPUT->notification("No target for Choice");
             break;
             case 'SB.2.9-2':
-                notify("Target Activity does not exist or is unavailable");
+                echo $OUTPUT->notification("Target Activity does not exist or is unavailable");
             break;
             case 'SB.2.9-3':
-                notify("Target Activity hidden from choice");
+                echo $OUTPUT->notification("Target Activity hidden from choice");
             break;
             case 'SB.2.9-4':
-                notify("Choice Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Choice Sequencing Control Model Violation");
             break;
             case 'SB.2.9-5':
-                notify("No activities to consider");
+                echo $OUTPUT->notification("No activities to consider");
             break;
             case 'SB.2.9-6':
-                notify("Unable to activate target; target is not a child of the Current Activity");
+                echo $OUTPUT->notification("Unable to activate target; target is not a child of the Current Activity");
             break;
             case 'SB.2.9-7':
-                notify("Choice Exit Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Choice Exit Sequencing Control Model Violation");
             break;
             case 'SB.2.9-8':
-                notify("Unable to choose target activity - constrained choice");
+                echo $OUTPUT->notification("Unable to choose target activity - constrained choice");
             break;
             case 'SB.2.9-9':
-                notify("Choice Request Prevented by Flow-only Activity");
+                echo $OUTPUT->notification("Choice Request Prevented by Flow-only Activity");
             break;
 
             case 'SB.2.10-1':
-                notify("Sequencing session has not begun");
+                echo $OUTPUT->notification("Sequencing session has not begun");
             break;
             case 'SB.2.10-2':
-                notify("Current Activity is active or suspended");
+                echo $OUTPUT->notification("Current Activity is active or suspended");
             break;
             case 'SB.2.10-3':
-                notify("Flow Sequencing Control Model Violation");
+                echo $OUTPUT->notification("Flow Sequencing Control Model Violation");
             break;
             
             case 'SB.2.11-1':
-                notify("Sequencing session has not begun");
+                echo $OUTPUT->notification("Sequencing session has not begun");
             break;
             case 'SB.2.11-2':
-                notify("Current Activity has not been terminated");
+                echo $OUTPUT->notification("Current Activity has not been terminated");
             break;
 
             case 'SB.2.12-2':
-                notify("Undefined Sequencing Request");
+                echo $OUTPUT->notification("Undefined Sequencing Request");
             break;
 
             case 'DB.1.1-1':
-                notify("Cannot deliver a non-leaf activity");
+                echo $OUTPUT->notification("Cannot deliver a non-leaf activity");
             break;
             case 'DB.1.1-2':
-                notify("Nothing to deliver");
+                echo $OUTPUT->notification("Nothing to deliver");
             break;
             case 'DB.1.1-3':
-                notify("Activity unavailable");
+                echo $OUTPUT->notification("Activity unavailable");
             break;
 
             case 'DB.2-1':
-                notify("Identified activity is already active");
+                echo $OUTPUT->notification("Identified activity is already active");
             break;
                      
         }
index 67b8e8e9997b4b2a53a5a128c33ba3a8c060ca77..945b08b3655949cbfed66e3f0c2736660bf50f8a 100644 (file)
@@ -116,7 +116,7 @@ function xmldb_scorm_upgrade($oldversion) {
         /////////////////////////////////////
 
         function scorm_migrate_content_files($context, $base, $path) {
-            global $CFG;
+            global $CFG, $OUTPUT;
 
             $fullpathname = $base.$path;
             $fs           = get_file_storage();
@@ -137,7 +137,7 @@ function xmldb_scorm_upgrade($oldversion) {
 
                 if ($item->isFile()) {
                     if (!$item->isReadable()) {
-                        notify(" File not readable, skipping: ".$fullpathname.$item->getFilename());
+                        echo $OUTPUT->notification(" File not readable, skipping: ".$fullpathname.$item->getFilename());
                         unset($item); // release file handle
                         continue;
                     }
index d4ebf3f374894ac3cd74bf443522eea01d034eb2..938b1afb2c444b6085e3ce75b3d353cf766798be 100755 (executable)
@@ -702,14 +702,14 @@ function scorm_course_format_display($user,$course) {
         }
         $options = (object)array('noclean'=>true);
         $headertext .= '</td></tr><tr><td'.$colspan.'>'.get_string('summary').':<br />'.format_module_intro('scorm', $scorm, $scorm->coursemodule).'</td></tr></table>';
-        print_simple_box($headertext,'','100%');
+        echo $OUTPUT->box($headertext,'generalbox boxwidthwide');
         scorm_view_display($user, $scorm, 'view.php?id='.$course->id, $cm, '100%');
     } else {
         if (has_capability('moodle/course:update', $context)) {
             // Create a new activity
             redirect($CFG->wwwroot.'/course/mod.php?id='.$course->id.'&amp;section=0&sesskey='.sesskey().'&amp;add=scorm');
         } else {
-            notify('Could not find a scorm course here');
+            echo $OUTPUT->notification('Could not find a scorm course here');
         }
     }
     echo '</div>';
@@ -725,7 +725,7 @@ function scorm_view_display ($user, $scorm, $action, $cm, $boxwidth='') {
     $organization = optional_param('organization', '', PARAM_INT);
 
     if($scorm->displaycoursestructure == 1) {
-        print_simple_box_start('center',$boxwidth);
+        echo $OUTPUT->box_start('generalbox boxaligncenter');
 ?>
         <div class="structurehead"><?php print_string('contents','scorm') ?></div>
 <?php
@@ -783,7 +783,7 @@ function scorm_view_display ($user, $scorm, $action, $cm, $boxwidth='') {
     // do we want the TOC to be displayed?
     if($scorm->displaycoursestructure == 1) {
         echo $result->toc;
-        print_simple_box_end();
+        echo $OUTPUT->box_end();
     }
 
     // is this the first attempt ?
index 323147180fa21bb5ca5d65d0e61718062df52a85..243c532eb775641022fadbe305b0e7c52996f8fb 100644 (file)
@@ -5,17 +5,17 @@ require_once($CFG->dirroot.'/mod/scorm/locallib.php');
 class mod_scorm_mod_form extends moodleform_mod {
 
     function definition() {
-        global $CFG, $COURSE;
+        global $CFG, $COURSE, $OUTPUT;
         $cfg_scorm = get_config('scorm');
 
         $mform = $this->_form;
 
         if (!$CFG->slasharguments) {
-            $mform->addElement('static', '', '',notify(get_string('slashargs', 'scorm'), 'notifyproblem', 'center', true));
+            $mform->addElement('static', '', '',$OUTPUT->notification(get_string('slashargs', 'scorm'), 'notifyproblem'));
         }
         $zlib = ini_get('zlib.output_compression'); //check for zlib compression - if used, throw error because of IE bug. - SEE MDL-16185
         if (isset($zlib) && $zlib) {
-            $mform->addElement('static', '', '',notify(get_string('zlibwarning', 'scorm'), 'notifyproblem', 'center', true));
+            $mform->addElement('static', '', '',$OUTPUT->notification(get_string('zlibwarning', 'scorm'), 'notifyproblem'));
         }
 //-------------------------------------------------------------------------------
         $mform->addElement('header', 'general', get_string('general', 'form'));
@@ -367,4 +367,4 @@ class mod_scorm_mod_form extends moodleform_mod {
         parent::set_data($default_values);
     }
 }
-?>
\ No newline at end of file
+?>
index 643d0e6054a1cf62d2555a8b6953663e624741f9..d3d77ae2c5902d7b28208a8cc0c237d7cdc0a957 100755 (executable)
@@ -77,7 +77,7 @@
             $navigation = build_navigation($navlinks);
             print_header($pagetitle, $course->fullname, $navigation,
                      '', '', true, update_module_button($cm->id, $course->id, $strscorm), '', false);
-            print_simple_box(get_string("notopenyet", "scorm", userdate($scorm->timeopen)), "center");
+            echo $OUTPUT->box(get_string("notopenyet", "scorm", userdate($scorm->timeopen)), "generalbox boxaligncenter");
             echo $OUTPUT->footer();
             die;
         } elseif ($timenow > $scorm->timeclose) {
@@ -85,7 +85,7 @@
             $navigation = build_navigation($navlinks);
             print_header($pagetitle, $course->fullname, $navigation,
                      '', '', true, update_module_button($cm->id, $course->id, $strscorm), '', false);
-            print_simple_box(get_string("expired", "scorm", userdate($scorm->timeclose)), "center");
+            echo $OUTPUT->box(get_string("expired", "scorm", userdate($scorm->timeclose)), "generalbox boxaligncenter");
             echo $OUTPUT->footer();
             die;
         }
index c259e80f4cd77ea06a1b5bd648fc86b5ed69b5fe..2854f9321806869170b5670efc29bc32f356cbeb 100755 (executable)
@@ -97,7 +97,7 @@
 
     if ($action == 'delete' && has_capability('mod/scorm:deleteresponses',$contextmodule)) {
         if (scorm_delete_responses($attemptids, $scorm->id)) { //delete responses.
-            notify(get_string('scormresponsedeleted', 'scorm'), 'notifysuccess');
+            echo $OUTPUT->notification(get_string('scormresponsedeleted', 'scorm'), 'notifysuccess');
         }
     }
 
                 }
                 echo '</div>';
             } else {
-                notify(get_string('noactivity', 'scorm'));
+                echo $OUTPUT->notification(get_string('noactivity', 'scorm'));
             }
         } else {
             if (!empty($user)) {
                 // User SCORM report
                 if ($scoes = $DB->get_records_select('scorm_scoes',"scorm=? ORDER BY id", array($scorm->id))) {
                     if (!empty($userdata)) {
-                        print_simple_box_start('center');
+                        echo $OUTPUT->box_start('generalbox boxaligncenter');
                         echo '<div class="mdl-align">'."\n";
                         print_user_picture($user, $course->id, $userdata->picture, false, false);
                         echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user&amp;course=$course->id\">".
                              "$userdata->firstname $userdata->lastname</a><br />";
                         echo get_string('attempt','scorm').': '.$attempt;
                         echo '</div>'."\n";
-                        print_simple_box_end();
+                        echo $OUTPUT->box_end();
 
                         // Print general score data
                         $table = new stdClass();
     } else {
         // User SCO report
         if (!empty($userdata)) {
-            print_simple_box_start('center');
+            echo $OUTPUT->box_start('generalbox boxaligncenter');
             //print_heading(format_string($sco->title));
             echo $OUTPUT->heading('<a href="'.$CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&amp;mode=browse&amp;scoid='.$sco->id.'" target="_new">'.format_string($sco->title).'</a>');
             echo '<div class="mdl-align">'."\n";
                 echo '<h3>'.get_string('othertracks','scorm').'</h3>';
                 print_table($table);
             }
-            print_simple_box_end();
+            echo $OUTPUT->box_end();
         } else {
             print_error('missingparameter');
         }
index 5b4779bdc282bc8a9830f616b1540a75bc3ed1de..6478e91cc03657f0561a8d66d19b9cb658423a45 100755 (executable)
     if ($scorm->displayattemptstatus == 1) {
         $attemptstatus = scorm_get_attempt_status($USER,$scorm);
     }
-    print_simple_box(format_module_intro('scorm', $scorm, $cm->id).$attemptstatus, 'center', '70%', '', 5, 'generalbox', 'intro');
+    echo $OUTPUT->box(format_module_intro('scorm', $scorm, $cm->id).$attemptstatus, 'generalbox boxaligncenter boxwidthwide', 'intro');
     
     $scormopen = true;
     $timenow = time();
     if ($scorm->timeclose !=0) {
         if ($scorm->timeopen > $timenow) {
-            print_simple_box(get_string("notopenyet", "scorm", userdate($scorm->timeopen)), "center");
+            echo $OUTPUT->box(get_string("notopenyet", "scorm", userdate($scorm->timeopen)), "generalbox boxaligncenter");
             $scormopen = false;
         } else if ($timenow > $scorm->timeclose) {
-            print_simple_box(get_string("expired", "scorm", userdate($scorm->timeclose)), "center");
+            echo $OUTPUT->box(get_string("expired", "scorm", userdate($scorm->timeclose)), "generalbox boxaligncenter");
             $scormopen = false;
         }
     }