1 |
<?php |
2 |
|
3 |
/** |
4 |
* $Id: InfoBox.php,v 1.1 2003/05/13 16:22:22 joko Exp $ |
5 |
* |
6 |
* $Log: InfoBox.php,v $ |
7 |
* Revision 1.1 2003/05/13 16:22:22 joko |
8 |
* initial commit |
9 |
* |
10 |
* |
11 |
*/ |
12 |
|
13 |
/** |
14 |
* InfoBox |
15 |
* |
16 |
* This implements a "infobox widget" using phpHtmlLib. |
17 |
* |
18 |
* Its purpose is to show a boxed html div-/span- area |
19 |
* containing descriptive html-/plain text. |
20 |
* |
21 |
* @author Andreas Motl <andreas.motl@ilo.de> |
22 |
* @package org.netfrag.glib |
23 |
* @name InfoBox |
24 |
* |
25 |
*/ |
26 |
class InfoBox { |
27 |
|
28 |
var $_box; |
29 |
|
30 |
function InfoBox($args = array()) { |
31 |
$this->_args = $args; |
32 |
$this->settings(); |
33 |
$this->build_default(); |
34 |
} |
35 |
|
36 |
function render() { |
37 |
return $this->_box->render(); |
38 |
} |
39 |
|
40 |
function settings() { |
41 |
$this->SETTINGS = array( |
42 |
font_family => 'Verdana', |
43 |
font_size => '12', |
44 |
background => 'lightblue', |
45 |
width => '450', |
46 |
padding => 8 |
47 |
); |
48 |
} |
49 |
|
50 |
function build_default() { |
51 |
$this->_box = html_div(); |
52 |
extract($this->SETTINGS); |
53 |
$line_height = $font_size + $padding - 1; |
54 |
$this->_box->set_style("border: 1px groove black; padding: {$padding}px; line-height: {$line_height}px; background: $background; color: $color; width: {$width}px; font-size: {$font_size}px; font-family: $font_family; font-weight: $font_weight;"); |
55 |
$this->_box->add($this->_args[payload]); |
56 |
} |
57 |
|
58 |
} |
59 |
|
60 |
?> |