ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilJsLinkButton.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once "Services/UIComponent/Button/classes/class.ilButton.php";
5 
12 class ilJsLinkButton extends ilButton
13 {
14  protected $target;
15 
16  public static function getInstance()
17  {
18  return new self(self::TYPE_LINK);
19  }
20 
25  public function setTarget($a_value)
26  {
27  $this->target = trim($a_value);
28  }
29 
34  public function getTarget()
35  {
36  return $this->target;
37  }
38 
43  protected function renderCaption()
44  {
45  return '&nbsp;' . $this->getCaption() . '&nbsp;';
46  }
47 
48  public function render()
49  {
50  $this->prepareRender();
51 
52  $attr = array();
53 
54  $attr["target"] = $this->getTarget();
55  $attr["name"] = $this->getName();
56  $attr["onclick"] = $this->getOnClick();
57 
58  return '<a' . $this->renderAttributes($attr) . '>' .
59  $this->renderCaption() . '</a>';
60  }
61 }
getTarget()
Get target.
getOnClick()
Get onclick.
getCaption($a_translate=true)
Get caption.
prepareRender()
Prepare render.
setTarget($a_value)
Set target.
renderAttributes(array $a_additional_attr=null)
Render current HTML attributes.
renderCaption()
Prepare caption for render.