ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilTestPlayerNavButton.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
5 
13 {
17  private $nextCommand = '';
18 
19 // fau: testNav - add glyphicon support for navigation buttons
20  private $leftGlyph = '';
21  private $rightGlyph = '';
22 
23  public function setLeftGlyph($glyph)
24  {
25  $this->leftGlyph = $glyph;
26  }
27 
28  public function setRightGlyph($glyph)
29  {
30  $this->rightGlyph = $glyph;
31  }
32 
33  protected function renderCaption()
34  {
35  $caption = '';
36 
37  if ($this->leftGlyph)
38  {
39  $caption .= '<span class="'.$this->leftGlyph.'"></span> ';
40  }
41 
42  $caption .= parent::renderCaption();
43 
44  if ($this->rightGlyph)
45  {
46  $caption .= ' <span class="'.$this->rightGlyph.'"></span>';
47  }
48 
49  return $caption;
50  }
51 // fau.
52 
56  public function getNextCommand()
57  {
58  return $this->nextCommand;
59  }
60 
64  public function setNextCommand($nextCommand)
65  {
66  $this->nextCommand = $nextCommand;
67  }
68 
72  public function render()
73  {
74  $this->prepareRender();
75 
76  $attr = array(
77  'href' => $this->getUrl() ? $this->getUrl() : "#",
78  'target' => $this->getTarget()
79  );
80 
81  if( strlen($this->getNextCommand()) )
82  {
83  $attr['data-nextcmd'] = $this->getNextCommand();
84  }
85 
86  return '<a'.$this->renderAttributes($attr).'>'.$this->renderCaption().'</a>';
87  }
88 
89  public static function getInstance()
90  {
91  return new self(self::TYPE_LINK);
92  }
93 }
prepareRender()
Prepare render.
Create styles array
The data for the language used.
getTarget()
Get target.