title = array() ; $this->content = array() ; $this->image = array() ; $this->activated = 0 ; } /** ==================================================================================================================================================== * Add a tabulation * For instance, * $tabs = new SLFramework_Tabs() ;
ob_start() ;
echo "Content 1" ;
$tabs->add_tab("Tab1", ob_get_clean() ) ;
ob_start() ;
echo "Content 2" ;
$tabs->add_tab("Tab2", ob_get_clean() ) ;
echo $tabs->flush() ;
* will create to basic tabulation. * @param string $title the title of the tabulation * @param string $content the HTML content of the tab * @param string $image the path of an image that will be display before the title. Please indicate a 20x20px image. * @return void */ function add_tab($title, $content, $image="") { $this->title[] = $title ; $this->content[] = $content ; $this->image[] = $image ; } /** ==================================================================================================================================================== * Change the tabs activated by default (normally it is the first tab i.e. 1) * 1 is the first, 2 is the second, etc. * * @param integer $nb the tabultaion index to activate * @return void */ function activate($nb) { $this->activated = $nb-1 ; } /** ==================================================================================================================================================== * Print the tabulation HTML code. * * @return void */ function flush() { global $_SERVER ; ob_start() ; $rnd = rand(1, 100000) ; ?>
title) ; $i++) { ?>
content[$i] ; ?>