Просмотр файла modules/forum/templates/new_topic.phtml

Размер файла: 4.75Kb
<?php

/**
 * This file is part of JohnCMS Content Management System.
 *
 * @copyright JohnCMS Community
 * @license   https://opensource.org/licenses/GPL-3.0 GPL-3.0
 * @link      https://johncms.com JohnCMS Project
 */

/**
 * @var $csrf_token
 * @var $show_post_preview
 * @var $preview_message
 * @var $add_files
 * @var $back_url
 * @var $th
 * @var $msg
 * @var $data
 * @var \Johncms\Users\User $user
 */

$this->layout('system::layout/default');
?>

<?php if ($show_post_preview): ?>
    <h3><?= $th ?></h3>
    <div class="new_post-item mb-4">
        <div class="new_post-header d-flex justify-content-between">
            <div class="post-user">
                <div class="avatar">
                    <img src="<?= $this->avatar($user->id) ?>" class="img-fluid" alt=".">
                </div>
                <span class="user-status <?= $user->is_online ? 'online' : 'offline' ?> shadow"></span>
                <?php if (! empty($user->rights_name)): ?>
                    <div class="post-of-user"
                         data-toggle="tooltip"
                         data-placement="top"
                         data-html="true"
                         title="<?= $user->rights_name ?>">
                        <svg class="icon-post">
                            <use xlink:href="<?= $this->asset('icons/sprite.svg') ?>?4#check"/>
                        </svg>
                    </div>
                <?php endif ?>
            </div>
            <div class="flex-grow-1 post-user d-flex flex-wrap overflow-hidden d-flex align-items-center">
                <div class="w-100">
                    <div class="user-name d-inline mr-2"><?= $user->name ?></div>
                    <div class="post-meta d-inline mr-2"><?= $tools->displayDate(time()) ?></div>
                </div>
                <?php if (! empty($user->status)): ?>
                    <div class="overflow-hidden text-nowrap text-dark-brown overflow-ellipsis small">
                        <span class="font-weight-bold"><?= $user->status ?></span>
                    </div>
                <?php endif ?>
            </div>
        </div>
        <div class="post-body mt-2 pt-2 pb-2">
            <?= $preview_message ?>
        </div>
    </div>
<?php endif; ?>

<form name="new_topic" action="/forum/?act=nt&amp;id=<?= $id ?>" method="post">
    <input type="hidden" name="csrf_token" value="<?= $csrf_token ?>"/>
    <?php if (! empty($errors['csrf_token'])): ?>
        <div class="alert alert-danger"><?= implode(', ', $errors['csrf_token']) ?></div>
    <?php endif ?>
    <div class="form-group">
        <label for="th"><?= __('Title') ?></label>
        <input type="text" class="form-control <?= ! empty($errors['name']) ? 'is-invalid' : '' ?>" id="th" placeholder="" name="th" value="<?= $th ?>" maxlength="200" required>
        <?php if (! empty($errors['name'])): ?>
            <div class="invalid-feedback d-block"><?= implode(', ', $errors['name']) ?></div>
        <?php endif ?>
    </div>
    <div class="form-group">
        <label for="msg"><?= __('Message') ?></label>
        <div><?= $bbcode ?></div>
        <textarea rows="<?= $user->config->fieldHeight ?>" name="msg" id="msg"
                  class="form-control <?= ! empty($errors['message']) ? 'is-invalid' : '' ?>"><?= $msg ?></textarea>
        <?php if (! empty($errors['message'])): ?>
            <div class="invalid-feedback d-block"><?= implode(', ', $errors['message']) ?></div>
        <?php endif ?>
    </div>
    <?php if ($user->rights > 0): ?>
        <div class="form-group">
            <label for="meta_description"><?= __('Meta description') ?></label>
            <textarea name="meta_description" class="form-control" id="meta_description" rows="1"><?= $data['meta_description'] ?></textarea>
        </div>
        <div class="form-group">
            <label for="meta_keywords"><?= __('Meta keywords') ?></label>
            <textarea name="meta_keywords" class="form-control" id="meta_keywords" rows="1"><?= $data['meta_keywords'] ?></textarea>
        </div>
    <?php endif; ?>
    <div class="custom-control custom-checkbox mb-3">
        <input type="checkbox" class="custom-control-input" name="addfiles" value="1" id="addfiles" <?= $add_files ? 'checked' : '' ?>>
        <label class="custom-control-label" for="addfiles"><?= __('Add File') ?></label>
    </div>
    <div>
        <button type="submit" name="submit" value="1" class="btn btn-primary"><?= __('Write') ?></button>
        <?php if (! empty($settings_forum['preview'])): ?>
            <button type="submit" class="btn btn-secondary"><?= __('Preview') ?></button>
        <?php endif; ?>
    </div>
    <div class="mt-3">
        <a href="<?= $back_url ?>"><?= __('Back') ?></a>
    </div>
</form>

<div class="mt-2">
    <a href="/help/?act=smileys"><?= __('Smilies') ?></a>
</div>