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
|
<?php
class MASK {
var $id; // MaskID
var $ids; // List of items
function __construct(&$props = NULL) {
if ((is_array($props))&&(isset($props["db_mask"]))) {
if ($props["db_mask"]===false) {
$this->ids = array();
$this->id = "none";
} else if (($props["db_mask"]=="all")||($props["db_mask"]=="")) {
$this->ids = false;
$this->id = "all";
} else {
$this->ids = split(",", $props["db_mask"]);
if (count($this->ids)) {
$this->id = "custom";
} else {
$this->ids = false;
$this->id = "all";
}
}
} else {
$this->ids = false;
$this->id = "all";
}
}
function Check($id) {
if (($this->ids===false)||(in_array($id, $this->ids))) return true;
return false;
}
function GetIDs() {
return $this->ids;
}
}
?>
|