/redirect/code/trunk/administrator/components/com_redirect/libraries/jxtended/form/fields/media.php
PHP | 70 lines | 37 code | 8 blank | 25 comment | 1 complexity | e042f247cd867303144403b3fbab0c38 MD5 | raw file
- <?php
- /**
- * @version $Id: media.php 390 2010-11-05 11:35:33Z eddieajau $
- * @package JXtended.Libraries
- * @subpackage Form
- * @copyright Copyright 2005 - 2010 New Life in IT Pty Ltd. All rights reserved.
- * @license GNU General Public License
- * @link http://www.theartofjoomla.com
- */
- defined('JPATH_BASE') or die;
- juimport('jxtended.form.formfield');
- /**
- * Form Field class for JXtended Libraries.
- *
- * @package JXtended.Libraries
- * @subpackage Form
- * @since 1.1
- */
- class JFormFieldMedia extends JFormField
- {
- /**
- * The field type.
- *
- * @var string
- */
- protected $type = 'Media';
- /**
- * Method to get the field input.
- *
- * @return string The field input.
- */
- protected function _getInput()
- {
- static $init = false;
- $html = '';
- if (!$init)
- {
- JHtml::_('behavior.modal');
- $js = "
- function jInsertFieldValue(value,id) {
- document.getElementById(id).value = value;
- }";
- $doc = &JFactory::getDocument();
- $doc->addScriptDeclaration($js);
- $init = true;
- }
- $link = $this->_element->attributes('link').$this->inputId;
- $size = $this->_element->attributes('size') ? 'size="'.$this->_element->attributes('size').'"' : '';
- $class = $this->_element->attributes('class') ? 'class="'.$this->_element->attributes('class').'"' : '';
- $html .= '<div style="float: left;">';
- $html .= '<input type="text" name="'.$this->inputName.'" id="'.$this->inputId.'" value="'.htmlspecialchars($this->value).'" '.$class.$size.' />';
- $html .= '</div>';
- $html .= '<div class="button2-left">';
- $html .= '<div class="blank">';
- $html .= '<a class="modal" title="'.JText::_('SELECT').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 650, y: 375}}">';
- $html .= JText::_('SELECT');
- $html .= '</a>';
- $html .= '</div>';
- $html .= '</div>';
- return $html;
- }
- }