]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trail...
authorPetr Skoda <skodak@moodle.org>
Sun, 1 Nov 2009 13:17:47 +0000 (13:17 +0000)
committerPetr Skoda <skodak@moodle.org>
Sun, 1 Nov 2009 13:17:47 +0000 (13:17 +0000)
42 files changed:
calendar/event.php
calendar/export.php
calendar/export_execute.php
calendar/lib.php
calendar/view.php
mod/assignment/backuplib.php
mod/assignment/db/access.php
mod/assignment/db/install.php
mod/assignment/db/upgrade.php
mod/assignment/lib.php
mod/assignment/mod_form.php
mod/assignment/restorelib.php
mod/assignment/settings.php
mod/assignment/simpletest/test_assignment_portfolio_callers.php
mod/assignment/type/offline/assignment.class.php
mod/assignment/type/online/all.php
mod/assignment/type/online/assignment.class.php
mod/assignment/type/online/version.php
mod/assignment/type/upload/assignment.class.php
mod/assignment/type/uploadsingle/assignment.class.php
mod/assignment/version.php
mod/chat/README.txt
mod/chat/backuplib.php
mod/chat/chatd.php
mod/chat/db/access.php
mod/chat/db/install.php
mod/chat/db/upgrade.php
mod/chat/gui_ajax/index.php
mod/chat/gui_ajax/script.js
mod/chat/gui_basic/index.php
mod/chat/gui_header_js/jsupdate.php
mod/chat/gui_header_js/jsupdated.php
mod/chat/gui_header_js/users.php
mod/chat/gui_sockets/chatinput.php
mod/chat/index.php
mod/chat/lib.php
mod/chat/report.php
mod/chat/restorelib.php
mod/chat/settings.php
mod/chat/simpletest/test_chat_portfolio_callers.php
mod/chat/version.php
mod/chat/view.php

index 87deb6d5ece45f4b7970c6799a42a0322ec47eee..95183df39820770e58720e9b9bda4c63d13b32da 100644 (file)
@@ -657,5 +657,3 @@ function calendar_add_event_allowed($event) {
             return false;
     }
 }
-
-?>
index 19b81fb57f161a889da8616dfa52b1467172b017..e6f7983bef3b27e31e39476f5c983a877df67660 100644 (file)
@@ -197,7 +197,3 @@ echo '</td>';
 echo '</tr></table>';
 
 echo $OUTPUT->footer();
-
-
-
-?>
index 40d72cdb5932c88c0ae0090b4abd547beda8e66c..f0bee0c28b38aa6653c07e93ef925f531372ab1c 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 require_once('../config.php');
 //require_once($CFG->dirroot.'/course/lib.php');
@@ -168,5 +168,3 @@ header('Content-length: '.strlen($serialized));
 header('Content-type: text/calendar');
 
 echo $serialized;
-
-?>
index 310c23b625cd2123399635e5220f255e0a253d98..e1f66bf74bdb3f0da603a7a36facfae1abf24b50 100644 (file)
@@ -1595,4 +1595,3 @@ function calendar_user_can_add_event() {
     calendar_get_allowed_types($allowed);
     return (bool)($allowed->user || $allowed->groups || $allowed->courses || $allowed->site);
 }
-?>
index e3ce44bb5255cdc1d07922de72b8542146ea4477..2dfa38af58ce9972a5baec6f3ac5a4ae15a9c7e5 100644 (file)
@@ -655,5 +655,3 @@ function calendar_course_filter_selector($getvars = '') {
     $select->nothinglabel = false;
     return $OUTPUT->select($select);
 }
-
-?>
index 581e496b2c4eca6c722c52275b2427001f50b7d8..c4d670c77d5d230c278c639c78872bcc08ea65b2 100644 (file)
@@ -1,15 +1,15 @@
-<?php //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //assignment mods
 
     //This is the "graphical" structure of the assignment mod:
     //
     //                     assignment
-    //                    (CL,pk->id)             
+    //                    (CL,pk->id)
     //                        |
     //                        |
     //                        |
-    //                 assignment_submisions 
+    //                 assignment_submisions
     //           (UL,pk->id, fk->assignment,files)
     //
     // Meaning: pk->primary key field of the table
                 }
             }
         }
