]> git.mjollnir.org Git - moodle.git/commitdiff
cvsimport fixups
authorJonathan Newman <jonathan.newman@catalyst.net.nz>
Tue, 20 Jan 2009 23:53:34 +0000 (23:53 +0000)
committerJonathan Newman <jonathan.newman@catalyst.net.nz>
Tue, 20 Jan 2009 23:53:34 +0000 (23:53 +0000)
27 files changed:
admin/mnet/mnet_themes.html
admin/pagelib.php
admin/search.php
admin/settings.php
admin/upgradesettings.php
blocks/admin_bookmarks/block_admin_bookmarks.php
blocks/admin_bookmarks/create.php
blocks/admin_bookmarks/delete.php
blocks/admin_tree/block_admin_tree.php
blocks/moodleblock.class.php
blocks/rss_client/block_rss_client.php
blocks/rss_client/config_instance.html
blocks/rss_client/config_instance_tabs.php
course/category.php
course/delete.php
course/import/groups/index.php
grade/import/grade_import_form.php
lang/en_utf8/qtype_randomsamatch.php
lang/en_utf8/qtype_shortanswer.php
mod/feedback/analysis.php
mod/feedback/analysis_course.php
mod/feedback/complete.php
mod/lesson/action/confirmdelete.php
mod/quiz/settingslib.php
question/type/missingtype/questiontype.php
repository/boxnet/class.curl.php [deleted file]
repository/flickr/PEAR/HTTP/Request/Listener.php [deleted file]

