-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathReports.php
More file actions
52 lines (44 loc) · 1.57 KB
/
Reports.php
File metadata and controls
52 lines (44 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Copyright (C) 2015-2019 FeatherBB
* based on code by (C) 2008-2015 FluxBB
* and Rickard Andersson (C) 2002-2008 PunBB
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
*/
namespace FeatherBB\Controller\Admin;
use FeatherBB\Core\AdminUtils;
use FeatherBB\Core\Interfaces\ForumSettings;
use FeatherBB\Core\Interfaces\Hooks;
use FeatherBB\Core\Interfaces\Input;
use FeatherBB\Core\Interfaces\Lang;
use FeatherBB\Core\Interfaces\Request;
use FeatherBB\Core\Interfaces\Router;
use FeatherBB\Core\Interfaces\View;
use FeatherBB\Core\Utils;
class Reports
{
public function __construct()
{
$this->model = new \FeatherBB\Model\Admin\Reports();
Lang::load('admin/reports');
}
public function display($req, $res, $args)
{
Hooks::fire('controller.admin.reports.display');
// Zap a report
if (Request::isPost()) {
$zapId = intval(key(Input::post('zap_id')));
$this->model->zap($zapId);
return Router::redirect(Router::pathFor('adminReports'), __('Report zapped redirect'));
}
AdminUtils::generateAdminMenu('reports');
return View::setPageInfo([
'title' => [Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Reports')],
'active_page' => 'admin',
'admin_console' => true,
'report_data' => $this->model->reports(),
'report_zapped_data' => $this->model->zappedReports(),
]
)->addTemplate('@forum/admin/reports')->display();
}
}