Ejemplo n.º 1
0
 /**
  * @param Translation $tr
  * @param Chapter $chap
  */
 function renderTrRow($tr, $chap)
 {
     echo "<td class='t'>";
     echo "<div class='tb'>";
     echo nl2br(htmlspecialchars($tr->body));
     echo "</div>";
     echo "<div class='ti'>";
     if ($tr->user_id == 0) {
         echo "(анонимно) ";
     } else {
         echo "{$tr->user->ahref} ";
     }
     echo Yii::app()->dateFormatter->format("d.MM.yy в H:m", $tr->cdate);
     echo "</div>";
     echo "</td>";
     echo "<td class='tr'>";
     if ($chap->can("rate")) {
         echo "<div class='rater'>";
     }
     if ($chap->can("rate") && $chap->book->membership->status == GroupMember::MODERATOR) {
         echo "<a href='#' class='m'>&minus;</a> ";
     }
     echo "<span class='rate'>{$tr->rating}</span>";
     if ($chap->can("rate")) {
         echo " <a href='#' class='p'>+</a></div>";
     }
     echo "</td>";
     echo "<td class='te'>";
     if ($tr->user_id == Yii::app()->user->id || $chap->book->membership->status == GroupMember::MODERATOR) {
         echo "<a href='#' class='e'><i class='i icon-edit'></i></a> ";
         echo "<a href='#' class='x'><i class='i icon-remove'></i></a>";
     }
     echo "</td>";
 }