Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla4/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla4/item.tar

tmpl/edit.php000064400000017737151157244760007211 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_menus
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @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.core');
JHtml::_('behavior.tabstate');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen',
'#jform_request_filter_tag', null,
array('placeholder_text_multiple' =>
JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_TAGS')));
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');

JText::script('ERROR');
JText::script('JGLOBAL_VALIDATION_FORM_FAILED');

$assoc = JLanguageAssociations::isEnabled();

// Ajax for parent items
$script = "
jQuery(document).ready(function ($){
	$('#jform_menutype').change(function(){
		var menutype = $(this).val();
		$.ajax({
			url:
'index.php?option=com_menus&task=item.getParentItem&menutype='
+ menutype,
			dataType: 'json'
		}).done(function(data) {
			$('#jform_parent_id option').each(function() {
				if ($(this).val() != '1') {
					$(this).remove();
				}
			});

			$.each(data, function (i, val) {
				var option = $('<option>');
				option.text(val.title).val(val.id);
				$('#jform_parent_id').append(option);
			});
			$('#jform_parent_id').trigger('liszt:updated');
		});
	});

	// Menu type Login Form specific
	$('#item-form').on('submit', function() {
		if ($('#jform_params_login_redirect_url') &&
$('#jform_params_logout_redirect_url')) {
			// Login
			if
($('#jform_params_login_redirect_url').closest('.control-group').css('display')
=== 'block') {
				$('#jform_params_login_redirect_menuitem_id').val('');
			}
			if
($('#jform_params_login_redirect_menuitem_name').closest('.control-group').css('display')
=== 'block') {
				$('#jform_params_login_redirect_url').val('');

			}

			// Logout
			if
($('#jform_params_logout_redirect_url').closest('.control-group').css('display')
=== 'block') {
				$('#jform_params_logout_redirect_menuitem_id').val('');
			}
			if
($('#jform_params_logout_redirect_menuitem_id').closest('.control-group').css('display')
=== 'block') {
				$('#jform_params_logout_redirect_url').val('');
			}
		}
	});
});

Joomla.submitbutton = function(task, type){
	if (task == 'item.setType' || task ==
'item.setMenuType')
	{
		if (task == 'item.setType')
		{
			jQuery('#item-form
input[name=\"jform[type]\"]').val(type);
			jQuery('#fieldtype').val('type');
		} else {
			jQuery('#item-form
input[name=\"jform[menutype]\"]').val(type);
		}
		Joomla.submitform('item.setType',
document.getElementById('item-form'));
	} else if (task == 'item.cancel' ||
document.formvalidator.isValid(document.getElementById('item-form')))
	{
		Joomla.submitform(task, document.getElementById('item-form'));

		// @deprecated 4.0  The following js is not needed since 3.7.0.
		if (task !== 'item.apply')
		{
			window.parent.jQuery('#menuEdit" . (int) $this->item->id
. "Modal').modal('hide');
		}
	}
	else
	{
		// special case for modal popups validation response
		jQuery('#item-form .modal-value.invalid').each(function(){
			var field = jQuery(this),
				idReversed =
field.attr('id').split('').reverse().join(''),
				separatorLocation = idReversed.indexOf('_'),
				nameId = '#' +
idReversed.substr(separatorLocation).split('').reverse().join('')
+ 'name';
			jQuery(nameId).addClass('invalid');
		});
	}
};
";

$input = JFactory::getApplication()->input;

// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration($script);
// In case of modal
$isModal  = $input->get('layout') == 'modal' ? true
: false;
$layout   = $isModal ? 'modal' : 'edit';
$tmpl     = $isModal || $input->get('tmpl', '',
'cmd') === 'component' ?
'&tmpl=component' : '';
$clientId = $this->state->get('item.client_id', 0);
$lang     = JFactory::getLanguage()->getTag();

// Load mod_menu.ini file when client is administrator
if ($clientId === 1)
{
	JFactory::getLanguage()->load('mod_menu',
JPATH_ADMINISTRATOR, null, false, true);
}
?>
<form action="<?php echo
JRoute::_('index.php?option=com_menus&view=item&client_id='
. $clientId . '&layout=' . $layout . $tmpl .
'&id=' . (int) $this->item->id); ?>"
method="post" name="adminForm" id="item-form"
class="form-validate">

	<?php echo JLayoutHelper::render('joomla.edit.title_alias',
$this); ?>

	<?php // Add the translation of the menu item title when client is
administrator ?>
	<?php if ($clientId === 1 && $this->item->id != 0) :
?>
		<div class="form-inline form-inline-header">
			<div class="control-group">
				<div class="control-label">
					<label><?php echo
JText::sprintf('COM_MENUS_TITLE_TRANSLATION', $lang);
?></label>
				</div>
				<div class="controls">
					<input class="input-xlarge" value="<?php echo
JText::_($this->item->title); ?>"
readonly="readonly" type="text">
				</div>
			</div>
		</div>
	<?php endif; ?>

	<div class="form-horizontal">
		<?php echo JHtml::_('bootstrap.startTabSet',
'myTab', array('active' => 'details'));
?>

		<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'details', JText::_('COM_MENUS_ITEM_DETAILS')); ?>
		<div class="row-fluid">
			<div class="span9">
				<?php
				echo $this->form->renderField('type');

				if ($this->item->type == 'alias')
				{
					echo $this->form->renderField('aliasoptions',
'params');
				}

				if ($this->item->type == 'separator')
				{
					echo $this->form->renderField('text_separator',
'params');
				}

				echo $this->form->renderFieldset('request');

				if ($this->item->type == 'url')
				{
					$this->form->setFieldAttribute('link',
'readonly', 'false');
					$this->form->setFieldAttribute('link',
'required', 'true');
				}

				echo $this->form->renderField('link');

				if ($this->item->type == 'alias')
				{
					echo $this->form->renderField('alias_redirect',
'params');
				}

				echo $this->form->renderField('browserNav');
				echo $this->form->renderField('template_style_id');

				if (!$isModal && $this->item->type ==
'container')
				{
					echo $this->loadTemplate('container');
				}
				?>
			</div>
			<div class="span3">
				<?php
				// Set main fields.
				$this->fields = array(
					'id',
					'client_id',
					'menutype',
					'parent_id',
					'menuordering',
					'published',
					'home',
					'access',
					'language',
					'note',
				);

				if ($this->item->type != 'component')
				{
					$this->fields = array_diff($this->fields,
array('home'));
				}

				echo JLayoutHelper::render('joomla.edit.global', $this);
?>
			</div>
		</div>
		<?php echo JHtml::_('bootstrap.endTab'); ?>

		<?php
		$this->fieldsets = array();
		$this->ignore_fieldsets = array('aliasoptions',
'request', 'item_associations');
		echo JLayoutHelper::render('joomla.edit.params', $this);
		?>

		<?php if (!$isModal && $assoc &&
$this->state->get('item.client_id') != 1) : ?>
			<?php if ($this->item->type !== 'alias' &&
$this->item->type !== 'url'
				&& $this->item->type !== 'separator' &&
$this->item->type !== 'heading') : ?>
				<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'associations',
JText::_('JGLOBAL_FIELDSET_ASSOCIATIONS')); ?>
				<?php echo $this->loadTemplate('associations'); ?>
				<?php echo JHtml::_('bootstrap.endTab'); ?>
			<?php endif; ?>
		<?php elseif ($isModal && $assoc &&
$this->state->get('item.client_id') != 1) : ?>
			<div class="hidden"><?php echo
$this->loadTemplate('associations'); ?></div>
		<?php endif; ?>

		<?php if (!empty($this->modules)) : ?>
			<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'modules',
JText::_('COM_MENUS_ITEM_MODULE_ASSIGNMENT')); ?>
			<?php echo $this->loadTemplate('modules'); ?>
			<?php echo JHtml::_('bootstrap.endTab'); ?>
		<?php endif; ?>

		<?php echo JHtml::_('bootstrap.endTabSet'); ?>
	</div>

	<input type="hidden" name="task" value=""
/>
	<input type="hidden" name="forcedLanguage"
value="<?php echo $input->get('forcedLanguage',
'', 'cmd'); ?>" />
	<?php echo $this->form->getInput('component_id'); ?>
	<?php echo JHtml::_('form.token'); ?>
	<input type="hidden" id="fieldtype"
name="fieldtype" value="" />
</form>
tmpl/edit.xml000064400000000763151157244760007211 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_MENUS_ITEM_VIEW_EDIT_TITLE">
		<message>
			<![CDATA[COM_MENUS_ITEM_VIEW_EDIT_DESC]]>
		</message>
	</layout>
	<fieldset name="request">
		<fields name="request">
			<field
				name="menutype"
				type="menu"
				label="COM_MENUS_ITEMS_CHOOSE_MENU_LABEL"
				description="COM_MENUS_ITEMS_CHOOSE_MENU_DESC"
				clientid=""
				>
				<option value="">COM_MENUS_SELECT_MENU</option>
			</field>
		</fields>
	</fieldset>
</metadata>
tmpl/edit_associations.php000064400000000523151157244760011751
0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_menus
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

echo JLayoutHelper::render('joomla.edit.associations', $this);
tmpl/edit_container.php000064400000011621151157244760011235
0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_menus
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */
defined('_JEXEC') or die;

use Joomla\Registry\Registry;

// Initialise related data.
$menuLinks = MenusHelper::getMenuLinks('main');

JHtml::_('script', 'jui/treeselectmenu.jquery.min.js',
array('version' => 'auto', 'relative'
=> true));

$script = <<<'JS'
	jQuery(document).ready(function ($) {
		var propagate = function () {
			var $this = $(this);
			var sub = $this.closest('li').find('.treeselect-sub
[type="checkbox"]');
			sub.prop('checked', this.checked);
			if ($this.val() == 1)
				sub.each(propagate);
			else
				sub.attr('disabled', this.checked ? 'disabled' :
null);
		};
		$('.treeselect')
			.on('click', '[type="checkbox"]',
propagate)
			.find('[type="checkbox"]:checked').each(propagate);
	});
JS;

$style = <<<'CSS'
	.checkbox-toggle {
		display: none !important;
	}
	.checkbox-toggle[disabled] ~ .btn-hide {
		opacity: 0.5;
	}
	.checkbox-toggle ~ .btn-show {
		display: inline;
	}
	.checkbox-toggle ~ .btn-hide {
		display: none;
	}
	.checkbox-toggle:checked ~ .btn-show {
		display: none;
	}
	.checkbox-toggle:checked ~ .btn-hide {
		display: inline;
	}
CSS;

JFactory::getDocument()->addScriptDeclaration($script);
JFactory::getDocument()->addStyleDeclaration($style);
?>
<div id="menuselect-group" class="control-group">
	<div class="control-label"><?php echo
$this->form->getLabel('hideitems', 'params');
?></div>

	<div id="jform_params_hideitems"
class="controls">
		<?php if (!empty($menuLinks)) : ?>
		<?php $id = 'jform_params_hideitems'; ?>

		<div class="well well-small">
			<div class="form-inline">
				<span class="small"><?php echo
JText::_('COM_MENUS_ACTION_EXPAND'); ?>:
					<a id="treeExpandAll"
href="javascript://"><?php echo JText::_('JALL');
?></a>,
					<a id="treeCollapseAll"
href="javascript://"><?php echo
JText::_('JNONE'); ?></a>|
					<?php echo JText::_('JSHOW'); ?>:
					<a id="treeUncheckAll"
href="javascript://"><?php echo JText::_('JALL');
?></a>,
					<a id="treeCheckAll"
href="javascript://"><?php echo
JText::_('JNONE'); ?></a>
				</span>
				<input type="text" id="treeselectfilter"
name="treeselectfilter" class="input-medium search-query
pull-right" size="16"
					autocomplete="off" placeholder="<?php echo
JText::_('JSEARCH_FILTER'); ?>"
aria-invalid="false" tabindex="-1">
			</div>

			<div class="clearfix"></div>

			<hr class="hr-condensed" />

			<ul class="treeselect">

				<?php if (count($menuLinks)) : ?>
					<?php $prevlevel = 0; ?>
					<div class="alert alert-info"><?php echo
JText::_('COM_MENUS_ITEM_FIELD_COMPONENTS_CONTAINER_HIDE_ITEMS_DESC')?></div>
					<li>
					<?php
					$params      = new Registry($this->item->params);
					$hiddenLinks = (array) $params->get('hideitems');

					foreach ($menuLinks as $i => $link) : ?>
						<?php
						if ($extension = $link->element):
							$lang->load("$extension.sys", JPATH_ADMINISTRATOR,
null, false, true)
							|| $lang->load("$extension.sys", JPATH_ADMINISTRATOR .
'/components/' . $extension, null, false, true);
						endif;

						if ($prevlevel < $link->level)
						{
							echo '<ul class="treeselect-sub">';
						}
						elseif ($prevlevel > $link->level)
						{
							echo str_repeat('</li></ul>', $prevlevel -
$link->level);
						}
						else
						{
							echo '</li>';
						}

						$selected = in_array($link->value, $hiddenLinks) ? 1 : 0;
						?>
							<li>
								<div class="treeselect-item pull-left">
									<input type="checkbox" <?php echo $link->value
> 1 ? ' name="jform[params][hideitems][]" ' :
''; ?>
										   id="<?php echo $id . $link->value; ?>"
value="<?php echo (int) $link->value; ?>"
class="novalidate checkbox-toggle"
										<?php echo $selected ? '
checked="checked"' : ''; ?> />

									<?php if ($link->value == 1): ?>
										<label for="<?php echo $id . $link->value;
?>" class="btn btn-mini btn-info pull-left"><?php
echo JText::_('JALL') ?></label>
									<?php else: ?>
										<label for="<?php echo $id . $link->value;
?>" class="btn btn-mini btn-danger btn-hide
pull-left"><?php echo JText::_('JHIDE')
?></label>
										<label for="<?php echo $id . $link->value;
?>" class="btn btn-mini btn-success btn-show
pull-left"><?php echo JText::_('JSHOW')
?></label>
										<label for="<?php echo $id . $link->value;
?>" class="pull-left"><?php echo
JText::_($link->text); ?></label>
									<?php endif; ?>
								</div>
						<?php

						if (!isset($menuLinks[$i + 1]))
						{
							echo str_repeat('</li></ul>',
$link->level);
						}
						$prevlevel = $link->level;
						?>
						<?php endforeach; ?>
					</li>
					<?php endif; ?>

			</ul>
			<div id="noresultsfound" style="display:none;"
class="alert alert-no-items">
				<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
			</div>
		</div>
		<?php endif; ?>
	</div>
</div>
tmpl/edit_modules.php000064400000013140151157244760010721 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_menus
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.core');

foreach ($this->levels as $key => $value) {
	$allLevels[$value->id] = $value->title;
}

JFactory::getDocument()->addScriptDeclaration('
	var viewLevels = ' . json_encode($allLevels) . ',
		menuId = parseInt(' . (int) $this->item->id . ');

	jQuery(function($) {
		var baseLink =
"index.php?option=com_modules&amp;client_id=0&amp;task=module.edit&amp;tmpl=component&amp;view=module&amp;layout=modal&amp;id=",
			iFrameAttr = "class=\"iframe jviewport-height70\"";

		$(document)
			.on("click",
"input:radio[id^=\'jform_toggle_modules_assigned1\']",
function (event) {
				$(".table tr.no").hide();
			})
			.on("click",
"input:radio[id^=\'jform_toggle_modules_assigned0\']",
function (event) {
				$(".table tr.no").show();
			})
			.on("click",
"input:radio[id^=\'jform_toggle_modules_published1\']",
function (event) {
				$(".table tr.unpublished").hide();
			})
			.on("click",
"input:radio[id^=\'jform_toggle_modules_published0\']",
function (event) {
				$(".table tr.unpublished").show();
			})
			.on("click", ".module-edit-link", function () {
				var link = baseLink + $(this).data("moduleId"),
					iFrame = $("<iframe src=\"" + link + "\"
" + iFrameAttr + "></iframe>");

				$("#moduleEditModal").modal()
					.find(".modal-body").empty().prepend(iFrame);
			})
			.on("click", "#moduleEditModal .modal-footer .btn",
function () {
				var target = $(this).data("target");

				if (target) {
					$("#moduleEditModal
iframe").contents().find(target).click();
				}
			});
	});
');

JFactory::getDocument()->addStyleDeclaration('
ul.horizontal-buttons li {
  display: inline-block;
  padding-right: 10%;
}
');

// Set up the bootstrap modal that will be used for all module editors
echo JHtml::_(
	'bootstrap.renderModal',
	'moduleEditModal',
	array(
		'title'       =>
JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'),
		'backdrop'    => 'static',
		'keyboard'    => false,
		'closeButton' => false,
		'bodyHeight'  => '70',
		'modalWidth'  => '80',
		'footer'      => '<button type="button"
class="btn" data-dismiss="modal"
data-target="#closeBtn">'
				. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</button>'
				. '<button type="button" class="btn
btn-primary" data-dismiss="modal"
data-target="#saveBtn">'
				. JText::_('JSAVE') . '</button>'
				. '<button type="button" class="btn
btn-success" data-target="#applyBtn">'
				. JText::_('JAPPLY') . '</button>',
	)
);

?>
<?php
// Set main fields.
$this->fields =
array('toggle_modules_assigned','toggle_modules_published');

echo JLayoutHelper::render('joomla.menu.edit_modules', $this);
?>

	<table class="table table-striped">
		<thead>
		<tr>
			<th class="left">
				<?php echo JText::_('COM_MENUS_HEADING_ASSIGN_MODULE');
?>
			</th>
			<th>
				<?php echo JText::_('COM_MENUS_HEADING_LEVELS'); ?>
			</th>
			<th>
				<?php echo JText::_('COM_MENUS_HEADING_POSITION'); ?>
			</th>
			<th>
				<?php echo JText::_('COM_MENUS_HEADING_DISPLAY'); ?>
			</th>
			<th>
				<?php echo JText::_('COM_MENUS_HEADING_PUBLISHED_ITEMS');
?>
			</th>
		</tr>
		</thead>
		<tbody>
		<?php foreach ($this->modules as $i => &$module) : ?>
			<?php if (is_null($module->menuid)) : ?>
				<?php if (!$module->except || $module->menuid < 0) : ?>
					<?php $no = 'no '; ?>
				<?php else : ?>
					<?php $no = ''; ?>
				<?php endif; ?>
			<?php else : ?>
				<?php $no = ''; ?>
			<?php endif; ?>
			<?php if ($module->published) : ?>
				<?php $status = ''; ?>
			<?php else : ?>
				<?php $status = 'unpublished '; ?>
			<?php endif; ?>
			<tr class="<?php echo $no; ?><?php echo $status;
?>row<?php echo $i % 2; ?>" id="tr-<?php echo
$module->id; ?>" style="display:table-row">
				<td id="<?php echo $module->id; ?>">
					<button type="button"
						data-target="#moduleEditModal"
						class="btn btn-link module-edit-link"
						title="<?php echo
JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'); ?>"
						id="title-<?php echo $module->id; ?>"
						data-module-id="<?php echo $module->id; ?>">
						<?php echo $this->escape($module->title);
?></button>
				</td>
				<td id="access-<?php echo $module->id; ?>">
					<?php echo $this->escape($module->access_title); ?>
				</td>
				<td id="position-<?php echo $module->id; ?>">
					<?php echo $this->escape($module->position); ?>
				</td>
				<td id="menus-<?php echo $module->id; ?>">
					<?php if (is_null($module->menuid)) : ?>
						<?php if ($module->except) : ?>
							<span class="label label-success">
								<?php echo JText::_('JYES'); ?>
							</span>
						<?php else : ?>
							<span class="label label-important">
								<?php echo JText::_('JNO'); ?>
							</span>
						<?php endif; ?>
					<?php elseif ($module->menuid > 0) : ?>
						<span class="label label-success">
							<?php echo JText::_('JYES'); ?>
						</span>
					<?php elseif ($module->menuid < 0) : ?>
						<span class="label label-important">
							<?php echo JText::_('JNO'); ?>
						</span>
					<?php else : ?>
						<span class="label label-info">
							<?php echo JText::_('JALL'); ?>
						</span>
					<?php endif; ?>
				</td>
				<td id="status-<?php echo $module->id; ?>">
						<?php if ($module->published) : ?>
							<span class="label label-success">
								<?php echo JText::_('JYES'); ?>
							</span>
						<?php else : ?>
							<span class="label label-important">
								<?php echo JText::_('JNO'); ?>
							</span>
						<?php endif; ?>
				</td>
			</tr>
		<?php endforeach; ?>
		</tbody>
	</table>
tmpl/edit_options.php000064400000002703151157244760010747 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_menus
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;
?>
<?php
	echo JHtml::_('bootstrap.startAccordion',
'menuOptions', array('active' =>
'collapse0'));
	$fieldSets = $this->form->getFieldsets('params');
	$i = 0;

	foreach ($fieldSets as $name => $fieldSet) :
		if (!(($this->item->link ==
'index.php?option=com_wrapper&view=wrapper') &&
$fieldSet->name == 'request')
				&& !($this->item->link == 'index.php?Itemid='
&& $fieldSet->name == 'aliasoptions')) :
			$label = !empty($fieldSet->label) ? $fieldSet->label :
'COM_MENUS_' . $name . '_FIELDSET_LABEL';
			echo JHtml::_('bootstrap.addSlide', 'menuOptions',
JText::_($label), 'collapse' . ($i++));
				if (isset($fieldSet->description) &&
trim($fieldSet->description)) :
					echo '<p class="tip">' .
$this->escape(JText::_($fieldSet->description)) .
'</p>';
				endif;
				?>
					<?php foreach ($this->form->getFieldset($name) as $field) :
?>

						<div class="control-group">

							<div class="control-label">
								<?php echo $field->label; ?>
							</div>
							<div class="controls">
								<?php echo $field->input; ?>
							</div>

						</div>
					<?php endforeach;
			echo JHtml::_('bootstrap.endSlide');
		endif;
	endforeach; ?>
<?php

echo JHtml::_('bootstrap.endAccordion');
tmpl/modal.php000064400000002525151157244760007345 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_menus
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('bootstrap.tooltip', '.hasTooltip',
array('placement' => 'bottom'));

// @deprecated 4.0 the function parameter, the inline js and the buttons
are not needed since 3.7.0.
$function  =
JFactory::getApplication()->input->getCmd('function',
'jEditMenu_' . (int) $this->item->id);

// Function to update input title when changed
JFactory::getDocument()->addScriptDeclaration('
	function jEditMenuModal() {
		if (window.parent &&
document.formvalidator.isValid(document.getElementById("item-form")))
{
			return window.parent.' . $this->escape($function) .
'(document.getElementById("jform_title").value);
		}
	}
');
?>
<button id="applyBtn" type="button"
class="hidden"
onclick="Joomla.submitbutton('item.apply');
jEditMenuModal();"></button>
<button id="saveBtn" type="button"
class="hidden"
onclick="Joomla.submitbutton('item.save');
jEditMenuModal();"></button>
<button id="closeBtn" type="button"
class="hidden"
onclick="Joomla.submitbutton('item.cancel');"></button>

<div class="container-popup">
	<?php $this->setLayout('edit'); ?>
	<?php echo $this->loadTemplate(); ?>
</div>
tmpl/modal_associations.php000064400000000523151157244760012120
0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_menus
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

echo JLayoutHelper::render('joomla.edit.associations', $this);
tmpl/modal_options.php000064400000002703151157244760011116 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_menus
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;
?>
<?php
	echo JHtml::_('bootstrap.startAccordion',
'menuOptions', array('active' =>
'collapse0'));
	$fieldSets = $this->form->getFieldsets('params');
	$i = 0;

	foreach ($fieldSets as $name => $fieldSet) :
		if (!(($this->item->link ==
'index.php?option=com_wrapper&view=wrapper') &&
$fieldSet->name == 'request')
				&& !($this->item->link == 'index.php?Itemid='
&& $fieldSet->name == 'aliasoptions')) :
			$label = !empty($fieldSet->label) ? $fieldSet->label :
'COM_MENUS_' . $name . '_FIELDSET_LABEL';
			echo JHtml::_('bootstrap.addSlide', 'menuOptions',
JText::_($label), 'collapse' . ($i++));
				if (isset($fieldSet->description) &&
trim($fieldSet->description)) :
					echo '<p class="tip">' .
$this->escape(JText::_($fieldSet->description)) .
'</p>';
				endif;
				?>
					<?php foreach ($this->form->getFieldset($name) as $field) :
?>

						<div class="control-group">

							<div class="control-label">
								<?php echo $field->label; ?>
							</div>
							<div class="controls">
								<?php echo $field->input; ?>
							</div>

						</div>
					<?php endforeach;
			echo JHtml::_('bootstrap.endSlide');
		endif;
	endforeach; ?>
<?php

echo JHtml::_('bootstrap.endAccordion');
view.html.php000064400000010512151157244760007205 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_menus
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * The HTML Menus Menu Item View.
 *
 * @since  1.6
 */
class MenusViewItem extends JViewLegacy
{
	/**
	 * @var  JForm
	 */
	protected $form;

	/**
	 * @var  object
	 */
	protected $item;

	/**
	 * @var  mixed
	 */
	protected $modules;

	/**
	 * @var  JObject
	 */
	protected $state;

	/**
	 * @var  JObject
	 */
	protected $canDo;

	/**
	 * Display the view
	 *
	 * @param   string  $tpl  The name of the template file to parse;
automatically searches through the template paths.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	public function display($tpl = null)
	{
		$user = JFactory::getUser();

		$this->state   = $this->get('State');
		$this->form    = $this->get('Form');
		$this->item    = $this->get('Item');
		$this->modules = $this->get('Modules');
		$this->levels  = $this->get('ViewLevels');
		$this->canDo   = JHelperContent::getActions('com_menus',
'menu', (int)
$this->state->get('item.menutypeid'));

		// Check if we're allowed to edit this item
		// No need to check for create, because then the moduletype select is
empty
		if (!empty($this->item->id) &&
!$this->canDo->get('core.edit'))
		{
			throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
		}

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseError(500, implode("\n", $errors));

			return;
		}

		// If we are forcing a language in modal (used for associations).
		if ($this->getLayout() === 'modal' &&
$forcedLanguage =
JFactory::getApplication()->input->get('forcedLanguage',
'', 'cmd'))
		{
			// Set the language field to the forcedLanguage and disable changing it.
			$this->form->setValue('language', null,
$forcedLanguage);
			$this->form->setFieldAttribute('language',
'readonly', 'true');

			// Only allow to select categories with All language or with the forced
language.
			$this->form->setFieldAttribute('parent_id',
'language', '*,' . $forcedLanguage);
		}

		parent::display($tpl);
		$this->addToolbar();
	}

	/**
	 * Add the page title and toolbar.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function addToolbar()
	{
		$input = JFactory::getApplication()->input;
		$input->set('hidemainmenu', true);

		$user       = JFactory::getUser();
		$isNew      = ($this->item->id == 0);
		$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
		$canDo      = $this->canDo;
		$clientId   = $this->state->get('item.client_id', 0);

		JToolbarHelper::title(JText::_($isNew ?
'COM_MENUS_VIEW_NEW_ITEM_TITLE' :
'COM_MENUS_VIEW_EDIT_ITEM_TITLE'), 'list menu-add');

		// If a new item, can save the item.  Allow users with edit permissions
to apply changes to prevent returning to grid.
		if ($isNew && $canDo->get('core.create'))
		{
			if ($canDo->get('core.edit'))
			{
				JToolbarHelper::apply('item.apply');
			}

			JToolbarHelper::save('item.save');
		}

		// If not checked out, can save the item.
		if (!$isNew && !$checkedOut &&
$canDo->get('core.edit'))
		{
			JToolbarHelper::apply('item.apply');
			JToolbarHelper::save('item.save');
		}

		// If the user can create new items, allow them to see Save & New
		if ($canDo->get('core.create'))
		{
			JToolbarHelper::save2new('item.save2new');
		}

		// If an existing item, can save to a copy only if we have create rights.
		if (!$isNew && $canDo->get('core.create'))
		{
			JToolbarHelper::save2copy('item.save2copy');
		}

		if (!$isNew && JLanguageAssociations::isEnabled() &&
JComponentHelper::isEnabled('com_associations') &&
$clientId != 1)
		{
			JToolbarHelper::custom('item.editAssociations',
'contract', 'contract',
'JTOOLBAR_ASSOCIATIONS', false, false);
		}

		if ($isNew)
		{
			JToolbarHelper::cancel('item.cancel');
		}
		else
		{
			JToolbarHelper::cancel('item.cancel',
'JTOOLBAR_CLOSE');
		}

		JToolbarHelper::divider();

		// Get the help information for the menu item.
		$lang = JFactory::getLanguage();

		$help = $this->get('Help');

		if ($lang->hasKey($help->url))
		{
			$debug = $lang->setDebug(false);
			$url   = JText::_($help->url);
			$lang->setDebug($debug);
		}
		else
		{
			$url = $help->url;
		}

		JToolbarHelper::help($help->key, $help->local, $url);
	}
}