-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHtmlUsers.class.php
88 lines (72 loc) · 2.29 KB
/
HtmlUsers.class.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
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
class HtmlUsers extends HtmlTable
{
private $_caption,
$_content,
$_attributes;
public function makeListTab($donnees)
{
$UsersTab = new HtmlTable();
$makeListTabRow = array();
$i = 0;
if (isset($donnees) && count($donnees))
{
foreach ($donnees as $donnees)
{
$makeListTabRow[$i] = new HtmlTableRow();
foreach ($donnees as $key => $value)
{
if ($key == 'pseudo' || $key == 'email' || $key == 'date')
{
$makeListTabCell = new HtmlTableCell();
$makeListTabCell->addAttribute('class', $key);
$makeListTabCell->addContent($value);
$makeListTabRow[$i]->addItem($makeListTabCell);
}
}
$UsersTab->addItem($makeListTabRow[$i]);
$i++;
}
if (isset($this->_caption))
$UsersTab->setCaption($this->_caption);
if (isset($this->_attributes))
{
foreach ($this->_attributes as $key => $value)
{
$UsersTab->addAttribute($key, $value);
}
}
$this->_content = ($UsersTab);
return (1);
}
else
return (0);
}
public function setCaption($caption)
{
if (isset($caption))
$this->_caption = $caption;
if ($this->_content)
$this->_content->setCaption($this->_caption);
}
public function toHtml()
{
return ($this->_content->tohtml());
}
public function getTableNumRows()
{
if ($this->_content)
{
return ($this->_content->getTableNumRows());
}
}
public function addAttribute($key, $value)
{
if (isset($key) && isset($value))
{
$this->_attributes[$key] = $value;
if ($this->_content)
$this->_content->addAttribute($key, $value);
}
}
}