| 4 |
* $Id$ |
* $Id$ |
| 5 |
* |
* |
| 6 |
* $Log$ |
* $Log$ |
| 7 |
|
* Revision 1.2 2003/06/06 04:22:11 joko |
| 8 |
|
* modifications to be a more advanced abstract base class |
| 9 |
|
* |
| 10 |
* Revision 1.1 2003/05/13 16:22:22 joko |
* Revision 1.1 2003/05/13 16:22:22 joko |
| 11 |
* initial commit |
* initial commit |
| 12 |
* |
* |
| 32 |
|
|
| 33 |
function InfoBox($args = array()) { |
function InfoBox($args = array()) { |
| 34 |
$this->_args = $args; |
$this->_args = $args; |
| 35 |
|
$this->settings(); |
| 36 |
$this->build_default(); |
$this->build_default(); |
| 37 |
} |
} |
| 38 |
|
|
| 40 |
return $this->_box->render(); |
return $this->_box->render(); |
| 41 |
} |
} |
| 42 |
|
|
| 43 |
|
function settings() { |
| 44 |
|
$this->SETTINGS = array( |
| 45 |
|
font_family => 'Verdana', |
| 46 |
|
font_size => '12', |
| 47 |
|
background => 'lightblue', |
| 48 |
|
width => '450', |
| 49 |
|
padding => 8 |
| 50 |
|
); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
function build_default() { |
function build_default() { |
| 54 |
$this->_box = html_div(); |
$this->_box = html_div(); |
| 55 |
$this->_box->set_style("border: 1px groove black; padding:2px; width: 450px; background:lightblue; font-size:12px;"); |
extract($this->SETTINGS); |
| 56 |
|
$line_height = $font_size + $padding - 1; |
| 57 |
|
$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;"); |
| 58 |
$this->_box->add($this->_args[payload]); |
$this->_box->add($this->_args[payload]); |
| 59 |
} |
} |
| 60 |
|
|