Skip to content

Commit

Permalink
Forum-Module (1.35.1): Variable descriptions (#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhunderter authored Aug 16, 2024
1 parent 8b6f437 commit 95fc8c4
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 26 deletions.
6 changes: 5 additions & 1 deletion application/modules/forum/boxes/views/forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@

use Ilch\Date;

/** @var bool $DESCPostorder */
$DESCPostorder = $this->get('DESCPostorder');
/** @var int $postsPerPage */
$postsPerPage = $this->get('postsPerPage');
?>

<?php if (!empty($this->get('lastActiveTopicsToShow'))) : ?>
<ul class="list-unstyled">
<?php foreach ($this->get('lastActiveTopicsToShow') as $topic) : ?>
<?php
/** @var \Modules\Forum\Models\ForumTopic $topic */
foreach ($this->get('lastActiveTopicsToShow') as $topic) : ?>
<li style="line-height: 15px;">
<?php if ($this->getUser()) : ?>
<?php if ($topic['lastPost']->getRead()) : ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

use Ilch\Date;

/** @var \Modules\Forum\Models\ForumTopic[] $topics */
$topics = $this->get('topics');
/** @var bool $DESCPostorder */
$DESCPostorder = $this->get('DESCPostorder');
/** @var int $postsPerPage */
$postsPerPage = $this->get('postsPerPage');
?>

Expand Down
23 changes: 17 additions & 6 deletions application/modules/forum/views/admin/index/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
/** @var ForumItem|null $forumItems */
$forumItems = $this->get('forumItems');

/**
* @param ForumItem $item
* @param \Ilch\View $obj
*/
function rec(ForumItem $item, \Ilch\View $obj)
{
$class = 'mjs-nestedSortable-branch mjs-nestedSortable-expanded';
Expand Down Expand Up @@ -173,22 +177,28 @@ function () {
<div class="row mb-3"><label for="assignedGroupsRead" class="col-xl-3 col-form-label"><?=$this->getTrans('see') ?></label>\n\
<div class="col-xl-6"><select class="chosen-select form-control" id="assignedGroupsRead" name="user[groups][]" data-placeholder="<?=$this->getTrans('selectAssignedGroups') ?>" multiple>\n\
\n\
<?php foreach ($this->get('userGroupList') as $groupList) : ?>\n\
<option value="<?=$groupList->getId() ?>"><?=$this->escape($groupList->getName()) ?></option>\n\
<?php
/** @var \Modules\User\Models\Group $group */
foreach ($this->get('userGroupList') as $group) : ?>\n\
<option value="<?=$group->getId() ?>"><?=$this->escape($group->getName()) ?></option>\n\
<?php endforeach; ?>\n\
</select></div></div>\n\
<div class="row mb-3"><label for="assignedGroupsReply" class="col-xl-3 col-form-label"><?=$this->getTrans('answer') ?></label>\n\
<div class="col-xl-6"><select class="chosen-select form-control" id="assignedGroupsReply" name="user[groups][]" data-placeholder="<?=$this->getTrans('selectAssignedGroups') ?>" multiple>\n\
\n\
<?php foreach ($this->get('userGroupList') as $groupList) : ?>\n\
<option value="<?=$groupList->getId() ?>"><?=$this->escape($groupList->getName()) ?></option>\n\
<?php
/** @var \Modules\User\Models\Group $group */
foreach ($this->get('userGroupList') as $group) : ?>\n\
<option value="<?=$group->getId() ?>"><?=$this->escape($group->getName()) ?></option>\n\
<?php endforeach; ?>\n\
</select></div></div>\n\
<div class="row mb-3"><label for="assignedGroupsCreate" class="col-xl-3 col-form-label"><?=$this->getTrans('create') ?></label>\n\
<div class="col-xl-6"><select class="chosen-select form-control" id="assignedGroupsCreate" name="user[groups][]" data-placeholder="<?=$this->getTrans('selectAssignedGroups') ?>" multiple>\n\
\n\
<?php foreach ($this->get('userGroupList') as $groupList) : ?>\n\
<option value="<?=$groupList->getId() ?>"><?=$this->escape($groupList->getName()) ?></option>\n\
<?php
/** @var \Modules\User\Models\Group $group */
foreach ($this->get('userGroupList') as $group) : ?>\n\
<option value="<?=$group->getId() ?>"><?=$this->escape($group->getName()) ?></option>\n\
<?php endforeach; ?>\n\
</select></div></div>';

Expand All @@ -198,6 +208,7 @@ function () {
$('.dyn').html(menuHtml);
<?php
$prefixes = [];
/** @var \Modules\Forum\Models\Prefix $prefix */
foreach ($this->get('prefixes') ?? [] as $prefix) {
$prefixes[] = ['value' => $prefix->getId(), 'label' => $prefix->getPrefix()];
}
Expand Down
7 changes: 5 additions & 2 deletions application/modules/forum/views/admin/prefixes/treat.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php

/** @var \Ilch\View $this */

/** @var \Modules\Forum\Models\Prefix|null $prefix */
$prefix = $this->get('prefix');
?>
<h1><?=($this->get('prefix')) ? $this->getTrans('edit') : $this->getTrans('add') ?></h1>
<h1><?=($prefix) ? $this->getTrans('edit') : $this->getTrans('add') ?></h1>
<form method="POST">
<?=$this->getTokenField() ?>
<div class="row mb-3<?=$this->validation()->hasError('prefix') ? ' has-error' : '' ?>">
Expand All @@ -14,7 +17,7 @@
class="form-control"
id="prefix"
name="prefix"
value="<?=($this->get('prefix')) ? $this->escape($this->get('prefix')->getPrefix()) : '' ?>"
value="<?=($prefix) ? $this->escape($prefix->getPrefix()) : '' ?>"
required />
</div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions application/modules/forum/views/admin/ranks/treat.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php

/** @var \Ilch\View $this */

/** @var \Modules\Forum\Models\Rank|null $rank */
$rank = $this->get('rank');
?>
<h1><?=($this->get('rank')) ? $this->getTrans('edit') : $this->getTrans('add') ?></h1>
<h1><?=($rank) ? $this->getTrans('edit') : $this->getTrans('add') ?></h1>
<form method="POST">
<?=$this->getTokenField() ?>
<div class="row mb-3<?=$this->validation()->hasError('title') ? ' has-error' : '' ?>">
Expand All @@ -14,7 +17,7 @@
class="form-control"
id="title"
name="title"
value="<?=($this->get('rank')) ? $this->escape($this->get('rank')->getTitle()) : '' ?>"
value="<?=($rank) ? $this->escape($rank->getTitle()) : '' ?>"
required />
</div>
</div>
Expand All @@ -28,7 +31,7 @@ class="form-control"
id="posts"
name="posts"
min="0"
value="<?=($this->get('rank')) ? $this->escape($this->get('rank')->getPosts()) : '' ?>"
value="<?=($rank) ? $this->escape($rank->getPosts()) : '' ?>"
required />
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions application/modules/forum/views/edittopic/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
<?php
/** @var ForumItem[]|null $forumItems */
$forumItems = $this->get('forumItems');
/** @var int[] $editTopicItems */
$editTopicItems = $this->get('editTopicItems');

/**
* @param ForumItem $item
* @param View $obj
* @param int|null $i
*/
function rec(ForumItem $item, View $obj, ?int $i)
{
$subItems = $item->getSubItems();
Expand Down
14 changes: 12 additions & 2 deletions application/modules/forum/views/index/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
/** @var array $onlineUsersHighestRankedGroup */
$onlineUsersHighestRankedGroup = $this->get('onlineUsersHighestRankedGroup');

/** @var \Modules\User\Models\User $registNewUser */
$registNewUser = $this->get('registNewUser');

/**
* @param ForumItem $item
* @param View $obj
* @param int|null $i
*/
function rec(ForumItem $item, View $obj, ?int $i)
{
$DESCPostorder = $obj->get('DESCPostorder');
Expand Down Expand Up @@ -190,7 +198,9 @@ function rec(ForumItem $item, View $obj, ?int $i)
<div class="small">
<ul class="group-legend">
<li><i class="fa-solid fa-bars"></i> <?=$this->getTrans('legend') ?>:</li>
<?php foreach ($this->get('listGroups') as $group) : ?>
<?php
/** @var \Modules\User\Models\Group $group */
foreach ($this->get('listGroups') as $group) : ?>
<?php if ($group->getName() !== 'Guest') : ?>
<li class="group"><span class="forum appearance<?=$group->getId() ?>"><?=$group->getName() ?></span></li>
<?php endif; ?>
Expand All @@ -214,7 +224,7 @@ function rec(ForumItem $item, View $obj, ?int $i)
<li><?=$this->getTrans('totalPosts') ?>: <?=$forumStatistics->getCountPosts() ?></li>
<li><?=$this->getTrans('totalTopics') ?>: <?=$forumStatistics->getCountTopics() ?></li>
<li><?=$this->getTrans('totalMembers') ?>: <?=$forumStatistics->getCountUsers() ?></li>
<li><?=$this->getTrans('newMember') ?> <a href="<?=$this->getUrl(['module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $this->get('registNewUser')->getId()]) ?>" class="ilch-link" title="<?=$this->escape($this->get('registNewUser')->getName()) ?>"><?=$this->escape($this->get('registNewUser')->getName()) ?></a></li>
<li><?=$this->getTrans('newMember') ?> <a href="<?=$this->getUrl(['module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $registNewUser->getId()]) ?>" class="ilch-link" title="<?=$this->escape($registNewUser->getName()) ?>"><?=$this->escape($registNewUser->getName()) ?></a></li>
</ul>
</div>
<hr />
Expand Down
4 changes: 2 additions & 2 deletions application/modules/forum/views/newtopic/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<div class="col-xl-12">
<div class="row mb-3<?=$this->validation()->hasError('topicTitle') ? ' has-error' : '' ?>">
<label for="topicTitle" class="col-lg-2 col-form-label">
<?=$this->getTrans('topicTitle') ?>
<?=$this->getTrans('topicTitle') ?>
</label>
<?php if ($forum->getPrefixes() != '') : ?>
<?php $prefixIds = explode(',', $forum->getPrefixes()); ?>
Expand Down Expand Up @@ -69,7 +69,7 @@ class="form-control"
</div>
</div>
<div class="row mb-3<?=$this->validation()->hasError('text') ? ' has-error' : '' ?>">
<label class="col-xl-2 col-form-label">
<label class="col-xl-2 col-form-label" for="ck_1">
<?=$this->getTrans('text') ?>
</label>
<div class="col-xl-10">
Expand Down
3 changes: 1 addition & 2 deletions application/modules/forum/views/rememberedposts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

/** @var \Ilch\View $this */

/** @var \Modules\Forum\Models\ForumPost[]|null $rememberedPosts */

use Ilch\Date;

/** @var \Modules\Forum\Models\Remember[]|null $rememberedPosts */
$rememberedPosts = $this->get('rememberedPosts');
?>
<link href="<?=$this->getModuleUrl('static/css/forum.css') ?>" rel="stylesheet">
Expand Down
5 changes: 4 additions & 1 deletion application/modules/forum/views/rememberedposts/treat.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

/** @var \Ilch\View $this */

/** @var \Modules\Forum\Models\Remember|null $rememberedPost */
$rememberedPost = $this->get('rememberedPost');
?>
<link href="<?=$this->getModuleUrl('static/css/forum.css') ?>" rel="stylesheet">

Expand All @@ -19,7 +22,7 @@ class="form-control"
id="note"
name="note"
maxlength="255"
value="<?=($this->originalInput('note') == '') ? $this->escape($this->get('rememberedPost')->getNote()) : $this->originalInput('note') ?>" />
value="<?=($this->originalInput('note') == '') ? $this->escape($rememberedPost->getNote()) : $this->originalInput('note') ?>" />
</div>
</div>
<button type="submit" class="btn btn-sm btn-primary"><?=$this->getTrans('saveNoteRememberedPost') ?></button>
Expand Down
5 changes: 3 additions & 2 deletions application/modules/forum/views/showactivetopics/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

/** @var \Ilch\View $this */

/** @var array $topics */

use Ilch\Date;

/** @var array $topics */
$topics = $this->get('topics');
/** @var bool $DESCPostorder */
$DESCPostorder = $this->get('DESCPostorder');
/** @var int $postsPerPage */
$postsPerPage = $this->get('postsPerPage');
?>

Expand Down
8 changes: 7 additions & 1 deletion application/modules/forum/views/showcat/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@
/** @var \Modules\Forum\Models\ForumItem $cat */
$cat = $this->get('cat');

function rec($item, \Ilch\View $obj)
/**
* @param \Modules\Forum\Models\ForumItem $item
* @param \Ilch\View $obj
*/
function rec(\Modules\Forum\Models\ForumItem $item, \Ilch\View $obj)
{
/** @var Forum $forumMapper */
$forumMapper = $obj->get('forumMapper');

/** @var bool $DESCPostorder */
$DESCPostorder = $obj->get('DESCPostorder');
/** @var int $postsPerPage */
$postsPerPage = $obj->get('postsPerPage');
$subItems = $item->getSubItems();
$topics = $item->getTopics();
Expand Down
3 changes: 3 additions & 0 deletions application/modules/forum/views/shownewposts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

use Ilch\Date;

/** @var \Modules\Forum\Models\ForumTopic[] $topics */
$topics = $this->get('topics');
/** @var int $postsPerPage */
$DESCPostorder = $this->get('DESCPostorder');
/** @var int $postsPerPage */
$postsPerPage = $this->get('postsPerPage');
?>

Expand Down
7 changes: 5 additions & 2 deletions application/modules/forum/views/showposts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
if ($this->getUser()) {
$adminAccess = $this->getUser()->isAdmin();
}

/** @var \Ilch\Pagination $pagination */
$pagination = $this->get('pagination');
?>

<link href="<?=$this->getModuleUrl('static/css/forum.css') ?>" rel="stylesheet">
Expand Down Expand Up @@ -77,7 +80,7 @@
</span><?=$this->getTrans('lockPost') ?>
</div>
<?php endif; ?>
<?=$this->get('pagination')->getHtml($this, ['action' => 'index', 'topicid' => $this->getRequest()->getParam('topicid')]) ?>
<?=$pagination->getHtml($this, ['action' => 'index', 'topicid' => $this->getRequest()->getParam('topicid')]) ?>
</div>
<div class="col-xl-12">
<div class="posts-head ilch-head">
Expand Down Expand Up @@ -262,7 +265,7 @@
</span><?=$this->getTrans('lockPost') ?>
</div>
<?php endif; ?>
<?=$this->get('pagination')->getHtml($this, ['action' => 'index', 'topicid' => $this->getRequest()->getParam('topicid')]) ?>
<?=$pagination->getHtml($this, ['action' => 'index', 'topicid' => $this->getRequest()->getParam('topicid')]) ?>
</div>
</div>

Expand Down
9 changes: 7 additions & 2 deletions application/modules/forum/views/showtopics/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@
if ($this->getUser()) {
$adminAccess = $this->getUser()->isAdmin();
}
/** @var bool $DESCPostorder */
$DESCPostorder = $this->get('DESCPostorder');
/** @var int $postsPerPage */
$postsPerPage = $this->get('postsPerPage');

/** @var \Ilch\Pagination $pagination */
$pagination = $this->get('pagination');
?>
<link href="<?=$this->getModuleUrl('static/css/forum.css') ?>" rel="stylesheet">

Expand All @@ -48,7 +53,7 @@
</span><?=$this->getTrans('loginTopic') ?>
</a>
<?php endif; ?>
<?=$this->get('pagination')->getHtml($this, ['action' => 'index', 'forumid' => $this->getRequest()->getParam('forumid')]) ?>
<?=$pagination->getHtml($this, ['action' => 'index', 'forumid' => $this->getRequest()->getParam('forumid')]) ?>
</div>
<?php if ($forumEdit) : ?>
<form name="editForm" method="POST">
Expand Down Expand Up @@ -177,7 +182,7 @@
</span><?=$this->getTrans('loginTopic') ?>
</a>
<?php endif; ?>
<?=$this->get('pagination')->getHtml($this, ['action' => 'index', 'forumid' => $this->getRequest()->getParam('forumid')]) ?>
<?=$pagination->getHtml($this, ['action' => 'index', 'forumid' => $this->getRequest()->getParam('forumid')]) ?>
</div>
<div class="topic-actions">
<?php if ($adminAccess || ($this->getUser() && $this->getUser()->hasAccess('module_forum'))) : ?>
Expand Down

0 comments on commit 95fc8c4

Please sign in to comment.