Current Path :
/
home
/
develito
/
www
/
modules
/
mod_vvisit_counter
/
fields
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/www/modules/mod_vvisit_counter/fields/jscolor.php
<?php /** * @package Vinaora Extensions * @copyright Copyright (C) 2011-2015 VINAORA. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * @website http://vinaora.com * @twitter https://twitter.com/vinaora * @facebook https://www.facebook.com/pages/Vinaora/290796031029819 * @google+ https://plus.google.com/111142324019789502653 */ // no direct access defined('_JEXEC') or die; jimport('joomla.form.formfield'); /** * Form Field class for the Joomla Framework. * */ class JFormFieldJSColor extends JFormField { protected $type = 'JSColor'; public function getInput() { $module = strrchr(dirname(__DIR__), 'mod_'); $doc =& JFactory::getDocument(); $doc->addScript( JUri::root(true) . "/media/{$module}/jscolor/jscolor.js" ); // Add 'color' class CSS if not exits if(stripos((string) $this->element['class'], 'color') === false) { $this->element['class'] = 'color ' . $this->element['class']; } // Initialize some field attributes. $size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; $maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : ''; $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; $readonly = ((string) $this->element['readonly'] == 'true') ? ' readonly="readonly"' : ''; $disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : ''; $required = $this->required ? ' required="required" aria-required="true"' : ''; // Initialize JavaScript field attributes. $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : ''; return '<input type="text" name="' . $this->name . '" id="' . $this->id . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . $required . '/>'; } }