Current Path :
/
home
/
develito
/
public_html
/
libraries-new
/
syw-
/
fields
/
Or
Select Your Path :
Upload File :
New :
File
Dir
//home/develito/public_html/libraries-new/syw-/fields/imagelink.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 JFormFieldImageLink extends JFormField { public $type = 'ImageLink'; protected function getLabel() { $html = ''; $title = trim($this->element['title']); $image_src = $this->element['imagesrc']; // path ex: ../modules/mod_latestnews/images/icon.png $link = $this->element['link']; $html .= '<div style="clear: both;">'; $html .= '<a href="'.$link.'" target="_blank" title="'.JText::_($title).'">'; if ($image_src) { $html .= '<img src="'.JURI::root().$image_src.'" alt="'.JText::_($title).'">'; } else { $html .= JText::_($title); } $html .= '</a>'; $html .= '</div>'; return $html; } protected function getInput() { $title = trim($this->element['title']); $image_src = $this->element['imagesrc']; $text = trim($this->element['text']); $link = $this->element['link']; $titleintext = false; if ($this->element['titleintext']) { $titleintext = ($this->element['titleintext'] === 'true'); } $html = '<div style="padding-top: 5px; overflow: inherit">'; if ($titleintext) { $html .= '<strong>'.JText::_($title).'</strong>: '; } if ($text) { $html .= JText::sprintf($text, $link); } $html .= '</div>'; return $html; } } ?>