0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: colorpicker.php.tar
home/academiac/www/administrator/components/com_unitehcarousel/models/fields/colorpicker.php 0000604 00000003340 15137501050 0026713 0 ustar 00 <?php /** * @package Unite Horizontal Carousel for Joomla 1.7-2.5 * @author UniteCMS.net * @copyright (C) 2012 Unite CMS, All Rights Reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ defined('JPATH_BASE') or die; /** * Supports a modal article picker. * * @package Joomla.Administrator * @subpackage com_content * @since 1.6 */ class JFormFieldColorpicker extends JFormField { /** * The form field type. * * @var string * @since 1.6 */ protected $type = 'color_picker'; /** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput(){ //get script declaration HelperUniteHCar::addScript("farbtastic/farbtastic.js"); HelperUniteHCar::addStylesheet("farbtastic/farbtastic.css"); // Initialize some field attributes. $size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; $maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : ''; $class = ' class="color-picker"'; $readonly = ((string) $this->element['readonly'] == 'true') ? ' readonly="readonly"' : ''; $disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : ''; // 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 . '/>'; return $html; } } home/academiac/www/modules/mod_avatar_slide_galleria/fields/colorpicker.php 0000604 00000003303 15137503574 0023314 0 ustar 00 <?php defined('_JEXEC') or die( 'Restricted access' ); class JFormFieldcolorpicker extends JFormField { protected $type = 'colorpicker'; protected function getInput() { $document = JFactory::getDocument(); $base_path = JURI::root(true).'/modules/mod_avatar_slide_galleria/'; $color_code = '[255,0,0]'; $document->addScript($base_path.'assets/js/mooRainbow.js'); $document->addStyleSheet($base_path.'assets/css/mooRainbow.css'); if(strlen($this->value) == 7 && substr($this->value, 0, 1) == '#') { $color_code = '[' .hexdec(substr($this->value, 1, 2)) .',' .hexdec(substr($this->value, 3, 2)) .',' .hexdec(substr($this->value, 5, 2)) .']'; } $control_code = 'window.addEvent("domready", function() { ' .'new MooRainbow("'.$this->id.'", {' .' id: "'.$this->id.'", ' .' startColor: "'.$color_code.'", ' .' imgPath: "'.$base_path.'assets/images/", ' .'onChange: function(color) {' .' this.element.value = color.hex;' .'}, ' .'}); ' .'});'; $document->addScriptDeclaration($control_code); $html_code = '<input id="'.$this->id.'" name="'.$this->name.'" type="text" class="text_area" size="9" value="'.$this->value.'"/>'; return $html_code; } } ?>