getInput(); } /** * Get the rendering of this field type for a repeatable (grid) display, * e.g. in a view listing many item (typically a "browse" task) * * @since 2.0 * * @return string The field HTML */ public function getRepeatable() { return $this->getInput(); } /** * Get the rendering of this field type for static display, e.g. in a single * item view (typically a "read" task). * * @since 2.0 * * @return string The field HTML */ public function getInput() { $this->label = ''; $allowedElement = array('button', 'a'); if (in_array($this->element['htmlelement'], $allowedElement)) { $type = $this->element['htmlelement']; } else { $type = 'button'; } $text = $this->element['text'] ? (string) $this->element['text'] : ''; $class = $this->class ? $this->class : ''; $icon = $this->element['icon'] ? ' ' : ''; if ($this->element['listItemTask']) { $this->onclick = "listItemTask('cb" . $this->item->getId() . "', '" . (string)$this->element['listItemTask'] . "')"; } $onclick = $this->onclick ? 'onclick="' . $this->onclick . '" ' : ''; $url = $this->element['url'] ? 'href="' . $this->parseFieldTags((string) $this->element['url']) . '" ' : ''; $title = $this->element['title'] ? 'title="' . JText::_((string) $this->element['title']) . '" ' : ''; $useValue = StringHelper::toBool((string) $this->element['use_value']); if (!$useValue) { $this->value = JText::_($text); } $html = '<' . $type . ' id="' . $this->id . '" class="btn ' . $class . '" ' . $onclick . $url . $title . '>'; $html .= $icon . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8'); $html .= ''; return $html; } /** * Method to get the field title. * * @return string The field title. */ protected function getTitle() { return null; } }