Exemple #1
0
 function formatRow()
 {
     /* -------------------------------------
        |
        |   get additional data from DB
        |
        */
     // Get data about sender
     if ($from_model = $this->config->getTypeModelClassName($this->current_row['from_type'])) {
         $from = $this->add($from_model)->tryLoad($this->current_row['from_id']);
     } else {
         $from['name'] = Model_Message::getFromTypes($this->current_row['from_type']);
     }
     // get data about receiver
     if ($to_model = $this->config->getTypeModelClassName($this->current_row['to_type'])) {
         $to = $this->add($to_model)->tryLoad($this->current_row['to_id']);
     } else {
         $to['name'] = Model_Message::getToTypes($this->current_row['to_type']);
     }
     /* -------------------------------------
        |
        |           compile HTML
        |
        */
     $mixed_html = '';
     $message_model = $this->config->getMessageModelClassName();
     $mixed_html = $mixed_html . '<div class="' . $this->config->get('message-from-class') . '"><strong>From:</strong> ' . $from['name'] . ' (' . $message_model::getFromTypes($this->current_row['from_type']) . ') ' . ($this->current_row['from_is_deleted'] ? '*deleted*' : '') . '</div>';
     $mixed_html = $mixed_html . '<div class="' . $this->config->get('message-to-class') . '"><strong>To:</strong> ' . $to['name'] . ' (' . $message_model::getToTypes($this->current_row['to_type']) . ') ' . ($this->current_row['to_is_deleted'] ? '*deleted*' : '') . '</div>';
     $mixed_html = $mixed_html . '<div class="' . $this->config->get('message-text-class') . '">' . $this->current_row['text'] . '</div>';
     $this->current_row_html['message'] = $mixed_html;
     parent::formatRow();
 }