| Current Path : /home/wuectly/www/03cbe/ |
| Current File : /home/wuectly/www/03cbe/field.zip |
PK [$]X�ʬ� � skins.phpnu &1i� <?php
/**
* @package Joomla.Plugin
* @subpackage Editors.tinymce
*
* @copyright (C) 2014 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Generates the list of options for available skins.
*
* @package Joomla.Plugin
* @subpackage Editors.tinymce
* @since 3.4
*/
class JFormFieldSkins extends JFormFieldList
{
protected $type = 'skins';
/**
* Method to get the skins options.
*
* @return array The skins option objects.
*
* @since 3.4
*/
public function getOptions()
{
$options = array();
$directories = glob(JPATH_ROOT . '/media/editors/tinymce/skins' . '/*', GLOB_ONLYDIR);
for ($i = 0, $iMax = count($directories); $i < $iMax; ++$i)
{
$dir = basename($directories[$i]);
$options[] = JHtml::_('select.option', $i, $dir);
}
$options = array_merge(parent::getOptions(), $options);
return $options;
}
/**
* Method to get the field input markup for the list of skins.
*
* @return string The field input markup.
*
* @since 3.4
*/
protected function getInput()
{
$html = array();
// Get the field options.
$options = (array) $this->getOptions();
// Create a regular list.
$html[] = JHtml::_('select.genericlist', $options, $this->name, '', 'value', 'text', $this->value, $this->id);
return implode($html);
}
}
PK [$]���h h uploaddirs.phpnu &1i� <?php
/**
* @package Joomla.Plugin
* @subpackage Editors.tinymce
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('folderlist');
/**
* Generates the list of directories available for drag and drop upload.
*
* @package Joomla.Plugin
* @subpackage Editors.tinymce
* @since 3.7.0
*/
class JFormFieldUploaddirs extends JFormFieldFolderList
{
protected $type = 'uploaddirs';
/**
* 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.7.0
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$return = parent::setup($element, $value, $group);
// Get the path in which to search for file options.
$this->directory = JComponentHelper::getParams('com_media')->get('image_path');
$this->recursive = true;
$this->hideDefault = true;
return $return;
}
/**
* Method to get the directories options.
*
* @return array The dirs option objects.
*
* @since 3.7.0
*/
public function getOptions()
{
return parent::getOptions();
}
/**
* Method to get the field input markup for the list of directories.
*
* @return string The field input markup.
*
* @since 3.7.0
*/
protected function getInput()
{
$html = array();
// Get the field options.
$options = (array) $this->getOptions();
// Reset the non selected value to null
if ($options[0]->value === '-1')
{
$options[0]->value = '';
}
// Create a regular list.
$html[] = JHtml::_('select.genericlist', $options, $this->name, '', 'value', 'text', $this->value, $this->id);
return implode($html);
}
}
PK [$]w��- - tinymcebuilder.phpnu &1i� <?php
/**
* @package Joomla.Plugin
* @subpackage Editors.tinymce
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Form Field class for the TinyMCE editor.
*
* @package Joomla.Plugin
* @subpackage Editors.tinymce
* @since 3.7.0
*/
class JFormFieldTinymceBuilder extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 3.7.0
*/
protected $type = 'tinymcebuilder';
/**
* Name of the layout being used to render the field
*
* @var string
* @since 3.7.0
*/
protected $layout = 'plugins.editors.tinymce.field.tinymcebuilder';
/**
* The prepared layout data
*
* @var array
* @since 3.7.0
*/
protected $layoutData = array();
/**
* Method to get the data to be passed to the layout for rendering.
*
* @return array
*
* @since 3.7.0
*/
protected function getLayoutData()
{
if (!empty($this->layoutData))
{
return $this->layoutData;
}
$data = parent::getLayoutData();
$paramsAll = (object) $this->form->getValue('params');
$setsAmount = empty($paramsAll->sets_amount) ? 3 : $paramsAll->sets_amount;
if (empty($data['value']))
{
$data['value'] = array();
}
// Get the plugin
require_once JPATH_PLUGINS . '/editors/tinymce/tinymce.php';
$menus = array(
'edit' => array('label' => 'Edit'),
'insert' => array('label' => 'Insert'),
'view' => array('label' => 'View'),
'format' => array('label' => 'Format'),
'table' => array('label' => 'Table'),
'tools' => array('label' => 'Tools'),
);
$data['menus'] = $menus;
$data['menubarSource'] = array_keys($menus);
$data['buttons'] = PlgEditorTinymce::getKnownButtons();
$data['buttonsSource'] = array_keys($data['buttons']);
$data['toolbarPreset'] = PlgEditorTinymce::getToolbarPreset();
$data['setsAmount'] = $setsAmount;
// Get array of sets names
for ($i = 0; $i < $setsAmount; $i++)
{
$data['setsNames'][$i] = JText::sprintf('PLG_TINY_SET_TITLE', $i);
}
// Prepare the forms for each set
$setsForms = array();
$formsource = JPATH_PLUGINS . '/editors/tinymce/form/setoptions.xml';
// Preload an old params for B/C
$setParams = new stdClass;
if (!empty($paramsAll->html_width) && empty($paramsAll->configuration['setoptions']))
{
$plugin = JPluginHelper::getPlugin('editors', 'tinymce');
JFactory::getApplication()->enqueueMessage(JText::sprintf('PLG_TINY_LEGACY_WARNING', '#'), 'warning');
if (is_object($plugin) && !empty($plugin->params))
{
$setParams = (object) json_decode($plugin->params);
}
}
// Collect already used groups
$groupsInUse = array();
// Prepare the Set forms, for the set options
foreach (array_keys($data['setsNames']) as $num)
{
$formname = 'set.form.' . $num;
$control = $this->name . '[setoptions][' . $num . ']';
$setsForms[$num] = JForm::getInstance($formname, $formsource, array('control' => $control));
// Check whether we already have saved values or it first time or even old params
if (empty($this->value['setoptions'][$num]))
{
$formValues = $setParams;
/*
* Predefine group:
* Set 0: for Administrator, Editor, Super Users (4,7,8)
* Set 1: for Registered, Manager (2,6), all else are public
*/
$formValues->access = !$num ? array(4,7,8) : ($num === 1 ? array(2,6) : array());
// Assign Public to the new Set, but only when it not in use already
if (empty($formValues->access) && !in_array(1, $groupsInUse))
{
$formValues->access = array(1);
}
}
else
{
$formValues = (object) $this->value['setoptions'][$num];
}
// Collect already used groups
if (!empty($formValues->access))
{
$groupsInUse = array_merge($groupsInUse, $formValues->access);
}
// Bind the values
$setsForms[$num]->bind($formValues);
}
krsort($data['setsNames']);
$data['setsForms'] = $setsForms;
// Check for TinyMCE language file
$language = JFactory::getLanguage();
$languageFile1 = 'media/editors/tinymce/langs/' . $language->getTag() . '.js';
$languageFile2 = 'media/editors/tinymce/langs/' . substr($language->getTag(), 0, strpos($language->getTag(), '-')) . '.js';
$data['languageFile'] = '';
if (file_exists(JPATH_ROOT . '/' . $languageFile1))
{
$data['languageFile'] = $languageFile1;
}
elseif (file_exists(JPATH_ROOT . '/' . $languageFile2))
{
$data['languageFile'] = $languageFile2;
}
$this->layoutData = $data;
return $data;
}
}
PK a$]$>m� � edit.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('behavior.keepalive');
JHtml::_('formbehavior.chosen', '#jform_catid', null, array('disable_search_threshold' => 0 ));
$app = JFactory::getApplication();
$input = $app->input;
JFactory::getDocument()->addScriptDeclaration('
Joomla.submitbutton = function(task)
{
if (task == "field.cancel" || document.formvalidator.isValid(document.getElementById("item-form")))
{
Joomla.submitform(task, document.getElementById("item-form"));
}
};
jQuery(document).ready(function() {
jQuery("#jform_title").data("dp-old-value", jQuery("#jform_title").val());
jQuery("#jform_title").change(function(data, handler) {
if(jQuery("#jform_title").data("dp-old-value") == jQuery("#jform_label").val()) {
jQuery("#jform_label").val(jQuery("#jform_title").val());
}
jQuery("#jform_title").data("dp-old-value", jQuery("#jform_title").val());
});
});
');
?>
<div class="fields-edit">
<form action="<?php echo JRoute::_('index.php?option=com_fields&context=' . $input->getCmd('context', 'com_content') . '&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate">
<div class="col main-section">
<fieldset class="adminform">
<ul class="adminformlist">
<li>
<?php echo $this->form->getLabel('title'); ?>
<?php echo $this->form->getInput('title'); ?>
</li>
</ul>
<div class="clr"></div>
</fieldset>
<fieldset class="adminform">
<ul class="adminformlist">
<li><?php echo $this->form->renderField('type'); ?></li>
<li><?php echo $this->form->renderField('name'); ?></li>
<li><?php echo $this->form->renderField('label'); ?></li>
<li><?php echo $this->form->renderField('description'); ?></li>
<li><?php echo $this->form->renderField('required'); ?></li>
<li><?php echo $this->form->renderField('default_value'); ?></li>
<?php foreach ($this->form->getFieldsets('fieldparams') as $name => $fieldSet) : ?>
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<li><?php echo $field->renderField(); ?></li>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
</fieldset>
</div>
<div class="col options-section">
<?php echo JHtml::_('sliders.start', 'groups-sliders-' . $this->item->id, array('useCookie' => 1)); ?>
<?php echo JHtml::_('sliders.panel', JText::_('COM_FIELDS_VIEW_FIELD_FIELDSET_GENERAL'), 'general'); ?>
<?php $this->set('fields',
array(
array(
'published',
'state',
'enabled',
),
'group_id',
'assigned_cat_ids',
'access',
'language',
'note',
)
); ?>
<?php echo JLayoutHelper::render('joomla.edit.global', $this); ?>
<?php $this->set('fields', null); ?>
<?php echo JHtml::_('sliders.panel', JText::_('JGLOBAL_FIELDSET_OPTIONS'), '-options'); ?>
<?php $this->set('ignore_fieldsets', array('fieldparams')); ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo JHtml::_('sliders.panel', JText::_('JGLOBAL_FIELDSET_PUBLISHING'), 'publishing-details'); ?>
<fieldset class="panelform">
<legend class="element-invisible"><?php echo JText::_('JGLOBAL_FIELDSET_PUBLISHING'); ?></legend>
<ul class="adminformlist">
<li><?php echo $this->form->getLabel('created_user_id'); ?>
<?php echo $this->form->getInput('created_user_id'); ?></li>
<li><?php echo $this->form->getLabel('created_time'); ?>
<?php echo $this->form->getInput('created_time'); ?></li>
<?php if ($this->item->modified_by) : ?>
<li><?php echo $this->form->getLabel('modified_by'); ?>
<?php echo $this->form->getInput('modified_by'); ?></li>
<li><?php echo $this->form->getLabel('modified_time'); ?>
<?php echo $this->form->getInput('modified_time'); ?></li>
<?php endif; ?>
<li><?php echo $this->form->getLabel('id'); ?>
<?php echo $this->form->getInput('id'); ?></li>
</ul>
</fieldset>
<?php echo JHtml::_('sliders.end'); ?>
<div class="clr"></div>
</div>
<div class="clr"></div>
<?php if ($this->canDo->get('core.admin')) : ?>
<div class="col rules-section">
<?php echo JHtml::_('sliders.start', 'permissions-sliders-' . $this->item->id, array('useCookie' => 1)); ?>
<?php echo JHtml::_('sliders.panel', JText::_('JGLOBAL_ACTION_PERMISSIONS_LABEL'), 'access-rules'); ?>
<fieldset class="panelform">
<legend class="element-invisible"><?php echo JText::_('JGLOBAL_ACTION_PERMISSIONS_LABEL'); ?></legend>
<?php echo $this->form->getLabel('rules'); ?>
<?php echo $this->form->getInput('rules'); ?>
</fieldset>
<?php echo JHtml::_('sliders.end'); ?>
</div>
<?php endif; ?>
<?php echo $this->form->getInput('context'); ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
<div class="clr"></div>
</div>
PK [$]X�ʬ� � skins.phpnu &1i� PK [$]���h h uploaddirs.phpnu &1i� PK [$]w��- - � tinymcebuilder.phpnu &1i� PK a$]$>m� � ."