index 054e140271caf7550d66029565de597f5eb358d9..2e1c4a2e3abf70fd5faadd6f34fd5d5a045dbdbe 100644 (file)
@@ -18,7 +18,7 @@ if ($mnet_peer->id != $CFG->mnet_all_hosts_id) {
 print_tabs(array($tabs), 'mnetthemes');
 
     $themes = get_list_of_plugins("theme");
-    $sesskey = !empty($USER->id) ? $USER->sesskey : '';
+    $sesskey = sesskey();
 
     echo '<table style="margin-left:auto;margin-right:auto;" cellpadding="7" cellspacing="5">';
 
index 1dee158b54cc35247e1874393a4d399cdcf49a84..7bcff27be3d874cd60e3e9dde1c6ffb7c360e49d 100644 (file)
@@ -36,11 +36,11 @@ class page_admin extends page_base {
             return;
         }
 
-        $adminroot =& admin_get_root(false, false); //settings not required - only pages
+        $adminroot = admin_get_root(false, false); //settings not required - only pages
 
         // fetch the path parameter
         $this->section = $section;
-        $current =& $adminroot->locate($section, true);
+        $current = $adminroot->locate($section, true);
         $this->visiblepathtosection = array_reverse($current->visiblepath);
 
         // all done
@@ -69,10 +69,10 @@ class page_admin extends page_base {
             return $this->url;
         }
 
-        $adminroot =& admin_get_root(false, false); //settings not required - only pages
+        $adminroot = admin_get_root(false, false); //settings not required - only pages
 
-        $root =& $adminroot->locate($this->section);
-        if (is_a($root, 'admin_externalpage')) {
+        $root = $adminroot->locate($this->section);
+        if ($root instanceof admin_externalpage) {
             return $root->url;
         } else {
             return ($CFG->wwwroot . '/' . $CFG->admin . '/settings.php');
index f3b5557522afa4206b891cf1a80b9832b53ae839..2d13ba56baf9f66df85373e2d5f7356a3dc37ca5 100644 (file)
@@ -7,7 +7,7 @@ require_once($CFG->libdir.'/adminlib.php');
 
 $query = trim(optional_param('query', '', PARAM_NOTAGS));  // Search string
 
-$adminroot =& admin_get_root(); // need all settings here
+$adminroot = admin_get_root(); // need all settings here
 $adminroot->search = $query; // So we can reference it in search boxes later in this invocation
 $statusmsg = '';
 $errormsg  = '';
@@ -20,7 +20,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
     if (admin_write_settings($data)) {
         $statusmsg = get_string('changessaved');
     }
-    $adminroot =& admin_get_root(true); //reload tree
+    $adminroot = admin_get_root(true); //reload tree
 
     if (!empty($adminroot->errors)) {
         $errormsg = get_string('errorwithsettings', 'admin');
index 2cdef063f04406a12e1b6629625a247925399b82..cc39b20956b9ffde6187d734ae977678cb67c8bf 100644 (file)
@@ -12,10 +12,10 @@ $adminediting = optional_param('adminedit', -1, PARAM_BOOL);
 /// no guest autologin
 require_login(0, false);
 
-$adminroot =& admin_get_root(); // need all settings
-$page      =& $adminroot->locate($section);
+$adminroot = admin_get_root(); // need all settings
+$page      = $adminroot->locate($section);
 
-if (empty($page) or !is_a($page, 'admin_settingpage')) {
+if (empty($page) or !($page instanceof admin_settingpage)) {
     print_error('sectionerror', 'admin', "$CFG->wwwroot/$CFG->admin/");
     die;
 }
index d5973418d180e59d21db317cef7ed646aade8e01..81f5cdd11f5bbf3606f630388000c70e23c6e1e7 100644 (file)
@@ -11,13 +11,13 @@ $return = optional_param('return', '', PARAM_ALPHA);
 /// no guest autologin
 require_login(0, false);
 
-$adminroot =& admin_get_root(); // need all settings
+$adminroot = admin_get_root(); // need all settings
 admin_externalpage_setup('upgradesettings'); // now hidden page
 
 // now we'll deal with the case that the admin has submitted the form with new settings
 if ($data = data_submitted() and confirm_sesskey()) {
     $count = admin_write_settings($data);
-    $adminroot =& admin_get_root(true); //reload tree
+    $adminroot = admin_get_root(true); //reload tree
 }
 
 $newsettings = admin_output_new_settings_by_page($adminroot);
index cfefb41bbedcc218e6dada08b303402b60f480a6..0cd292ea46ddc764dc0708bbb41c4fe9f2228506 100644 (file)
@@ -40,7 +40,7 @@ class block_admin_bookmarks extends block_base {
         if (get_user_preferences('admin_bookmarks')) {
             // this is expensive! Only require when bookmakrs exist..
             require_once($CFG->libdir.'/adminlib.php');
-            $adminroot =& admin_get_root(false, false);  // settings not required - only pages
+            $adminroot = admin_get_root(false, false);  // settings not required - only pages
 
             $bookmarks = explode(',', get_user_preferences('admin_bookmarks'));
             // hmm... just a liiitle (potentially) processor-intensive
@@ -51,9 +51,9 @@ class block_admin_bookmarks extends block_base {
 
             foreach($bookmarks as $bookmark) {
                 $temp = $adminroot->locate($bookmark);
-                if (is_a($temp, 'admin_settingpage')) {
+                if ($temp instanceof admin_settingpage) {
                     $this->content->text .= '<li><a href="' . $CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=' . $bookmark . '">' . $temp->visiblename . "</a></li>\n";
-                } else if (is_a($temp, 'admin_externalpage')) {
+                } else if ($temp instanceof admin_externalpage) {
                     $this->content->text .= '<li><a href="' . $temp->url . '">' . $temp->visiblename . "</a></li>\n";
                 }
             }
index 746c5cf37c4042472d23866360e35243e800aad0..ef1c8286ace32084c534788e99af320b1f0dbe66 100644 (file)
@@ -4,7 +4,7 @@ require('../../config.php');
 
 require_once($CFG->libdir.'/adminlib.php');
 require_login();
-$adminroot =& admin_get_root(false, false);  // settings not required - only pages
+$adminroot = admin_get_root(false, false);  // settings not required - only pages
 
 if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey()) {
 
@@ -22,7 +22,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
 
     $temp = $adminroot->locate($section);
 
-    if (is_a($temp, 'admin_settingpage') || is_a($temp, 'admin_externalpage')) {
+    if ($temp instanceof admin_settingpage || $temp instanceof admin_externalpage) {
         $bookmarks[] = $section;
         $bookmarks = implode(',', $bookmarks);
         set_user_preference('admin_bookmarks', $bookmarks);
@@ -32,10 +32,10 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
         die;
     }
 
-    if (is_a($temp, 'admin_settingpage')) {
+    if ($temp instanceof admin_settingpage) {
         redirect($CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=' . $section);
 
-    } elseif (is_a($temp, 'admin_externalpage')) {
+    } elseif ($temp instanceof admin_externalpage) {
         redirect($temp->url);
     }
 
index cc06f0600d0ce96cec23f65839b4c94cafffdc18..835ee6c1219531d8035541c0df5400070f9e249d 100644 (file)
@@ -5,7 +5,7 @@ require('../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 
 require_login();
-$adminroot =& admin_get_root(false, false); // settings not required - only pages
+$adminroot = admin_get_root(false, false); // settings not required - only pages
 
 if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey()) {
 
@@ -26,9 +26,9 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
 
         $temp = $adminroot->locate($section);
 
-        if (is_a($temp, 'admin_externalpage')) {
+        if ($temp instanceof admin_externalpage) {
             redirect($temp->url, get_string('bookmarkdeleted','admin'));
-        } elseif (is_a($temp, 'admin_settingpage')) {
+        } elseif ($temp instanceof admin_settingpage) {
             redirect($CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=' . $section);
         } else {
             redirect($CFG->wwwroot);
index d34900caaefb73a2635082c17b4d8081746e2850..ef6a3a6a359df34746c1affd7495ca68bdc179a4 100644 (file)
@@ -57,7 +57,7 @@ class block_admin_tree extends block_base {
 
     function build_tree (&$content) {
         global $CFG;
-        if (is_a($content, 'admin_settingpage')) {
+        if ($content instanceof admin_settingpage) {
             // show hidden pages in tree if hidden page active
             if ($content->check_access() and (($content->name == $this->section) or !$content->is_hidden())) {
                 $class = ($content->name == $this->section) ? 'link current' : 'link';
@@ -66,7 +66,7 @@ class block_admin_tree extends block_base {
                 }
                 $this->create_item($content->visiblename, $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section='.$content->name,$CFG->pixpath.'/i/item.gif', $class);
             }
-        } else if (is_a($content, 'admin_externalpage')) {
+        } else if ($content instanceof admin_externalpage) {
             // show hidden pages in tree if hidden page active
             if ($content->check_access() and (($content->name == $this->section) or !$content->is_hidden())) {
                 $class = ($content->name == $this->section) ? 'link current' : 'link';
@@ -80,7 +80,7 @@ class block_admin_tree extends block_base {
                 }
                 $this->create_item($content->visiblename, $content->url, $CFG->pixpath.'/i/item.gif', $class);
             }
-        } else if (is_a($content, 'admin_category')) {
+        } else if ($content instanceof admin_category) {
             if ($content->check_access() and !$content->is_hidden()) {
 
                 // check if the category we're currently printing is a parent category for the current page; if it is, we
@@ -117,7 +117,7 @@ class block_admin_tree extends block_base {
         }
 
         require_once($CFG->libdir.'/adminlib.php');
-        $adminroot =& admin_get_root(false, false); // settings not required - only pages
+        $adminroot = admin_get_root(false, false); // settings not required - only pages
 
         if ($current = $adminroot->locate($this->section, true)) {
             $this->pathtosection = $current->path;
index 0fe65dcd67be646aa37e7795fa7557df6962be46..6ee4066a845dca73b177d7275feb7ca39a2a2bc4 100644 (file)
@@ -469,7 +469,7 @@ class block_base {
         } else {
             $page = page_create_object($this->instance->pagetype, $this->instance->pageid);
         }
-        $script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey));
+        $script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => sesskey()));
 
         if (empty($this->instance->pinned)) {
             $movebuttons .= '<a class="icon roles" title="'. $this->str->assignroles .'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id.'">' .
index 1ce01c01e4a6799d53d7bc619c3d8c25bdbc7991..4fc064ca564e434c4fda56309f3ba9ebb5031cbb 100644 (file)
                 // This instance is configured - show Add/Edit feeds link.
                 $script = $page->url_get_full(
                                     array('instanceid' => $this->instance->id,
-                                          'sesskey' => $USER->sesskey,
+                                          'sesskey' => sesskey(),
                                           'blockaction' => 'config',
                                           'currentaction' => 'managefeeds',
                                           'id' => $this->courseid,
                 if (has_capability('block/rss_client:manageanyfeeds', $context)) {
                     $script = $page->url_get_full(
                                     array('instanceid' => $this->instance->id,
-                                          'sesskey' => $USER->sesskey,
+                                          'sesskey' => sesskey(),
                                           'blockaction' => 'config',
                                           'currentaction' => 'configblock',
                                           'id' => $this->courseid,
index 4375b8ca3dff4ccb03f0daf0aa28071fcca044dc..9abb4d3bbc17ab232e4e9b5e36d9b428e1f03dd7 100644 (file)
@@ -104,7 +104,7 @@ print_box_start();
                         || has_capability('block/rss_client:createsharedfeeds', $context)) {
 
                     $addrsspage = $page->url_get_full(array('instanceid' => $this->instance->id, 
-                                                            'sesskey' => $USER->sesskey,
+                                                            'sesskey' => sesskey(),
                                                             'blockaction' => 'config', 
                                                             'currentaction' => 'managefeeds',
                                                             'id' => $id));
index c3a7e3274c57eb7730372b44158b9f08c6997848..24a6447753bcfa024f46ef6153f40a71928cd7df 100644 (file)
@@ -13,12 +13,12 @@ if (empty($this->instance->pinned)) {
 }
 
 if (has_capability('moodle/site:manageblocks', $context)) {
-    $script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id, 'section' => 'rss'));
+    $script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => sesskey(), 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id, 'section' => 'rss'));
     $row[] = new tabobject('configblock', $script,
                 get_string('configblock', 'block_rss_client'));
 }
 
-$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $id, 'section' => 'rss'));
+$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => sesskey(), 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $id, 'section' => 'rss'));
 $row[] = new tabobject('managefeeds', $script,
             get_string('managefeeds', 'block_rss_client'));
 
index 3bc713f2e806cde07d68371681183551e38da8d3..7129a805b7e1ba94160a4543b44eb4a523829f19 100644 (file)
         unset($options);
         $options['id'] = $category->id;
         $options['resort'] = 'name';
-        $options['sesskey'] = $USER->sesskey;
+        $options['sesskey'] = sesskey();
         print_single_button('category.php', $options, get_string('resortcoursesbyname'), 'get');
     }
 
index 967126d980f7b60f73ce9a1a291180ed928bfd10..480068a79db8f1de5441970efbf5a7325e3c5988 100644 (file)
@@ -41,7 +41,7 @@
 
         notice_yesno("$strdeletecoursecheck<br /><br />" . format_string($course->fullname) .
                      " (" . format_string($course->shortname) . ")",
-                     "delete.php?id=$course->id&amp;delete=".md5($course->timemodified)."&amp;sesskey=$USER->sesskey",
+                     "delete.php?id=$course->id&amp;delete=".md5($course->timemodified)."&amp;sesskey=".sesskey(),
                      "category.php?id=$course->category");
 
         print_footer($course);
index b8f1ac2ce7f686c20939671bf354b0cab816b128..2dda3612c0bf04d31988c76877e2bddf7eb5b69b 100755 (executable)
@@ -87,7 +87,7 @@
             if ( !(isset($required[$h]) or
                 isset($optionalDefaults[$h]) or
                 isset($optional[$h])) ) {
-                print_error('invalidfieldname', 'error', 'index.php?id='.$id.'&amp;sesskey='.$USER->sesskey, $h);
+                print_error('invalidfieldname', 'error', 'index.php?id='.$id.'&amp;sesskey='.sesskey(), $h);
             }
             if ( isset($required[$h]) ) {
                 $required[$h] = 2;
@@ -96,7 +96,7 @@
         // check for required fields
         foreach ($required as $key => $value) {
             if ($value < 2) {
-                print_error('fieldrequired', 'error', 'uploaduser.php?id='.$id.'&amp;sesskey='.$USER->sesskey, $key);
+                print_error('fieldrequired', 'error', 'uploaduser.php?id='.$id.'&amp;sesskey='.sesskey(), $key);
             }
         }
         $linenum = 2; // since header is line 1
                 foreach ($record as $name => $value) {
                     // check for required values
                     if (isset($required[$name]) and !$value) {
-                        print_error('missingfield', 'error', 'uploaduser.php?sesskey='.$USER->sesskey, $name);
+                        print_error('missingfield', 'error', 'uploaduser.php?sesskey='.sesskey(), $name);
                     }
                     else if ($name == "groupname") {
                         $newgroup->name = $value;
index 4ac9b4a3d62c4aff4b0cb634c96867b5db848f04..ee0d9ce450889e8a196381adf9dd888ac737c219 100755 (executable)
@@ -29,6 +29,12 @@ class grade_import_form extends moodleform {
     function definition (){
         $mform =& $this->_form;
 
+        if (isset($this->_customdata)) {  // hardcoding plugin names here is hacky
+            $features = $this->_customdata;
+        } else {
+            $features = array();
+        }
+
         // course id needs to be passed for auth purposes
         $mform->addElement('hidden', 'id', optional_param('id'));
         $mform->setType('id', PARAM_INT);
@@ -41,6 +47,19 @@ class grade_import_form extends moodleform {
         $encodings = $textlib->get_encodings();
         $mform->addElement('select', 'encoding', get_string('encoding', 'grades'), $encodings);
 
+        if (!empty($features['includeseparator'])) {
+            $radio = array();
+            $radio[] = &MoodleQuickForm::createElement('radio', 'separator', null, get_string('septab', 'grades'), 'tab');
+            $radio[] = &MoodleQuickForm::createElement('radio', 'separator', null, get_string('sepcomma', 'grades'), 'comma');
+            $mform->addGroup($radio, 'separator', get_string('separator', 'grades'), ' ', false);
+            $mform->setDefault('separator', 'comma');
+        }
+
+        if (!empty($features['verbosescales'])) {
+            $options = array(1=>get_string('yes'), 0=>get_string('no'));
+            $mform->addElement('select', 'verbosescales', get_string('verbosescales', 'grades'), $options); 
+        }
+
         $options = array('10'=>10, '20'=>20, '100'=>100, '1000'=>1000, '100000'=>100000);
         $mform->addElement('select', 'previewrows', get_string('rowpreviewnum', 'grades'), $options); // TODO: localize
         $mform->setType('previewrows', PARAM_INT);
@@ -106,6 +125,10 @@ class grade_import_mapping_form extends moodleform {
         $mform->setType('id', PARAM_INT);
         $mform->addElement('hidden', 'importcode');
         $mform->setType('importcode', PARAM_FILE);
+        $mform->addElement('hidden', 'verbosescales', 1);
+        $mform->setType('separator', PARAM_ALPHA);
+        $mform->addElement('hidden', 'separator', 'comma');
+        $mform->setType('verbosescales', PARAM_INT);
         $this->add_action_buttons(false, get_string('uploadgrades', 'grades'));
 
     }
index 830f580333fe6ec0b1909eb7d447c57f4d1c8609..2f8d9f55ad194804906f38651bc3b387912346c8 100644 (file)
@@ -1,4 +1,7 @@
 <?php
-$string['notenoughsaincategory'] = 'There is/are only $a->nosaquestions short answer questions in the category that you chose \'$a->catname\'. Choose a different category, make some more questions in this category or reduce the amount of questions you\'ve selected.';
+$string['addingrandomsamatch'] = 'Adding a Random short-answer matching question';
+$string['editingrandomsamatch'] = 'Editing a Random short-answer matching question';
 $string['nosaincategory'] = 'There are no short answer questions in the category that you chose \'$a->catname\'. Choose a different category, make some questions in this category.';
+$string['notenoughsaincategory'] = 'There is/are only $a->nosaquestions short answer questions in the category that you chose \'$a->catname\'. Choose a different category, make some more questions in this category or reduce the amount of questions you\'ve selected.';
+$string['randomsamatch'] = 'Random short-answer matching';
 ?>
\ No newline at end of file
index 9a5d85ba38797bafe145c7fab7e3f55c9a0c7573..6da6bf715067396cf14fb7643f5a1d4ab13d4e35 100644 (file)
@@ -1,6 +1,9 @@
 <?php
+$string['addingshortanswer'] = 'Adding a short answer question';
 $string['addmoreanswerblanks'] = 'Blanks for {no} More Answers';
+$string['answermustbegiven'] = 'You must enter an answer if there is a grade or feedback.';
 $string['answerno'] = 'Answer $a';
+$string['editingshortanswer'] = 'Editing a Short answer question';
 $string['filloutoneanswer'] = 'You must provide at least one possible answer. Answers left blank will not be used. \'*\' can be used as a wildcard to match any characters. The first matching answer will be used to determine the score and feedback.';
-$string['answermustbegiven'] = 'You must enter an answer if there is a grade or feedback.';
+$string['shortanswer'] = 'Short answer';
 ?>
\ No newline at end of file
index 0684f3bc720f7e9eaf067957f2b4ce12968f706d..f3c8a6a8ab91f9702f60a25f4ef1e5f8a77bd993 100644 (file)
         // echo '<div class="feedback_centered_button">';
         echo '<div class="form-buttons">';
         $export_button_link = 'analysis_to_excel.php';
-        $export_button_options = array('sesskey'=>$USER->sesskey, 'id'=>$id);
+        $export_button_options = array('sesskey'=>sesskey(), 'id'=>$id);
         $export_button_label = get_string('export_to_excel', 'feedback');
         print_single_button($export_button_link, $export_button_options, $export_button_label, 'post');
         echo '</div>';
index 24545478b72f701eb5ab45c850c399186ce90b3b..9e1aead342af7f8cc6a86430445ef5ad0a7c1157 100644 (file)
@@ -72,7 +72,7 @@
         //button "export to excel"
         echo '<div class="mdl-align">';
         $export_button_link = 'analysis_to_excel.php';
-        $export_button_options = array('sesskey'=>$USER->sesskey, 'id'=>$id, 'coursefilter'=>$coursefilter);
+        $export_button_options = array('sesskey'=>sesskey(), 'id'=>$id, 'coursefilter'=>$coursefilter);
         $export_button_label = get_string('export_to_excel', 'feedback');
         print_single_button($export_button_link, $export_button_options, $export_button_label, 'post');
         echo '</div>';
 
         echo get_string('search_course', 'feedback') . ': ';
         echo '<input type="text" name="searchcourse" value="'.s($searchcourse).'"/> <input type="submit" value="'.get_string('search').'"/>';
-        echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
+        echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
         echo '<input type="hidden" name="id" value="'.$id.'" />';
         echo '<input type="hidden" name="courseitemfilter" value="'.$courseitemfilter.'" />';
         echo '<input type="hidden" name="courseitemfiltertyp" value="'.$courseitemfiltertyp.'" />';
index 00144ed3e731ef127f89ca24862504386e325aa2..85441f2e0d7e1aadc354671a31e5294fd7dacb85 100644 (file)
                 // print_simple_box_start('center', '75%');
                 print_box_start('generalbox boxaligncenter boxwidthwide');
                 echo '<div class="mdl-align"><form name="frm" action="'.$ME.'" method="post" onsubmit=" ">';
-                echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
+                echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
                 echo '<table>';
                 switch ($feedback->anonymous) {
                     case FEEDBACK_ANONYMOUS_YES:
                             echo '<form name="frm" action="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'" method="post" onsubmit=" ">';
                         }
                     }
-                echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
+                echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
                 echo '<input type="hidden" name="courseid" value="'. $courseid . '" />';
                 echo '<button type="submit">'.get_string('cancel').'</button>';
                 echo '</form>';
index 6b1b10d6ba4d654d095bb5d6944f2e6479829fd6..af580c0cdedc7c648395b9400434234e24f9f542 100644 (file)
@@ -26,6 +26,6 @@
         }
     }
     notice_yesno(get_string("confirmdeletionofthispage","lesson"), 
-         "lesson.php?action=delete&amp;id=$cm->id&amp;pageid=$pageid&amp;sesskey=".$USER->sesskey, 
+         "lesson.php?action=delete&amp;id=$cm->id&amp;pageid=$pageid&amp;sesskey=".sesskey(),
          "view.php?id=$cm->id");
 ?>
index 8c8843cf3d96d6ecea6ed3640188134d6e4e09e8..5768d4152e9a369a7852f976a50d34967cf1db8d 100644 (file)
@@ -18,9 +18,9 @@ class admin_setting_quiz_reviewoptions extends admin_setting {
             QUIZ_REVIEW_SCORES => 'scores',
             QUIZ_REVIEW_OVERALLFEEDBACK => 'overallfeedback');
 
-    function __construct($name, $visiblename, $description, $defaultsetting) {
+    public function __construct($name, $visiblename, $description, $defaultsetting) {
         $this->plugin = 'quiz';
-        parent::admin_setting($name, $visiblename, $description, $defaultsetting);
+        parent::__construct($name, $visiblename, $description, $defaultsetting);
     }
 
     private function normalise_data($data) {
@@ -35,7 +35,7 @@ class admin_setting_quiz_reviewoptions extends admin_setting {
         return $value;
     }
 
-    function get_setting() {
+    public function get_setting() {
         $value = $this->config_read($this->name);
         $fix = $this->config_read('fix_' . $this->name);
         if (is_null($value) or is_null($fix)) {
@@ -44,7 +44,7 @@ class admin_setting_quiz_reviewoptions extends admin_setting {
         return array('value' => $value, 'fix' => $fix);
     }
 
-    function write_setting($data) {
+    public function write_setting($data) {
         if (!isset($data['value'])) {
             $data['value'] = $this->normalise_data($data);
         }
@@ -62,7 +62,7 @@ class admin_setting_quiz_reviewoptions extends admin_setting {
         return '';
     }
 
-    function output_html($data, $query='') {
+    public function output_html($data, $query='') {
         if (!isset($data['value'])) {
             $data['value'] = $this->normalise_data($data);
         }
index 1bbdcf6d41ae0a268d4eab82afb30b67ff0cec56..d3f1255b093a3ec15657632a8460855f53c76f51 100644 (file)
@@ -63,7 +63,7 @@ class question_missingtype_qtype extends default_questiontype {
 
     function display_question_editing_page(&$mform, $question, $wizardnow){
 
-        print_heading(get_string('warningmissingtype', 'quiz'));
+        print_heading(get_string('warningmissingtype', 'qtype_missingtype'));
 
         $mform->display();
 
diff --git a/repository/boxnet/class.curl.php b/repository/boxnet/class.curl.php
deleted file mode 100755 (executable)
index 88d3878..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-<?php\r
-/**\r
- * @author Dick Munroe (munroe@csworks.com)\r
- * @copyright copyright @ 2004, Dick Munroe, released under the GPL.\r
- *\r
- * The cURL class is a thin wrapper around the procedural interface\r
- * to cURL provided by PHP.  I use it mostly as a base class for\r
- * web services whose low level interface is, literally, web pages.\r
- *\r
- * There are a few differences (value added, I guess) between the interface\r
- * provided by this class and the procedural cURL interface.  Most\r
- * noticable are:\r
- *\r
- *  1. The curl::exec function (when returning data to the caller rather\r
- *     than simply outputing it) always parses the HTTP header and returns\r
- *     only the body portion of the reqeust.  The header is available via\r
- *     the curl::getHeader method.\r
- *  2. The status of the last curl::exec is always maintained.  It is\r
- *     available via the curl::getStatus method.  In addition to the information\r
- *     returned by curl_getinfo, that of curl_error and curl_errno is folded\r
- *     in as well.\r
- *\r
- * @example ./example.class.curl.php\r
- */\r
-\r
-//\r
-// Edit History:\r
-//\r
-//  Dick Munroe munroe@csworks.com 30-Nov-2004\r
-//     Initial Version Created.\r
-//\r
-//  Dick Munroe munroe@csworks.com 01-Dec-2004\r
-//     Forgot to check for cURL actually being in this instance of PHP.\r
-//\r
-\r
-class curl\r
-{\r
-  /**\r
-   * The mapping to caseless header names.\r
-   *\r
-   * @access private\r
-   * @var array\r
-   */\r
-\r
-  var $m_caseless ;\r
-\r
-  /**\r
-   * The handle for the current curl session.\r
-   *\r
-   * @access private\r
-   * @var resource\r
-   */\r
-  \r
-  var $m_handle ;\r
-\r
-  /**\r
-   * The parsed contents of the HTTP header if one happened in the\r
-   * message.  All repeated elements appear as arrays.\r
-   *\r
-   * The headers are stored as an associative array, the key of which\r
-   * is the name of the header, e.g., Set-Cookie, and the values of which\r
-   * are the bodies of the header in the order in which they occurred.\r
-   * \r
-   * Some headers can be repeated in a single header, e.g., Set-Cookie and\r
-   * pragma, so each type of header has an array containing one or more\r
-   * headers of the same type.\r
-   *\r
-   * The names of the headers can, potentially, vary in spelling from\r
-   * server to server and client to client.  No attempt to regulate this\r
-   * is made, i.e., the curl class does not force all headers to lower\r
-   * or upper class, but it DOES collect all headers of the same type\r
-   * under the spelling of the type of header used by the FIRST header\r
-   * of that type.\r
-   *\r
-   * For example, two headers:\r
-   *\r
-   *   1. Set-Cookie: ...\r
-   *   2. set-cookie: ...\r
-   *\r
-   * Would appear as $this->m_header['Set-Cookie'][0] and ...[1]\r
-   *\r
-   * @access private\r
-   * @var mixed\r
-   */\r
-\r
-  var $m_header ;\r
-\r
-  /**\r
-   * Current setting of the curl options.\r
-   *\r
-   * @access private\r
-   * @var mixed\r
-   */\r
-\r
-  var $m_options ;\r
-\r
-  /**\r
-   * Status information for the last executed http request.  Includes the errno and error\r
-   * in addition to the information returned by curl_getinfo.\r
-   *\r
-   * The keys defined are those returned by curl_getinfo with two additional\r
-   * ones specified, 'error' which is the value of curl_error and 'errno' which\r
-   * is the value of curl_errno.\r
-   *\r
-   * @link http://www.php.net/curl_getinfo\r
-   * @link http://www.php.net/curl_errno\r
-   * @link http://www.php.net/curl_error\r
-   * @access private\r
-   * @var mixed\r
-   */\r
-\r
-  var $m_status ;\r
-\r
-  /**\r
-   * curl class constructor\r
-   *\r
-   * Initializes the curl class for it's default behavior:\r
-   *  o no HTTP headers.\r
-   *  o return the transfer as a string.\r
-   *  o URL to access.\r
-   * By default, the curl class will simply read the URL provided\r
-   * in the constructor.\r
-   *\r
-   * @link http://www.php.net/curl_init\r
-   * @param string $theURL [optional] the URL to be accessed by this instance of the class.\r
-   */\r
-\r
-  function curl($theURL=null)\r
-    {\r
-      if (!function_exists('curl_init'))\r
-       {\r
-         trigger_error('PHP was not built with --with-curl, rebuild PHP to use the curl class.', E_USER_ERROR) ;\r
-       }\r
-\r
-      $this->m_handle = curl_init() ;\r
-      \r
-      $this->m_caseless = null ;\r
-      $this->m_header = null ;\r
-      $this->m_options = null ;\r
-      $this->m_status = null ;\r
-\r
-      if (!empty($theURL))\r
-       {\r
-         $this->setopt(CURLOPT_URL, $theURL) ; \r
-       }\r
-      $this->setopt(CURLOPT_HEADER, false) ;\r
-      $this->setopt(CURLOPT_RETURNTRANSFER, true) ;\r
-    }\r
-\r
-  /**\r
-   * Free the resources associated with the curl session.\r
-   *\r
-   * @link http://www.php.net/curl_close\r
-   */\r
-\r
-  function close()\r
-    {\r
-      curl_close($this->m_handle) ;\r
-      $this->m_handle = null ;\r
-    }\r
-\r
-  /**\r
-   * Execute the curl request and return the result.\r
-   *\r
-   * @link http://www.php.net/curl_exec\r
-   * @link http://www.php.net/curl_getinfo\r
-   * @link http://www.php.net/curl_errno\r
-   * @link http://www.php.net/curl_error\r
-   * @return string The contents of the page (or other interaction as defined by the\r
-   *                settings of the various curl options).\r
-   */\r
-\r
-  function exec()\r
-    {\r
-      $theReturnValue = curl_exec($this->m_handle) ;\r
-      \r
-      $this->m_status = curl_getinfo($this->m_handle) ;\r
-      $this->m_status['errno'] = curl_errno($this->m_handle) ;\r
-      $this->m_status['error'] = curl_error($this->m_handle) ;\r
-      \r
-      //\r
-      // Parse out the http header (if any).\r
-      //\r
-\r
-      $this->m_header = null ;\r
-\r
-      if ($this->getOption(CURLOPT_HEADER))\r
-       {\r
-         $theArray = preg_split("/(\r\n){2,2}/", $theReturnValue, 2) ;\r
-\r
-         $this->parseHeader($theArray[0]) ;\r
-\r
-         return $theArray[1] ;\r
-       }\r
-\r
-      return $theReturnValue ;\r
-    }\r
-\r
-  /**\r
-   * Returns the parsed http header.\r
-   *\r
-   * @param string $theHeader [optional] the name of the header to be returned.\r
-   *                          The name of the header is case insensitive.  If\r
-   *                          the header name is omitted the parsed header is\r
-   *                          returned.  If the requested header doesn't exist\r
-   *                          false is returned.\r
-   * @returns mixed\r
-   */\r
-\r
-  function getHeader($theHeader=null)\r
-    {\r
-      if (empty($theHeader))\r
-       {\r
-         return $this->m_header ;\r
-       }\r
-      else\r
-       {\r
-         $theHeader = strtoupper($theHeader) ;\r
-         if (isset($this->m_caseless[$theHeader]))\r
-           {\r
-             return $this->m_header[$this->m_caseless[$theHeader]] ;\r
-           }\r
-         else\r
-           {\r
-             return false ;\r
-           }\r
-       }\r
-    }\r
-\r
-  /**\r
-   * Returns the current setting of the request option.  If no \r
-   * option has been set, it return null.\r
-   *\r
-   * @param integer the requested CURLOPT.\r
-   * @returns mixed\r
-   */\r
-\r
-  function getOption($theOption)\r
-    {\r
-      if (isset($this->m_options[$theOption]))\r
-       {\r
-         return $this->m_options[$theOption] ;\r
-       }\r
-\r
-      return null ;\r
-    }\r
-\r
-  /**\r
-   * Did the last curl exec operation have an error?\r
-   *\r
-   * @return mixed The error message associated with the error if an error \r
-   *               occurred, false otherwise.\r
-   */\r
-\r
-  function hasError()\r
-    {\r
-      if (isset($this->m_status['error']))\r
-       {\r
-         return (empty($this->m_status['error']) ? false : $this->m_status['error']) ;\r
-       }\r
-      else\r
-       {\r
-         return false ;\r
-       }\r
-    }\r
-\r
-  /**\r
-   * Parse an HTTP header.\r
-   *\r
-   * As a side effect it stores the parsed header in the\r
-   * m_header instance variable.  The header is stored as\r
-   * an associative array and the case of the headers \r
-   * as provided by the server is preserved and all\r
-   * repeated headers (pragma, set-cookie, etc) are grouped\r
-   * with the first spelling for that header\r
-   * that is seen.\r
-   *\r
-   * All headers are stored as if they COULD be repeated, so\r
-   * the headers are really stored as an array of arrays.\r
-   *\r
-   * @param string $theHeader The HTTP data header.\r
-   */\r
-\r
-  function parseHeader($theHeader)\r
-    {\r
-      $this->m_caseless = array() ;\r
-\r
-      $theArray = preg_split("/(\r\n)+/", $theHeader) ;\r
-\r
-      //\r
-      // Ditch the HTTP status line.\r
-      //\r
-\r
-      if (preg_match('/^HTTP/', $theArray[0]))\r
-       {\r
-         $theArray = array_slice($theArray, 1) ;\r
-       }\r
-\r
-      foreach ($theArray as $theHeaderString)\r
-       {\r
-         $theHeaderStringArray = preg_split("/\s*:\s*/", $theHeaderString, 2) ;\r
-\r
-         $theCaselessTag = strtoupper($theHeaderStringArray[0]) ;\r
-\r
-         if (!isset($this->m_caseless[$theCaselessTag]))\r
-           {\r
-             $this->m_caseless[$theCaselessTag] = $theHeaderStringArray[0] ;\r
-           }\r
-         \r
-         $this->m_header[$this->m_caseless[$theCaselessTag]][] = $theHeaderStringArray[1] ;\r
-       }\r
-    }\r
-\r
-  /**\r
-   * Return the status information of the last curl request.\r
-   *\r
-   * @param string $theField [optional] the particular portion\r
-   *                         of the status information desired.\r
-   *                         If omitted the array of status\r
-   *                         information is returned.  If a non-existant\r
-   *                         status field is requested, false is returned.\r
-   * @returns mixed\r
-   */\r
-\r
-  function getStatus($theField=null)\r
-    {\r
-      if (empty($theField))\r
-       {\r
-         return $this->m_status ;\r
-       }\r
-      else\r
-       {\r
-         if (isset($this->m_status[$theField]))\r
-           {\r
-             return $this->m_status[$theField] ;\r
-           }\r
-         else\r
-           {\r
-             return false ;\r
-           }\r
-       }\r
-    }\r
-\r
-  /**\r
-   * Set a curl option.\r
-   *\r
-   * @link http://www.php.net/curl_setopt\r
-   * @param mixed $theOption One of the valid CURLOPT defines.\r
-   * @param mixed $theValue the value of the curl option.\r
-   */\r
-\r
-  function setopt($theOption, $theValue)\r
-    {\r
-      curl_setopt($this->m_handle, $theOption, $theValue) ;\r
-      $this->m_options[$theOption] = $theValue ;\r
-    }\r
-}\r
-?>
\ No newline at end of file
diff --git a/repository/flickr/PEAR/HTTP/Request/Listener.php b/repository/flickr/PEAR/HTTP/Request/Listener.php
deleted file mode 100755 (executable)
index b6c3fac..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-/**
- * Listener for HTTP_Request and HTTP_Response objects
- *
- * PHP versions 4 and 5
- * 
- * LICENSE:
- *
- * Copyright (c) 2002-2007, Richard Heyes
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * o Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * o Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * o The names of the authors may not be used to endorse or promote
- *   products derived from this software without specific prior written
- *   permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * @category    HTTP
- * @package     HTTP_Request
- * @author      Alexey Borzov <avb@php.net>
- * @copyright   2002-2007 Richard Heyes
- * @license     http://opensource.org/licenses/bsd-license.php New BSD License
- * @version     CVS: $Id$
- * @link        http://pear.php.net/package/HTTP_Request/ 
- */
-
-/**
- * Listener for HTTP_Request and HTTP_Response objects
- *
- * This class implements the Observer part of a Subject-Observer
- * design pattern.
- *
- * @category    HTTP
- * @package     HTTP_Request
- * @author      Alexey Borzov <avb@php.net>
- * @version     Release: 1.4.2
- */
-class HTTP_Request_Listener 
-{
-   /**
-    * A listener's identifier
-    * @var string
-    */
-    var $_id;
-
-   /**
-    * Constructor, sets the object's identifier
-    *
-    * @access public
-    */
-    function HTTP_Request_Listener()
-    {
-        $this->_id = md5(uniqid('http_request_', 1));
-    }
-
-
-   /**
-    * Returns the listener's identifier
-    *
-    * @access public
-    * @return string
-    */
-    function getId()
-    {
-        return $this->_id;
-    }
-
-
-   /**
-    * This method is called when Listener is notified of an event
-    *
-    * @access   public
-    * @param    object  an object the listener is attached to
-    * @param    string  Event name
-    * @param    mixed   Additional data
-    * @abstract
-    */
-    function update(&$subject, $event, $data = null)
-    {
-        echo "Notified of event: '$event'\n";
-        if (null !== $data) {
-            echo "Additional data: ";
-            var_dump($data);
-        }
-    }
-}
-?>