first commit

This commit is contained in:
2025-06-17 11:53:18 +02:00
commit 9f0f7ba12b
8804 changed files with 1369176 additions and 0 deletions

View File

@ -0,0 +1,177 @@
<?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\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
$this->useCoreUI = true;
Text::script('ERROR');
Text::script('JGLOBAL_VALIDATION_FORM_FAILED');
Text::script('JGLOBAL_ROOT_PARENT');
$this->document->addScriptOptions('menu-item', ['itemId' => (int) $this->item->id]);
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate')
->useScript('com_menus.admin-item-edit');
$assoc = Associations::isEnabled();
$input = Factory::getApplication()->getInput();
// In case of modal
$isModal = $input->get('layout') === 'modal';
$layout = $isModal ? 'modal' : 'edit';
$tmpl = $input->get('tmpl');
$tmpl = $tmpl ? '&tmpl=' . $tmpl : '';
$clientId = $this->state->get('item.client_id', 0);
$lang = $this->getLanguage()->getTag();
// Load mod_menu.ini file when client is administrator
if ($clientId === 1) {
$this->getLanguage()->load('mod_menu', JPATH_ADMINISTRATOR);
}
?>
<form action="<?php echo Route::_('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" aria-label="<?php echo Text::_('COM_MENUS_ITEM_FORM_' . ((int) $this->item->id === 0 ? 'NEW' : 'EDIT'), true); ?>" class="form-validate">
<?php echo LayoutHelper::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="row title-alias form-vertical mb-3">
<div class="col-12">
<div class="control-group">
<div class="control-label">
<label for="menus_title_translation"><?php echo Text::sprintf('COM_MENUS_TITLE_TRANSLATION', $lang); ?></label>
</div>
<div class="controls">
<input id="menus_title_translation" class="form-control" value="<?php echo Text::_($this->item->title); ?>" readonly="readonly" type="text">
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="main-card">
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'details', 'recall' => true, 'breakpoint' => 768]); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'details', Text::_('COM_MENUS_ITEM_DETAILS')); ?>
<div class="row">
<div class="col-lg-9">
<?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="col-lg-3">
<?php
// Set main fields.
$this->fields = [
'id',
'client_id',
'menutype',
'parent_id',
'menuordering',
'published',
'home',
'publish_up',
'publish_down',
'access',
'language',
'note',
];
if ($this->item->type != 'component') {
$this->fields = array_diff($this->fields, ['home']);
$this->form->setFieldAttribute('publish_up', 'showon', '');
$this->form->setFieldAttribute('publish_down', 'showon', '');
}
echo LayoutHelper::render('joomla.edit.global', $this); ?>
</div>
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php
$this->fieldsets = [];
$this->ignore_fieldsets = ['aliasoptions', 'request', 'item_associations'];
echo LayoutHelper::render('joomla.edit.params', $this);
?>
<?php if (!$isModal && $assoc && $this->state->get('item.client_id') != 1) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'associations', Text::_('JGLOBAL_FIELDSET_ASSOCIATIONS')); ?>
<fieldset id="fieldset-associations" class="options-form">
<legend><?php echo Text::_('JGLOBAL_FIELDSET_ASSOCIATIONS'); ?></legend>
<div>
<?php echo LayoutHelper::render('joomla.edit.associations', $this); ?>
</div>
</fieldset>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php elseif ($isModal && $assoc) : ?>
<div class="hidden"><?php echo LayoutHelper::render('joomla.edit.associations', $this); ?></div>
<?php endif; ?>
<?php if (!empty($this->modules)) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'modules', Text::_('COM_MENUS_ITEM_MODULE_ASSIGNMENT')); ?>
<fieldset id="fieldset-modules" class="options-form">
<legend><?php echo Text::_('COM_MENUS_ITEM_MODULE_ASSIGNMENT'); ?></legend>
<div>
<?php echo $this->loadTemplate('modules'); ?>
</div>
</fieldset>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
</div>
<input type="hidden" name="task" value="">
<input type="hidden" name="forcedLanguage" value="<?php echo $input->get('forcedLanguage', '', 'cmd'); ?>">
<input type="hidden" name="menutype" value="<?php echo $input->get('menutype', '', 'cmd'); ?>">
<?php echo $this->form->getInput('component_id'); ?>
<?php echo HTMLHelper::_('form.token'); ?>
<input type="hidden" id="fieldtype" name="fieldtype" value="">
</form>

View File

@ -0,0 +1,21 @@
<?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>

View File

