00001 <?php
00002
00007 class TKLinkAction extends TKAction {
00008 protected $dest;
00009 protected $newWindow;
00010
00011 protected static $nextWindow = 0;
00012
00018 public function __construct($dest, $newWindow = false) {
00019 parent::__construct();
00020
00021 $this->dest = $dest;
00022 $this->newWindow = $newWindow;
00023 }
00024
00026 public function getInvocation() {
00027 $i = self::$nextWindow++;
00028 if($this->newWindow)
00029 return "window.open('$this->dest', 'journalwindow$i')";
00030 else
00031 return "window.location='" . $this->dest . "'";
00032 }
00033
00035 public static function createFromXML($attrs, $children) {
00036 $dest = $attrs['dest'];
00037 $obj = new TKLinkAction($dest);
00038 return $obj;
00039 }
00040 }
00041
00042 ?>