PK Ž!]ÆÁ5™
imagelist.xmlnu &1i„
plg_fields_imagelistJoomla! ProjectMarch 2016(C) 2016 Open Source Matters, Inc.GNU General Public License version 2 or later; see LICENSE.txtadmin@joomla.orgwww.joomla.org3.7.0PLG_FIELDS_IMAGELIST_XML_DESCRIPTIONimagelist.phpparamstmplen-GB.plg_fields_imagelist.inien-GB.plg_fields_imagelist.sys.ini
PK Ž!]%mýau u
imagelist.phpnu &1i„
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::import('components.com_fields.libraries.fieldsplugin', JPATH_ADMINISTRATOR);
/**
* Fields Imagelist Plugin
*
* @since 3.7.0
*/
class PlgFieldsImagelist extends FieldsPlugin
{
/**
* Transforms the field into a DOM XML element and appends it as a child on the given parent.
*
* @param stdClass $field The field.
* @param DOMElement $parent The field node parent.
* @param JForm $form The form.
*
* @return DOMElement
*
* @since 3.7.0
*/
public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form)
{
$fieldNode = parent::onCustomFieldsPrepareDom($field, $parent, $form);
if (!$fieldNode)
{
return $fieldNode;
}
$fieldNode->setAttribute('hide_default', 'true');
$fieldNode->setAttribute('directory', '/images/' . $fieldNode->getAttribute('directory'));
return $fieldNode;
}
}
PK Ž!]ÆoÐlÉ É tmpl/imagelist.phpnu &1i„
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
if ($field->value == '')
{
return;
}
$class = $fieldParams->get('image_class');
if ($class)
{
// space before, so if no class sprintf below works
$class = ' class="' . htmlentities($class, ENT_COMPAT, 'UTF-8', true) . '"';
}
$value = (array) $field->value;
$buffer = '';
foreach ($value as $path)
{
if (!$path || $path == '-1')
{
continue;
}
if ($fieldParams->get('directory', '/') !== '/')
{
$buffer .= sprintf('',
$fieldParams->get('directory'),
htmlentities($path, ENT_COMPAT, 'UTF-8', true),
$class
);
}
else
{
$buffer .= sprintf('',
htmlentities($path, ENT_COMPAT, 'UTF-8', true),
$class
);
}
}
echo $buffer;
PK Ž!]‰hE… params/imagelist.xmlnu &1i„ PK Ž!]ÆÁ5™
M imagelist.xmlnu &1i„ PK Ž!]%mýau u
¨ imagelist.phpnu &1i„ PK Ž!]ÆoÐlÉ É Z tmpl/imagelist.phpnu &1i„ PK @ e