function select($tid) { if ($this->tab_event) { Event::trigger($this->tab_event, $this); } if ($this->vars['tabs']) { if (!isset($this->vars['tabs'][$tid])) { $tid = key($this->vars['tabs']); } $this->vars['tabs'][$tid]['active'] = TRUE; $this->vars['selected'] = $tid; if ($this->content_event) { Event::trigger_one($this->content_event, $tid, $this); } } return $this; }