CoreFiles by mySites.guru
edit_container.php108 lines, 4,289 bytes, from Joomla_4.0.0-alpha10-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha9
md5
5b0f39e495f172f3cebb4cf7cdfe44f8
sha1
5c367abfc984a6bf0311d3d839fac071b2fe6d90
sha256
f8402dee66e8de51b6fd22ca81647c2727710d22d9611cc601875e4ca7f3aca3
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_menus
 *
 * @copyright   Copyright (C) 2005 - 2019 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\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Component\Menus\Administrator\Helper\MenusHelper;
use Joomla\Registry\Registry;

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

HTMLHelper::_('stylesheet', 'com_menus/admin-item-edit_container.css', array('version' => 'auto', 'relative' => true));
HTMLHelper::_('script', 'com_menus/admin-item-edit_container.min.js', array('version' => 'auto', 'relative' => true));
HTMLHelper::_('script', 'legacy/treeselectmenu.min.js', array('version' => 'auto', 'relative' => true));
?>

<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="form-inline">
			<span class="small mr-2"><?php echo Text::_('COM_MENUS_ACTION_EXPAND'); ?>:
				<a id="treeExpandAll" href="javascript://"><?php echo Text::_('JALL'); ?></a>,
				<a id="treeCollapseAll" href="javascript://"><?php echo Text::_('JNONE'); ?></a> |
				<?php echo Text::_('JSHOW'); ?>:
				<a id="treeUncheckAll" href="javascript://"><?php echo Text::_('JALL'); ?></a>,
				<a id="treeCheckAll" href="javascript://"><?php echo Text::_('JNONE'); ?></a>
			</span>
			<input type="text" id="treeselectfilter" name="treeselectfilter" class="form-control search-query"
				autocomplete="off" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" aria-invalid="false" tabindex="-1">
		</div>

		<hr>

		<ul class="treeselect">
			<?php if (count($menuLinks)) : ?>
				<?php $prevlevel = 0; ?>
				<div class="alert alert-info">
					<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
					<?php echo Text::_('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">
								<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-sm btn-info"><?php echo Text::_('JALL') ?></label>
								<?php else: ?>
									<label for="<?php echo $id . $link->value; ?>" class="btn btn-sm btn-danger btn-hide"><?php echo Text::_('JHIDE') ?></label>
									<label for="<?php echo $id . $link->value; ?>" class="btn btn-sm btn-success btn-show"><?php echo Text::_('JSHOW') ?></label>
									<label for="<?php echo $id . $link->value; ?>"><?php echo Text::_($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>
		<joomla-alert id="noresultsfound" type="warning" style="display:none;"><?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?></joomla-alert>
		<?php endif; ?>
	</div>
</div>

The same content is in 2 releases, Joomla 4.0.0-alpha10 to 4.0.0-alpha11. See them all, or every version of this file.