File: /home/centralexf/www/modules/mod_jts_counterstats/admin/display.php
<?php
/**
* @version $Id: text.php 20196 2011-01-09 02:40:25Z ian $
* @package Joomla.Framework
* @subpackage Form
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
jimport('joomla.form.formfield');
/**
* Form Field class for the Joomla Framework.
*
* @package Joomla.Framework
* @subpackage Form
* @since 1.6
*/
class JFormFieldDisplay extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'display';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
$html = array();
$options = array ();
$folders = JFolder::folders(JPATH_ROOT.DS.'modules/mod_jts_counterstats/tmpl/images');
// Initialize some field attributes.
$class = $this->element['class'] ? ' class="radio '.(string) $this->element['class'].'"' : ' class="radio"';
$document = JFactory::getDocument();
$document->addStyleDeclaration('
#'.$this->id.' {width: 145px;}
#'.$this->id.' input {position: relative; top: 12px;}
fieldset.num label {min-width: 0 !important}
');
$html[] = '<fieldset id="'.$this->id.'"'.$class.'>';
foreach ($folders as $option)
{
$val = $option;
$text = "<img src='".JURI::root(). "/modules/mod_jts_counterstats/tmpl/images/".$option."/counter.png'/></br>";
$options[] = JHTML::_('select.option', $val, $text);
}
$html[] = JHTML::_('select.radiolist', $options, $this->name, '', 'value', 'text', $this->value, $this->id );
$html[] = "</fieldset>";
return implode("\n", $html);
}
}