Skip to content

Commit

Permalink
Try changing adapter.php instead - alter element.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris committed Apr 12, 2016
1 parent 69f1fa0 commit be3badb
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions libraries/cms/installer/adapter/component.php
Expand Up @@ -947,24 +947,25 @@ protected function _buildAdminMenus($component_id = null)
$data['title'] = (string) trim($menuElement);
$data['alias'] = (string) $menuElement;


// My changes here
// Set the menu link
if ((string) $menuElement->attributes()->link)
{
if (preg_match('/^index\.php\?/', $menuElement->attributes()->link))
// Checks if link attribute begins with 'index.php?'
// Allows compatibility with components made by following the MVC Component tutorial
// even though core component menu links simply begin with 'option='
if (preg_match('/^index\.php\?/', (string) $menuElement->attributes()->link))
{
$data['link'] = (string) $menuElement->attributes()->link;
}
else
{
$goot = 'flob';
$data['link'] = 'index.php?' . (string) $menuElement->attributes()->link;
}
$menuLink = $menuElement->attributes()->link;
$data['link'] = 'index.php?' . $menuElement->attributes()->link;
}


// Original code:
//$data['link'] = 'index.php?option=' . $option;


else
{
$data['link'] = 'index.php?option=' . $option;
}
$data['type'] = 'component';
$data['published'] = 0;
$data['parent_id'] = 1;
Expand Down

0 comments on commit be3badb

Please sign in to comment.