modules = array();
$this->width = $width."%";
$this->class = "page_column page_column_again column";
$this->id_extra = $id_extra;
$this->bgColor = "";
}
public function setBgColor($bgColor){$this->bgColor = $bgColor;}
public function setClass( $position = '' ){
$this->class .= "_".$position;
}
public function clear(){
$this->modules = array();
}
public function addModule( $module ){
$this->modules[] = $module;
}
public function numModules(){
return count($this->modules);
}
public function getHTML(){
GLOBAL $COLUMN_NUMBER;
GLOBAL $LI_NUMBER;
$html = "";
$html .= "
\n";
if(count($this->modules) == 0){
$html .= "-
\n"; // for validation
} else {
foreach( $this->modules as $module ){
//Special case for Ad Modules - allow them to calculate their optimal size.
if(get_class($module) == "AdModule"){
$width = floor((CSS_WRAPPER_MIN_WIDTH * $this->width) / 100); // width in pixels of the column
$module->informSize($width, 0, $this->bgColor);
}
$html .= " \n";
$LI_NUMBER++;
}
}
$html .= "
\n";
$COLUMN_NUMBER++;
return $html;
}
////
// Displays the code for the modules inside of the column without any markup for the column itself.
////
public function getContentOnly(){
GLOBAL $COLUMN_NUMBER;
if(count($this->modules) == 0){
$html .= " \n"; // for validation
} else {
foreach( $this->modules as $module ){
//Special case for Ad Modules - allow them to calculate their optimal size.
if(get_class($module) == "AdModule"){
$width = floor((CSS_WRAPPER_MIN_WIDTH * $this->width) / 100); // width in pixels of the column
$module->informSize($width, 0, $this->bgColor);
}
$html .= $module->getHTML();
}
}
$COLUMN_NUMBER++;
}
} // end class Column
?>