1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: 19: 20: 21: 22: 23:
24: class cGuiList {
25:
26: protected $cells;
27:
28: public function __construct() {
29: $this->cells = array();
30: }
31:
32: public function setCell($item, $cell, $value) {
33: $this->cells[$item][$cell] = $value;
34: }
35:
36: public function render($print = false) {
37: global $cfg;
38:
39: $backendPath = cRegistry::getBackendPath();
40:
41: $tpl = new cTemplate();
42: $tpl2 = new cTemplate();
43:
44: $colcount = 0;
45:
46: if (is_array($this->cells)) {
47: foreach ($this->cells as $row => $cells) {
48: $thefont = '';
49: $unne = '';
50:
51: $colcount++;
52:
53: $content = "";
54: $count = 0;
55:
56: foreach ($cells as $key => $value) {
57: $count++;
58: $tpl2->reset();
59:
60: $tpl2->set('s', 'CONTENT', $value);
61: if ($colcount == 1) {
62: $content .= $tpl2->generate($backendPath . $cfg['path']['templates'] . $cfg['templates']['generic_list_head'], true);
63: } else {
64: $content .= $tpl2->generate($backendPath . $cfg['path']['templates'] . $cfg['templates']['generic_list_row'], true);
65: }
66: }
67:
68: $tpl->set('d', 'ROWS', $content);
69: $tpl->next();
70: }
71: }
72:
73: $rendered = $tpl->generate($backendPath . $cfg['path']['templates'] . $cfg['templates']['generic_list'], true);
74:
75: if ($print == true) {
76: echo $rendered;
77: } else {
78: return $rendered;
79: }
80: }
81:
82: }
83:
84: ?>