Skip to content

Commit a284f41

Browse files
committed
More Twig. Todo: search, moderation
1 parent f0e8204 commit a284f41

19 files changed

Lines changed: 153 additions & 383 deletions

‎featherbb/Controller/Admin/Parser.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public function display($req, $res, $args)
102102
'admin_console' => true,
103103
'smiley_files' => $this->model->getSmileyFiles(),
104104
'smilies' => $smilies,
105+
'file_uploads' => (ini_get('file_uploads') == 1),
105106
'urlBase' => URL::base().'/style/img/smilies/',
106107
]
107108
)->addTemplate('@forum/admin/parser')->display();

‎featherbb/Model/Profile.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ public function updateProfile($id, $info, $section)
701701
$form['username'] = Utils::trim(Input::post('req_username'));
702702

703703
if ($form['username'] != $info['old_username']) {
704-
$errors = '';
704+
$errors = [];
705705
$errors = $this->checkUsername($form['username'], $errors, $id);
706706
if (!empty($errors)) {
707707
throw new Error($errors[0]);

‎featherbb/Model/Register.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Register
2121
public function checkErrors()
2222
{
2323
$user = [];
24-
$user['errors'] = '';
24+
$user['errors'] = [];
2525

2626
$user = Container::get('hooks')->fire('model.register.check_for_errors_start', $user);
2727

‎featherbb/View/admin/forums/permissions.html.twig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<input type="hidden" name="read_forum_old[{{ perm.g_id }}]" value="{{ perm.read_forum ? '1' : '0' }}" />
8585
<input type="checkbox" name="read_forum_new[{{ perm.g_id }}]" value="1"
8686
{{ perm.read_forum ? ' checked="checked"' : '' }}
87-
{{ perm.g_read_board == '0' ? ' disabled="disabled"' : '' }}
87+
{{ perm['board.read'] == '0' ? ' disabled="disabled"' : '' }}
8888
tabindex="{{ getIndex() }}" />
8989
</td>
9090
<td{{ perm.post_replies_def == 0 and cur_forum.redirect_url == '' ? ' class="nodefault"' : '' }}>

‎featherbb/View/admin/groups/add_edit_group.html.twig‎

Lines changed: 42 additions & 42 deletions
Large diffs are not rendered by default.

‎featherbb/View/admin/groups/admin_groups.html.twig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060

6161

6262
{% for cur_group in groups %}
63-
{% if cur_group.g_id > getEnv('FEATHER_GUEST') and cur_group.g_moderator == 0 %}
63+
{% if cur_group.g_id > getEnv('FEATHER_GUEST') and cur_group.is_moderator == 0 %}
6464

6565
<option value="{{ cur_group.g_id }}"{{ cur_group.g_id == settings('o_default_user_group') ? ' selected="selected"' : '' }}>{{ cur_group.g_title }}</option>
6666

‎featherbb/View/admin/menu.html.twig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<li{{ page == 'users' ? ' class="isactive"' : '' }}>
1313
<a href="{{ pathFor('adminUsers') }}">{{ trans('Users') }}</a>
1414
</li>
15-
{% if isAdmin() or userGet('g_mod_ban_users') == '1' %}
15+
{% if isAdmin() or can('mod.ban_users') %}
1616
<li{{ page == 'bans' ? ' class="isactive"': '' }}>
1717
<a href="{{ pathFor('adminBans') }}">{{ trans('Bans') }}</a>
1818
</li>

‎featherbb/View/admin/parser.html.twig‎

Lines changed: 74 additions & 270 deletions
Large diffs are not rendered by default.

‎featherbb/View/admin/reports.html.twig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{{ breadcrumbsAdmin({
2828
(report.forum_name): pathFor('Forum', {'id': report.forum_id, 'name': slug(report.forum_name)}),
2929
(report.subject): pathFor('Forum', {'id': report.topic_id, 'name': slug(report.subject)}),
30-
(trans(['Post ID', report.pid])): {{ pathFor('viewPost', {'name': slug(report.subject), 'id': report.topic_id, 'pid': report.pid}) }}~'#p' ~report.pid
30+
(trans(['Post ID', report.pid])): pathFor('viewPost', {'name': slug(report.subject), 'id': report.topic_id, 'pid': report.pid})~'#p' ~report.pid
3131
})
3232
}}
3333
</td>
@@ -86,7 +86,7 @@
8686
{{ breadcrumbsAdmin({
8787
(report.forum_name): pathFor('Forum', {'id': report.forum_id, 'name': slug(report.forum_name)}),
8888
(report.subject): pathFor('Forum', {'id': report.topic_id, 'name': slug(report.subject)}),
89-
(trans(['Post ID', report.pid])): {{ pathFor('viewPost', {'name': slug(report.subject), 'id': report.topic_id, 'pid': report.pid}) }}~'#p' ~report.pid
89+
(trans(['Post ID', report.pid])): pathFor('viewPost', {'name': slug(report.subject), 'id': report.topic_id, 'pid': report.pid})~'#p' ~report.pid
9090
}) }}
9191
</td>
9292
</tr>

‎featherbb/View/admin/statistics.html.twig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<dd>
1616
{{ trans(['Server load data', server_load, num_online]) }}
1717
</dd>
18-
{% if userGet('g_id') == getEnv('FEATHER_ADMIN') %}
18+
{% if isAdmin() %}
1919

2020
<dt>{{ trans('Environment label') }}</dt>
2121
<dd>

0 commit comments

Comments
 (0)