-
Notifications
You must be signed in to change notification settings - Fork 3
/
class.owaestype.php
75 lines (68 loc) · 1.98 KB
/
class.owaestype.php
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
define ("DIRECTION_SPEND", 0);
define ("DIRECTION_EARN", 1);
function owaestype($vKey = NULL) { // FUNCTION owaestype(5) == CLASS new owaestype(5)
return new owaestype($vKey);
}
class owaestype {
private $arTypes;
private $iType = 0;
public function owaestype($vKey = NULL) {
$this->arTypes = array(
1 => array(
"key" => "ervaring",
"title" => "Werkervaring",
"iconclass" => "icon-werkervaring",
"direction" => DIRECTION_SPEND,
"minimumlevel" => settings("rights", "add-ervaring"),
),
2 => array(
"key" => "opleiding",
"title" => "Opleiding",
"iconclass" => "icon-opleiding",
"direction" => DIRECTION_EARN,
"minimumlevel" => settings("rights", "add-opleiding"),
),
3 => array(
"key" => "infra",
"title" => "Delen",
"iconclass" => "icon-delen",
"direction" => DIRECTION_EARN,
"minimumlevel" => settings("rights", "add-infra"),
),
);
foreach ($this->arTypes as $iKey=>$arType) {
if ($vKey == $iKey) $this->iType = $iKey;
if ($vKey == $arType["key"]) $this->iType = $iKey;
}
}
public function getAllTypes() {
$arTypes = array();
foreach ($this->arTypes as $iID=>$arType) $arTypes[$arType["key"]] = $arType["title"];
return $arTypes;
}
public function task() {
return ($this->arTypes[$this->iType]["direction"] == DIRECTION_SPEND);
}
public function key() {
return $this->arTypes[$this->iType]["key"];
}
public function title() {
return $this->arTypes[$this->iType]["title"];
}
public function minimumlevel() {
return $this->arTypes[$this->iType]["minimumlevel"];
}
public function __toString() {
return $this->arTypes[$this->iType]["title"];
}
public function id() {
return $this->iType;
}
public function direction() {
return $this->arTypes[$this->iType]["direction"];
}
public function iconclass() {
return $this->arTypes[$this->iType]["iconclass"];
}
}