ILIAS  release_7 Revision v7.30-3-g800a261c036
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
4require_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 $caption .= '<span class="' . $this->leftGlyph . '"></span> ';
39 }
40
41 $caption .= parent::renderCaption();
42
43 if ($this->rightGlyph) {
44 $caption .= ' <span class="' . $this->rightGlyph . '"></span>';
45 }
46
47 return $caption;
48 }
49 // fau.
50
54 public function getNextCommand()
55 {
56 return $this->nextCommand;
57 }
58
63 {
64 $this->nextCommand = $nextCommand;
65 }
66
70 public function render()
71 {
72 $this->prepareRender();
73
74 $attr = array(
75 'href' => $this->getUrl() ? $this->getUrl() : "#",
76 'target' => $this->getTarget()
77 );
78
79 if (strlen($this->getNextCommand())) {
80 $attr['data-nextcmd'] = $this->getNextCommand();
81 }
82
83 return '<a' . $this->renderAttributes($attr) . '>' . $this->renderCaption() . '</a>';
84 }
85
86 public static function getInstance()
87 {
88 return new self(self::TYPE_LINK);
89 }
90}
An exception for terminatinating execution or to throw for unit testing.
prepareRender()
Prepare render.
getTarget()
Get target.
renderAttributes(array $a_additional_attr=null)
Render current HTML attributes.string
renderCaption()
Prepare caption for render.