Search code examples
joomla2.5joomla-extensions

Joomla 2.5 component: com_categories appear without toolbar buttons


I developing some component for Joomla 2.5. I follow official tutorial:
http://docs.joomla.org/Developing_a_Model-View-Controller_Component/2.5/Adding_categories

Now, I added categories functionality for my component, but when I open categories menu in administrative panel I don't see add, delete, edit buttons...
This is code of helper:

abstract class youtubeHelper
{
        public static function addSubmenu($submenu) 
        {
                JSubMenuHelper::addEntry(JText::_('COM_YOUTUBE_SUBMENU_ITEMS'),
                                         'index.php?option=com_youtube', $submenu == 'items');
                JSubMenuHelper::addEntry(JText::_('COM_YOUTUBE_SUBMENU_CATEGORIES'),
                                         'index.php?option=com_categories&view=categories&extension=com_youtube',
                                         $submenu == 'categories');

                // set some global property
                $document = JFactory::getDocument();
                $document->addStyleDeclaration('.icon-48-youtube ' .
                                               '{background-image: url(../media/com_youtube/images/tux-48x48.png);}');

                if ($submenu == 'categories') 
                {
                        $document->setTitle(JText::_('COM_YOUTUBE_ADMINISTRATION_CATEGORIES'));
                }
        }
}

What I need do for add the buttons?


Solution

  • You don't need to add any thing in code, you need to add access.xml file in your component.

    If you look at the com_content folder you will see this file.

    Copy this file to your component folder and edit it for your component.