1 | <?php |
||
2 | |||
3 | use Ffcms\Core\Helper\Date; |
||
4 | use Ffcms\Templex\Url\Url; |
||
5 | |||
6 | /** @var \Apps\ActiveRecord\Invite[]|\Illuminate\Support\Collection $records */ |
||
7 | /** @var array $pagination */ |
||
8 | /** @var array $configs */ |
||
9 | /** @var \Ffcms\Templex\Template\Template $this */ |
||
10 | |||
11 | $this->layout('_layouts/default', [ |
||
12 | 'title' => __('Invitation list'), |
||
13 | 'breadcrumbs' => [ |
||
14 | Url::to('main/index') => __('Main'), |
||
15 | Url::to('application/index') => __('Applications'), |
||
16 | __('Invitation list') |
||
17 | ] |
||
18 | ]); |
||
19 | ?> |
||
20 | |||
21 | <?php $this->start('body') ?> |
||
22 | |||
23 | <?= $this->insert('user/_tabs') ?> |
||
0 ignored issues
–
show
|
|||
24 | <h1><?= __('Invitation list') ?></h1> |
||
25 | <?php if ($configs['registrationType'] !== 0) { |
||
26 | echo $this->bootstrap()->alert('danger', __('Invite system is disabled. Registration is public')); |
||
27 | } ?> |
||
28 | <div> |
||
29 | <?= Url::a(['user/invite'], __('Send invite'), ['class' => 'btn btn-info']) ?> |
||
30 | </div> |
||
31 | |||
32 | <?php if ($records->count() < 1) { |
||
33 | echo $this->bootstrap()->alert('warning', __('No invites recently send')); |
||
34 | $this->stop(); |
||
35 | return; |
||
36 | } ?> |
||
37 | |||
38 | <?php |
||
39 | $table = $this->table(['class' => 'table table-striped']) |
||
40 | ->head([ |
||
41 | ['text' => '#'], |
||
42 | ['text' => __('Email')], |
||
43 | ['text' => __('Valid')], |
||
44 | ['text' => __('Send date')], |
||
45 | ['text' => __('Actions'), 'properties' => ['class' => 'text-center']] |
||
46 | ]); |
||
47 | |||
48 | |||
49 | foreach ($records as $invite) { |
||
50 | $time = Date::convertToTimestamp($invite->created_at); |
||
51 | $table->row([ |
||
52 | ['text' => $invite->id], |
||
53 | ['text' => $invite->email], |
||
54 | ['text' => (time() - $time < \Apps\ActiveRecord\Invite::TOKEN_VALID_TIME ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-minus text-danger"></i>'), 'html' => true], |
||
55 | ['text' => Date::convertToDatetime($invite->created_at, Date::FORMAT_TO_DAY)], |
||
56 | ['text' => Url::a(['user/invitedelete', [$invite->id]], ' <i class="fa fa-trash-o fa-lg"></i>', ['html' => true]), |
||
57 | 'properties' => ['class' => 'text-center'], 'html' => true] |
||
58 | ]); |
||
59 | } |
||
60 | ?> |
||
61 | |||
62 | <div class="table-responsive"> |
||
63 | <?= $table->display() ?> |
||
64 | </div> |
||
65 | |||
66 | <?= $this->bootstrap()->pagination($pagination['url'], ['class' => 'pagination justify-content-center']) |
||
67 | ->size($pagination['total'], $pagination['page'], $pagination['step']) |
||
68 | ->display(); ?> |
||
69 | |||
70 | <?php $this->stop() ?> |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.