-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHomeboxTab.class.inc
56 lines (45 loc) · 1.1 KB
/
HomeboxTab.class.inc
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
<?php
/**
* @file
* TODO Add file description for Tab Class
*/
class HomeboxTab {
private $name = NULL;
private $slug = NULL;
// private $url = NULL;
private $boxes = array();
public function __construct($name = NULL) {
$this->name = $name;
$this->setSlug($name);
// $this->url = url('homebox/get/tab/'. $this->slug);
}
public function __destruct() {
module_invoke_all('hombebox_tab_destruct', $this);
}
public function setName($name) {
if (!is_null($name)) {
$this->name = $name;
}
$this->name = t('New tab');
}
public function getName() {
return $this->name;
}
private function setSlug($name) {
if (!is_null($name)) {
$this->slug = drupal_strtolower(str_replace(' ', '-', $name));
return $this->slug;
}
return $this->slug = t('new-tab');
}
// public function getUrl() {
// return $this->url;
// }
public function getSlug() {
return $this->slug;
}
public function addBox(&$box_object) {
// Check array_push() for keyed value pairs
return array_push($this->boxes, $box_object);
}
}