Passed
Pull Request — dev (#47)
by Stone
04:17 queued 01:57
created

Config   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 14 1
1
<?php
2
3
namespace App\Controllers\Admin;
4
5
use App\Models\ConfigModel;
6
use Core\AdminController;
7
8
/**
9
 * all to do with the config page
10
 * Class Config
11
 * @package App\Controllers\Admin
12
 */
13
class Config extends AdminController
14
{
15
    /**
16
     * Shows the config page with all of the config options
17
     * @throws \Twig_Error_Loader
18
     * @throws \Twig_Error_Runtime
19
     * @throws \Twig_Error_Syntax
20
     * @throws \ReflectionException
21
     */
22
    public function index()
23
    {
24
        $this->onlyAdmin();
25
26
        //going to have to think of a better way of handeling this.
27
        $this->data['userRole'] = 'Admin';
28
        $this->data['userLevel'] = $this->auth->getUserLevel();
29
30
        $configObj = new ConfigModel($this->container);
31
        $this->data['configList'] = $configObj->getAllConfigOrdered();
32
33
34
35
        $this->renderView('Admin/Config');
36
    }
37
}
38