コード例 #1
0
 function formatRow($row)
 {
     $out = '';
     $data = MBFeedbackItem::load($row);
     $outData = null;
     foreach (SpecialMoodBar::$fields as $field) {
         $outData = MoodBarFormatter::getHTMLRepresentation($data, $field);
         $out .= Xml::tags('td', null, $outData);
     }
     $out = Xml::tags('tr', $this->getRowAttrs($row), $out) . "\n";
     return $out;
 }
コード例 #2
0
 protected function outputRow($fh, $row)
 {
     //if there is an exception when setting this single record
     //record it so it won't stop the outputting of other records
     try {
         $item = MBFeedbackItem::load($row);
         $user = User::newFromRow($row);
         $outData = array();
         foreach ($this->fields as $field) {
             $outData[] = MoodBarFormatter::getInternalRepresentation($item, $field);
         }
     } catch (Exception $e) {
         $outData[] = wfMessage('moodbar-feedback-load-record-error')->escaped();
     }
     fputcsv($fh, $outData);
 }