예제 #1
0
 function _setToolBar()
 {
     global $mainframe, $option;
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $document = JFactory::getDocument();
     $document->addStyleSheet(JUri::base() . 'components/com_quick2cart/css/quick2cart.css');
     $bar = JToolBar::getInstance('toolbar');
     $layout = $jinput->get('layout');
     if ($layout == 'payouts') {
         // CSV EXPORT
         if (JVERSION >= 3.0) {
             JToolBarHelper::custom('csvexport', 'icon-32-save.png', 'icon-32-save.png', JText::_("COM_QUICK2CART_SALES_CSV_EXPORT"), false);
         } else {
             $button = "<a href='#' onclick=\"javascript:document.getElementById('task').value = 'csvexport';document.getElementById('controller').value = 'reports';document.adminForm.submit();\" ><span class='icon-32-save' title='Export'></span>" . JText::_('COM_QUICK2CART_SALES_CSV_EXPORT') . "</a>";
             $bar->appendButton('Custom', $button);
         }
         //	JToolBarHelper::title(JText::_('COM_QUICK2CART_PAYOUT_REPORTS'),'icon-48-quick2cart.png');
         //JToolBarHelper::addNewX('add');
         JToolBarHelper::addNew('reports.add', 'JTOOLBAR_NEW');
         JToolBarHelper::DeleteList(JText::_('COM_QUICK2CART_DELETE_PAYOUT_CONFIRM'), 'delete', 'JTOOLBAR_DELETE');
         JToolBarHelper::title(JText::_('COM_QUICK2CART_REPORTS'), 'icon-48-quick2cart.png');
     } elseif ($layout == 'edit_payout') {
         JToolBarHelper::title(JText::_('COM_QUICK2CART_EDIT_PAYOUT'), 'icon-48-quick2cart.png');
     }
     $task = $jinput->get('task');
     if ($task == "save" || $task == "edit_pay") {
         JToolBarHelper::save('reports.save', 'JTOOLBAR_SAVE');
         JToolBarHelper::back(JText::_('COM_QUICK2CART_BACK'), 'index.php?option=com_quick2cart&view=reports&layout=payouts');
     } else {
         JToolBarHelper::back(JText::_('COM_QUICK2CART_BACK'), 'index.php?option=com_quick2cart&view=reports');
     }
 }