예제 #1
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/j2xml.php';
     $canDo = j2xmlHelper::getActions();
     $toolbar = JToolBar::getInstance('toolbar');
     $toolbar->addButtonPath(JPATH_COMPONENT . DS . 'buttons');
     JToolBarHelper::title(JText::_('COM_J2XML_TOOLBAR_J2XML'), 'j2xml.png');
     $doc = JFactory::getDocument();
     if ($canDo->get('core.create') || $canDo->get('core.edit')) {
         $icon_48_j2xml = " .icon-48-j2xml {background:url(../media/com_j2xml/images/icon-48-j2xml.png) no-repeat; }";
         $doc->addStyleDeclaration($icon_48_j2xml);
         if (class_exists('JPlatform')) {
             if (version_compare(JPlatform::RELEASE, '12', 'lt')) {
                 $icon_32_import = " .icon-32-j2xml-import {background:url(../media/com_j2xml/images/icon-32-import.png) no-repeat; }";
                 $doc->addStyleDeclaration($icon_32_import);
                 $icon_32_open = " .icon-32-j2xml-open {background:url(../media/com_j2xml/images/icon-32-open.png) no-repeat; }";
                 $doc->addStyleDeclaration($icon_32_open);
                 $toolbar->loadButtonType('Import', true);
                 $toolbar->appendButton('Import', 'j2xml', 'COM_J2XML_BUTTON_OPEN', 'COM_J2XML_BUTTON_IMPORT', 'cpanel.import');
             } else {
                 jimport('eshiol.core.file');
                 $toolbar = JToolBar::getInstance('toolbar');
                 $toolbar->appendButton('File', 'j2xml', 'COM_J2XML_BUTTON_OPEN', 'COM_J2XML_BUTTON_IMPORT', 'j2xml.cpanel.import', 600, 400);
             }
         }
         //			$params = JComponentHelper::getParams('com_j2xml');
         $hostname = JFactory::getURI()->getHost();
         if ($hostname == 'localhost' && JRequest::getCmd('develop', '0') === '1') {
             $toolbar->appendButton('Link', 'purge', 'COM_J2XML_CONTENT_DELETE', 'index.php?option=com_j2xml&task=cpanel.clean&develop=1&' . JSession::getFormToken() . '=1');
         }
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_j2xml');
     }
 }
예제 #2
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/j2xml.php';
     $canDo = j2xmlHelper::getActions();
     $toolbar = JToolBar::getInstance('toolbar');
     $toolbar->addButtonPath(JPATH_COMPONENT . DS . 'buttons');
     $doc = JFactory::getDocument();
     if (version_compare(JPlatform::RELEASE, '12', 'lt')) {
         $icon_48_j2xml = " .icon-48-j2xml {background:url(../media/com_j2xml/images/icon-48-j2xml.png) no-repeat; }";
         $doc->addStyleDeclaration($icon_48_j2xml);
         $icon_32_import = " .icon-32-j2xml-import {background:url(../media/com_j2xml/images/icon-32-import.png) no-repeat; }";
         $doc->addStyleDeclaration($icon_32_import);
         $icon_32_open = " .icon-32-j2xml-open {background:url(../media/com_j2xml/images/icon-32-open.png) no-repeat; }";
         $doc->addStyleDeclaration($icon_32_open);
     }
     JToolBarHelper::title(JText::_('COM_J2XML_TOOLBAR_J2XML'), 'j2xml.png');
     if ($canDo->get('core.create') || $canDo->get('core.edit')) {
         $toolbar->loadButtonType('Import', true);
         $toolbar->appendButton('Import', 'j2xml', 'COM_J2XML_BUTTON_OPEN', 'COM_J2XML_BUTTON_IMPORT', 'cpanel.import');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_j2xml');
     }
 }