|
1
|
|
|
<?php |
|
2
|
|
|
require_once('class.ProfilesPage.php'); |
|
3
|
|
|
require_once('class.FlipSession.php'); |
|
4
|
|
|
class ProfilesLeadPage extends FlipAdminPage |
|
5
|
|
|
{ |
|
6
|
|
|
private $is_lead; |
|
7
|
|
|
|
|
8
|
|
|
function __construct($title) |
|
|
|
|
|
|
9
|
|
|
{ |
|
10
|
|
|
parent::__construct($title); |
|
11
|
|
|
if($this->user == false) |
|
12
|
|
|
{ |
|
13
|
|
|
$this->is_lead = false; |
|
14
|
|
|
} |
|
15
|
|
|
else |
|
16
|
|
|
{ |
|
17
|
|
|
$this->is_lead = $this->user->isInGroupNamed('Leads'); |
|
18
|
|
|
if(!$this->is_lead) |
|
19
|
|
|
{ |
|
20
|
|
|
$this->is_lead = $this->user->isInGroupNamed('CC'); |
|
21
|
|
|
} |
|
22
|
|
|
} |
|
23
|
|
|
if($this->is_lead) |
|
24
|
|
|
{ |
|
25
|
|
|
$this->is_admin = $this->is_lead; |
|
26
|
|
|
} |
|
27
|
|
|
$this->add_leads_css(); |
|
28
|
|
|
$this->add_links(); |
|
29
|
|
|
$this->addWellKnownJS(JS_DATATABLE, false); |
|
30
|
|
|
$this->addWellKnownJS(JQUERY_VALIDATE); |
|
31
|
|
|
$this->addWellKnownJS(JS_METISMENU); |
|
32
|
|
|
$this->addJSByURI('../_admin/js/admin.js'); |
|
33
|
|
|
$this->addWellKnownJS(JS_LOGIN); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
function add_leads_css() |
|
|
|
|
|
|
37
|
|
|
{ |
|
38
|
|
|
$this->addWellKnownCSS(CSS_DATATABLE); |
|
39
|
|
|
$this->addCSSByURI('../css/profiles.css'); |
|
40
|
|
|
$this->addCSSByURI('css/lead.css'); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
function add_links() |
|
|
|
|
|
|
44
|
|
|
{ |
|
45
|
|
|
$dirMenu = array( |
|
46
|
|
|
'All' => 'directory.php', |
|
47
|
|
|
'AAR' => 'directory.php?filter=aar', |
|
48
|
|
|
'AFs' => 'directory.php?filter=af', |
|
49
|
|
|
'CC' => 'directory.php?filter=cc', |
|
50
|
|
|
'360/24/7 Department' => 'directory.php?filter=360', |
|
51
|
|
|
'Art' => 'directory.php?filter=Art', |
|
52
|
|
|
'City Planning' => 'directory.php?filter=CityPlanning', |
|
53
|
|
|
'Communications' => 'directory.php?filter=Comm', |
|
54
|
|
|
'Genesis' => 'directory.php?filter=Genesis', |
|
55
|
|
|
'Safety' => 'directory.php?filter=Safety', |
|
56
|
|
|
'Site-Ops' => 'directory.php?filter=site-ops', |
|
57
|
|
|
'Site Prep' => 'directory.php?filter=siteprep', |
|
58
|
|
|
'Site Sign-Off' => 'directory.php?filter=sign-off', |
|
59
|
|
|
'Volunteer Coordinator' => 'directory.php?filter=vc' |
|
60
|
|
|
); |
|
61
|
|
|
$this->addLink('<span class="fa fa-dashboard"></span> Dashboard', 'index.php'); |
|
62
|
|
|
$this->addLink('<span class="fa fa-th-list"></span> Directory', false, $dirMenu); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
public function isAdmin() |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->is_lead; |
|
68
|
|
|
} |
|
69
|
|
|
} |
|
70
|
|
|
?> |
|
|
|
|
|
|
71
|
|
|
|
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.