id = $id;
$this->imgSpace = $imgSpace;
$this->itemSpace = $itemSpace;
$this->items = array();
}
function addItem($title,$url,$img,$active,$show=true,$id=NULL)
{
if($show)
{
if (is_array($url)) {
$link = $url[0];
$ahtml = (!empty($url[1])) ? ' '.$url[1] : '';
} else {
$link = $url;
$ahtml = '';
}
$this->items[] =
'
'.
(($img) ? ''.$this->imgSpace : '').
''.$title.''."\n";
}
}
function draw()
{
$res = ''."\n";
if (count($this->items) > 0) {
for ($i=0; $iitems); $i++)
{
if ($i+1 < count($this->items) && $this->itemSpace != '') {
$res .= preg_replace('|$|',$this->itemSpace.'',$this->items[$i]);
$res .= "\n";
} else {
$res .= $this->items[$i]."\n";
}
}
} else {
$res .= '-
';
}
$res .= '
'."\n";
return $res;
}
}
?>