Skip to content

Commit

Permalink
Backendmenu: Fixing export of additionla features for menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar committed Apr 1, 2024
1 parent 828c236 commit 2794e30
Showing 1 changed file with 38 additions and 9 deletions.
47 changes: 38 additions & 9 deletions administrator/components/com_menus/src/View/Menu/XmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Menu\AdministratorMenuItem;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Router\Route;
use Joomla\Component\Menus\Administrator\Helper\MenusHelper;
Expand Down Expand Up @@ -103,8 +104,8 @@ public function display($tpl = null)
/**
* Add a child node to the xml
*
* @param \SimpleXMLElement $xml The current XML node which would become the parent to the new node
* @param \stdClass $item The menuitem object to create the child XML node from
* @param \SimpleXMLElement $xml The current XML node which would become the parent to the new node
* @param AdministratorMenuItem $item The menuitem object to create the child XML node from
*
* @return void
*
Expand All @@ -114,22 +115,22 @@ protected function addXmlChild($xml, $item)
{
$node = $xml->addChild('menuitem');

$node['type'] = $item->type;

if ($item->title) {
$node['title'] = htmlentities($item->title, ENT_XML1);
}

if ($item->link) {
$node['link'] = $item->link;
}
$node['type'] = $item->type;

if ($item->element) {
$node['element'] = $item->element;
}

if (isset($item->class) && $item->class) {
$node['class'] = htmlentities($item->class, ENT_XML1);
if ($item->link) {
$node['link'] = $item->link;
}

if (isset($item->class) && trim($item->class)) {
$node['class'] = htmlentities(trim($item->class), ENT_XML1);
}

if ($item->access) {
Expand All @@ -140,6 +141,34 @@ protected function addXmlChild($xml, $item)
$node['target'] = '_blank';
}

if ($item->getParams()->get('ajax-badge')) {
$node['ajax-badge'] = $item->getParams()->get('ajax-badge');
}

if ($item->icon) {
$node['icon'] = $item->icon;
}

if ($item->getParams()->get('menu-quicktask')) {
$node['quicktask'] = $item->getParams()->get('menu-quicktask');

if ($item->getParams()->get('menu-quicktask-title')) {
$node['quicktask-title'] = $item->getParams()->get('menu-quicktask-title');
}

if ($item->getParams()->get('menu-quicktask-icon')) {
$node['quicktask-icon'] = $item->getParams()->get('menu-quicktask-icon');
}

if ($item->getParams()->get('menu-quicktask-permission')) {
$node['quicktask-permission'] = $item->getParams()->get('menu-quicktask-permission');
}
}

if ($item->getParams()->get('dashboard')) {
$node['dashboard'] = $item->getParams()->get('dashboard');
}

if ($item->getParams() && $hideitems = $item->getParams()->get('hideitems')) {
$item->getParams()->set('hideitems', $this->getModel('Menu')->getExtensionElementsForMenuItems($hideitems));

Expand Down

0 comments on commit 2794e30

Please sign in to comment.