Deutschland United States United Kingdom
ContentLion - Open Source CMS

tabber.php

Rev 3 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log

<?php

class Plugin_Tabber_Tabber {

    protected $tabs = array();
    protected $customStyle = null;
   
    public function __construct () {
        //
    }
   
    public function addCustomStyleClass ($class = "tabberlive") {
        $this->customStyle = $class;
    }                  
   
    public function addTab (Plugin_Tabber_Tab $tab) {
        $this->tabs[] = $tab;
    }
   
    public function getCode () {
        if ($this->customStyle == null) {
            $code = "<div class=\"tabber\">";
        } else {
            $code = "<div class=\"" . $this->customerStyle . "\">";
        }
       
        foreach ($this->tabs as $tab) {
            $code .= $tab->getCode();
        }
       
        EventManager::raiseEvent("tabber_get_tabber", array('code' => &$code, 'instance' => &$this));
       
        $code .= "</div>";
        return $code;
    }
   
    public function show () {
        echo $this->getCode();
    }
   
}

?>