| Current Path : /home/wuectly/www/03cbe/ |
| Current File : /home/wuectly/www/03cbe/fields.zip |
PK He$]��t3 3 searchplugins.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\Field\PluginsField;
use Joomla\CMS\Language\Text;
class JFormFieldSearchPlugins extends PluginsField
{
/**
* The form field type.
*
* @var string
*
* @since 11.1
*/
protected $type = 'SearchPlugins';
/**
* Method to attach a JForm object to the field.
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the `<field>` tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
*
* @return boolean True on success.
*
* @see JFormField::setup()
* @since 3.2
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
if (is_string($value) && strpos($value, ',') !== false) {
$value = explode(',', $value);
}
$return = parent::setup($element, $value, $group);
if ($return) {
$this->folder = 'search';
$this->element['useaccess'] = 'true';
}
return $return;
}
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options
*
* @since 11.4
*/
protected function getOptions()
{
$options = array();
$default = explode(',', $this->default);
foreach (parent::getOptions() as $item) {
if (in_array($item->value, $default)) {
continue;
}
// skip "newsfeeds"
if ($item->value == 'newsfeeds') {
continue;
}
$options[] = $item;
}
foreach ($default as $name) {
if (!is_dir(JPATH_SITE . '/components/com_jce/editor/extensions/search/adapter/' . $name)) {
continue;
}
$option = new StdClass;
$option->text = Text::_('PLG_SEARCH_' . strtoupper($name) . '_' . strtoupper($name), true);
$option->disable = '';
$option->value = $name;
$options[] = $option;
}
// Merge any additional options in the XML definition.
return $options;
}
}
PK He$]3��9u u profileordering.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\OrderingField;
/**
* Supports an HTML select list of plugins.
*
* @since 1.6
*/
class JFormFieldProfileordering extends OrderingField
{
/**
* The form field type.
*
* @var string
*
* @since 1.6
*/
protected $type = 'Profileordering';
/**
* Builds the query for the ordering list.
*
* @return JDatabaseQuery The query for the ordering form field
*/
protected function getQuery()
{
$db = Factory::getDbo();
// Build the query for the ordering list.
$query = $db->getQuery(true)
->select(array($db->quoteName('ordering', 'value'), $db->quoteName('name', 'text'), $db->quote('id')))
->from($db->quoteName('#__wf_profiles'))
->order('ordering');
return $query;
}
/**
* Retrieves the current Item's Id.
*
* @return int The current item ID
*/
protected function getItemId()
{
return (int) $this->form->getValue('id');
}
}
PK He$]��z^ filesystempath.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2026 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\Field\TextField;
class JFormFieldFilesystemPath extends TextField
{
/**
* The form field type.
*
* @var string
*
* @since 2.8
*/
protected $type = 'FilesystemPath';
/**
* Method to attach a JForm object to the field.
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
*
* @return boolean True on success.
*
* @since 2.8
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$return = parent::setup($element, $value, $group);
return $return;
}
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 11.1
*/
protected function getInput()
{
$values = $this->value;
$path = '';
// Step 1: If it's an array, flatten the "first meaningful" item.
if (is_array($values) && !empty($values)) {
// If it's an associative array already (eg: ['path' => 'images']), use it as-is.
if (array_key_exists('path', $values)) {
$values = [$values];
} else {
// Otherwise take the first non-empty item (eg: first JSON string in the array)
$values = reset($values);
}
}
// Step 2: If it's a string, try decode JSON; if not JSON, treat as path string.
if (is_string($values)) {
$value = trim(htmlspecialchars_decode($values));
if ($value !== '') {
$decoded = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE && $decoded !== null && $decoded !== []) {
$values = $decoded;
} else {
// Not valid JSON -> it’s a plain path
$values = [['path' => $value]];
}
} else {
$values = [];
}
}
// Step 3: Extract first path
if (is_array($values) && !empty($values)) {
// If decoded to a single associative item, normalise to a list.
if (array_key_exists('path', $values)) {
$values = [$values];
}
$first = reset($values);
if (is_array($first) && isset($first['path'])) {
$path = (string) $first['path'];
}
}
$this->value = $path;
// collect the layout data...
$layoutData = $this->getLayoutData();
// ...and reset the value to the processed value
$layoutData['value'] = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
return $this->getRenderer($this->layout)->render($layoutData);
}
}PK He$]�� A A fonts.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\Field\CheckboxesField;
use Joomla\CMS\Language\Text;
class JFormFieldFonts extends CheckboxesField
{
/**
* The form field type.
*
* @var string
*
* @since 11.1
*/
protected $type = 'Fonts';
/**
* Name of the layout being used to render the field
*
* @var string
* @since 3.5
*/
protected $layout = 'form.field.fonts';
/**
* Flag to tell the field to always be in multiple values mode.
*
* @var boolean
* @since 11.1
*/
protected $forceMultiple = false;
private static $fonts = array(
'Andale Mono' => 'andale mono,times',
'Arial' => 'arial,helvetica,sans-serif',
'Arial Black' => 'arial black,avant garde',
'Book Antiqua' => 'book antiqua,palatino',
'Comic Sans MS' => 'comic sans ms,sans-serif',
'Courier New' => 'courier new,courier',
'Georgia' => 'georgia,palatino',
'Helvetica' => 'helvetica',
'Impact' => 'impact,chicago',
'Symbol' => 'symbol',
'Tahoma' => 'tahoma,arial,helvetica,sans-serif',
'Terminal' => 'terminal,monaco',
'Times New Roman' => 'times new roman,times',
'Trebuchet MS' => 'trebuchet ms,geneva',
'Verdana' => 'verdana,geneva',
'Webdings' => 'webdings',
'Wingdings' => 'wingdings,zapf dingbats',
);
/**
* Allow to override renderer include paths in child fields
*
* @return array
*
* @since 3.5
*/
protected function getLayoutPaths()
{
return array(JPATH_ADMINISTRATOR . '/components/com_jce/layouts', JPATH_SITE . '/layouts');
}
protected function getOptions()
{
$fieldname = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname);
$options = array();
if (is_string($this->value)) {
$this->value = json_decode(htmlspecialchars_decode($this->value), true);
}
// cast to array
$this->value = (array) $this->value;
$fonts = array();
// map associative array to array of key value pairs
foreach ($this->value as $key => $value) {
if (is_numeric($key) && is_array($value)) {
$fonts[] = $value;
} else {
$fonts[] = array($key => $value);
}
}
// array of font names to exclude from default list
$exclude = array();
// array of custom font key/value pairs
$custom = array();
foreach ($fonts as $font) {
list($text) = array_keys($font);
list($value) = array_values($font);
// add to $exclude array
$exclude[] = $text;
$value = htmlspecialchars_decode($value, ENT_QUOTES);
$isCustom = !in_array($value, array_values(self::$fonts));
$item = array(
'value' => $value,
'text' => Text::alt($text, $fieldname),
'checked' => true,
'custom' => $isCustom,
);
$item = (object) $item;
if ($isCustom) {
$custom[] = $item;
} else {
$options[] = $item;
}
}
$checked = empty($exclude) ? true : false;
// assign empty (unchecked) options for unused fonts
foreach (self::$fonts as $text => $value) {
if (in_array($text, $exclude)) {
continue;
}
$tmp = array(
'value' => $value,
'text' => Text::alt($text, $fieldname),
'checked' => $checked,
'custom' => false,
);
$options[] = (object) $tmp;
}
return array_merge($options, $custom);
}
}
PK He$]7[�� � yesno.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\Field\RadioField;
class JFormFieldYesNo extends RadioField
{
/**
* The form field type.
*
* @var string
*
* @since 11.1
*/
protected $type = 'YesNo';
/**
* Method to attach a JForm object to the field.
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the form field object
* @param mixed $value The form field value to validate
* @param string $group The field name group control value. This acts as as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]"
*
* @return bool True on success
*
* @since 11.1
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$return = parent::setup($element, $value, $group);
$this->class = trim($this->class . ' btn-group btn-group-yesno');
return $return;
}
}
PK He$]��h$� � uploadmaxsize.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\Field\NumberField;
use Joomla\CMS\Language\Text;
/**
* Form Field class for the Joomla Platform.
* Supports a one line text field.
*
* @link http://www.w3.org/TR/html-markup/input.text.html#input.text
* @since 11.1
*/
class JFormFieldUploadMaxSize extends NumberField
{
/**
* The form field type.
*
* @var string
*
* @since 11.1
*/
protected $type = 'uploadmaxsize';
/**
* Method to get the field input markup.
*
* @return string The field input markup
*
* @since 11.1
*/
protected function getInput()
{
$max = $this->getUploadValue();
$this->max = (int) $max;
$this->class = trim($this->class . ' input-small');
$html = '<div class="input-append input-group">';
$html .= parent::getInput();
$html .= ' <div class="input-group-append">';
$html .= ' <span class="add-on input-group-text">Kb</span>';
$html .= ' </div>';
$html .= ' <small class="help-inline form-text"> <em>' . Text::_('WF_SERVER_UPLOAD_SIZE') . ' : ' . (string) $max . '</em></small>';
$html .= '</div>';
return $html;
}
public function getUploadValue()
{
$upload = trim(ini_get('upload_max_filesize'));
$post = trim(ini_get('post_max_size'));
$upload = $this->convertValue($upload);
$post = $this->convertValue($post);
if (intval($post) === 0) {
return $upload;
}
if (intval($upload) < intval($post)) {
return $upload;
}
return $post;
}
public function convertValue($value)
{
$unit = 'KB';
$prefix = '';
preg_match('#([0-9]+)\s?([a-z]*)#i', $value, $matches);
// get unit
if (isset($matches[2])) {
$prefix = $matches[2];
// extract first character only, eg: g, m, k
if ($prefix) {
$prefix = strtolower($prefix[0]);
}
}
// get value
if (isset($matches[1])) {
$value = (int) $matches[1];
}
$value = intval($value);
// Convert to bytes
switch ($prefix) {
case 'g':
$value *= 1073741824;
break;
case 'm':
$value *= 1048576;
break;
case 'k':
$value *= 1024;
break;
}
// Convert to unit value
switch (strtolower($unit[0])) {
case 'g':
$value /= 1073741824;
break;
case 'm':
$value /= 1048576;
break;
case 'k':
$value /= 1024;
break;
}
if ($unit) {
return (int) $value . ' ' . $unit;
}
return 0;
}
}
PK He$]3�� �
plugin.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\Field\FilelistField;
class JFormFieldPlugin extends FilelistField
{
/**
* The form field type.
*
* @var string
*
* @since 11.1
*/
protected $type = 'Plugin';
/**
* Method to attach a JForm object to the field.
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the form field object
* @param mixed $value The form field value to validate
* @param string $group The field name group control value. This acts as as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]"
*
* @return bool True on success
*
* @since 11.1
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$return = parent::setup($element, $value, $group);
return $return;
}
/**
* Method to get the field input markup.
*
* @return string The field input markup
*
* @since 11.1
*/
protected function getInput()
{
$value = $this->value;
// decode json string
if (!empty($value) && is_string($value)) {
$value = json_decode($value, true);
}
// default
if (empty($value)) {
$type = $this->default;
$path = '';
}
$plugins = $this->getPlugins();
$html = '<div class="span9">';
foreach ($plugins as $plugin) {
$name = (string) str_replace($this->name . '-', '', $plugin->element);
$form = Form::getInstance('plg_jce_' . $plugin->element, $plugin->manifest, array('control' => $this->name . '[' . $name . ']'), true, '//extension');
if ($form) {
$html .= $form->renderFieldset('extension.' . $name . '.' . $name);
}
}
$html .= '</div>';
return $html;
}
/**
* Method to get the field options.
*
* @return array The field option objects
*
* @since 11.1
*/
protected function getPlugins()
{
static $plugins;
if (!isset($plugins)) {
$language = Factory::getLanguage();
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('name, element')
->from('#__extensions')
->where('enabled = 1')
->where('type =' . $db->quote('plugin'))
->where('state IN (0,1)')
->where('folder = ' . $db->quote('jce'))
->where('element LIKE ' . $db->quote($this->name . '-%'))
->order('ordering');
$plugins = $db->setQuery($query)->loadObjectList();
foreach ($plugins as $plugin) {
$name = str_replace($this->name, '', $plugin->element);
// load language file
$language->load('plg_jce_' . $this->name . '_' . $name, JPATH_ADMINISTRATOR);
// create manifest path
$plugin->manifest = JPATH_PLUGINS . '/jce/' . $plugin->element . '/' . $plugin->element . '.xml';
}
}
return $plugins;
}
}
PK He$]��� � customlist.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\Field\ListField;
class JFormFieldCustomList extends ListField
{
/**
* The form field type.
*
* @var string
*
* @since 11.1
*/
protected $type = 'CustomList';
/**
* Method to attach a JForm object to the field.
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the form field object
* @param mixed $value The form field value to validate
* @param string $group The field name group control value. This acts as as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]"
*
* @return bool True on success
*
* @since 11.1
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$return = parent::setup($element, $value, $group);
$this->class = trim($this->class . ' com_jce_select_custom');
return $return;
}
protected function getOptions()
{
$options = parent::getOptions();
$this->value = is_array($this->value) ? $this->value : explode(',', $this->value);
$custom = array();
foreach ($this->value as $value) {
$tmp = array(
'value' => $value,
'text' => $value,
'selected' => true,
);
$found = false;
foreach ($options as $option) {
if ($option->value === $value) {
$found = true;
}
}
if (!$found) {
$custom[] = (object) $tmp;
}
}
// Merge any additional options in the XML definition.
$options = array_merge($options, $custom);
return $options;
}
}
PK He$]~Do� �
extension.phpnu &1i� <?php
defined('JPATH_PLATFORM') or die;
JFormHelper::loadFieldClass('filetype');
class JFormFieldExtension extends JFormFieldFiletype
{
}PK He$]� @ @ keyvalue.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Language\Text;
class JFormFieldKeyValue extends FormField
{
/**
* The form field type.
*
* @var string
*
* @since 2.8
*/
protected $type = 'KeyValue';
/**
* Method to attach a JForm object to the field.
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
*
* @return boolean True on success.
*
* @since 2.8
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$return = parent::setup($element, $value, $group);
return $return;
}
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 11.1
*/
protected function getInput()
{
$values = $this->value;
if (is_string($values) && !empty($values)) {
$value = htmlspecialchars_decode($this->value);
$value = html_entity_decode($value, ENT_QUOTES | ENT_HTML5, 'UTF-8');
$values = json_decode($value, true);
// not valid json
if (empty($values) || json_last_error() !== JSON_ERROR_NONE) {
$values = array();
// If the value is a string with key-value pairs, convert it to an array
if (strpos($value, ':') !== false && strpos($value, '{') === false) {
foreach (explode(',', $value) as $item) {
$pair = explode(':', $item);
array_walk($pair, function (&$val) {
$val = trim($val, chr(0x22) . chr(0x27) . chr(0x38));
});
$values[] = array(
'name' => $pair[0],
'value' => $pair[1],
);
}
} else {
// where the value is a string with no key-value pairs, use only the "name" key
$values = array(
array(
'name' => $value,
'value' => '',
),
);
}
}
}
// default
if (empty($values)) {
$values = array(
array(
'name' => '',
'value' => '',
),
);
}
$subForm = new Form($this->name, array('control' => $this->formControl));
$children = (array) $this->element->children();
// if field has defined children
if (count($children)) {
$children = $this->element->children();
$subForm->load($children, true);
$subForm->setFields($children);
} else {
$label = $this->element['label'];
$xml = '<form><fields name="' . $this->name . '">';
$keyName = 'name';
$keyLabel = 'WF_LABEL_NAME';
if (isset($this->element['keyName'])) {
$keyName = $this->element['keyName'];
}
if (isset($this->element['keyLabel'])) {
$keyLabel = htmlspecialchars($this->element['keyLabel'], ENT_QUOTES, 'UTF-8');
}
$xml .= '<field name="' . $keyName . '" type="text" label="' . $keyLabel . '" description="" />';
$valueName = 'value';
$valueLabel = 'WF_LABEL_VALUE';
if (isset($this->element['valueName'])) {
$valueName = $this->element['valueName'];
}
if (isset($this->element['valueLabel'])) {
$valueLabel = htmlspecialchars($this->element['valueLabel'], ENT_QUOTES, 'UTF-8');
}
$xml .= '<field name="' . $valueName . '" type="text" label="' . $valueLabel . '" description="" />';
if ($this->element['boolean']) {
$xml .= '<field name="boolean" type="checkbox" class="wf-keyvalue-boolean" label="' . Text::_('WF_LABEL_BOOLEAN') . '" description="" />';
}
$xml .= '</fields></form>';
$subForm->load($xml);
}
$fields = $subForm->getFieldset();
// And finaly build a main container
$str = array();
$sortable = '';
if (isset($this->element['sortable'])) {
$sortable = ' data-sortable="' . $this->element['sortable'] . '"';
}
$str[] = '<div class="form-field-repeatable"' . $sortable . '>';
// the default field names for the key-value pairs
$fieldItem = array('name', 'value');
foreach ($values as $value) {
$str[] = '<div class="form-field-repeatable-item wf-keyvalue">';
$str[] = ' <div class="form-field-repeatable-item-group well p-4 card">';
$n = 0;
foreach ($fields as $field) {
$tmpField = clone $field;
$tmpField->element['multiple'] = true;
$name = (string) $tmpField->element['name'];
$val = is_array($value) && isset($value[$name]) ? $value[$name] : '';
// if the original value is a string and does not match the field name, use the default field item name
if (!isset($value[$name]) && is_string($this->value)) {
$key = $fieldItem[$n] ?? '';
if ($key) {
$val = $value[$key] ?? '';
}
}
// escape value
$tmpField->value = htmlspecialchars_decode($val);
$tmpField->setup($tmpField->element, $tmpField->value, $this->group);
// reset id
$tmpField->id .= '_' . $n;
// reset name
$tmpField->name = $name;
$str[] = $tmpField->renderField(array('description' => $tmpField->description));
$n++;
}
$str[] = ' </div>';
$str[] = ' <div class="form-field-repeatable-item-control">';
$str[] = ' <button class="btn btn-link form-field-repeatable-add" aria-label="' . Text::_('JGLOBAL_FIELD_ADD') . '"><i class="icon icon-plus pull-right float-right"></i></button>';
$str[] = ' <button class="btn btn-link form-field-repeatable-remove" aria-label="' . Text::_('JGLOBAL_FIELD_REMOVE') . '"><i class="icon icon-trash pull-right float-right"></i></button>';
$str[] = ' </div>';
$str[] = '</div>';
}
if (!empty($this->value)) {
$this->value = htmlspecialchars(json_encode($values));
}
$str[] = '<input type="hidden" name="' . $this->name . '" value="' . $this->value . '" />';
$str[] = '</div>';
return implode("", $str);
}
}
PK He$]�P� � styleformat.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Language\Text;
/**
* Renders a select element.
*/
class JFormFieldStyleFormat extends FormField
{
/*
* Element type
*
* @access protected
* @var string
*/
protected $type = 'StyleFormat';
private function loadSubForm()
{
$subForm = new Form($this->name);
// editor manifest
$manifest = JPATH_ADMINISTRATOR . '/components/com_jce/models/forms/styleformat.xml';
$xml = simplexml_load_file($manifest);
$subForm->load($xml);
return $subForm;
}
private function renderFields($form, $item)
{
$fields = $form->getFieldset();
$data = array();
foreach ($fields as $field) {
$tmpField = clone $field;
$key = (string) $tmpField->element['name'];
// default value
$tmpField->value = "";
if (array_key_exists($key, $item)) {
$tmpField->value = htmlspecialchars_decode($item[$key], ENT_QUOTES);
}
$tmpField->setup($tmpField->element, $tmpField->value, $this->group);
$tmpField->id = '';
$tmpField->name = '';
$data[] = '<div class="styleformat-item-' . $key . '" data-key="' . $key . '">' . $tmpField->renderField(array('description' => $tmpField->description)) . '</div>';
}
return implode('', $data);
}
protected function getInput()
{
$wf = WFApplication::getInstance();
$output = array();
// default item list (remove "attributes" for now)
$default = array('title' => '', 'element' => '', 'selector' => '', 'classes' => '', 'styles' => '', 'attributes' => '');
// pass to items
$items = $this->value;
if (is_string($items)) {
$items = json_decode(htmlspecialchars_decode($this->value), true);
}
// cast to array
$items = (array) $items;
/* Convert legacy styles */
$theme_advanced_styles = $wf->getParam('editor.theme_advanced_styles', '');
if (!empty($theme_advanced_styles)) {
foreach (explode(',', $theme_advanced_styles) as $styles) {
$style = json_decode('{' . preg_replace('#([^=]+)=([^=]+)#', '"title":"$1","classes":"$2"', $styles) . '}', true);
if ($style) {
$items[] = $style;
}
}
}
// create default array if no items
if (empty($items)) {
$items = array($default);
}
$output[] = '<div class="styleformat-list">';
$x = 0;
$subForm = $this->loadSubForm();
foreach ($items as $item) {
$elements = array('<div class="styleformat border bg-light-subtle">');
$elements[] = $this->renderFields($subForm, $item);
$elements[] = '<div class="styleformat-header">';
// handle
$elements[] = '<span class="styleformat-item-handle"></span>';
// delete button
$elements[] = '<button class="styleformat-item-trash btn btn-link"><i class="icon icon-trash"></i></button>';
// collapse
$elements[] = '<button class="close collapse btn btn-link"><i class="icon icon-chevron-up"></i><i class="icon icon-chevron-down"></i></button>';
$elements[] = '</div>';
$elements[] = '</div>';
$output[] = implode('', $elements);
$x++;
}
$output[] = '<button class="btn btn-link styleformat-item-plus border"><span class="text-left">' . Text::_('WF_STYLEFORMAT_NEW') . '</span><i class="icon icon-plus"></i></button>';
// hidden field
$output[] = '<input type="hidden" name="' . $this->name . '" value="" />';
if (!empty($theme_advanced_styles)) {
$output[] = '<input type="hidden" name="' . $this->getName('theme_advanced_styles') . '" value="" class="isdirty" />';
}
$output[] = '</div>';
return implode("\n", $output);
}
}PK He$]a�r̓ � filesystem.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Form\Form;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
class JFormFieldFilesystem extends ListField
{
/**
* The form field type.
*
* @var string
*
* @since 11.1
*/
protected $type = 'Filesystem';
/**
* Method to attach a JForm object to the field.
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the form field object
* @param mixed $value The form field value to validate
* @param string $group The field name group control value. This acts as as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]"
*
* @return bool True on success
*
* @since 11.1
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$return = parent::setup($element, $value, $group);
return $return;
}
/**
* Method to get the field input markup.
*
* @return string The field input markup
*
* @since 11.1
*/
protected function getInput()
{
$value = $this->value;
// decode json string
if (!empty($value) && is_string($value)) {
$value = json_decode($value, true);
}
// default
if (empty($value)) {
$value = array('name' => $this->default);
} else {
if (!isset($value['name'])) {
$value['name'] = $this->default;
}
}
$plugins = $this->getPlugins();
$options = $this->getOptions();
$html = '';
$html .= '<div class="controls-row">';
$html .= '<div class="control-group">';
$html .= HTMLHelper::_('select.genericlist', $options, $this->name . '[name]', 'data-toggle="filesystem-options" class="custom-select"', 'value', 'text', $value['name']);
$html .= '</div>';
$html .= '<div class="filesystem-options clearfix">';
foreach ($plugins as $plugin) {
$form = Form::getInstance('plg_jce_' . $this->name . '_' . $plugin->name, $plugin->manifest, array('control' => $this->name . '[' . $plugin->name . ']'), true, '//extension');
if ($form) {
// get the data for this form, if set
$data = isset($value[$plugin->name]) ? $value[$plugin->name] : array();
// bind data to form
$form->bind($data);
$html .= '<div class="well well-small p-3 card" data-toggle-target="filesystem-options-' . $plugin->name . '">';
$fields = $form->getFieldset('filesystem.' . $plugin->name);
foreach ($fields as $field) {
$html .= $field->renderField(array('description' => $field->description));
}
$html .= '</div>';
}
}
$html .= '</div>';
$html .= '</div>';
return $html;
}
/**
* Method to get the field options.
*
* @return array The field option objects
*
* @since 11.1
*/
protected function getPlugins()
{
static $plugins;
if (!isset($plugins)) {
$plugins = JcePluginsHelper::getExtensions('filesystem');
}
return $plugins;
}
/**
* Method to get the field options.
*
* @return array The field option objects
*
* @since 11.1
*/
protected function getOptions()
{
$fieldname = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname);
$options = parent::getOptions();
$plugins = $this->getPlugins();
foreach ($plugins as $plugin) {
$value = (string) $plugin->name;
$text = (string) $plugin->title;
$tmp = array(
'value' => $value,
'text' => Text::alt($text, $fieldname),
'disable' => false,
'class' => '',
'selected' => false,
);
// Add the option object to the result set.
$options[] = (object) $tmp;
}
reset($options);
return $options;
}
}
PK He$]�M�
�
components.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text;
/**
* Form Field class for the Joomla Framework.
*
* @since 11.4
*/
class JFormFieldComponents extends ListField
{
/**
* The field type.
*
* @var string
*
* @since 11.4
*/
protected $type = 'Components';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options
*
* @since 11.4
*/
protected function getOptions()
{
$language = Factory::getLanguage();
$exclude = array(
'com_admin',
'com_cache',
'com_checkin',
'com_config',
'com_cpanel',
'com_fields',
'com_finder',
'com_installer',
'com_jce',
'com_languages',
'com_login',
'com_mailto',
'com_menus',
'com_media',
'com_messages',
'com_newsfeeds',
'com_plugins',
'com_redirect',
'com_templates',
'com_users',
'com_wrapper',
'com_search',
'com_user',
'com_updates',
);
// Get list of plugins
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('element AS value, name AS text')
->from('#__extensions')
->where('type = ' . $db->quote('component'))
->where('enabled = 1')
->order('ordering, name');
$db->setQuery($query);
$components = $db->loadObjectList();
$options = array();
// load component languages
for ($i = 0; $i < count($components); ++$i) {
if (!in_array($components[$i]->value, $exclude)) {
// load system language file
$language->load($components[$i]->value . '.sys', JPATH_ADMINISTRATOR);
$language->load($components[$i]->value, JPATH_ADMINISTRATOR);
// translate name
$components[$i]->text = Text::_($components[$i]->text, true);
$components[$i]->disable = '';
$options[] = $components[$i];
}
}
// Merge any additional options in the XML definition.
return array_merge(parent::getOptions(), $options);
}
}
PK He$]��F( ( componentslist.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text;
use Joomla\Utilities\ArrayHelper;
/**
* Form Field class for the Joomla Framework.
*
* @since 11.4
*/
class JFormFieldComponentsList extends ListField
{
/**
* The field type.
*
* @var string
*
* @since 11.4
*/
protected $type = 'ComponentsList';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options
*
* @since 11.4
*/
protected function getOptions()
{
$language = Factory::getLanguage();
$exclude = array(
'com_admin',
'com_cache',
'com_checkin',
'com_config',
'com_cpanel',
'com_fields',
'com_finder',
'com_installer',
'com_languages',
'com_login',
'com_mailto',
'com_menus',
'com_media',
'com_messages',
'com_newsfeeds',
'com_plugins',
'com_redirect',
'com_templates',
'com_users',
'com_wrapper',
'com_search',
'com_user',
'com_updates',
);
// Get list of plugins
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('element AS value, name AS text')
->from('#__extensions')
->where('type = ' . $db->quote('component'))
->where('enabled = 1')
->order('ordering, name');
$db->setQuery($query);
$items = $db->loadObjectList();
$options = array();
foreach ($items as $item) {
// Load language
$extension = $item->value;
$language->load("$extension.sys", JPATH_ADMINISTRATOR)
|| $language->load("$extension.sys", JPATH_ADMINISTRATOR . '/components/' . $extension);
$text = strtoupper($item->text);
if ($text === 'COM_JCE') {
$text = 'WF_CPANEL_BROWSER';
}
// Translate component name
$item->text = Text::_($text);
$options[] = $item;
}
// Sort by component name
$options = ArrayHelper::sortObjects($options, 'text', 1, true, true);
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
}
PK He$]��=l� � mediajce.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\Field\MediaField;
/**
* Provides a modal media selector field for the JCE File Browser
*
* @since 2.6.17
*/
class JFormFieldMediaJce extends MediaField
{
/**
* The form field type.
*
* @var string
*/
protected $type = 'MediaJce';
/**
* Layout to render
*
* @var string
* @since 3.5
*/
protected $layout = 'joomla.form.field.media';
/**
* Default mediatype
*
* @var string
* @since 2.9.39
*/
protected $mediatype;
/**
* Method to attach a JForm object to the field.
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the `<field>` tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
*
* @return boolean True on success.
*
* @see JFormField::setup()
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$result = parent::setup($element, $value, $group);
if ($result === true) {
$this->mediatype = isset($this->element['mediatype']) ? (string) $this->element['mediatype'] : 'images';
if (!isset($this->element['converted'])) {
$this->element['converted'] = 0;
}
}
return $result;
}
/**
* Get the data that is going to be passed to the layout
*
* @return array
*/
public function getLayoutData()
{
require_once JPATH_ADMINISTRATOR . '/components/com_jce/helpers/browser.php';
$config = array(
'element' => $this->id,
'mediatype' => strtolower($this->mediatype),
'converted' => (int) $this->element['converted'] ? true : false,
);
if (isset($this->element['plugin'])) {
$config['plugin'] = (string) $this->element['plugin'];
}
// Get the basic field data
$data = parent::getLayoutData();
$this->link = WFBrowserHelper::getMediaFieldUrl($config);
// not a valid file browser link
if (!$this->link) {
return $data;
}
$options = WFBrowserHelper::getMediaFieldOptions($config);
$extraData = array(
'link' => $this->link,
'class' => $this->element['class'] . ' input-medium wf-media-input wf-media-input-active',
);
if ($options['upload'] == 1) {
$extraData['class'] .= ' wf-media-input-upload';
}
return array_merge($data, $extraData);
}
}
PK He$]S*LQ heading.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Language\Text;
class JFormFieldHeading extends FormField
{
/**
* The form field type.
*
* @var string
*
* @since 11.1
*/
protected $type = 'Heading';
/**
* Method to get the field input markup for a spacer.
* The spacer does not have accept input.
*
* @return string The field input markup
*
* @since 11.1
*/
protected function getInput()
{
return ' ';
}
/**
* Method to get the field label markup for a spacer.
* Use the label text or name from the XML element as the spacer or
* Use a hr="true" to automatically generate plain hr markup.
*
* @return string The field label markup
*
* @since 11.1
*/
protected function getLabel()
{
$html = array();
$class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
$html[] = '<h3' . $class . '>';
// Get the label text from the XML element, defaulting to the element name.
$text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
$text = $this->translateLabel ? Text::_($text) : $text;
$html[] = $text;
$html[] = '</h3>';
// If a description is specified, use it to build a tooltip.
if (!empty($this->description)) {
$html[] = '<small>' . Text::_($this->description) . '</small>';
}
return implode('', $html);
}
/**
* Method to get the field title.
*
* @return string The field title
*
* @since 11.1
*/
protected function getTitle()
{
return $this->getLabel();
}
}
PK He$]�>���&