For a project I'm converting I needed a tabbed view with all tabs closed initially. CTabView doesn't like that, but I wanted to use the build-in version. For that reason I extended CTabview with an additional control: noTab.
class MyTabView extends CTabView
{
public $noTab = false;
protected function renderHeader()
{
if ($this->noTab === true)
$this->activeTab='';
echo "<ul>n";
foreach($this->tabs as $id=>$tab)
{
$title=isset($tab['title'])?$tab['title']:'undefined';
$active=$id===$this->activeTab?' class="active"' : '';
$url=isset($tab['url'])?$tab['url']:"#{$id}";
echo "<li><a href="{$url}"{$active}><span>{$title}</span></a></li>n";
}
echo "</ul>n";
}
}
The Title is not urlencoded anymore, so it will accept HTML too, that way you can add some nice thumbnail image besides your title.
-edit- There was some CSS here… Looked nice in FF, but IE ahem, well @#$^@#$!