<?php /** @var \mystic\forum\orm\TopicLogMessage $logMessage */ /** @var ?\mystic\forum\orm\User $postAuthor */ use mystic\forum\orm\TopicLogMessage; $hide_actions ??= false; $hide_pfp ??= false; $user = ""; if ($postAuthor === null) { $user = __("(deleted)"); } else { $user = '<a href="?_action=viewuser&user=' . htmlentities(urlencode($postAuthor->id)) . '">' . htmlentities($postAuthor->displayName) . '</a>'; } ?> <div class="media" id="post-<?= htmlentities($logMessage->id) ?>"> <div class="media-left hidden-sm hidden-xs"> <?php if ($postAuthor): ?> <?php if ($hide_actions): ?> <img class="media-object" alt="<?= __("Profile picture") ?>" src="?_action=profilepicture&user=<?= htmlentities(urlencode($postAuthor->id)) ?>" width="64" height="64"> <?php else: ?> <a href="?_action=viewuser&user=<?= htmlentities(urlencode($postAuthor->id)) ?>"> <img class="media-object" alt="<?= __("Profile picture") ?>" src="?_action=profilepicture&user=<?= htmlentities(urlencode($postAuthor->id)) ?>" width="64" height="64"> </a> <?php endif; ?> <?php else: ?> <div class="media-object" style="width:64px;height:64px"></div> <?php endif; ?> </div> <div class="media-body"> <?php if ($logMessage->type === TopicLogMessage::LOCKED): ?> <div class="well icon-well text-info"> <span class="glyphicon glyphicon-lock text-info" aria-hidden="true"></span> <em><?= __("%user% locked this topic", [ "user" => $user, ]) ?></em> <br> <small class="_time"><?= $logMessage->postDate->format("c") ?></small> </div> <?php elseif ($logMessage->type === TopicLogMessage::UNLOCKED): ?> <div class="well icon-well text-success"> <span class="glyphicon glyphicon-globe text-success" aria-hidden="true"></span> <em><?= __("%user% unlocked this topic", [ "user" => $user, ]) ?></em> <br> <small class="_time"><?= $logMessage->postDate->format("c") ?></small> </div> <?php elseif ($logMessage->type === TopicLogMessage::TITLE_CHANGED): ?> <div class="well icon-well text-info"> <span class="glyphicon glyphicon-pencil text-info" aria-hidden="true"></span> <em><?= __("%user% changed the title of this topic from %old_title% to %new_title%", [ "user" => $user, "old_title" => '<strong>' . htmlentities($logMessage->params["old_value"] ?? __("unknown")) . '</strong>', "new_title" => '<strong>' . htmlentities($logMessage->params["new_value"] ?? __("unknown")) . '</strong>', ]) ?></em> <br> <small class="_time"><?= $logMessage->postDate->format("c") ?></small> </div> <?php else: ?> <?= __("unknown") ?> <?php endif; ?> </div> </div>