improved variable initialisation
authorPetr Skoda <skodak@moodle.org>
Sat, 18 Sep 2010 12:51:47 +0000 (12:51 +0000)
committerPetr Skoda <skodak@moodle.org>
Sat, 18 Sep 2010 12:51:47 +0000 (12:51 +0000)
mod/feedback/complete_guest.php

index 0d5e808..5885f2d 100644 (file)
         echo $OUTPUT->heading(format_text($feedback->name));
 
         if( (intval($feedback->publish_stats) == 1) AND
-                ( has_capability('mod/feedback:viewanalysepage', $context)) AND 
+                ( has_capability('mod/feedback:viewanalysepage', $context)) AND
                 !( has_capability('mod/feedback:viewreports', $context)) ) {
             echo $OUTPUT->box_start('mdl-align');
             echo '<a href="'.$analysisurl->out().'">'.get_string('completed_feedbacks', 'feedback').'</a>';
                 }
                 echo $OUTPUT->box_start('feedback_items');
 
-                unset($startitem);
+                $startitem = null;
                 $itemnr = $DB->count_records_select('feedback_item', 'feedback = ? AND hasvalue = 1 AND position < ?', array($feedback->id, $startposition));
                 $lastbreakposition = 0;
                 $align = right_to_left() ? 'right' : 'left';
-                
+
                 foreach($feedbackitems as $feedbackitem){
                     if(!isset($startitem)) {
                         //avoid showing double pagebreaks
                         }
                         $startitem = $feedbackitem;
                     }
-                    
+
                     if($feedbackitem->dependitem > 0) {
                         //chech if the conditions are ok
                         if(!isset($feedbackcompletedtmp->id) OR !feedback_compare_item_value($feedbackcompletedtmp->id, $feedbackitem->dependitem, $feedbackitem->dependvalue, true)) {
                             continue;
                         }
                     }
-                    
+
                     if($feedbackitem->dependitem > 0) {
                         $dependstyle = ' feedback_complete_depend';
                     }else {
                         $dependstyle = '';
                     }
-                    
+
                     echo $OUTPUT->box_start('feedback_item_box_'.$align.$dependstyle);
                         $value = '';
                         //get the value