File: /home/confeduphaar/backip-old-files/libraries/syw/fields/sywonlinehelp.php
<?php
/**
* @copyright Copyright (C) 2011 Simplify Your Web, Inc. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die ;
jimport('joomla.form.formfield');
class JFormFieldSYWOnlineHelp extends JFormField
{
protected $type = 'SYWOnlineHelp';
protected $title;
protected $heading;
protected $layer_class;
protected $url;
protected function getLabel()
{
return '';
}
protected function getInput()
{
JHtml::_('script', 'syw/fields.js', false, true);
JHtml::_('stylesheet', 'syw/fields.css', false, true);
JHtml::_('stylesheet', 'syw/fonts-min.css', false, true);
$html = array();
$html[] = !empty($this->title) ? '<'.$this->heading.'>'.JText::_($this->title).'</'.$this->heading.'>' : '';
$html[] = '<table style="width: 100%"><tr>';
$html[] = !empty($this->description) ? '<td style="background-color: transparent">'.JText::_($this->description).'</td>' : '';
if ($this->url) {
$html[] = '<td style="text-align: right; background-color: transparent">';
$html[] = '<a href="'.$this->url.'" target="_blank" class="btn btn-info btn-small"><i class="SYWicon-local-library"></i> <span>'.JText::_('JHELP').'</span></a>';
$html[] = '</td>';
}
$html[] = '</tr></table>';
return '<div class="syw_help'.$this->layer_class.'" style="margin-bottom: 0">'.implode($html).'</div>';
}
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$return = parent::setup($element, $value, $group);
if ($return) {
$this->title = !empty($this->element['label']) ? (string)$this->element['label'] : (isset($this->element['title']) ? (string)$this->element['title'] : '');
$this->heading = isset($this->element['heading']) ? (string)$this->element['heading'] : 'h4';
$this->layer_class = isset($this->class) ? ' ' . $this->class : (isset($this->element['class']) ? ' ' . ((string)$this->element['class']) : '');
$this->url = isset($this->element['url']) ? (string)$this->element['url'] : '';
}
return $return;
}
}