| Current Path : /home/wuectly/www/03cbe/ |
| Current File : /home/wuectly/www/03cbe/fields.zip |
PK 0�#]�{$� �
render.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @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;
// Check if we have all the data
if (!key_exists('item', $displayData) || !key_exists('context', $displayData))
{
return;
}
// Setting up for display
$item = $displayData['item'];
if (!$item)
{
return;
}
$context = $displayData['context'];
if (!$context)
{
return;
}
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
$parts = explode('.', $context);
$component = $parts[0];
$fields = null;
if (key_exists('fields', $displayData))
{
$fields = $displayData['fields'];
}
else
{
$fields = $item->jcfields ?: FieldsHelper::getFields($context, $item, true);
}
if (!$fields)
{
return;
}
// Check if we have mail context in first element
$isMail = (reset($fields)->context == 'com_contact.mail');
if (!$isMail)
{
// Print the container tag
echo '<dl class="fields-container contact-fields dl-horizontal">';
}
// Loop through the fields and print them
foreach ($fields as $field)
{
// If the value is empty do nothing
if (!strlen($field->value) && !$isMail)
{
continue;
}
$layout = $field->params->get('layout', 'render');
echo FieldsHelper::render($context, 'field.' . $layout, array('field' => $field));
}
if (!$isMail)
{
// Close the container
echo '</dl>';
}
PK .�#]$ۢ�� � default.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::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', 'select');
$app = JFactory::getApplication();
$user = JFactory::getUser();
$userId = $user->get('id');
$context = $this->escape($this->state->get('filter.context'));
$component = $this->state->get('filter.component');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$ordering = ($listOrder == 'a.ordering');
$saveOrder = ($listOrder == 'a.ordering' && strtolower($listDirn) == 'asc');
// The category object of the component
$category = JCategories::getInstance(str_replace('com_', '', $component));
if ($saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_fields&task=fields.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'fieldList', 'adminForm', strtolower($listDirn), $saveOrderingUrl, false, true);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_fields&view=fields'); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<div id="filter-bar" class="js-stools-container-bar pull-left">
<div class="btn-group pull-left">
<?php echo $this->filterForm->getField('context')->input; ?>
</div>
</div>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="adminlist" id="fieldList">
<thead>
<tr>
<th class="checkmark-col">
<input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
</th>
<th width="1%" class="nowrap center">
<?php echo JHtml::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
</th>
<th>
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th>
<th>
<?php echo JHtml::_('searchtools.sort', 'COM_FIELDS_FIELD_TYPE_LABEL', 'a.type', $listDirn, $listOrder); ?>
</th>
<th>
<?php echo JHtml::_('searchtools.sort', 'COM_FIELDS_FIELD_GROUP_LABEL', 'g.title', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
</th>
<th width="5%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?>
</th>
<th width="1%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="9">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php $ordering = ($listOrder == 'a.ordering'); ?>
<?php $canEdit = $user->authorise('core.edit', $component . '.field.' . $item->id); ?>
<?php $canCheckin = $user->authorise('core.admin', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; ?>
<?php $canEditOwn = $user->authorise('core.edit.own', $component . '.field.' . $item->id) && $item->created_user_id == $userId; ?>
<?php $canChange = $user->authorise('core.edit.state', $component . '.field.' . $item->id) && $canCheckin; ?>
<tr class="row<?php echo $i % 2; ?>" item-id="<?php echo $item->id ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="center">
<?php echo JHtml::_('jgrid.published', $item->state, $i, 'fields.', $canChange); ?>
</td>
<td>
<div class="pull-left break-word">
<?php if ($item->checked_out) : ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'fields.', $canCheckin); ?>
<?php endif; ?>
<?php if ($canEdit || $canEditOwn) : ?>
<a href="<?php echo JRoute::_('index.php?option=com_fields&task=field.edit&id=' . $item->id . '&context=' . $context); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
<span class="small break-word">
<?php if (empty($item->note)) : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_NAME', $this->escape($item->name)); ?>
<?php else : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_NAME_NOTE', $this->escape($item->name), $this->escape($item->note)); ?>
<?php endif; ?>
</span>
<div class="small">
<?php if ($category) : ?>
<?php echo JText::_('JCATEGORY') . ': '; ?>
<?php $categories = FieldsHelper::getAssignedCategoriesTitles($item->id); ?>
<?php if ($categories) : ?>
<?php echo implode(', ', $categories); ?>
<?php else : ?>
<?php echo JText::_('JALL'); ?>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</td>
<td class="small">
<?php echo $this->escape($item->type); ?>
</td>
<td>
<?php echo $this->escape($item->group_title); ?>
</td>
<td class="small hidden-phone">
<?php echo $this->escape($item->access_level); ?>
</td>
<td class="small nowrap hidden-phone">
<?php echo JLayoutHelper::render('joomla.content.language', $item); ?>
</td>
<td class="center hidden-phone">
<span><?php echo (int) $item->id; ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php //Load the batch processing form. ?>
<?php if ($user->authorise('core.create', $component)
&& $user->authorise('core.edit', $component)
&& $user->authorise('core.edit.state', $component)) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_FIELDS_VIEW_FIELDS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
PK :�#]��4ߋ � logtype.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage System.actionlogs
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
FormHelper::loadFieldClass('checkboxes');
JLoader::register('ActionlogsHelper', JPATH_ADMINISTRATOR . '/components/com_actionlogs/helpers/actionlogs.php');
/**
* Field to load a list of all users that have logged actions
*
* @since 3.9.0
*/
class JFormFieldLogType extends JFormFieldCheckboxes
{
/**
* The form field type.
*
* @var string
* @since 3.9.0
*/
protected $type = 'LogType';
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 3.9.0
*/
public function getOptions()
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('extension'))
->from($db->quoteName('#__action_logs_extensions'));
$extensions = $db->setQuery($query)->loadColumn();
$options = array();
$tmp = array('checked' => true);
foreach ($extensions as $extension)
{
ActionlogsHelper::loadTranslationFiles($extension);
$option = HTMLHelper::_('select.option', $extension, Text::_($extension));
$options[ApplicationHelper::stringURLSafe(Text::_($extension)) . '_' . $extension] = (object) array_merge($tmp, (array) $option);
}
ksort($options);
return array_merge(parent::getOptions(), array_values($options));
}
}
PK :�#]5v'� � plugininfo.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_actionlogs
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Information field.
*
* @since 3.9.2
*/
class JFormFieldPluginInfo extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 3.9.2
*/
protected $type = 'PluginInfo';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 3.9.2
*/
protected function getInput()
{
$db = JFactory::getDbo();
$result = null;
$query = $db->getQuery(true)
->select($db->quoteName('extension_id'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('folder') . ' = ' . $db->quote('actionlog'))
->where($db->quoteName('element') . ' = ' . $db->quote('joomla'));
$db->setQuery($query);
try
{
$result = (int) $db->loadResult();
}
catch (RuntimeException $e)
{
JError::raiseWarning(500, $e->getMessage());
}
$link = JHtml::_(
'link',
JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . $result),
JText::_('PLG_SYSTEM_ACTIONLOGS_JOOMLA_ACTIONLOG_DISABLED'),
array('class' => 'alert-link')
);
return '<div class="alert alert-info">'
. JText::sprintf('PLG_SYSTEM_ACTIONLOGS_JOOMLA_ACTIONLOG_DISABLED_REDIRECT', $link)
. '</div>';
}
}
PK :�#]�ݧ� logcreator.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_actionlogs
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
FormHelper::loadFieldClass('list');
/**
* Field to load a list of all users that have logged actions
*
* @since 3.9.0
*/
class JFormFieldLogCreator extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.9.0
*/
protected $type = 'LogCreator';
/**
* Cached array of the category items.
*
* @var array
* @since 3.9.0
*/
protected static $options = array();
/**
* Method to get the options to populate list
*
* @return array The field option objects.
*
* @since 3.9.0
*/
protected function getOptions()
{
// Accepted modifiers
$hash = md5($this->element);
if (!isset(static::$options[$hash]))
{
static::$options[$hash] = parent::getOptions();
$options = array();
$db = Factory::getDbo();
// Construct the query
$query = $db->getQuery(true)
->select($db->quoteName('u.id', 'value'))
->select($db->quoteName('u.username', 'text'))
->from($db->quoteName('#__users', 'u'))
->join('INNER', $db->quoteName('#__action_logs', 'c') . ' ON ' . $db->quoteName('c.user_id') . ' = ' . $db->quoteName('u.id'))
->group($db->quoteName('u.id'))
->group($db->quoteName('u.username'))
->order($db->quoteName('u.username'));
// Setup the query
$db->setQuery($query);
// Return the result
if ($options = $db->loadObjectList())
{
static::$options[$hash] = array_merge(static::$options[$hash], $options);
}
}
return static::$options[$hash];
}
}
PK :�#]{�q4m m
extension.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_actionlogs
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
FormHelper::loadFieldClass('list');
JLoader::register('ActionlogsHelper', JPATH_ADMINISTRATOR . '/components/com_actionlogs/helpers/actionlogs.php');
/**
* Field to load a list of all extensions that have logged actions
*
* @since 3.9.0
*/
class JFormFieldExtension extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.9.0
*/
protected $type = 'extension';
/**
* Method to get the options to populate list
*
* @return array The field option objects.
*
* @since 3.9.0
*/
public function getOptions()
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('DISTINCT ' . $db->quoteName('extension'))
->from($db->quoteName('#__action_logs'))
->order($db->quoteName('extension'));
$db->setQuery($query);
$context = $db->loadColumn();
$options = array();
if (count($context) > 0)
{
foreach ($context as $item)
{
$extensions[] = strtok($item, '.');
}
$extensions = array_unique($extensions);
foreach ($extensions as $extension)
{
ActionlogsHelper::loadTranslationFiles($extension);
$options[] = HTMLHelper::_('select.option', $extension, Text::_($extension));
}
}
return array_merge(parent::getOptions(), $options);
}
}
PK :�#]��]� � logsdaterange.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_actionlogs
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
FormHelper::loadFieldClass('predefinedlist');
/**
* Field to show a list of range dates to sort with
*
* @since 3.9.0
*/
class JFormFieldLogsDateRange extends JFormFieldPredefinedList
{
/**
* The form field type.
*
* @var string
* @since 3.9.0
*/
protected $type = 'logsdaterange';
/**
* Available options
*
* @var array
* @since 3.9.0
*/
protected $predefinedOptions = array(
'today' => 'COM_ACTIONLOGS_OPTION_RANGE_TODAY',
'past_week' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_WEEK',
'past_1month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_1MONTH',
'past_3month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_3MONTH',
'past_6month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_6MONTH',
'past_year' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_YEAR',
);
/**
* Method to instantiate the form field object.
*
* @param JForm $form The form to attach to the form field object.
*
* @since 3.9.0
*/
public function __construct($form = null)
{
parent::__construct($form);
// Load the required language
$lang = Factory::getLanguage();
$lang->load('com_actionlogs', JPATH_ADMINISTRATOR);
}
}
PK ��#]�C=U� � mediajce/video.phpnu &1i� <?php
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
array_walk($displayData, function (&$value, $key) {
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
});
echo '<video ' . ArrayHelper::toString($displayData) . '></video>';PK ��#]�J� � mediajce/iframe.phpnu &1i� <?php
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
array_walk($displayData, function (&$value, $key) {
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
});
echo '<iframe ' . ArrayHelper::toString($displayData) . '></iframe>';PK ��#]�m��� � mediajce/figure.phpnu &1i� <?php
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
$caption = $displayData['caption'];
$html = $displayData['html'];
unset($displayData['caption']);
unset($displayData['html']);
array_walk($displayData, function (&$value, $key) {
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
});
echo '<figure' . ArrayHelper::toString($displayData) . '>' . $html . '<figcaption>' . htmlentities($caption, ENT_COMPAT, 'UTF-8', true) . '</figcaption></figure>';PK ��#]�2G G mediajce/image.phpnu &1i� <?php
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
array_walk($displayData, function (&$value, $key) {
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
if ($key !== 'alt' && $value == '') {
unset($displayData[$key]);
}
});
echo '<img ' . ArrayHelper::toString($displayData) . '>';PK ��#]�»� mediajce/object.phpnu &1i� <?php
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
unset ($displayData['src']);
array_walk($displayData, function (&$value, $key) {
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
});
echo '<object ' . ArrayHelper::toString($displayData) . '></object>';PK ��#]CZ�� � mediajce/link.phpnu &1i� <?php
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
$displayData['href'] = $displayData['src'];
unset($displayData['src']);
$attribs = array();
foreach ($displayData as $key => $value) {
if ($value !== '') {
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
$attribs[$key] = $value;
}
};
$text = isset($attribs['title']) ? $attribs['title'] : basename($attribs['href']);
echo '<a ' . ArrayHelper::toString($attribs) . '>' . $text . '</a>';PK ��#]z�C� � mediajce/audio.phpnu &1i� <?php
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
array_walk($displayData, function (&$value, $key) {
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
});
echo '<audio ' . ArrayHelper::toString($displayData) . '></audio>';PK �#]��-� �
xmapmenus.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2007 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
defined('_JEXEC') or die;
jimport('joomla.html.html');
require_once JPATH_LIBRARIES . '/joomla/form/fields/list.php';
/**
* Menus Form Field class for the Xmap Component
*
* @package Xmap
* @subpackage com_xmap
* @since 2.0
*/
class JFormFieldXmapmenus extends JFormFieldList
{
/**
* The field type.
*
* @var string
*/
public $type = 'Xmapmenus';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
protected function _getOptions()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
//$currentMenus = array_keys(get_object_vars($this->value));
$currentMenus = array();
$query->select('menutype As value, title As text');
$query->from('#__menu_types AS a');
$query->order('a.title');
// Get the options.
$db->setQuery($query);
// echo $db->getQuery();
$menus = $db->loadObjectList('value');
$options = array();
// Add the current sitemap menus in the defined order to the list
foreach ($currentMenus as $menutype) {
if (!empty($menus[$menutype])) {
$options[] = $menus[$menutype];
}
}
// Add the rest of the menus to the list (if any)
foreach ($menus as $menutype => $menu) {
if (!in_array($menutype, $currentMenus)) {
$options[] = $menu;
}
}
// Check for a database error.
if ($db->getErrorNum()) {
JError::raiseWarning(500, $db->getErrorMsg());
}
$options = array_merge(
parent::getOptions(),
$options
);
return $options;
}
/**
* Method to get the field input.
*
* @return string The field input.
*/
protected function getInput()
{
$disabled = $this->element['disabled'] == 'true' ? true : false;
$readonly = $this->element['readonly'] == 'true' ? true : false;
$attributes = ' ';
$type = 'radio';
if ($v = $this->element['size']) {
$attributes .= 'size="' . $v . '" ';
}
if ($v = $this->element['class']) {
$attributes .= 'class="' . $v . '" ';
} else {
$attributes .= 'class="inputbox" ';
}
if ($m = $this->element['multiple']) {
$type = 'checkbox';
}
$value = $this->value;
if (!is_array($value)) {
// Convert the selections field to an array.
$registry = new JRegistry;
$registry->loadString($value);
$value = $registry->toArray();
}
$doc = JFactory::getDocument();
$doc->addScriptDeclaration("
window.addEvent('domready',function(){
\$\$('div.xmap-menu-options select').addEvent('mouseover',function(event){xmapMenusSortable.detach();})
\$\$('div.xmap-menu-options select').addEvent('mouseout',function(event){xmapMenusSortable.attach();})
var xmapMenusSortable = new Sortables(\$('ul_" . $this->inputId . "'),{
clone:true,
revert: true,
preventDefault: true,
onStart: function(el) {
el.setStyle('background','#bbb');
},
onComplete: function(el) {
el.setStyle('background','#eee');
}
});
});");
if ($disabled || $readonly) {
$attributes .= 'disabled="disabled"';
}
$options = (array) $this->_getOptions();
$return = '<ul id="ul_' . $this->inputId . '" class="ul_sortable">';
// Create a regular list.
$i = 0;
//Lets show the enabled menus first
$this->currentItems = array_keys($value);
// Sort the menu options
uasort($options, array($this, 'myCompare'));
foreach ($options as $option) {
$prioritiesName = preg_replace('/(jform\[[^\]]+)(\].*)/', '$1_priority$2', $this->name);
$changefreqName = preg_replace('/(jform\[[^\]]+)(\].*)/', '$1_changefreq$2', $this->name);
$selected = (isset($value[$option->value]) ? ' checked="checked"' : '');
$i++;
$return .= '<li id="menu_' . $i . '">';
$return .= '<input type="' . $type . '" id="' . $this->id . '_' . $i . '" name="' . $this->name . '" value="' . $option->value . '"' . $attributes . $selected . ' />';
$return .= '<label for="' . $this->id . '_' . $i . '" class="menu_label">' . $option->text . '</label>';
$return .= '<div class="xmap-menu-options" id="menu_options_' . $i . '">';
$return .= '<label class="control-label">' . JText::_('XMAP_PRIORITY') . '</label>';
$return .= '<div class="controls">' . JHTML::_('xmap.priorities', $prioritiesName, ($selected ? $value[$option->value]['priority'] : '0.5'), $i) . '</div>';
$return .= '<label class="control-label">' . JText::_('XMAP_CHANGE_FREQUENCY') . '</label>';
$return .= '<div class="controls">' . JHTML::_('xmap.changefrequency', $changefreqName, ($selected ? $value[$option->value]['changefreq'] : 'weekly'), $i) . '</div>';
$return .= '</div>';
$return .= '</li>';
}
$return .= "</ul>";
return $return;
}
public function myCompare($a, $b) {
$indexA = array_search($a->value, $this->currentItems);
$indexB = array_search($b->value, $this->currentItems);
if ($indexA === $indexB && $indexA !== false) {
return 0;
}
if ($indexA === false && $indexA === $indexB) {
return ($a->value < $b->value) ? -1 : 1;
}
if ($indexA === false) {
return 1;
}
if ($indexB === false) {
return -1;
}
return ($indexA < $indexB) ? -1 : 1;
}
}
PK �#]�S�B B modal/sitemaps.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2007 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
defined('_JEXEC') or die;
jimport('joomla.form.field');
/**
* Supports a modal sitemap picker.
*
* @package Xmap
* @subpackage com_xmap
* @since 2.0
*/
class JFormFieldModal_Sitemaps extends JFormField
{
/**
* The field type.
*
* @var string
*/
protected $type = 'Modal_Sitemaps';
/**
* Method to get a list of options for a sitemaps list input.
*
* @return array An array of JHtml options.
*/
protected function getInput()
{
// Initialise variables.
$db = JFactory::getDBO();
$doc = JFactory::getDocument();
// Load the modal behavior.
JHtml::_('behavior.modal', 'a.modal');
// Get the title of the linked chart
if ($this->value) {
$db->setQuery(
'SELECT title' .
' FROM #__xmap_sitemap' .
' WHERE id = ' . (int) $this->value
);
$title = $db->loadResult();
if ($error = $db->getErrorMsg()) {
JError::raiseWarning(500, $error);
}
} else {
$title = '';
}
if (empty($title)) {
$title = JText::_('COM_XMAP_SELECT_AN_SITEMAP');
}
$doc->addScriptDeclaration(
"function jSelectSitemap_" . $this->id . "(id, title, object) {
$('" . $this->id . "_id').value = id;
$('" . $this->id . "_name').value = title;
SqueezeBox.close();
}"
);
$link = 'index.php?option=com_xmap&view=sitemaps&layout=modal&tmpl=component&function=jSelectSitemap_' . $this->id;
JHTML::_('behavior.modal', 'a.modal');
$html = '<span class="input-append">';
$html .= "\n" . '<input class="input-medium" type="text" id="' . $this->id . '_name" value="' . htmlspecialchars($title, ENT_QUOTES, 'UTF-8') . '" disabled="disabled" />';
if(version_compare(JVERSION,'3.0.0','ge'))
$html .= '<a class="modal btn" title="' . JText::_('COM_XMAP_CHANGE_SITEMAP') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('COM_XMAP_CHANGE_SITEMAP_BUTTON') . '</a>' . "\n";
else
$html .= '<div class="button2-left"><div class="blank"><a class="modal btn" title="' . JText::_('COM_XMAP_CHANGE_SITEMAP') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('COM_XMAP_CHANGE_SITEMAP_BUTTON') . '</a></div></div>' . "\n";
$html .= '</span>';
$html .= "\n" . '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . (int) $this->value . '" />';
return $html;
}
}PK �#]�6� modal/index.htmlnu &1i� <!DOCTYPE html><title></title>PK �#]�6�
index.htmlnu &1i� <!DOCTYPE html><title></title>PK Z�#]�vhi i plugintype.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_plugins
*
* @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('PluginsHelper', JPATH_ADMINISTRATOR . '/components/com_plugins/helpers/plugins.php');
JFormHelper::loadFieldClass('list');
/**
* Plugin Type field.
*
* @since 3.5
*/
class JFormFieldPluginType extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.5
*/
protected $type = 'PluginType';
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 3.5
*/
public function getOptions()
{
$options = PluginsHelper::folderOptions();
return array_merge(parent::getOptions(), $options);
}
}
PK Z�#]�*n�y y pluginelement.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_plugins
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('PluginsHelper', JPATH_ADMINISTRATOR . '/components/com_plugins/helpers/plugins.php');
JFormHelper::loadFieldClass('list');
/**
* Plugin Element field.
*
* @since 3.9.0
*/
class JFormFieldPluginElement extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.9.0
*/
protected $type = 'PluginElement';
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 3.9.0
*/
public function getOptions()
{
$options = PluginsHelper::elementOptions();
return array_merge(parent::getOptions(), $options);
}
}
PK Z�#]X�D� � pluginordering.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_plugins
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JFormHelper::loadFieldClass('ordering');
/**
* Supports an HTML select list of plugins.
*
* @since 1.6
*/
class JFormFieldPluginordering extends JFormFieldOrdering
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'Pluginordering';
/**
* Builds the query for the ordering list.
*
* @return JDatabaseQuery The query for the ordering form field.
*/
protected function getQuery()
{
$db = JFactory::getDbo();
$folder = $this->form->getValue('folder');
// Build the query for the ordering list.
$query = $db->getQuery(true)
->select(
array(
$db->quoteName('ordering', 'value'),
$db->quoteName('name', 'text'),
$db->quoteName('type'),
$db->quote('folder'),
$db->quote('extension_id')
)
)
->from($db->quoteName('#__extensions'))
->where('(type =' . $db->quote('plugin') . 'AND folder=' . $db->quote($folder) . ')')
->order('ordering');
return $query;
}
/**
* Retrieves the current Item's Id.
*
* @return integer The current item ID.
*/
protected function getItemId()
{
return (int) $this->form->getValue('extension_id');
}
}
PK k$]�&~�� � menupreset.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @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;
use Joomla\CMS\Menu\MenuHelper;
JFormHelper::loadFieldClass('list');
/**
* Administrator Menu Presets list field.
*
* @since 3.8.0
*/
class JFormFieldMenuPreset extends JFormFieldList
{
/**
* The form field type.
*
* @var string
*
* @since 3.8.0
*/
protected $type = 'MenuPreset';
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 3.8.0
*/
protected function getOptions()
{
$options = array();
$presets = MenuHelper::getPresets();
foreach ($presets as $preset)
{
$options[] = JHtml::_('select.option', $preset->name, JText::_($preset->title));
}
return array_merge(parent::getOptions(), $options);
}
}
PK k$]}QT�� � menuitembytype.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
JFormHelper::loadFieldClass('groupedlist');
// Import the com_menus helper.
JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php');
/**
* Supports an HTML grouped select list of menu item grouped by menu
*
* @since 3.8.0
*/
class JFormFieldMenuitemByType extends JFormFieldGroupedList
{
/**
* The form field type.
*
* @var string
* @since 3.8.0
*/
public $type = 'MenuItemByType';
/**
* The menu type.
*
* @var string
* @since 3.8.0
*/
protected $menuType;
/**
* The client id.
*
* @var string
* @since 3.8.0
*/
protected $clientId;
/**
* The language.
*
* @var array
* @since 3.8.0
*/
protected $language;
/**
* The published status.
*
* @var array
* @since 3.8.0
*/
protected $published;
/**
* The disabled status.
*
* @var array
* @since 3.8.0
*/
protected $disable;
/**
* Method to get certain otherwise inaccessible properties from the form field object.
*
* @param string $name The property name for which to get the value.
*
* @return mixed The property value or null.
*
* @since 3.8.0
*/
public function __get($name)
{
switch ($name)
{
case 'menuType':
case 'clientId':
case 'language':
case 'published':
case 'disable':
return $this->$name;
}
return parent::__get($name);
}
/**
* Method to set certain otherwise inaccessible properties of the form field object.
*
* @param string $name The property name for which to set the value.
* @param mixed $value The value of the property.
*
* @return void
*
* @since 3.8.0
*/
public function __set($name, $value)
{
switch ($name)
{
case 'menuType':
$this->menuType = (string) $value;
break;
case 'clientId':
$this->clientId = (int) $value;
break;
case 'language':
case 'published':
case 'disable':
$value = (string) $value;
$this->$name = $value ? explode(',', $value) : array();
break;
default:
parent::__set($name, $value);
}
}
/**
* 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.8.0
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$result = parent::setup($element, $value, $group);
if ($result == true)
{
$menuType = (string) $this->element['menu_type'];
if (!$menuType)
{
$app = JFactory::getApplication('administrator');
$currentMenuType = $app->getUserState('com_menus.items.menutype', '');
$menuType = $app->input->getString('menutype', $currentMenuType);
}
$this->menuType = $menuType;
$this->clientId = (int) $this->element['client_id'];
$this->published = $this->element['published'] ? explode(',', (string) $this->element['published']) : array();
$this->disable = $this->element['disable'] ? explode(',', (string) $this->element['disable']) : array();
$this->language = $this->element['language'] ? explode(',', (string) $this->element['language']) : array();
}
return $result;
}
/**
* Method to get the field option groups.
*
* @return array The field option objects as a nested array in groups.
*
* @since 3.8.0
*/
protected function getGroups()
{
$groups = array();
$menuType = $this->menuType;
// Get the menu items.
$items = MenusHelper::getMenuLinks($menuType, 0, 0, $this->published, $this->language, $this->clientId);
// Build group for a specific menu type.
if ($menuType)
{
// If the menutype is empty, group the items by menutype.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('title'))
->from($db->quoteName('#__menu_types'))
->where($db->quoteName('menutype') . ' = ' . $db->quote($menuType));
$db->setQuery($query);
try
{
$menuTitle = $db->loadResult();
}
catch (RuntimeException $e)
{
$menuTitle = $menuType;
}
// Initialize the group.
$groups[$menuTitle] = array();
// Build the options array.
foreach ($items as $key => $link)
{
// Unset if item is menu_item_root
if ($link->text === 'Menu_Item_Root')
{
unset($items[$key]);
continue;
}
$levelPrefix = str_repeat('- ', max(0, $link->level - 1));
// Displays language code if not set to All
if ($link->language !== '*')
{
$lang = ' (' . $link->language . ')';
}
else
{
$lang = '';
}
$groups[$menuTitle][] = JHtml::_('select.option',
$link->value, $levelPrefix . $link->text . $lang,
'value',
'text',
in_array($link->type, $this->disable)
);
}
}
// Build groups for all menu types.
else
{
// Build the groups arrays.
foreach ($items as $menu)
{
// Initialize the group.
$groups[$menu->title] = array();
// Build the options array.
foreach ($menu->links as $link)
{
$levelPrefix = str_repeat('- ', max(0, $link->level - 1));
// Displays language code if not set to All
if ($link->language !== '*')
{
$lang = ' (' . $link->language . ')';
}
else
{
$lang = '';
}
$groups[$menu->title][] = JHtml::_('select.option',
$link->value,
$levelPrefix . $link->text . $lang,
'value',
'text',
in_array($link->type, $this->disable)
);
}
}
}
// Merge any additional groups in the XML definition.
$groups = array_merge(parent::getGroups(), $groups);
return $groups;
}
}
PK k$]_��
�
menutype.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
JFormHelper::loadFieldClass('list');
/**
* Menu Type field.
*
* @since 1.6
*/
class JFormFieldMenutype extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'menutype';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 1.6
*/
protected function getInput()
{
$html = array();
$recordId = (int) $this->form->getValue('id');
$size = (string) ($v = $this->element['size']) ? ' size="' . $v . '"' : '';
$class = (string) ($v = $this->element['class']) ? ' class="' . $v . '"' : 'class="text_area"';
$required = (string) $this->element['required'] ? ' required="required"' : '';
$clientId = (int) $this->element['clientid'] ?: 0;
// Get a reverse lookup of the base link URL to Title
switch ($this->value)
{
case 'url':
$value = JText::_('COM_MENUS_TYPE_EXTERNAL_URL');
break;
case 'alias':
$value = JText::_('COM_MENUS_TYPE_ALIAS');
break;
case 'separator':
$value = JText::_('COM_MENUS_TYPE_SEPARATOR');
break;
case 'heading':
$value = JText::_('COM_MENUS_TYPE_HEADING');
break;
case 'container':
$value = JText::_('COM_MENUS_TYPE_CONTAINER');
break;
default:
$link = $this->form->getValue('link');
/** @var MenusModelMenutypes $model */
$model = JModelLegacy::getInstance('Menutypes', 'MenusModel', array('ignore_request' => true));
$model->setState('client_id', $clientId);
$rlu = $model->getReverseLookup();
// Clean the link back to the option, view and layout
$value = JText::_(ArrayHelper::getValue($rlu, MenusHelper::getLinkKey($link)));
break;
}
// Include jQuery
JHtml::_('jquery.framework');
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration('
function jSelectPosition_' . $this->id . '(name) {
document.getElementById("' . $this->id . '").value = name;
}
'
);
$link = JRoute::_('index.php?option=com_menus&view=menutypes&tmpl=component&client_id=' . $clientId . '&recordId=' . $recordId);
$html[] = '<span class="input-append"><input type="text" ' . $required . ' readonly="readonly" id="' . $this->id
. '" value="' . $value . '" ' . $size . $class . ' />';
$html[] = '<button type="button" data-target="#menuTypeModal" class="btn btn-primary" data-toggle="modal" title="' . JText::_('JSELECT') . '">'
. '<span class="icon-list icon-white" aria-hidden="true"></span> '
. JText::_('JSELECT') . '</button></span>';
$html[] = JHtml::_(
'bootstrap.renderModal',
'menuTypeModal',
array(
'url' => $link,
'title' => JText::_('COM_MENUS_ITEM_FIELD_TYPE_LABEL'),
'width' => '800px',
'height' => '300px',
'modalWidth' => '80',
'bodyHeight' => '70',
'footer' => '<button type="button" class="btn" data-dismiss="modal">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
)
);
$html[] = '<input class="input-small" type="hidden" name="' . $this->name . '" value="'
. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" />';
return implode("\n", $html);
}
}
PK k$]XP��G G menuparent.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JFormHelper::loadFieldClass('list');
/**
* Menu Parent field.
*
* @since 1.6
*/
class JFormFieldMenuParent extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'MenuParent';
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 1.6
*/
protected function getOptions()
{
$options = array();
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('DISTINCT(a.id) AS value, a.title AS text, a.level, a.lft')
->from('#__menu AS a');
// Filter by menu type.
if ($menuType = $this->form->getValue('menutype'))
{
$query->where('a.menutype = ' . $db->quote($menuType));
}
else
{
// Skip special menu types
$query->where('a.menutype != ' . $db->quote(''));
$query->where('a.menutype != ' . $db->quote('main'));
}
// Filter by client id.
$clientId = $this->getAttribute('clientid');
if (!is_null($clientId))
{
$query->where($db->quoteName('a.client_id') . ' = ' . (int) $clientId);
}
// Prevent parenting to children of this item.
if ($id = $this->form->getValue('id'))
{
$query->join('LEFT', $db->quoteName('#__menu') . ' AS p ON p.id = ' . (int) $id)
->where('NOT(a.lft >= p.lft AND a.rgt <= p.rgt)');
}
$query->where('a.published != -2')
->order('a.lft ASC');
// Get the options.
$db->setQuery($query);
try
{
$options = $db->loadObjectList();
}
catch (RuntimeException $e)
{
JError::raiseWarning(500, $e->getMessage());
}
// Pad the option text with spaces using depth level as a multiplier.
for ($i = 0, $n = count($options); $i < $n; $i++)
{
if ($clientId != 0)
{
// Allow translation of custom admin menus
$options[$i]->text = str_repeat('- ', $options[$i]->level) . JText::_($options[$i]->text);
}
else
{
$options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text;
}
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
}
PK k$]D��� componentscategory.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @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;
use Joomla\Utilities\ArrayHelper;
JFormHelper::loadFieldClass('list');
/**
* Components Category field.
*
* @since 1.6
*/
class JFormFieldComponentsCategory extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.7.0
*/
protected $type = 'ComponentsCategory';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*
* @since 3.7.0
*/
protected function getOptions()
{
// Initialise variable.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('DISTINCT a.name AS text, a.element AS value')
->from('#__extensions as a')
->where('a.enabled >= 1')
->where('a.type =' . $db->quote('component'))
->join('INNER', '#__categories as b ON a.element=b.extension');
$items = $db->setQuery($query)->loadObjectList();
if (count($items))
{
$lang = JFactory::getLanguage();
foreach ($items as &$item)
{
// Load language
$extension = $item->value;
$source = JPATH_ADMINISTRATOR . '/components/' . $extension;
$lang->load("$extension.sys", JPATH_ADMINISTRATOR, null, false, true)
|| $lang->load("$extension.sys", $source, null, false, true);
// Translate component name
$item->text = JText::_($item->text);
}
// Sort by component name
$items = ArrayHelper::sortObjects($items, 'text', 1, true, true);
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $items);
return $options;
}
}
PK k$]��Ҩ3 �3 modal/menu.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @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;
use Joomla\CMS\Language\LanguageHelper;
JHtml::_('bootstrap.tooltip', '.hasTooltip');
/**
* Supports a modal menu item picker.
*
* @since 3.7.0
*/
class JFormFieldModal_Menu extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 3.7.0
*/
protected $type = 'Modal_Menu';
/**
* Determinate, if the select button is shown
*
* @var boolean
* @since 3.7.0
*/
protected $allowSelect = true;
/**
* Determinate, if the clear button is shown
*
* @var boolean
* @since 3.7.0
*/
protected $allowClear = true;
/**
* Determinate, if the create button is shown
*
* @var boolean
* @since 3.7.0
*/
protected $allowNew = false;
/**
* Determinate, if the edit button is shown
*
* @var boolean
* @since 3.7.0
*/
protected $allowEdit = false;
/**
* Determinate, if the propagate button is shown
*
* @var boolean
* @since 3.9.0
*/
protected $allowPropagate = false;
/**
* Method to get certain otherwise inaccessible properties from the form field object.
*
* @param string $name The property name for which to get the value.
*
* @return mixed The property value or null.
*
* @since 3.7.0
*/
public function __get($name)
{
switch ($name)
{
case 'allowSelect':
case 'allowClear':
case 'allowNew':
case 'allowEdit':
case 'allowPropagate':
return $this->$name;
}
return parent::__get($name);
}
/**
* Method to set certain otherwise inaccessible properties of the form field object.
*
* @param string $name The property name for which to set the value.
* @param mixed $value The value of the property.
*
* @return void
*
* @since 3.7.0
*/
public function __set($name, $value)
{
switch ($name)
{
case 'allowSelect':
case 'allowClear':
case 'allowNew':
case 'allowEdit':
case 'allowPropagate':
$value = (string) $value;
$this->$name = !($value === 'false' || $value === 'off' || $value === '0');
break;
default:
parent::__set($name, $value);
}
}
/**
* 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);
if ($return)
{
$this->allowSelect = ((string) $this->element['select']) !== 'false';
$this->allowClear = ((string) $this->element['clear']) !== 'false';
$this->allowPropagate = ((string) $this->element['propagate']) === 'true';
// Creating/editing menu items is not supported in frontend.
$isAdministrator = JFactory::getApplication()->isClient('administrator');
$this->allowNew = $isAdministrator ? ((string) $this->element['new']) === 'true' : false;
$this->allowEdit = $isAdministrator ? ((string) $this->element['edit']) === 'true' : false;
}
return $return;
}
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 3.7.0
*/
protected function getInput()
{
$clientId = (int) $this->element['clientid'];
$languages = LanguageHelper::getContentLanguages(array(0, 1));
// Load language
JFactory::getLanguage()->load('com_menus', JPATH_ADMINISTRATOR);
// The active article id field.
$value = (int) $this->value > 0 ? (int) $this->value : '';
// Create the modal id.
$modalId = 'Item_' . $this->id;
// Add the modal field script to the document head.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/modal-fields.js', array('version' => 'auto', 'relative' => true));
// Script to proxy the select modal function to the modal-fields.js file.
if ($this->allowSelect)
{
static $scriptSelect = null;
if (is_null($scriptSelect))
{
$scriptSelect = array();
}
if (!isset($scriptSelect[$this->id]))
{
JFactory::getDocument()->addScriptDeclaration("
function jSelectMenu_" . $this->id . "(id, title, object) {
window.processModalSelect('Item', '" . $this->id . "', id, title, '', object);
}
"
);
JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED');
$scriptSelect[$this->id] = true;
}
}
// Setup variables for display.
$linkSuffix = '&layout=modal&client_id=' . $clientId . '&tmpl=component&' . JSession::getFormToken() . '=1';
$linkItems = 'index.php?option=com_menus&view=items' . $linkSuffix;
$linkItem = 'index.php?option=com_menus&view=item' . $linkSuffix;
$modalTitle = JText::_('COM_MENUS_CHANGE_MENUITEM');
if (isset($this->element['language']))
{
$linkItems .= '&forcedLanguage=' . $this->element['language'];
$linkItem .= '&forcedLanguage=' . $this->element['language'];
$modalTitle .= ' — ' . $this->element['label'];
}
$urlSelect = $linkItems . '&function=jSelectMenu_' . $this->id;
$urlEdit = $linkItem . '&task=item.edit&id=\' + document.getElementById("' . $this->id . '_id").value + \'';
$urlNew = $linkItem . '&task=item.add';
if ($value)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('title'))
->from($db->quoteName('#__menu'))
->where($db->quoteName('id') . ' = ' . (int) $value);
$db->setQuery($query);
try
{
$title = $db->loadResult();
}
catch (RuntimeException $e)
{
JError::raiseWarning(500, $e->getMessage());
}
}
// Placeholder if option is present or not
if (empty($title))
{
if ($this->element->option && (string) $this->element->option['value'] == '')
{
$title_holder = JText::_($this->element->option);
}
else
{
$title_holder = JText::_('COM_MENUS_SELECT_A_MENUITEM');
}
}
$title = empty($title) ? $title_holder : htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
// The current menu item display field.
$html = '<span class="input-append">';
$html .= '<input class="input-medium" id="' . $this->id . '_name" type="text" value="' . $title . '" disabled="disabled" size="35" />';
// Select menu item button
if ($this->allowSelect)
{
$html .= '<button'
. ' type="button"'
. ' class="btn hasTooltip' . ($value ? ' hidden' : '') . '"'
. ' id="' . $this->id . '_select"'
. ' data-toggle="modal"'
. ' data-target="#ModalSelect' . $modalId . '"'
. ' title="' . JHtml::tooltipText('COM_MENUS_CHANGE_MENUITEM') . '">'
. '<span class="icon-file" aria-hidden="true"></span> ' . JText::_('JSELECT')
. '</button>';
}
// New menu item button
if ($this->allowNew)
{
$html .= '<button'
. ' type="button"'
. ' class="btn hasTooltip' . ($value ? ' hidden' : '') . '"'
. ' id="' . $this->id . '_new"'
. ' data-toggle="modal"'
. ' data-target="#ModalNew' . $modalId . '"'
. ' title="' . JHtml::tooltipText('COM_MENUS_NEW_MENUITEM') . '">'
. '<span class="icon-new" aria-hidden="true"></span> ' . JText::_('JACTION_CREATE')
. '</button>';
}
// Edit menu item button
if ($this->allowEdit)
{
$html .= '<button'
. ' type="button"'
. ' class="btn hasTooltip' . ($value ? '' : ' hidden') . '"'
. ' id="' . $this->id . '_edit"'
. ' data-toggle="modal"'
. ' data-target="#ModalEdit' . $modalId . '"'
. ' title="' . JHtml::tooltipText('COM_MENUS_EDIT_MENUITEM') . '">'
. '<span class="icon-edit" aria-hidden="true"></span> ' . JText::_('JACTION_EDIT')
. '</button>';
}
// Clear menu item button
if ($this->allowClear)
{
$html .= '<button'
. ' type="button"'
. ' class="btn' . ($value ? '' : ' hidden') . '"'
. ' id="' . $this->id . '_clear"'
. ' onclick="window.processModalParent(\'' . $this->id . '\'); return false;">'
. '<span class="icon-remove" aria-hidden="true"></span>' . JText::_('JCLEAR')
. '</button>';
}
// Propagate menu item button
if ($this->allowPropagate && count($languages) > 2)
{
// Strip off language tag at the end
$tagLength = (int) strlen($this->element['language']);
$callbackFunctionStem = substr("jSelectMenu_" . $this->id, 0, -$tagLength);
$html .= '<a'
. ' class="btn hasTooltip' . ($value ? '' : ' hidden') . '"'
. ' id="' . $this->id . '_propagate"'
. ' href="#"'
. ' title="' . JHtml::tooltipText('JGLOBAL_ASSOCIATIONS_PROPAGATE_TIP') . '"'
. ' onclick="Joomla.propagateAssociation(\'' . $this->id . '\', \'' . $callbackFunctionStem . '\');">'
. '<span class="icon-refresh" aria-hidden="true"></span>' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON')
. '</a>';
}
$html .= '</span>';
// Select menu item modal
if ($this->allowSelect)
{
$html .= JHtml::_(
'bootstrap.renderModal',
'ModalSelect' . $modalId,
array(
'title' => $modalTitle,
'url' => $urlSelect,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<button type="button" class="btn" data-dismiss="modal">' . JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>',
)
);
}
// New menu item modal
if ($this->allowNew)
{
$html .= JHtml::_(
'bootstrap.renderModal',
'ModalNew' . $modalId,
array(
'title' => JText::_('COM_MENUS_NEW_MENUITEM'),
'backdrop' => 'static',
'keyboard' => false,
'closeButton' => false,
'url' => $urlNew,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<button type="button" class="btn"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'item\', \'cancel\', \'item-form\'); return false;">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" class="btn btn-primary"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'item\', \'save\', \'item-form\'); return false;">'
. JText::_('JSAVE') . '</button>'
. '<button type="button" class="btn btn-success"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'item\', \'apply\', \'item-form\'); return false;">'
. JText::_('JAPPLY') . '</button>',
)
);
}
// Edit menu item modal
if ($this->allowEdit)
{
$html .= JHtml::_(
'bootstrap.renderModal',
'ModalEdit' . $modalId,
array(
'title' => JText::_('COM_MENUS_EDIT_MENUITEM'),
'backdrop' => 'static',
'keyboard' => false,
'closeButton' => false,
'url' => $urlEdit,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<button type="button" class="btn"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'item\', \'cancel\', \'item-form\'); return false;">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" class="btn btn-primary"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'item\', \'save\', \'item-form\'); return false;">'
. JText::_('JSAVE') . '</button>'
. '<button type="button" class="btn btn-success"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'item\', \'apply\', \'item-form\'); return false;">'
. JText::_('JAPPLY') . '</button>',
)
);
}
// Note: class='required' for client side validation.
$class = $this->required ? ' class="required modal-value"' : '';
// Placeholder if option is present or not when clearing field
if ($this->element->option && (string) $this->element->option['value'] == '')
{
$title_holder = JText::_($this->element->option);
}
else
{
$title_holder = JText::_('COM_MENUS_SELECT_A_MENUITEM');
}
$html .= '<input type="hidden" id="' . $this->id . '_id" ' . $class . ' data-required="' . (int) $this->required . '" name="' . $this->name
. '" data-text="' . htmlspecialchars($title_holder, ENT_COMPAT, 'UTF-8') . '" value="' . $value . '" />';
return $html;
}
/**
* Method to get the field label markup.
*
* @return string The field label markup.
*
* @since 3.7.0
*/
protected function getLabel()
{
return str_replace($this->id, $this->id . '_id', parent::getLabel());
}
}
PK k$]z���� � menuordering.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JFormHelper::loadFieldClass('list');
/**
* Menu Ordering field.
*
* @since 1.6
*/
class JFormFieldMenuOrdering extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 1.7
*/
protected $type = 'MenuOrdering';
/**
* Method to get the list of siblings in a menu.
* The method requires that parent be set.
*
* @return array The field option objects or false if the parent field has not been set
*
* @since 1.7
*/
protected function getOptions()
{
$options = array();
// Get the parent
$parent_id = $this->form->getValue('parent_id', 0);
if (empty($parent_id))
{
return false;
}
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('a.id AS value, a.title AS text, a.client_id AS ' . $db->quoteName('clientId'))
->from('#__menu AS a')
->where('a.published >= 0')
->where('a.parent_id =' . (int) $parent_id);
if ($menuType = $this->form->getValue('menutype'))
{
$query->where('a.menutype = ' . $db->quote($menuType));
}
else
{
$query->where('a.menutype != ' . $db->quote(''));
}
$query->order('a.lft ASC');
// Get the options.
$db->setQuery($query);
try
{
$options = $db->loadObjectList();
}
catch (RuntimeException $e)
{
JError::raiseWarning(500, $e->getMessage());
}
// Allow translation of custom admin menus
foreach ($options as &$option)
{
if ($option->clientId != 0)
{
$option->text = JText::_($option->text);
}
}
$options = array_merge(
array(array('value' => '-1', 'text' => JText::_('COM_MENUS_ITEM_FIELD_ORDERING_VALUE_FIRST'))),
$options,
array(array('value' => '-2', 'text' => JText::_('COM_MENUS_ITEM_FIELD_ORDERING_VALUE_LAST')))
);
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 1.7
*/
protected function getInput()
{
if ($this->form->getValue('id', 0) == 0)
{
return '<span class="readonly">' . JText::_('COM_MENUS_ITEM_FIELD_ORDERING_TEXT') . '</span>';
}
else
{
return parent::getInput();
}
}
}
PK &$]�fOt'