No Code Attached Yet
avatar motokraft
motokraft
10 Feb 2022

Problem identified

There is such a piece of code!
`php
// Ok, now its time to handle the menus. Start with the component root menu, then handle submenus.
$menuElement = $this->getManifest()->administration->menu;

// Just do not create the menu if $menuElement not exist
if (!$menuElement)
{
return true;
}

// If the menu item is hidden do nothing more, just return
if (\in_array((string) $menuElement['hidden'], array('true', 'hidden')))
{
return true;
}

// Let's figure out what the menu item data should look like
$data = array();

// I have a menu element, use this information
$data['menutype'] = 'main';
$data['client_id'] = 1;
$data['title'] = (string) trim($menuElement);
$data['alias'] = (string) $menuElement;
$data['type'] = 'component';
$data['published'] = 1;
$data['parent_id'] = 1;
$data['component_id'] = $componentId;
$data['img'] = ((string) $menuElement->attributes()->img) ?: 'class:component';
$data['home'] = 0;
$data['path'] = '';
$data['params'] = '';

if ($params = $menuElement->params)
{
// Pass $params through Registry to convert to JSON.
$params = new Registry($params);
$data['params'] = $params->toString();
}
`

Open questions

  1. Main question: Submit an example of an XML file with adding a menu item to the admin panel!
  2. Administration->menu child element structure for adding menu options
avatar motokraft motokraft - open - 10 Feb 2022
avatar joomla-cms-bot joomla-cms-bot - change - 10 Feb 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 Feb 2022
avatar motokraft motokraft - change - 10 Feb 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-02-10 18:03:49
Closed_By motokraft
avatar motokraft motokraft - close - 10 Feb 2022
avatar motokraft
motokraft - comment - 10 Feb 2022

Отвечать не надо! Как было куском гавна так им и осталось....

Add a Comment

Login with GitHub to post a comment