@ -0,0 +1,105 @@
<?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\Language\Text;
use Joomla\Component\Menus\Administrator\Helper\MenusHelper;
use Joomla\Registry\Registry;
// Initialise related data.
$menuLinks = MenusHelper::getMenuLinks('main');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('joomla.treeselectmenu')
->useStyle('com_menus.admin-item-edit-container')
->useScript('com_menus.admin-item-edit-container');
?>
<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 me-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" aria-label="<?php echo Text::_('JSEARCH_FILTER'); ?>">
</div>
<hr>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_MENUS_ITEM_FIELD_COMPONENTS_CONTAINER_HIDE_ITEMS_DESC'); ?>
</div>
<?php if (count($menuLinks)) : ?>
<ul class="treeselect">
<?php $prevlevel = 0; ?>
<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)
|| $lang->load("$extension.sys", JPATH_ADMINISTRATOR . '/components/' . $extension);
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>
</ul>
<?php endif; ?>
<joomla-alert id="noresultsfound" type="warning" style="display:none"><?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?></joomla-alert>
<?php endif; ?>
</div>
</div>

View File

@ -0,0 +1,148 @@
<?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\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
foreach ($this->levels as $key => $value) {
$allLevels[$value->id] = $value->title;
}
$this->document->addScriptOptions('menus-edit-modules', ['viewLevels' => $allLevels, 'itemId' => $this->item->id]);
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('com_menus.admin-item-edit-modules');
// Set up the bootstrap modal that will be used for all module editors
echo HTMLHelper::_(
'bootstrap.renderModal',
'moduleEditModal',
[
'title' => Text::_('COM_MENUS_EDIT_MODULE_SETTINGS'),
'backdrop' => 'static',
'keyboard' => false,
'closeButton' => false,
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-bs-target="#closeBtn">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" class="btn btn-primary" data-bs-dismiss="modal" data-bs-target="#saveBtn">'
. Text::_('JSAVE') . '</button>'
. '<button type="button" class="btn btn-success" data-bs-target="#applyBtn">'
. Text::_('JAPPLY') . '</button>',
]
);
?>
<?php
// Set main fields.
$this->fields = ['toggle_modules_assigned', 'toggle_modules_published'];
echo LayoutHelper::render('joomla.menu.edit_modules', $this); ?>
<table class="table" id="modules_assigned">
<caption class="visually-hidden">
<?php echo Text::_('COM_MENUS_MODULES_TABLE_CAPTION'); ?>
</caption>
<thead>
<tr>
<th scope="col" class="w-40">
<?php echo Text::_('COM_MENUS_HEADING_ASSIGN_MODULE'); ?>
</th>
<th scope="col" class="w-15">
<?php echo Text::_('COM_MENUS_HEADING_LEVELS'); ?>
</th>
<th scope="col" class="w-15">
<?php echo Text::_('COM_MENUS_HEADING_POSITION'); ?>
</th>
<th scope="col">
<?php echo Text::_('COM_MENUS_HEADING_DISPLAY'); ?>
</th>
<th scope="col">
<?php echo Text::_('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 id="tr-<?php echo $module->id; ?>" class="<?php echo $no; ?><?php echo $status; ?>row<?php echo $i % 2; ?>">
<th scope="row">
<button type="button"
data-bs-target="#moduleEditModal"
class="btn btn-link module-edit-link"
title="<?php echo Text::_('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>
</th>
<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="badge bg-success">
<?php echo Text::_('JYES'); ?>
</span>
<?php else : ?>
<span class="badge bg-danger">
<?php echo Text::_('JNO'); ?>
</span>
<?php endif; ?>
<?php elseif ($module->menuid > 0) : ?>
<span class="badge bg-success">
<?php echo Text::_('JYES'); ?>
</span>
<?php elseif ($module->menuid < 0) : ?>
<span class="badge bg-danger">
<?php echo Text::_('JNO'); ?>
</span>
<?php else : ?>
<span class="badge bg-info">
<?php echo Text::_('JALL'); ?>
</span>
<?php endif; ?>
</td>
<td id="status-<?php echo $module->id; ?>">
<?php if ($module->published) : ?>
<span class="badge bg-success">
<?php echo Text::_('JYES'); ?>
</span>
<?php else : ?>
<span class="badge bg-danger">
<?php echo Text::_('JNO'); ?>
</span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

View File

@ -0,0 +1,20 @@
<?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;
?>
<div class="subhead noshadow mb-3">
<?php echo $this->document->getToolbar('toolbar')->render(); ?>
</div>
<div class="container-popup">
<?php $this->setLayout('edit'); ?>
<?php echo $this->loadTemplate(); ?>
</div>

View File

@ -0,0 +1,42 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$icon = 'icon-check';
$title = $this->item ? $this->item->title : '';
$content = $this->item ? $this->item->alias : '';
$data = ['contentType' => 'com_menus.item'];
if ($this->item) {
$data['id'] = $this->item->id;
$data['title'] = $this->item->title;
$data['uri'] = 'index.php?Itemid=' . $this->item->id;
}
// Add Content select script
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('modal-content-select');
// The data for Content select script
$this->document->addScriptOptions('content-select-on-load', $data, false);
?>
<div class="px-4 py-5 my-5 text-center">
<span class="fa-8x mb-4 <?php echo $icon; ?>" aria-hidden="true"></span>
<h1 class="display-5 fw-bold"><?php echo $title; ?></h1>
<div class="col-lg-6 mx-auto">
<p class="lead mb-4">
<?php echo $content; ?>
</p>
</div>
</div>