?> <h1><?php echo __('Content publish'); ?> </h1> <hr /> <p><?php echo __('Are you sure to make this item public?'); ?> </p> <?php $items = []; foreach ($records as $record) { /** @var $record \Apps\ActiveRecord\Content */ $items[] = [['text' => $record->id], ['text' => $record->getLocaled('title')], ['text' => Simplify::parseUserLink($record->author_id), 'html' => true], ['text' => Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR)]]; } ?> <div class="table-responsive"> <?php echo Table::display(['table' => ['class' => 'table table-bordered'], 'thead' => ['titles' => [['text' => '#'], ['text' => __('Title')], ['text' => __('Author')], ['text' => __('Date')]]], 'tbody' => ['items' => $items]]); ?> </div> <?php $form = new Form($model, ['class' => 'form-horizontal']); echo $form->start(); ?> <?php
<hr /> <?php $form = new Form($model, ['class' => 'form-horizontal', 'action' => '', 'method' => 'post']); echo $form->start(); ?> <div class="row"> <div class="col-md-3"> <label class="pull-right"><?php echo $model->getLabel('name'); ?> </label> </div> <div class="col-md-9"> <?php echo Simplify::parseUserLink($model->id); ?> </div> </div> <p><?php echo __('Are you sure to remove this user from your blacklist?'); ?> <?php echo __('No any attentions will be displayed!'); ?> </p> <div class="col-md-9 col-md-offset-3"><?php echo $form->submitButton(__('Remove'), ['class' => 'btn btn-danger']); ?>
<h2><?php echo __('Comment answers'); ?> </h2> <?php foreach ($answers->get() as $answer) { /** @var \Apps\ActiveRecord\CommentAnswer $answer */ ?> <div class="panel panel-default" id="answer-<?php echo $answer->id; ?> "> <div class="panel-heading"> <?php $answerAuthor = Simplify::parseUserLink($answer->user_id, $answer->guest_name, 'user/update'); ?> <?php echo $answerAuthor . ', ' . Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR); ?> <div class="pull-right"> <?php if ((bool) $answer->moderate) { ?> <?php echo Url::link(['comments/publish', 'answer', $answer->id], __('Publish'), ['class' => 'label label-warning']); ?> <?php } ?> <?php
<?php if ($records === null || $records->count() < 1) { echo '<p class="alert alert-warning">' . __('Answers is not founded') . '</p>'; return; } $items = []; $moderateIsFound = false; foreach ($records as $item) { $commentObject = $item->getCommentPost(); $message = Text::cut(\App::$Security->strip_tags($item->message), 0, 75); $moderate = (bool) $item->moderate; if ($moderate) { $moderateIsFound = true; } $items[] = [1 => ['text' => $item->id], 2 => ['text' => ($moderate ? '<i class="fa fa-exclamation text-warning"></i> ' : null) . Url::link(['comments/read', $commentObject->id, null, ['#' => '#answer-' . $item->id]], $message), 'html' => true], 3 => ['text' => Simplify::parseUserLink((int) $item->user_id, $item->guest_name, 'user/update'), 'html' => true], 4 => ['text' => '<a href="' . App::$Alias->scriptUrl . $commentObject->pathway . '" target="_blank">' . Str::sub($commentObject->pathway, 0, 20) . '...</a>', 'html' => true], 5 => ['text' => Date::convertToDatetime($item->created_at, Date::FORMAT_TO_HOUR)], 6 => ['text' => Url::link(['comments/read', $commentObject->id], '<i class="fa fa-list fa-lg"></i>') . ' ' . Url::link(['comments/delete', 'answer', $item->id], '<i class="fa fa-trash-o fa-lg"></i>'), 'html' => true, 'property' => ['class' => 'text-center']], 'property' => ['class' => 'checkbox-row' . ($moderate !== false ? ' alert-warning' : null)]]; } $moderateAccept = false; if ($moderateIsFound) { $moderateAccept = ['type' => 'submit', 'class' => 'btn btn-warning', 'value' => __('Publish'), 'formaction' => Url::to('comments/publish', 'answer')]; } ?> <div class="table-responsive"> <?php echo Table::display(['table' => ['class' => 'table table-bordered table-hover'], 'thead' => ['titles' => [['text' => '#'], ['text' => __('Answer')], ['text' => __('Author')], ['text' => __('Page')], ['text' => __('Date')], ['text' => __('Actions')]]], 'tbody' => ['items' => $items], 'selectableBox' => ['attachOrder' => 1, 'form' => ['method' => 'GET', 'class' => 'form-horizontal', 'action' => Url::to('comments/delete', 'answer')], 'selector' => ['type' => 'checkbox', 'name' => 'selected[]', 'class' => 'massSelectId'], 'buttons' => [['type' => 'submit', 'class' => 'btn btn-danger', 'value' => __('Delete selected'), 'formaction' => Url::to('comment/delete', 'answer')], $moderateAccept]]]); ?> </div> <div class="text-center"> <?php
?> <h1><?php echo __('Publish comments and answers'); ?> </h1> <hr /> <?php echo __('Are you sure to moderate and make public this comments and answers?'); ?> <?php $items = []; foreach ($records as $item) { $message = Str::sub(\App::$Security->strip_tags($item->message), 0, 50); $author = Simplify::parseUserLink($item->user_id, $item->guest_name, 'user/update'); $items[] = [['text' => $item->id], ['text' => $message], ['text' => $author, 'html' => true], ['text' => Date::convertToDatetime($item->created_at, Date::FORMAT_TO_HOUR)]]; } ?> <div class="table-responsive"> <?php echo Table::display(['table' => ['class' => 'table table-bordered'], 'thead' => ['titles' => [['text' => '#'], ['text' => __('Message')], ['text' => __('Author')], ['text' => __('Date')]]], 'tbody' => ['items' => $items]]); ?> </div> <?php $form = new Form($model, ['class' => 'form-horizontal', 'method' => 'post']); echo $form->start(); ?>