芝麻web文件管理V1.00
编辑当前文件:/home/asmplong/www/ancien-site-2019/site/libraries/joomla/form/fields/media.php
element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id'; $authorField= $this->element['created_by_field'] ? (string) $this->element['created_by_field'] : 'created_by'; $asset = $this->form->getValue($assetField) ? $this->form->getValue($assetField) : (string) $this->element['asset_id'] ; if ($asset == '') { $asset = JRequest::getCmd('option'); } $link = (string) $this->element['link']; if (!self::$initialised) { // Load the modal behavior script. JHtml::_('behavior.modal'); // Build the script. $script = array(); $script[] = ' function jInsertFieldValue(value, id) {'; $script[] = ' var old_id = document.id(id).value;'; $script[] = ' if (old_id != id) {'; $script[] = ' var elem = document.id(id)'; $script[] = ' elem.value = value;'; $script[] = ' elem.fireEvent("change");'; $script[] = ' }'; $script[] = ' }'; // Add the script to the document head. JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); self::$initialised = true; } // Initialize variables. $html = array(); $attr = ''; // Initialize some field attributes. $attr .= $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : ''; $attr .= $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : ''; // Initialize JavaScript field attributes. $attr .= $this->element['onchange'] ? ' onchange="'.(string) $this->element['onchange'].'"' : ''; // The text field. $html[] = '
'; $html[] = '
'; $html[] = '
'; $directory = (string)$this->element['directory']; if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value)) { $folder = explode ('/',$this->value); array_shift($folder); array_pop($folder); $folder = implode('/',$folder); } elseif (file_exists(JPATH_ROOT . '/' . JComponentHelper::getParams('com_media')->get('image_path', 'images') . '/' . $directory)) { $folder = $directory; } else { $folder=''; } // The button. $html[] = '
'; $html[] = '
'; $html[] = '
'; $html[] = ' '.JText::_('JLIB_FORM_BUTTON_SELECT').'
'; $html[] = '
'; $html[] = '
'; $html[] = '
'; $html[] = '
'; $html[] = '
'; $html[] = ' '.JText::_('JLIB_FORM_BUTTON_CLEAR').'
'; $html[] = '
'; $html[] = '
'; return implode("\n", $html); } }