I am using Joomla 2.5 to create a special component that is executed from the front-end.
This component parses xml file to build Joomla menu, I'm executing INSERT INTO #__menu query, but I leave 0s for lft and rgt fields.
The menu is being built very messy, and when I click Rebuild button at the back-end everything looks perfect after that, path, lft, and rgt fields are being correctly filled.
I have spent 2 days trying to execute rebuild task from my front-end component's controller and module, I've even tried to use jimport('joomla.database.tablenested') but my lack of PHP OOP knowledge doesn't help me to correctly execute rebuild function...
The last thing I wrote was this:
jimport('joomla.database.tablenested');
class BSImportModelBSImport extends JModel
{
...
function theimport()
{
...
$db =& JFactory::getDBO();
$menu = new JTableNested('Menu', 'id',&$db);
return $menu->rebuild();
}
}
Please don't throw stones to my head if my question looks stupid... I really need help...
$menu = new JTableNested('Menu', 'id',&$db);
with$menu = new JTableNested('#__menu', 'id',&$db);
I hope this will help somebody... I apologize to moderators for my mistake again... Thank you! – Argentic