00001 <?php
00002
00008 class TKSwitchTabAction extends TKAction {
00009 protected $tabView;
00010 protected $tab;
00011 protected $styleChanges;
00012 protected $tabHandle;
00013
00015 public function __construct($tabView, $tab, $tabHandle, $addJS, $styleChanges) {
00016 parent::__construct();
00017
00018 $this->tabView = $tabView;
00019 $this->tab = $tab;
00020 $this->styleChanges = $styleChanges;
00021 $this->tabHandle = $tabHandle;
00022
00023 if($addJS) {
00024 Toolkit::addExtraJS("var tkv_tabView_idx_" . $tabView->getID()
00025 . " = '" . $tab->getID() . "';\n");
00026 Toolkit::addExtraJS("var tkv_tabView_hidx_" . $tabView->getID()
00027 . " = '" . $tabHandle->getID() . "';\n");
00028 }
00029 }
00030
00032 public function getInvocation() {
00033 $collect = "tk_doSwitchTab('tkv_tabView_idx_" . $this->tabView->getID()
00034 . "', '" . $this->tab->getID() . "', 'tkv_tabView_hidx_"
00035 . $this->tabView->getID() . "', '" . $this->styleChanges['oldClass']
00036 . "', '" . $this->tabHandle->getID() . "', '"
00037 . $this->styleChanges['newClass'] . "')";
00038 return $collect;
00039 }
00040 }
00041
00042 ?>