| 1 |
<?php |
| 2 |
/** |
| 3 |
* This file contains the CSSContainer widget |
| 4 |
* |
| 5 |
* $Id: CSSContainer.inc,v 1.1 2002/12/07 03:14:15 hemna Exp $ |
| 6 |
* |
| 7 |
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
| 8 |
* @package phpHtmlLib |
| 9 |
* |
| 10 |
*/ |
| 11 |
|
| 12 |
|
| 13 |
/** |
| 14 |
* This class is a container for CSSBuilder |
| 15 |
* objects. It is meant to make the |
| 16 |
* theming of many CSSBuilder objects easy |
| 17 |
* to manage. |
| 18 |
* |
| 19 |
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
| 20 |
* @package phpHtmlLib |
| 21 |
*/ |
| 22 |
class CSSContainer extends BaseWidget { |
| 23 |
|
| 24 |
/** |
| 25 |
* Only allow the adding of CSSBuilder |
| 26 |
* child classes |
| 27 |
* |
| 28 |
*/ |
| 29 |
function add() { |
| 30 |
$args = func_get_args(); |
| 31 |
foreach( $args as $arg ) { |
| 32 |
if (is_subclass_of($arg, "CSSBuilder")) { |
| 33 |
BaseWidget::add( $arg ); |
| 34 |
} |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
/** |
| 40 |
* This walks all of the |
| 41 |
* CSSBuilder objects |
| 42 |
* and calls their respective update_all_values |
| 43 |
* method. |
| 44 |
* |
| 45 |
* NOTE: This must be called AFTER all the classes |
| 46 |
* have been added. |
| 47 |
* |
| 48 |
* @param string - the property that the search lives in |
| 49 |
* @param string - the original value to find |
| 50 |
* @param string - the new value |
| 51 |
*/ |
| 52 |
function update_all_values( $property, $search, $value ) { |
| 53 |
|
| 54 |
$count = $this->count_content(); |
| 55 |
for ($i=0; $i<$count; $i++) { |
| 56 |
$this->_content[$i]->update_all_values($property, $search, $value ); |
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
} |
| 61 |
?> |