Completed
Push — develop ( ff0f24...b7393c )
by Patrick
09:27
created

lead/class.ProfilesLeadPage.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
require_once('../class.ProfilesPage.php');
3
class ProfilesLeadPage extends \Flipside\Http\FlipAdminPage
4
{
5
    private $is_lead;
6
7
    public function __construct($title)
8
    {
9
        parent::__construct($title);
10
        if($this->user == false)
11
        {
12
            $this->is_lead = false;
13
        }
14
        else
15
        {
16
            $this->is_lead = $this->user->isInGroupNamed('Leads');
17
            if(!$this->is_lead)
18
            {
19
                $this->is_lead = $this->user->isInGroupNamed('CC');
20
            }
21
        }
22
        if($this->is_lead)
23
        {
24
            $this->is_admin = $this->is_lead;
25
        }
26
        $this->add_leads_css();
27
        $this->addWellKnownJS(JS_DATATABLE, false);
0 ignored issues
show
The call to ProfilesLeadPage::addWellKnownJS() has too many arguments starting with false.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
28
        $this->addWellKnownJS(JQUERY_VALIDATE);
29
        $this->addWellKnownJS(JS_METISMENU);
30
        $this->addJS('../_admin/js/admin.js');
31
        $this->addWellKnownJS(JS_LOGIN);
32
33
        $dirMenu = array(
34
                'All' => 'directory.php',
35
                'AAR' => 'directory.php?filter=aar',
36
                'AFs' => 'directory.php?filter=af',
37
                'CC'  => 'directory.php?filter=cc',
38
                '360/24/7 Department' => 'directory.php?filter=360',
39
                'Art' => 'directory.php?filter=Art',
40
                'City Planning' => 'directory.php?filter=CityPlanning',
41
                'Communications' => 'directory.php?filter=Comm',
42
                'Genesis' => 'directory.php?filter=Genesis',
43
                'Safety' => 'directory.php?filter=Safety',
44
                'Site-Ops' => 'directory.php?filter=Ops',
45
                'Site Prep' => 'directory.php?filter=siteprep',
46
                'Site Sign-Off' => 'directory.php?filter=sign-off',
47
                'Volunteer Coordinator' => 'directory.php?filter=vc'
48
                );
49
50
        $this->content['header']['sidebar'] = array();
51
        $this->content['header']['sidebar']['Dashboard'] = array('icon' => 'fa-dashboard', 'url' => 'index.php');
52
        $this->content['header']['sidebar']['Directory'] = array('icon' => 'fa-th-list', 'menu' => $dirMenu);
53
    }
54
55
    protected function add_leads_css()
56
    {
57
        $this->addWellKnownCSS(CSS_DATATABLE);
58
        $this->addCSS('../css/profiles.css');
59
        $this->addCSS('css/lead.css');
60
    }
61
62
    public function isAdmin()
63
    {
64
        return $this->is_lead;
65
    }
66
}
67
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
68