Skip to content

Commit f42f622

Browse files
committed
More urlFor and fixes
1 parent 165b996 commit f42f622

32 files changed

+98
-116
lines changed

featherbb/Controller/Admin/Index.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ public function display($action = null)
8181
$this->feather->template->setPageInfo(array(
8282
'title' => array(Utils::escape($this->config['o_board_title']), __('Admin'), __('Index')),
8383
'active_page' => 'admin',
84-
'admin_console' => true,
85-
'install_file_exists' => is_dir($this->feather->forum_env['FEATHER_ROOT'].'install'),
84+
'admin_console' => true
8685
)
8786
)->addTemplate('admin/index.php')->display();
8887
}

featherbb/Controller/Admin/Maintenance.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Maintenance
1717
public function __construct()
1818
{
1919
$this->feather = \Slim\Slim::getInstance();
20-
$this->model = new \FeatherBB\Model\Admin\maintenance();
20+
$this->model = new \FeatherBB\Model\Admin\Maintenance();
2121
load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'].'featherbb/lang/'.$this->feather->user->language.'/admin/maintenance.mo');
2222
}
2323

featherbb/Model/Admin/Categories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function delete_category($cat_to_delete)
6060

6161
foreach ($forums_in_cat as $forum) {
6262
// Prune all posts and topics
63-
$this->maintenance = new \FeatherBB\Model\Admin\maintenance();
63+
$this->maintenance = new \FeatherBB\Model\Admin\Maintenance();
6464
$this->maintenance->prune($forum->id, 1, -1);
6565

6666
// Delete forum

featherbb/Model/Admin/Forums.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,10 @@ public function update_forum($forum_id, array $forum_data)
5555

5656
public function delete_forum($forum_id)
5757
{
58-
// Load the maintenance.php model file for prune public function
59-
require $this->feather->forum_env['FEATHER_ROOT'] . 'model/admin/maintenance.php';
60-
6158
$forum_id = $this->hook->fire('delete_forum_start', $forum_id);
6259

6360
// Prune all posts and topics
64-
$this->maintenance = new \FeatherBB\Model\Admin\maintenance();
61+
$this->maintenance = new \FeatherBB\Model\Admin\Maintenance();
6562
$this->maintenance->prune($forum_id, 1, -1);
6663

6764
// Delete the forum

featherbb/routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
};
139139

140140
// Admin index
141-
$feather->get('(/action/:action)(/)', '\FeatherBB\Controller\Admin\index:display');
141+
$feather->get('(/action/:action)(/)', '\FeatherBB\Controller\Admin\index:display')->name('adminAction');
142142
$feather->get('/index(/)', '\FeatherBB\Controller\Admin\index:display')->name('adminIndex');
143143

144144
// Admin bans

style/themes/FeatherBB/view/admin/bans/admin_bans.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<div class="blockform">
1919
<h2><span><?php _e('New ban head') ?></span></h2>
2020
<div class="box">
21-
<form id="bans" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/bans/add/') ?>">
21+
<form id="bans" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= $feather->urlFor('addBan') ?>">
2222
<input type="hidden" name="<?php echo $csrf_key; ?>" value="<?php echo $csrf_token; ?>">
2323
<div class="inform">
2424
<fieldset>
@@ -41,7 +41,7 @@
4141

4242
<h2 class="block2"><span><?php _e('Ban search head') ?></span></h2>
4343
<div class="box">
44-
<form id="find_bans" method="get" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/bans/') ?>">
44+
<form id="find_bans" method="get" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= $feather->urlFor('addBan') ?>">
4545
<input type="hidden" name="<?php echo $csrf_key; ?>" value="<?php echo $csrf_token; ?>">
4646
<p class="submittop"><input type="submit" name="find_ban" value="<?php _e('Submit search') ?>" tabindex="3" /></p>
4747
<div class="inform">
@@ -101,4 +101,4 @@
101101
</div>
102102
</div>
103103
<div class="clearer"></div>
104-
</div>
104+
</div>

style/themes/FeatherBB/view/admin/bans/search_ban.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
<div class="linkst">
2020
<div class="inbox crumbsplus">
2121
<ul class="crumbs">
22-
<li><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/') ?>"><?php _e('Admin').' '.__('Index') ?></a></li>
23-
<li><span>»&#160;</span><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/bans/') ?>"><?php _e('Bans') ?></a></li>
22+
<li><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= $feather->urlFor('adminIndex') ?>"><?php _e('Admin').' '.__('Index') ?></a></li>
23+
<li><span>»&#160;</span><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= $feather->urlFor('addBan') ?>"><?php _e('Bans') ?></a></li>
2424
<li><span>»&#160;</span><strong><?php _e('Results head') ?></strong></li>
2525
</ul>
2626
<div class="pagepost">
27-
<p class="pagelink"><?php echo $paging_links ?></p>
27+
<p class="pagelink"><?= $paging_links ?></p>
2828
</div>
2929
<div class="clearer"></div>
3030
</div>
@@ -53,13 +53,13 @@
5353
foreach ($ban_data as $cur_ban) {
5454
?>
5555
<tr>
56-
<td class="tcl"><?php echo($cur_ban['username'] != '') ? Utils::escape($cur_ban['username']) : '&#160;' ?></td>
57-
<td class="tc2"><?php echo($cur_ban['email'] != '') ? Utils::escape($cur_ban['email']) : '&#160;' ?></td>
58-
<td class="tc3"><?php echo($cur_ban['ip'] != '') ? Utils::escape($cur_ban['ip']) : '&#160;' ?></td>
59-
<td class="tc4"><?php echo $feather->utils->format_time($cur_ban['expire'], true) ?></td>
60-
<td class="tc5"><?php echo($cur_ban['message'] != '') ? Utils::escape($cur_ban['message']) : '&#160;' ?></td>
61-
<td class="tc6"><?php echo($cur_ban['ban_creator_username'] != '') ? '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"x x-first">Url::get('user/'.$cur_ban['ban_creator'].'/').'">'.Utils::escape($cur_ban['ban_creator_username']).'</a>' : __('Unknown') ?></td>
62-
<td class="tcr"><?php echo '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"x x-first">Url::get('admin/bans/edit/'.$cur_ban['id'].'/').'">'.__('Edit').'</a> | <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"x x-first">Url::get('admin/bans/delete/'.$cur_ban['id'].'/').'">'.__('Remove').'</a>' ?></td>
56+
<td class="tcl"><?= ($cur_ban['username'] != '') ? Utils::escape($cur_ban['username']) : '&#160;' ?></td>
57+
<td class="tc2"><?= ($cur_ban['email'] != '') ? Utils::escape($cur_ban['email']) : '&#160;' ?></td>
58+
<td class="tc3"><?= ($cur_ban['ip'] != '') ? Utils::escape($cur_ban['ip']) : '&#160;' ?></td>
59+
<td class="tc4"><?= $feather->utils->format_time($cur_ban['expire'], true) ?></td>
60+
<td class="tc5"><?= ($cur_ban['message'] != '') ? Utils::escape($cur_ban['message']) : '&#160;' ?></td>
61+
<td class="tc6"><?= ($cur_ban['ban_creator_username'] != '') ? '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"pl-s1">$feather->urlFor('userProfile', ['id' => $cur_ban['ban_creator']]).'">'.Utils::escape($cur_ban['ban_creator_username']).'</a>' : __('Unknown') ?></td>
62+
<td class="tcr"><?= '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"pl-s1">$feather->urlFor('editBan', ['id' => $cur_ban['id']]).'">'.__('Edit').'</a> | <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"pl-s1">$feather->urlFor('deleteBan', ['id' => $cur_ban['id']]).'">'.__('Remove').'</a>' ?></td>
6363
</tr>
6464
<?php
6565

@@ -78,13 +78,13 @@
7878
<div class="linksb">
7979
<div class="inbox crumbsplus">
8080
<div class="pagepost">
81-
<p class="pagelink"><?php echo $paging_links ?></p>
81+
<p class="pagelink"><?= $paging_links ?></p>
8282
</div>
8383
<ul class="crumbs">
84-
<li><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/') ?>"><?php _e('Admin').' '.__('Index') ?></a></li>
85-
<li><span>»&#160;</span><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/bans/') ?>"><?php _e('Bans') ?></a></li>
84+
<li><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= $feather->urlFor('adminIndex') ?>"><?php _e('Admin').' '.__('Index') ?></a></li>
85+
<li><span>»&#160;</span><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= $feather->urlFor('adminBans') ?>"><?php _e('Bans') ?></a></li>
8686
<li><span>»&#160;</span><strong><?php _e('Results head') ?></strong></li>
8787
</ul>
8888
<div class="clearer"></div>
8989
</div>
90-
</div>
90+
</div>

style/themes/FeatherBB/view/admin/categories.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<div class="blockform">
2020
<h2><span><?php _e('Add categories head') ?></span></h2>
2121
<div class="box">
22-
<form method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/categories/add/') ?>">
22+
<form method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= $feather->urlFor('addCategory') ?>">
2323
<div class="inform">
2424
<fieldset>
2525
<legend><?php _e('Add categories subhead') ?></legend>
@@ -28,9 +28,9 @@
2828
<tr>
2929
<th scope="row"><?php _e('Add category label') ?><div><input type="submit" value="<?php _e('Add new submit') ?>" tabindex="2" /></div></th>
3030
<td>
31-
<input type="hidden" name="<?php echo $csrf_key; ?>" value="<?php echo $csrf_token; ?>">
31+
<input type="hidden" name="<?= $csrf_key; ?>" value="<?= $csrf_token; ?>">
3232
<input type="text" name="cat_name" size="35" maxlength="80" tabindex="1" />
33-
<span><?php printf(__('Add category help'), '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"x x-first">Url::get('admin/forums').'">'.__('Forums').'</a>') ?></span>
33+
<span><?php printf(__('Add category help'), '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"pl-s1">$feather->urlFor('adminForums').'">'.__('Forums').'</a>') ?></span>
3434
</td>
3535
</tr>
3636
</table>
@@ -42,8 +42,8 @@
4242

4343
<?php if (!empty($cat_list)): ?> <h2 class="block2"><span><?php _e('Delete categories head') ?></span></h2>
4444
<div class="box">
45-
<form method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/categories/delete') ?>">
46-
<input type="hidden" name="<?php echo $csrf_key; ?>" value="<?php echo $csrf_token; ?>">
45+
<form method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= $feather->urlFor('deleteCategory') ?>">
46+
<input type="hidden" name="<?= $csrf_key; ?>" value="<?= $csrf_token; ?>">
4747
<div class="inform">
4848
<fieldset>
4949
<legend><?php _e('Delete categories subhead') ?></legend>
@@ -74,8 +74,8 @@
7474

7575
<?php if (!empty($cat_list)): ?> <h2 class="block2"><span><?php _e('Edit categories head') ?></span></h2>
7676
<div class="box">
77-
<form method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/categories/edit/') ?>">
78-
<input type="hidden" name="<?php echo $csrf_key; ?>" value="<?php echo $csrf_token; ?>">
77+
<form method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= $feather->urlFor('editCategory') ?>">
78+
<input type="hidden" name="<?= $csrf_key; ?>" value="<?= $csrf_token; ?>">
7979
<div class="inform">
8080
<fieldset>
8181
<legend><?php _e('Edit categories subhead') ?></legend>
@@ -93,8 +93,8 @@
9393
foreach ($cat_list as $cur_cat) {
9494
?>
9595
<tr>
96-
<td class="tcl"><input type="text" name="cat[<?php echo $cur_cat['id'] ?>][name]" value="<?php echo Utils::escape($cur_cat['cat_name']) ?>" size="35" maxlength="80" /></td>
97-
<td><input type="text" name="cat[<?php echo $cur_cat['id'] ?>][order]" value="<?php echo $cur_cat['disp_position'] ?>" size="3" maxlength="3" /></td>
96+
<td class="tcl"><input type="text" name="cat[<?= $cur_cat['id'] ?>][name]" value="<?= Utils::escape($cur_cat['cat_name']) ?>" size="35" maxlength="80" /></td>
97+
<td><input type="text" name="cat[<?= $cur_cat['id'] ?>][order]" value="<?= $cur_cat['disp_position'] ?>" size="3" maxlength="3" /></td>
9898
</tr>
9999
<?php
100100

@@ -111,4 +111,4 @@
111111
</div>
112112
<?php endif; ?> </div>
113113
<div class="clearer"></div>
114-
</div>
114+
</div>

style/themes/FeatherBB/view/admin/censoring.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
<div class="blockform">
2020
<h2><span><?php _e('Censoring head') ?></span></h2>
2121
<div class="box">
22-
<form id="censoring" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/censoring/') ?>">
22+
<form id="censoring" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo $feather->urlFor('adminCensoring') ?>">
2323
<input type="hidden" name="<?php echo $csrf_key; ?>" value="<?php echo $csrf_token; ?>">
2424
<div class="inform">
2525
<fieldset>
2626
<legend><?php _e('Add word subhead') ?></legend>
2727
<div class="infldset">
28-
<p><?php _e('Add word info').' '.($feather->forum_settings['o_censoring'] == '1' ? sprintf(__('Censoring enabled'), '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"x x-first">Url::get('admin/options#censoring').'">'.__('Options').'</a>') : sprintf(__('Censoring disabled'), '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"x x-first">Url::get('admin/options#censoring').'">'.__('Options').'</a>')) ?></p>
28+
<p><?php _e('Add word info').' '.($feather->forum_settings['o_censoring'] == '1' ? sprintf(__('Censoring enabled'), '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"pl-s1">$feather->urlFor('adminOptions').'#censoring">'.__('Options').'</a>') : sprintf(__('Censoring disabled'), '<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.%3Cspan+class%3D"pl-s1">$feather->urlFor('adminOptions').'#censoring">'.__('Options').'</a>')) ?></p>
2929
<table>
3030
<thead>
3131
<tr>
@@ -84,4 +84,4 @@
8484
</div>
8585
</div>
8686
<div class="clearer"></div>
87-
</div>
87+
</div>

style/themes/FeatherBB/view/admin/forums/admin_forums.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<div class="blockform">
1919
<h2><span><?php _e('Add forum head') ?></span></h2>
2020
<div class="box">
21-
<form method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/forums/add') ?>">
21+
<form method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo $feather->urlFor('addForum') ?>">
2222
<input type="hidden" name="<?php echo $csrf_key; ?>" value="<?php echo $csrf_token; ?>">
2323
<?php
2424
if (!empty($cat_list)) {
@@ -67,7 +67,7 @@
6767
?>
6868
<h2 class="block2"><span><?php _e('Manage forums head') ?></span></h2>
6969
<div class="box">
70-
<form id="edforum" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/forums/') ?>">
70+
<form id="edforum" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo $feather->urlFor('adminForums') ?>">
7171
<input type="hidden" name="<?php echo $csrf_key; ?>" value="<?php echo $csrf_token; ?>">
7272
<p class="submittop"><input type="submit" name="update_positions" value="<?php _e('Update positions') ?>" tabindex="3" /></p>
7373
<?php
@@ -90,7 +90,7 @@
9090
foreach ($cat_data['cat_forums'] as $forum) {
9191
?>
9292
<tr>
93-
<td class="tcl"><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/forums/edit/'.$forum['forum_id'].'/') ?>" tabindex="<?php echo $cur_index++ ?>"><?php _e('Edit link') ?></a> | <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo Url::get('admin/forums/delete/'.$forum['forum_id'].'/') ?>" tabindex="<?php echo $cur_index++ ?>"><?php _e('Delete link') ?></a></td>
93+
<td class="tcl"><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo $feather->urlFor('editForum', ['id' => $forum['forum_id']]) ?>" tabindex="<?php echo $cur_index++ ?>"><?php _e('Edit link') ?></a> | <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?php echo $feather->urlFor('deleteForum', ['id' => $forum['forum_id']]) ?>" tabindex="<?php echo $cur_index++ ?>"><?php _e('Delete link') ?></a></td>
9494
<td class="tc2"><input type="text" name="position[<?php echo $forum['forum_id'] ?>]" size="3" maxlength="3" value="<?php echo $forum['position'] ?>" tabindex="<?php echo $cur_index++ ?>" /></td>
9595
<td class="tcr"><strong><?php echo Utils::escape($forum['forum_name']) ?></strong></td>
9696
</tr>

0 commit comments

Comments
 (0)