id; $onchange = (string) $this->element['onchange']; $size = ($v = $this->element['size']) ? ' size="' . $v . '"' : ''; $class = ($v = $this->element['class']) ? ' class="' . $v . '"' : 'class="text_area"'; $required = ($v = $this->element['required']) ? ' required="required"' : ''; // Initialize some field attributes. $attr = $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : ''; $attr .= $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : ''; $idA = 'phFileNameModal'; // If external image, we don't need the filename will be required $extId = (int) $this->form->getValue('extid'); if ($extId > 0) { $readonly = ' readonly="readonly"'; $attr = ''; return ''; } /*$script = array(); $script[] = ' function phocaSelectFileName_'.$this->id.'(title) {'; $script[] = ' document.getElementById("'.$this->id.'").value = title;'; $script[] = ' '.$onchange; $script[] = ' jQuery(\'#'.$idA.'\').modal(\'toggle\');'; $script[] = ' }'; JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));*/ HTMLHelper::_('jquery.framework'); /* JFactory::getDocument()->addScriptDeclaration(' function phocaSelectFileName_' . $this->id . '(name) { document.getElementById("' . $this->id . '").value = name; jQuery(\'#'.$idA.'\').modal(\'toggle\'); } ');*/ $script = array(); $script[] = ' function phocaSelectFileName_'.$this->id.'(title) {'; $script[] = ' document.getElementById("'.$this->id.'").value = title;'; $script[] = ' '.$onchange; //$script[] = ' jModalClose();'; $script[] = ' jQuery(\'#'.$idA.'\').modal(\'toggle\');'; //$script[] = ' SqueezeBox.close();'; //$script[] = ' jQuery(\'#'.$idA.'\').modal(\'toggle\');'; $script[] = ' }'; // Add the script to the document head. Factory::getDocument()->addScriptDeclaration(implode("\n", $script)); $html[] = '