forked from gburton/CE-Phoenix
-
Notifications
You must be signed in to change notification settings - Fork 1
/
box.php
executable file
·60 lines (46 loc) · 1.84 KB
/
box.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
<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
Example usage:
$heading = array();
$heading[] = array('params' => 'class="menuBoxHeading"',
'text' => BOX_HEADING_TOOLS,
'link' => tep_href_link(basename($PHP_SELF));
$contents = array();
$contents[] = array('text' => SOME_TEXT);
$box = new box;
echo $box->infoBox($heading, $contents);
*/
class box extends tableBlock {
function __construct() {
$this->heading = array();
$this->contents = array();
}
function infoBox($heading, $contents) {
$this->table_row_parameters = 'class="infoBoxHeading"';
$this->table_data_parameters = 'class="infoBoxHeading"';
$this->heading = $this->tableBlock($heading);
$this->table_row_parameters = '';
$this->table_data_parameters = 'class="infoBoxContent"';
$this->contents = $this->tableBlock($contents);
return $this->heading . $this->contents;
}
function menuBox($heading, $contents) {
$this->table_data_parameters = 'class="menuBoxHeading"';
if (isset($heading[0]['link'])) {
$this->table_data_parameters .= ' onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . $heading[0]['link'] . '\'"';
$heading[0]['text'] = ' <a href="' . $heading[0]['link'] . '" class="menuBoxHeadingLink">' . $heading[0]['text'] . '</a> ';
} else {
$heading[0]['text'] = ' ' . $heading[0]['text'] . ' ';
}
$this->heading = $this->tableBlock($heading);
$this->table_data_parameters = 'class="menuBoxContent"';
$this->contents = (!empty($contents) ? $this->tableBlock($contents) : '');
return $this->heading . $this->contents;
}
}
?>