} } else { $bm = ""; } if ($chap->book->typ == "S") { if ($show == 0) { echo "<a href='#' class='ord'>{$pos}</a> "; } echo "{$bm}<br />"; echo "<span class='t1'>" . $o->nicetime("t1") . "</span><br /><span class='t2'>" . $o->nicetime("t2") . "</span>"; } else { echo "<a href='#' class='ord'>{$o->ord}</a> {$bm}"; } // AUTOFIX. Если есть какой-нибудь фильтр на переводы, то не делаем пересчёт orig.n_trs! if ($o->n_trs != count($o->trs) and $show == 0) { if ($fixer->add($o->id, count($o->trs))) { if (Yii::app()->user->can("geek")) { echo "<i class='icon-bell'></i>"; } } } echo "</td>"; echo "<td class='o'>"; $html = $o->render(); if ($show == 5) { $html = preg_replace("/({$to_esc})/i", "<span class='shl'>\\1</span>", $html); } echo $html; if ($chap->book->can("chap_edit")) { echo " <a href='#' class='e'><i class='icon-edit'></i></a>"; }
$fixer = new OrigCountFixer(); $can_tr_read = $chap->can("trread"); foreach ($orig as $o) { $o->chap = $chap; echo "<tr id='o{$o->id}'>"; if (!Yii::app()->user->isGuest) { echo "<td class='b'>"; if ($o->bookmark->id) { $title = "Закладка" . ($o->bookmark->note != "" ? ": "" . CHtml::encode($o->bookmark->note) . """ : ""); echo "<a href='#'><i class='icon-star' title='{$title}'></i></a>"; } else { echo "<a href='#'><i class='i icon-star-empty'></i></a>"; } // AUTOFIX. Если есть какой-нибудь фильтр на переводы, то не делаем пересчёт orig.n_trs! if ($filter->show != 0 && $o->n_trs != count($o->trs)) { $fixer->add($o->id, count($o->trs)) && Yii::app()->user->can("geek") && (print "<i class='icon-bell'></i>"); } echo "</td>"; } echo "<td class='o'><div>"; echo $o->render($filter); echo "</div></td>"; if ($chap->can("tr")) { echo "<td class='u'>"; echo "<a href='#'><i class='i icon-arrow-right'></i></a>"; echo "</td>"; } echo "<td class='t'>"; echo $o->renderTranslations($filter); echo "</td>"; echo "<td class='c'>";
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>"; } $user = Yii::app()->user; $fixer = new OrigCountFixer(); $can_tr_read = $chap->can("trread"); $to_esc = preg_quote($to); foreach ($orig as $o) { $o->chap = $chap; // AUTOFIX. Если есть какой-нибудь фильтр на переводы, то не делаем пересчёт orig.n_trs! if ($show != 0 && $o->n_trs != count($o->trs)) { $fixer->add($o->id, count($o->trs)) && Yii::app()->user->can("geek"); } if (count($o->trs) > 1) { $rowspan = " rowspan='" . count($o->trs) . "'"; } else { $rowspan = ""; } if (count($o->trs) <= 1) { $class = " class='last'"; } else { $class = ""; } echo "<tr {$class}>"; if (!Yii::app()->user->isGuest) { echo "<td class='b' {$rowspan}>"; if ($o->bookmark->id) {