Esempio n. 1
0
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocagallerycs.php';
     $state = $this->get('State');
     $canDo = PhocaGalleryCsHelper::getActions($state->get('filter.category_id'));
     $user = JFactory::getUser();
     $bar = JToolBar::getInstance('toolbar');
     JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_CATEGORIES'), 'folder');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('phocagalleryc.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('phocagalleryc.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::divider();
         JToolBarHelper::custom('phocagallerycs.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::custom('phocagallerycs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
         JToolBarHelper::custom('phocagallerycs.approve', 'approve.png', '', 'COM_PHOCAGALLERY_APPROVE', true);
         JToolBarHelper::custom('phocagallerycs.disapprove', 'disapprove.png', '', 'COM_PHOCAGALLERY_NOT_APPROVE', true);
         JToolBarHelper::custom('phocagallerycs.cooliris', 'cooliris.png', '', 'COM_PHOCAGALLERY_COOLIRIS', true);
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList(JText::_('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS'), 'phocagallerycs.delete', 'COM_PHOCAGALLERY_DELETE');
     }
     // Add a batch button
     if ($user->authorise('core.edit')) {
         JHtml::_('bootstrap.modal', 'collapseModal');
         $title = JText::_('JTOOLBAR_BATCH');
         $dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">\n\t\t\t\t\t\t<i class=\"icon-checkbox-partial\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>";
         $bar->appendButton('Custom', $dhtml, 'batch');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.phocagallery', true);
 }
Esempio n. 2
0
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocagallerycs.php';
     $state = $this->get('State');
     $canDo = PhocaGalleryCsHelper::getActions($state->get('filter.category_id'));
     JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_CATEGORIES'), 'category.png');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('phocagalleryc.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('phocagalleryc.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::divider();
         JToolBarHelper::custom('phocagallerycs.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::custom('phocagallerycs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
         JToolBarHelper::custom('phocagallerycs.approve', 'approve.png', '', 'COM_PHOCAGALLERY_APPROVE', true);
         JToolBarHelper::custom('phocagallerycs.disapprove', 'disapprove.png', '', 'COM_PHOCAGALLERY_NOT_APPROVE', true);
         JToolBarHelper::custom('phocagallerycs.cooliris', 'cooliris.png', '', 'COM_PHOCAGALLERY_COOLIRIS', true);
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList(JText::_('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS'), 'phocagallerycs.delete', 'COM_PHOCAGALLERY_DELETE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.phocagallery', true);
 }
Esempio n. 3
0
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocagallerycs.php';
     JRequest::setVar('hidemainmenu', true);
     $bar =& JToolBar::getInstance('toolbar');
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
     $canDo = PhocaGalleryCsHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
     $paramsC = JComponentHelper::getParams('com_phocagallery');
     $text = $isNew ? JText::_('COM_PHOCAGALLERY_NEW') : JText::_('COM_PHOCAGALLERY_EDIT');
     JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_CATEGORY') . ': <small><small>[ ' . $text . ' ]</small></small>', 'folder');
     // If not checked out, can save the item.
     if (!$checkedOut && $canDo->get('core.edit')) {
         JToolBarHelper::apply('phocagalleryc.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('phocagalleryc.save', 'JTOOLBAR_SAVE');
         JToolBarHelper::addNew('phocagalleryc.save2new', 'JTOOLBAR_SAVE_AND_NEW');
         $this->tmpl['enablepicasaloading'] = $paramsC->get('enable_picasa_loading', 1);
         $this->tmpl['enablefacebookloading'] = $paramsC->get('enable_facebook_loading', 1);
         if ($this->tmpl['enablepicasaloading'] == 1) {
             JToolBarHelper::custom('phocagalleryc.loadextimgp', 'loadextp.png', '', 'COM_PHOCAGALLERY_P_IMPORT', false);
         }
         if ($this->tmpl['enablefacebookloading'] == 1) {
             JToolBarHelper::custom('phocagalleryc.loadextimgf', 'loadextf.png', '', 'COM_PHOCAGALLERY_FB_IMPORT', false);
             JToolBarHelper::custom('phocagalleryc.uploadextimgf', 'uploadextf.png', '', 'COM_PHOCAGALLERY_FB_EXPORT', false);
         }
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         //JToolBarHelper::custom('phocagalleryc.save2copy', 'copy.png', 'copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('phocagalleryc.cancel', 'JTOOLBAR_CANCEL');
     } else {
         JToolBarHelper::cancel('phocagalleryc.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.phocagallery', true);
 }