-        return $status;  
+        return $status;
     }
 
     function assignment_backup_one_mod($bf,$preferences,$assignment) {
         global $CFG, $DB;
-    
+
         if (is_numeric($assignment)) {
             $assignment = $DB->get_record('assignment', array('id'=>$assignment));
         }
-    
+
         $status = true;
 
         //Start mod
                 //Start submission
                 $status =fwrite ($bf,start_tag("SUBMISSION",5,true));
                 //Print submission contents
-                fwrite ($bf,full_tag("ID",6,false,$ass_sub->id));       
-                fwrite ($bf,full_tag("USERID",6,false,$ass_sub->userid));       
-                fwrite ($bf,full_tag("TIMECREATED",6,false,$ass_sub->timecreated));       
-                fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$ass_sub->timemodified));       
-                fwrite ($bf,full_tag("NUMFILES",6,false,$ass_sub->numfiles));       
-                fwrite ($bf,full_tag("DATA1",6,false,$ass_sub->data1));       
-                fwrite ($bf,full_tag("DATA2",6,false,$ass_sub->data2));       
-                fwrite ($bf,full_tag("GRADE",6,false,$ass_sub->grade));       
-                fwrite ($bf,full_tag("SUBMISSIONCOMMENT",6,false,$ass_sub->submissioncomment));       
-                fwrite ($bf,full_tag("FORMAT",6,false,$ass_sub->format));       
-                fwrite ($bf,full_tag("TEACHER",6,false,$ass_sub->teacher));       
-                fwrite ($bf,full_tag("TIMEMARKED",6,false,$ass_sub->timemarked));       
-                fwrite ($bf,full_tag("MAILED",6,false,$ass_sub->mailed));       
+                fwrite ($bf,full_tag("ID",6,false,$ass_sub->id));
+                fwrite ($bf,full_tag("USERID",6,false,$ass_sub->userid));
+                fwrite ($bf,full_tag("TIMECREATED",6,false,$ass_sub->timecreated));
+                fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$ass_sub->timemodified));
+                fwrite ($bf,full_tag("NUMFILES",6,false,$ass_sub->numfiles));
+                fwrite ($bf,full_tag("DATA1",6,false,$ass_sub->data1));
+                fwrite ($bf,full_tag("DATA2",6,false,$ass_sub->data2));
+                fwrite ($bf,full_tag("GRADE",6,false,$ass_sub->grade));
+                fwrite ($bf,full_tag("SUBMISSIONCOMMENT",6,false,$ass_sub->submissioncomment));
+                fwrite ($bf,full_tag("FORMAT",6,false,$ass_sub->format));
+                fwrite ($bf,full_tag("TEACHER",6,false,$ass_sub->teacher));
+                fwrite ($bf,full_tag("TIMEMARKED",6,false,$ass_sub->timemarked));
+                fwrite ($bf,full_tag("MAILED",6,false,$ass_sub->mailed));
 
                 $class = 'assignment_' . $assignment->assignmenttype;
                 require_once($CFG->dirroot . '/mod/assignment/lib.php');
     //and files are user info's level
     function backup_assignment_files($bf,$preferences) {
         global $CFG, $DB;
-       
+
         $status = true;
 
         //First we check to moddata exists and create it as necessary
 
         return $status;
 
-    } 
+    }
 
     function backup_assignment_files_instance($bf,$preferences,$instanceid) {
         global $CFG, $DB;
-       
+
         $status = true;
 
         //First we check to moddata exists and create it as necessary
 
         return $status;
 
-    } 
+    }
 
     //Return an array of info (name,value)
     function assignment_check_backup_mods($course,$user_data=false,$backup_unique_code,$instances=null) {
         //Now, if requested, the user_data
         if ($user_data) {
             $info[1][0] = get_string("submissions","assignment");
-            if ($ids = assignment_submission_ids_by_course ($course)) { 
+            if ($ids = assignment_submission_ids_by_course ($course)) {
                 $info[1][1] = count($ids);
             } else {
                 $info[1][1] = 0;
 
     // INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
 
-    //Returns an array of assignments id 
+    //Returns an array of assignments id
     function assignment_ids ($course) {
         global $CFG, $DB;
 
                                         FROM {assignment} a
                                        WHERE a.course = ?", array($course));
     }
-    
+
     //Returns an array of assignment_submissions id
     function assignment_submission_ids_by_course ($course) {
         global $CFG, $DB;
                                         FROM {assignment_submissions} s
                                        WHERE s.assignment = ?", array($instanceid));
     }
-?>
+
index 2e970129a4cd1892d8231549c6107cb33e69bcfc..83df79296cf9972a619c93711c47e857191ba1ec 100644 (file)
@@ -80,4 +80,4 @@ $mod_assignment_capabilities = array(
     ),
 );
 
-?>
+
index eaefbd8b40513b65ce84752939fc39b03e85c72b..b8e9a7bad31c9a603549789fdf5546b4ae407c33 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file replaces:
 //   * STATEMENTS section in db/install.xml
index 7a807ae0d923bef815dfabcb7c810aa28291bfc8..dc2bfc083b0747b6ce1dd7b2102aacfeee720ff9 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file keeps track of upgrades to
 // the assignment module
@@ -161,4 +161,4 @@ function xmldb_assignment_upgrade($oldversion) {
     return $result;
 }
 
-?>
+
index 5c757972e162b1ec068a57e01f8cec017150f366..0584d17bd41ddb19423b1f7c2272785c9cd2d73d 100644 (file)
@@ -39,7 +39,7 @@ DEFINE ('ASSIGNMENT_COUNT_LETTERS', 2);
 
 /**
  * Standard base class for all assignment submodules (assignment types).
- * 
+ *
  * @package   mod-assignment
  * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -764,14 +764,14 @@ class assignment_base {
             $url = new moodle_url('/mod/assignment/submissions.php', array(
                     'id' => $this->cm->id,
                     'userid' => $submission->userid,
-                    'mode' => 'single', 
+                    'mode' => 'single',
                     'offset' => (optional_param('offset', '', PARAM_INT)-1)));
-                        
+
             $link = html_link::make($url, $buttontext);
             $link->add_action(new popup_action('click', $link->url, 'grade'.$submission->userid, array('height' => 450, 'width' => 700)));
             $link->title = $buttontext;
-            $button = $OUTPUT->link($link);                    
-            
+            $button = $OUTPUT->link($link);
+
             $output.= 'opener.document.getElementById("up'.$submission->userid.'").innerHTML="'.addslashes_js($button).'";';
         }
 
@@ -1358,7 +1358,7 @@ class assignment_base {
                 $link = html_link::make($popup_url, $buttontext);
                 $link->add_action(new popup_action('click', $link->url, 'grade'.$auser->id, array('height' => 600, 'width' => 700)));
                 $link->title = $buttontext;
-                $button = $OUTPUT->link($link);                    
+                $button = $OUTPUT->link($link);
 
                 $status  = '<div id="up'.$auser->id.'" class="s'.$auser->status.'">'.$button.'</div>';
 
@@ -2544,7 +2544,7 @@ function assignment_get_participants($assignmentid) {
  */
 function assignment_pluginfile($course, $cminfo, $context, $filearea, $args, $forcedownload) {
     global $CFG, $DB;
-    
+
     if (!$assignment = $DB->get_record('assignment', array('id'=>$cminfo->instance))) {
         return false;
     }
@@ -3077,9 +3077,9 @@ function assignment_types() {
         $types[$name] = get_string('type'.$name, 'assignment');
 
         // ugly hack to support pluggable assignment type titles..
-        if ($types[$name] == '[[type'.$name.']]') { 
+        if ($types[$name] == '[[type'.$name.']]') {
             $types[$name] = get_string('type'.$name, 'assignment_'.$name);
-        } 
+        }
     }
     asort($types);
     return $types;
@@ -3130,13 +3130,13 @@ function assignment_print_overview($courses, &$htmlarray) {
     $strreviewed = get_string('reviewed','assignment');
 
 
-    // NOTE: we do all possible database work here *outside* of the loop to ensure this scales 
+    // NOTE: we do all possible database work here *outside* of the loop to ensure this scales
     //
     list($sqlassignmentids, $assignmentidparams) = $DB->get_in_or_equal($assignmentids);
-    
+
     // build up and array of unmarked submissions indexed by assigment id/ userid
     // for use where the user has grading rights on assigment
-    $rs = $DB->get_recordset_sql("SELECT id, assignment, userid 
+    $rs = $DB->get_recordset_sql("SELECT id, assignment, userid
                             FROM {assignment_submissions}
                             WHERE teacher = 0 AND timemarked = 0
                             AND assignment $sqlassignmentids", $assignmentidparams);
@@ -3151,7 +3151,7 @@ function assignment_print_overview($courses, &$htmlarray) {
     // get all user submissions, indexed by assigment id
     $mysubmissions = $DB->get_records_sql("SELECT assignment, timemarked, teacher, grade
                                       FROM {assignment_submissions}
-                                      WHERE userid = ? AND 
+                                      WHERE userid = ? AND
                                       assignment $sqlassignmentids", array_merge(array($USER->id), $assignmentidparams));
 
     foreach ($assignments as $assignment) {
index cd1d6636766eb010e3ccbf6984069756fa6bc7ab..00e104512b1fa593966119af85563a48b84c6c2e 100644 (file)
@@ -63,7 +63,7 @@ class mod_assignment_mod_form extends moodleform_mod {
         // hack to support pluggable assignment type titles
         if ($typetitle === '[[type'.$type.']]') {
             $typetitle  = get_string('type'.$type, 'assignment_'.$type);
-        } 
+        }
 
         $mform->addElement('header', 'typedesc', $typetitle);
 
index b02ed66cf4535aca07e5b57b9394b1f2d1797927..ba364f34449ed1e38e358ef14685c735b6bd15ac 100644 (file)
@@ -1,15 +1,15 @@
-<?php //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //assignment mods
 
     //This is the "graphical" structure of the assignment mod:
     //
     //                     assignment
-    //                    (CL,pk->id)             
+    //                    (CL,pk->id)
     //                        |
     //                        |
     //                        |
-    //                 assignment_submisions 
+    //                 assignment_submisions
     //           (UL,pk->id, fk->assignment,files)
     //
     // Meaning: pk->primary key field of the table
@@ -64,9 +64,9 @@
 
             //We have to recode the grade field if it is <0 (scale)
             if ($assignment->grade < 0) {
-                $scale = backup_getid($restore->backup_unique_code,"scale",abs($assignment->grade));        
+                $scale = backup_getid($restore->backup_unique_code,"scale",abs($assignment->grade));
                 if ($scale) {
-                    $assignment->grade = -($scale->new_id);       
+                    $assignment->grade = -($scale->new_id);
                 }
             }
 
@@ -94,7 +94,7 @@
             //The structure is equal to the db, so insert the assignment
             $newid = $DB->insert_record ("assignment",$assignment);
 
-            //Do some output     
+            //Do some output
             if (!defined('RESTORE_SILENTLY')) {
                 echo "<li>".get_string("modulename","assignment")." \"".format_string($assignment->name,true)."\"</li>";
             }
                 call_user_func(array($class, 'restore_one_mod'), $info, $restore, $assignment);
 
                 //Now check if want to restore user data and do it.
-                if (restore_userdata_selected($restore,'assignment',$mod->id)) { 
+                if (restore_userdata_selected($restore,'assignment',$mod->id)) {
                     //Restore assignmet_submissions
                     $status = assignment_submissions_restore_mods($mod->id, $newid,$info,$restore) && $status;
                     $status = assignment_submissions_restore_mods($mod->id, $newid,$info,$restore, $assignment) && $status;
                 $submission->submissioncomment = backup_todb($sub_info['#']['COMMENT']['0']['#']);
             } else {
                 $submission->submissioncomment = backup_todb($sub_info['#']['SUBMISSIONCOMMENT']['0']['#']);
-            }  
+            }
             $submission->format = backup_todb($sub_info['#']['FORMAT']['0']['#']);
             $submission->teacher = backup_todb($sub_info['#']['TEACHER']['0']['#']);
             $submission->timemarked = backup_todb($sub_info['#']['TIMEMARKED']['0']['#']);
             $user = backup_getid($restore->backup_unique_code,"user",$submission->teacher);
             if ($user) {
                 $submission->teacher = $user->new_id;
-            } 
+            }
 
             //The structure is equal to the db, so insert the assignment_submission
             $newid = $DB->insert_record ("assignment_submissions",$submission);
                              $newid);
 
                 //Now copy moddata associated files
-                $status = assignment_restore_files ($old_assignment_id, $new_assignment_id, 
+                $status = assignment_restore_files ($old_assignment_id, $new_assignment_id,
                                                     $olduserid, $submission->userid, $restore);
 
                 $submission->id = $newid;
     }
 
     //This function copies the assignment related info from backup temp dir to course moddata folder,
-    //creating it if needed and recoding everything (assignment id and user id) 
+    //creating it if needed and recoding everything (assignment id and user id)
     function assignment_restore_files ($oldassid, $newassid, $olduserid, $newuserid, $restore) {
 
         global $CFG;
 
         //Now, locate course's moddata directory
         $moddata_path = $CFG->dataroot."/".$restore->course_id."/".$CFG->moddata;
-   
+
         //Check it exists and create it
         $status = check_dir_exists($moddata_path,true);
 
             //Now this user id
             $user_assignment_path = $this_assignment_path."/".$newuserid;
             //And now, copy temp_path to user_assignment_path
-            $status = backup_copy_file($temp_path, $user_assignment_path); 
+            $status = backup_copy_file($temp_path, $user_assignment_path);
         }
-       
+
         return $status;
     }
 
     //assignment_decode_content_links_caller() function in each module
     //in the restore process
     function assignment_decode_content_links ($content,$restore) {
-            
+
         global $CFG;
-            
+
         $result = $content;
-                
+
         //Link to the list of assignments
-                
+
         $searchstring='/\$@(ASSIGNMENTINDEX)\*([0-9]+)@\$/';
         //We look for it
         preg_match_all($searchstring,$content,$foundset);
                 if($rec->new_id) {
                     //Now replace it
                     $result= preg_replace($searchstring,$CFG->wwwroot.'/mod/assignment/index.php?id='.$rec->new_id,$result);
-                } else { 
+                } else {
                     //It's a foreign link so leave it as original
                     $result= preg_replace($searchstring,$restore->original_wwwroot.'/mod/assignment/index.php?id='.$old_id,$result);
                 }
     //This function returns a log record with all the necessay transformations
     //done. It's used by restore_log_module() to restore modules log.
     function assignment_restore_logs($restore,$log) {
-                    
+
         $status = false;
-                    
+
         //Depending of the action, we recode different things
         switch ($log->action) {
         case "add":
             break;
         case "update grades":
             if ($log->cmid) {
-                //Extract the assignment id from the url field                             
+                //Extract the assignment id from the url field
                 $assid = substr(strrchr($log->url,"="),1);
                 //Get the new_id of the module (to recode the info field)
                 $mod = backup_getid($restore->backup_unique_code,$log->module,$assid);
         }
         return $status;
     }
-?>
+
index cdf7effac5d61c945eabec757e9d4f19e0df2244..9db9cdf5a4dc72a0e5685c594b6ce8d66d82fab0 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 require_once($CFG->dirroot.'/mod/assignment/lib.php');
 
@@ -15,4 +15,4 @@ $settings->add(new admin_setting_configselect('assignment_itemstocount', get_str
 $settings->add(new admin_setting_configcheckbox('assignment_showrecentsubmissions', get_string('showrecentsubmissions', 'assignment'),
                    get_string('configshowrecentsubmissions', 'assignment'), 1));
 
-?>
+
index f97bfb8b001e22b185236213b95b15277564796f..f980e203ad69969d1a2a17302c4ddab453d64fa0 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 require_once("$CFG->libdir/simpletest/portfolio_testclass.php");
 require_once("$CFG->dirroot/mod/assignment/lib.php");
 require_once("$CFG->dirroot/$CFG->admin/generator.php");
@@ -52,4 +52,4 @@ class testAssignmentPortfolioCallers extends portfoliolib_test {
         parent::test_caller_with_plugins();
     }
 }
-?>
+
index 671ace428723f934d776e09c9c74651bafef91ea..a7c4309eda49bbc9368537a639b7552b335c77fa 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 /**
  * Extend the base assignment class for offline assignments
@@ -100,4 +100,4 @@ class assignment_offline extends assignment_base {
 
 }
 
-?>
+
index c7ebb24a29a9f797e57c3b9c9be9ae3550084eb6..f69ec0ef18a3e9e51b3618616a48845f184e3546 100644 (file)
@@ -4,7 +4,7 @@
 // all.php
 //
 // Displays a complete list of online assignments
-// for the course. Rather like what happened in 
+// for the course. Rather like what happened in
 // the old Journal activity.
 // Howard Miller 2008
 // See MDL-14045
@@ -31,7 +31,7 @@ $context = get_context_instance(CONTEXT_COURSE,$course->id);
 require_capability('mod/assignment:view',$context);
 
 // various strings
-$str = new stdClass; 
+$str = new stdClass;
 $str->assignments = get_string("modulenameplural", "assignment");
 $str->duedate = get_string('duedate','assignment');
 $str->duedateno = get_string('duedateno','assignment');
index f9d82b4658b9d133440710d0dc9bbf039032816e..9ad6dca5d070539d62db3d6bf0f34adce4609765 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 require_once($CFG->libdir.'/formslib.php');
 require_once($CFG->dirroot . '/mod/assignment/lib.php');
 /**
@@ -186,12 +186,12 @@ class assignment_online extends assignment_base {
         if (!$submission = $this->get_submission($userid)) {
             return '';
         }
-        
+
         $link = html_link::make("/mod/assignment/type/online/file.php?id={$this->cm->id}&userid={$submission->userid}", shorten_text(trim(strip_tags(format_text($submission->data1,$submission->data2))), 15));
         $link->add_action(new popup_action('click', $link->url, 'file'.$userid, array('height' => 450, 'width' => 580)));
         $link->title = get_string('submission', 'assignment');
-        $popup = $OUTPUT->link($link);                    
-        
+        $popup = $OUTPUT->link($link);
+
         $output = '<div class="files">'.
                   '<img src="'.$OUTPUT->old_icon_url('f/html') . '" class="icon" alt="html" />'.
                   $popup .
@@ -205,11 +205,11 @@ class assignment_online extends assignment_base {
         if (!$submission = $this->get_submission($userid)) {
             return '';
         }
-        
+
         $link = html_link::make("/mod/assignment/type/online/file.php?id={$this->cm->id}&userid={$submission->userid}", shorten_text(trim(strip_tags(format_text($submission->data1,$submission->data2))), 15));
         $link->add_action(new popup_action('click', $link->url, 'file'.$userid, array('height' => 450, 'width' => 580)));
         $link->title = get_string('submission', 'assignment');
-        $popup = $OUTPUT->link($link);                    
+        $popup = $OUTPUT->link($link);
 
         $output = '<div class="files">'.
                   '<img align="middle" src="'.$OUTPUT->old_icon_url('f/html') . '" height="16" width="16" alt="html" />'.
@@ -346,4 +346,4 @@ class mod_assignment_online_edit_form extends moodleform {
     }
 }
 
-?>
+
index ceba567deb29349924997c02a2a98382e9965526..b047325978dba9ca4b47f6b1fc8d0d6f40e16c00 100644 (file)
@@ -1,4 +1,4 @@
-<?PHP // $Id$
+<?php
 
 ////////////////////////////////////////////////////////////////////////////////
 //  Code fragment to define the module version etc.
@@ -8,4 +8,4 @@
 $plugin->version   = 2005042900;
 $plugin->requires  = 2007101000;
 
-?>
+
index 02ffac8df0855d47cfde8d04d87d869f4933f190..df8f611f7336cf7c48126202a405ab0ce0262a8c 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 require_once($CFG->libdir . '/portfoliolib.php');
 require_once($CFG->dirroot . '/mod/assignment/lib.php');
 
@@ -275,8 +275,8 @@ class assignment_upload extends assignment_base {
             $link = html_link::make("/mod/assignment/type/upload/notes.php?id=$this->cm->id&userid=$userid", get_string('notes', 'assignment'));
             $link->add_action(new popup_action('click', $link->url, 'notes', array('height' => 500, 'width' => 780)));
             $link->title = get_string('notes', 'assignment');
-            $output .= $OUTPUT->link($link);                    
-            
+            $output .= $OUTPUT->link($link);
+
             $output .= '&nbsp;';
         }
 
@@ -1150,4 +1150,4 @@ class mod_assignment_upload_response_form extends moodleform {
 
 
 
-?>
+
index b02673288983a7fb3f45e6e8240cf11597407fb4..fde72dd97613bc8cebca7e286e1a47cfb6fe16fd 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 /**
  * Extend the base assignment class for assignments where you upload a single file
@@ -221,4 +221,4 @@ class assignment_uploadsingle extends assignment_base {
     }
 }
 
-?>
+
index 6ea4d55d97e37c90c050cc33d9a546e734dff5ce..7c3351cba5edd7d42a14c3cf345c378838e78571 100644 (file)
@@ -1,4 +1,4 @@
-<?PHP // $Id$
+<?php
 
 ////////////////////////////////////////////////////////////////////////////////
 //  Code fragment to define the module version etc.
@@ -9,4 +9,4 @@ $module->version  = 2009062500;
 $module->requires = 2009041700;  // Requires this Moodle version
 $module->cron     = 60;
 
-?>
+
index 23bf0162780e7196e1fcd676905ea2c97d130515..d495677cca095f568a5c3a1d146a4ca5afc00fd3 100644 (file)
@@ -1,16 +1,16 @@
 Official Chat Module for Moodle
 ------------------------------
 
-The chat module now supports a backend daemon for 
+The chat module now supports a backend daemon for
 more efficiency.
 
-It's still buggy and being worked on, but if you 
+It's still buggy and being worked on, but if you
 want to test it and help out here are some quick
 instructions:
 
 1) Admin -> Config -> Modules -> Chat -> Settings
 
-2) Set the method to "sockets" and set up the ports etc 
+2) Set the method to "sockets" and set up the ports etc
 
 3) Start the server like this (from the Unix command line):
 
index 6465af976293827e6f1974db89d6b31f31fc32d9..b1174b9d746be7a98bb1aced6aa37e8ec28008ad 100644 (file)
@@ -1,15 +1,15 @@
-<?php //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //chat mods
 
     //This is the "graphical" structure of the chat mod:
     //
     //                       chat
-    //                    (CL,pk->id)             
+    //                    (CL,pk->id)
     //                        |
     //                        |
     //                        |
-    //                   chat_messages 
+    //                   chat_messages
     //               (UL,pk->id, fk->chatid)
     //
     // Meaning: pk->primary key field of the table
                 }
             }
         }
-        return $status;  
+        return $status;
     }
 
     function chat_backup_one_mod($bf,$preferences,$chat) {
         global $CFG, $DB;
-    
+
         if (is_numeric($chat)) {
             $chat = $DB->get_record('chat', array('id'=>$chat));
         }
-    
+
         $status = true;
 
         //Start mod
                 //Start message
                 $status =fwrite ($bf,start_tag("MESSAGE",5,true));
                 //Print message contents
-                fwrite ($bf,full_tag("ID",6,false,$cha_mes->id));       
-                fwrite ($bf,full_tag("USERID",6,false,$cha_mes->userid));       
-                fwrite ($bf,full_tag("GROUPID",6,false,$cha_mes->groupid)); 
-                fwrite ($bf,full_tag("SYSTEM",6,false,$cha_mes->system));       
-                fwrite ($bf,full_tag("MESSAGE_TEXT",6,false,$cha_mes->message));       
-                fwrite ($bf,full_tag("TIMESTAMP",6,false,$cha_mes->timestamp));       
+                fwrite ($bf,full_tag("ID",6,false,$cha_mes->id));
+                fwrite ($bf,full_tag("USERID",6,false,$cha_mes->userid));
+                fwrite ($bf,full_tag("GROUPID",6,false,$cha_mes->groupid));
+                fwrite ($bf,full_tag("SYSTEM",6,false,$cha_mes->system));
+                fwrite ($bf,full_tag("MESSAGE_TEXT",6,false,$cha_mes->message));
+                fwrite ($bf,full_tag("TIMESTAMP",6,false,$cha_mes->timestamp));
                 //End submission
                 $status =fwrite ($bf,end_tag("MESSAGE",5,true));
             }
         //Now, if requested, the user_data
         if ($user_data) {
             $info[1][0] = get_string("messages","chat");
-            if ($ids = chat_message_ids_by_course ($course)) { 
+            if ($ids = chat_message_ids_by_course ($course)) {
                 $info[1][1] = count($ids);
             } else {
                 $info[1][1] = 0;
         //Now, if requested, the user_data
         if (!empty($instance->userdata)) {
             $info[$instance->id.'1'][0] = get_string("messages","chat");
-            if ($ids = chat_message_ids_by_instance ($instance->id)) { 
+            if ($ids = chat_message_ids_by_instance ($instance->id)) {
                 $info[$instance->id.'1'][1] = count($ids);
             } else {
                 $info[$instance->id.'1'][1] = 0;
 
     // INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
 
-    //Returns an array of chats id 
+    //Returns an array of chats id
     function chat_ids ($course) {
         global $DB;
 
                                        FROM {chat} c
                                       WHERE c.course = ?", array($course));
     }
-    
+
     //Returns an array of assignment_submissions id
     function chat_message_ids_by_course ($course) {
         global $DB;
                                        FROM {chat_messages} m
                                       WHERE m.chatid = ?", array($instanceid));
     }
-?>
+
index c64ce54957dc8dc792b8aaf6cbed6f20d15817b4..d6fc4f53d7f7e89bb3d3e8e339a37932835c3fff 100755 (executable)
@@ -17,7 +17,7 @@ define('CHAT_SIDEKICK_MESSAGE',     0x22);
 define('CHAT_SIDEKICK_BEEP',        0x23);
 
 $phpversion = phpversion();
-echo 'Moodle chat daemon v1.0 on PHP '.$phpversion." (\$Id$)\n\n";
+echo 'Moodle chat daemon v1.0 on PHP '.$phpversion."\n\n";
 
 /// Set up all the variables we need   /////////////////////////////////////
 
@@ -1071,4 +1071,4 @@ while(true) {
 @socket_shutdown($DAEMON->listen_socket, 0);
 die("\n\n-- terminated --\n");
 
-?>
+
index f34243f41ec9c8cc1b14f3873aeec1edfc6d0434..e68ca6a5287c91d9e7c34bd4898cebc708303572 100644 (file)
@@ -100,4 +100,4 @@ $mod_chat_capabilities = array(
 
 );
 
-?>
+
index 212e1d741b01150f74efe535f97448a8af299130..db920e2811d7c51dcc5a70aea1e6bbcac9601583 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file replaces:
 //   * STATEMENTS section in db/install.xml
index 9666dc7c92fc2613900049381bbd2d220e9131ee..dd1b40eef6b485fba8c34871c9a0c4cd99d952b9 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file keeps track of upgrades to
 // the chat module
@@ -87,4 +87,4 @@ function xmldb_chat_upgrade($oldversion) {
     return $result;
 }
 
-?>
+
index 7d69560d17c0edd1902d59a48325aad42842dafe..4a75cec527e35fbdd7f760fe487efd5832b462d8 100644 (file)
@@ -53,8 +53,8 @@ if (!$chat_sid = chat_login_user($chat->id, 'ajax', $groupid, $course)) {
 }
 
 $str_title = format_string($course->shortname) . ": ".format_string($chat->name,true).$groupname;
-$str_send  = get_string('send', 'chat'); 
-$str_themes = get_string('themes'); 
+$str_send  = get_string('send', 'chat');
+$str_themes = get_string('themes');
 
 $PAGE->set_generaltype('popup');
 $PAGE->set_title('Chat');
@@ -132,4 +132,4 @@ echo <<<DIVS
 <div id="chat-notify"></div>
 DIVS;
 echo $OUTPUT->footer();
-?>
+
index a0c848e7ec0f96f7e57f1d695e7aac8effba87be..7885baba78a671ab1f46bbaca3b18858ef7b7fc0 100644 (file)
@@ -213,11 +213,11 @@ YAHOO.moodle.chat.append_msg = function(key, msg, row) {
     list.appendChild(item);
     if (!row) {
         var anim = new YAHOO.util.ColorAnim(item.id, YAHOO.moodle.chat.oddmsg_cfg);
-        //anim.animate(); 
+        //anim.animate();
     }
     if (msg.mymessage) {
         //var anim = new YAHOO.util.ColorAnim(item.id, YAHOO.moodle.chat.mymsg_cfg);
-        //anim.animate(); 
+        //anim.animate();
     }
 }
 
index c2d6649d1fb92302a93915a066b8f230b6b16600..38f8f6cb155abb2cc8aa253d7a48ea3889acd725 100644 (file)
@@ -193,4 +193,3 @@ if (empty($allmessages)) {
 echo '</div></div>';
 echo $OUTPUT->footer();
 
-?>
\ No newline at end of file
index f10b33a5e182c6898809e4ed453de671779bc0de..a7df3425caaf6132d185f726ca3f189a3b481d21 100644 (file)
@@ -55,7 +55,7 @@ if ($chat_lasttime == 0) { //display some previous messages
 
 $timenow    = time();
 
-$params = array('groupid'=>$chatuser->groupid, 'chatid'=>$chatuser->chatid, 'lasttime'=>$chat_lasttime); 
+$params = array('groupid'=>$chatuser->groupid, 'chatid'=>$chatuser->chatid, 'lasttime'=>$chat_lasttime);
 
 $groupselect = $chatuser->groupid ? " AND (groupid=:groupid OR groupid=0) " : "";
 
index f8e251d38cffa0e65368b8ce3f66a6a2aa4b9e55..c83827f27bac16a24e1c1299aa42bafe5c7e99b4 100644 (file)
@@ -1,15 +1,15 @@
 <?php
 
 /** jsupdated.php - notes by Martin Langhoff <martin@catalyst.net.nz>
- ** 
+ **
  ** This is an alternative version of jsupdate.php that acts
  ** as a long-running daemon. It will feed/stall/feed JS updates
  ** to the client. From the module configuration select "Stream"
  ** updates.
- ** 
- ** The client connection is not forever though. Once we reach 
- ** CHAT_MAX_CLIENT_UPDATES, it will force the client to re-fetch it. 
- ** 
+ **
+ ** The client connection is not forever though. Once we reach
+ ** CHAT_MAX_CLIENT_UPDATES, it will force the client to re-fetch it.
+ **
  ** This buys us all the benefits that chatd has, minus the setup,
  ** as we are using apache to do the daemon handling.
  **
@@ -117,10 +117,10 @@ foreach ($CFG->stylesheets as $stylesheet) {
 
     // Ensure the HTML head makes it out there
     echo $CHAT_DUMMY_DATA;
-    @ob_end_flush();   
+    @ob_end_flush();
+
+    for ($n=0; $n <= CHAT_MAX_CLIENT_UPDATES; $n++) {
 
-    for ($n=0; $n <= CHAT_MAX_CLIENT_UPDATES; $n++) { 
-        
         // ping first so we can later shortcut as needed.
         $chatuser->lastping = time();
         $DB->set_field('chat_users', 'lastping', $chatuser->lastping, array('id'=>$chatuser->id));
@@ -139,7 +139,7 @@ foreach ($CFG->stylesheets as $stylesheet) {
         }
 
         $timenow    = time();
-                
+
         $params = array('groupid'=>$chatuser->groupid, 'lastid'=>$chat_lastid, 'lasttime'=>$chat_lasttime, 'chatid'=>$chatuser->chatid);
         $groupselect = $chatuser->groupid ? " AND (groupid=:groupid OR groupid=0) " : "";
 
@@ -152,11 +152,11 @@ foreach ($CFG->stylesheets as $stylesheet) {
             }
             $newcriteria = "timestamp > :lasttime";
         }
-        
+
         $messages = $DB->get_records_select("chat_messages_current",
                                        "chatid = :chatid AND $newcriteria $groupselect", $params,
                                        "timestamp ASC");
-        
+
         if ($messages) {
             $num = count($messages);
         } else {
@@ -169,7 +169,7 @@ foreach ($CFG->stylesheets as $stylesheet) {
         }
 
         print '<script type="text/javascript">' . "\n";
-        print "//<![CDATA[\n\n"; 
+        print "//<![CDATA[\n\n";
 
         $chat_newrow = ($chat_lastrow + $num) % 2;
 
@@ -178,7 +178,7 @@ foreach ($CFG->stylesheets as $stylesheet) {
         if (($chat_lasttime != $chat_newlasttime) and $messages) {
 
             $beep         = false;
-            $refreshusers = false; 
+            $refreshusers = false;
             foreach ($messages as $message) {
                 $chat_lastrow = ($chat_lastrow + 1) % 2;
                 $formatmessage = chat_format_message($message, $chatuser->course, $USER, $chat_lastrow);
@@ -197,7 +197,7 @@ foreach ($CFG->stylesheets as $stylesheet) {
             $chat_lasttime = $message->timestamp;
             $chat_lastid   = $message->id;
         }
-                
+
         if ($refreshusers) {
             echo "if (parent.users.document.anchors[0] != null) {" .
                 "parent.users.location.href = parent.users.document.anchors[0].href;}\n";
@@ -229,12 +229,12 @@ EOD;
         print $CHAT_DUMMY_DATA;
         @ob_end_flush();
         sleep($CFG->chat_refresh_room);
-    } // here ends the for() loop 
+    } // here ends the for() loop
 
     // here & should be written & :-D
-    $refreshurl = "{$CFG->wwwroot}/mod/chat/gui_header_js/jsupdated.php?chat_sid=$chat_sid&chat_lasttime=$chat_lasttime&chat_lastrow=$chat_newrow&chat_lastid=$chat_lastid"; 
+    $refreshurl = "{$CFG->wwwroot}/mod/chat/gui_header_js/jsupdated.php?chat_sid=$chat_sid&chat_lasttime=$chat_lasttime&chat_lastrow=$chat_newrow&chat_lastid=$chat_lastid";
     print '<script type="text/javascript">' . "\n";
-    print "//<![CDATA[ \n\n"; 
+    print "//<![CDATA[ \n\n";
     print "location.href = '$refreshurl';\n";
     print "//]]>\n";
     print '</script>' . "\n\n";
index 0485c8d1c974520c888105d61e4d3029b1e9e165..cf8555c57bf4439c17ede759d4ecb125213228a2 100644 (file)
@@ -124,4 +124,3 @@ if ($CFG->chat_refresh_userlist < 15) {
 
 exit; // no further output
 
-?>
\ No newline at end of file
index cdb1f9421bd32ae4e41050e7613f00d69737e568..c772ca3ba22fef65d0ab5a197dc468c5b8e3fd10 100644 (file)
@@ -31,7 +31,7 @@ echo $OUTPUT->header();
         <input type="text" name="chat_message" id="chat_message" size="60" value="" />
         <?php echo $OUTPUT->help_icon(moodle_help_icon::make("chatting", get_string("helpchatting", "chat"), "chat", true)); ?>
     </form>
-    
+
     <form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport/"; ?>" method="get" target="empty" id="sendform">
         <input type="hidden" name="win" value="message" />
         <input type="hidden" name="chat_message" value="" />
index 44e52f438efde85ef293f9b13db8aa9c251340a4..f83b9225eca04eb0fe12610c52411655a26a9e34 100644 (file)
@@ -88,4 +88,4 @@ echo $OUTPUT->table($table);
 
 echo $OUTPUT->footer();
 
-?>
+
index a2090cabdbc2ad3404a82aee22f9c6a44d436afc..cd93a43a96516b404be21bd99de0be1a5b60f666 100644 (file)
@@ -539,9 +539,9 @@ function chat_get_users($chatid, $groupid=0, $groupingid=0) {
         $groupingjoin = '';
     }
 
-    return $DB->get_records_sql("SELECT 
-        DISTINCT u.id, u.firstname, u.lastname, u.picture, c.lastmessageping, c.firstping, u.imagealt 
-        FROM {chat_users} c JOIN {user} u ON u.id = c.userid $groupingjoin 
+    return $DB->get_records_sql("SELECT
+        DISTINCT u.id, u.firstname, u.lastname, u.picture, c.lastmessageping, c.firstping, u.imagealt
+        FROM {chat_users} c JOIN {user} u ON u.id = c.userid $groupingjoin
         WHERE c.chatid = :chatid $groupselect
         ORDER BY c.firstping ASC", $params);
 }
@@ -563,7 +563,7 @@ function chat_get_latest_message($chatid, $groupid=0) {
         $groupselect = "";
     }
 
-    $sql = "SELECT * 
+    $sql = "SELECT *
         FROM {chat_messages_current} WHERE chatid = :chatid $groupselect
         ORDER BY timestamp DESC";
 
@@ -1302,7 +1302,7 @@ class chat_portfolio_caller extends portfolio_module_caller_base {
             || ($this->participated
                 && has_capability('mod/chat:exportparticipatedsession', $context));
     }
-    
+
     /**
      * @todo Document this function
      */
@@ -1381,7 +1381,7 @@ function chat_extend_navigation($navigation, $course, $module, $cm) {
         }
 
         $links = array();
-        
+
         if (!empty($USER->screenreader)) {
             $links[] = html_link::make(new moodle_url($target.'gui_basic/index.php', $params), $strenterchat);
         } else {
index b830c862773006c769260ba6aa8da73f60d628f9..cd3081d26f4a90f96b779ddcbb8dc27f8d333708 100644 (file)
 /// Finish the page
     echo $OUTPUT->footer();
 
-?>
+
index 217d4862bebb3f58da834d598ab3a20c94317a95..562d0a8d1c01532c59f4ae25c51c7d5defc2935e 100644 (file)
@@ -1,15 +1,15 @@
-<?php //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //chat mods
 
     //This is the "graphical" structure of the chat mod:
     //
     //                       chat
-    //                    (CL,pk->id)             
+    //                    (CL,pk->id)
     //                        |
     //                        |
     //                        |
-    //                    chat_messages 
+    //                    chat_messages
     //                (UL,pk->id, fk->chatid)
     //
     // Meaning: pk->primary key field of the table
@@ -31,7 +31,7 @@
         $data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id);
 
         if ($data) {
-            //Now get completed xmlized object   
+            //Now get completed xmlized object
             $info = $data->info;
 
             //traverse_xmlize($info);                                                                     //Debug
@@ -54,7 +54,7 @@
             //The structure is equal to the db, so insert the chat
             $newid = $DB->insert_record ("chat",$chat);
 
-            //Do some output     
+            //Do some output
             if (!defined('RESTORE_SILENTLY')) {
                 echo "<li>".get_string("modulename","chat")." \"".format_string($chat->name,true)."\"</li>";
             }
@@ -85,7 +85,7 @@
 
         $status = true;
 
-        //Get the messages array 
+        //Get the messages array
         $messages = $info['MOD']['#']['MESSAGES']['0']['#']['MESSAGE'];
 
         //Iterate over messages
     //chat_decode_content_links_caller() function in each module
     //in the restore process
     function chat_decode_content_links ($content,$restore) {
-            
+
         global $CFG;
-            
+
         $result = $content;
-                
+
         //Link to the list of chats
-                
+
         $searchstring='/\$@(CHATINDEX)\*([0-9]+)@\$/';
         //We look for it
         preg_match_all($searchstring,$content,$foundset);
                 if($rec->new_id) {
                     //Now replace it
                     $result= preg_replace($searchstring,$CFG->wwwroot.'/mod/chat/index.php?id='.$rec->new_id,$result);
-                } else { 
+                } else {
                     //It's a foreign link so leave it as original
                     $result= preg_replace($searchstring,$restore->original_wwwroot.'/mod/chat/index.php?id='.$old_id,$result);
                 }
     function chat_decode_content_links_caller($restore) {
         global $CFG, $DB;
         $status = true;
-        
+
         if ($chats = $DB->get_records('chat', array('course'=>$restore->course_id), '', "id,intro")) {
                                                //Iterate over each chat->intro
             $i = 0;   //Counter to send some output to the browser to avoid timeouts
         }
         return $status;
     }
-?>
+
index 46f8b6d7d9183d2917aa5fff1765ce93251c638e..fa11c0769f1e2a07fb74d448463fc2857600ff73 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 $settings->add(new admin_setting_heading('chat_method_heading', get_string('generalconfig', 'chat'),
                    get_string('explaingeneralconfig', 'chat')));
@@ -44,4 +44,4 @@ $settings->add(new admin_setting_configtext('chat_serverport', get_string('serve
 $settings->add(new admin_setting_configtext('chat_servermax', get_string('servermax', 'chat'),
                    get_string('configservermax', 'chat'), 100, PARAM_INT));
 
-?>
+
index c08cc29be3d7be1dd20b9d3cb8e10a2a47c22a1d..f43a99a6b88242bb7ded615fbe7a6fa53c9d440c 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 require_once("$CFG->libdir/simpletest/portfolio_testclass.php");
 require_once("$CFG->dirroot/mod/chat/lib.php");
 require_once("$CFG->dirroot/$CFG->admin/generator.php");
@@ -43,4 +43,4 @@ class testChatPortfolioCallers extends portfoliolib_test {
         parent::test_caller_with_plugins();
     }
 }
-?>
+
index 9cbda2e14cd59f6c770a9563f4ecb5492afe6867..870b86ea106f64f93463eb7db18773380e932205 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 /////////////////////////////////////////////////////////////////////////////////
 ///  Code fragment to define the version of chat
@@ -9,4 +9,4 @@ $module->version  = 2009042000;   // The (date) version of this module
 $module->requires = 2009041700;  // Requires this Moodle version
 $module->cron     = 300;          // How often should cron check this module (seconds)?
 
-?>
+
index d69d9efb0de43a0d85c00ccd65efa504acc523ee..4888de15acf5230bfe35e144cf949db0451afde9 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 
 /// This page prints a particular instance of chat
 
         $link = html_link::make($chattarget, $strenterchat);
         $link->add_action(new popup_action('click', $link->url, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700)));
         $link->title = get_string('modulename', 'chat');
-        echo $OUTPUT->link($link);                    
-        
+        echo $OUTPUT->link($link);
+
         echo '</p>';
 
         if ($CFG->enableajax) {
 
     echo $OUTPUT->footer();
 
-?>
+