Esempio n. 1
0
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocagalleryimgs.php';
     $state = $this->get('State');
     $canDo = PhocaGalleryImgsHelper::getActions($state->get('filter.image_id'));
     JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_IMAGES'), 'image.png');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('phocagalleryimg.add', 'JTOOLBAR_NEW');
         JToolBarHelper::custom('phocagallerym.edit', 'multiple.png', '', 'COM_PHOCAGALLERY_MULTIPLE_ADD', false);
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('phocagalleryimg.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.create')) {
         $bar =& JToolBar::getInstance('toolbar');
         $bar->appendButton('Custom', '<a href="#" onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\'' . JText::_('COM_PHOCAGALLERY_WARNING_RECREATE_MAKE_SELECTION') . '\');}else{if(confirm(\'' . JText::_('COM_PHOCAGALLERY_WARNING_RECREATE_THUMBNAILS') . '\')){submitbutton(\'phocagalleryimg.recreate\');}}" class="toolbar"><span class="icon-32-recreate" title="' . JText::_('COM_PHOCAGALLERY_RECREATE_THUMBS') . '" type="Custom"></span>' . JText::_('COM_PHOCAGALLERY_RECREATE') . '</a>');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::divider();
         JToolBarHelper::custom('phocagalleryimgs.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::custom('phocagalleryimgs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
         JToolBarHelper::custom('phocagalleryimgs.approve', 'approve.png', '', 'COM_PHOCAGALLERY_APPROVE', true);
         JToolBarHelper::custom('phocagalleryimgs.disapprove', 'disapprove.png', '', 'COM_PHOCAGALLERY_NOT_APPROVE', true);
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList(JText::_('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS'), 'phocagalleryimgs.delete', 'COM_PHOCAGALLERY_DELETE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.phocagallery', true);
 }
Esempio n. 2
0
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocagalleryimgs.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 = PhocaGalleryImgsHelper::getActions($this->state->get('filter.image_id'), $this->item->id);
     $paramsC = JComponentHelper::getParams('com_phocagallery');
     $text = $isNew ? JText::_('COM_PHOCAGALLERY_NEW') : JText::_('COM_PHOCAGALLERY_EDIT');
     JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_IMAGE') . ': <small><small>[ ' . $text . ' ]</small></small>', 'image');
     // If not checked out, can save the item.
     if (!$checkedOut && $canDo->get('core.edit')) {
         JToolBarHelper::apply('phocagalleryimg.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('phocagalleryimg.save', 'JTOOLBAR_SAVE');
         JToolBarHelper::addNew('phocagalleryimg.save2new', 'JTOOLBAR_SAVE_AND_NEW');
     }
     // 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('phocagalleryimg.cancel', 'JTOOLBAR_CANCEL');
     } else {
         JToolBarHelper::cancel('phocagalleryimg.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.phocagallery', true);
 }
Esempio n. 3
0
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocagalleryimgs.php';
     $state = $this->get('State');
     $canDo = PhocaGalleryImgsHelper::getActions($state->get('filter.image_id'));
     $user = JFactory::getUser();
     $bar = JToolBar::getInstance('toolbar');
     JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_IMAGES'), 'image.png');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('phocagalleryimg.add', 'JTOOLBAR_NEW');
         JToolBarHelper::custom('phocagallerym.edit', 'multiple.png', '', 'COM_PHOCAGALLERY_MULTIPLE_ADD', false);
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('phocagalleryimg.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.create')) {
         /*
         			$bar->appendButton( 'Custom', '<a href="#" onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''.JText::_('COM_PHOCAGALLERY_WARNING_RECREATE_MAKE_SELECTION').'\');}else{if(confirm(\''.JText::_('COM_PHOCAGALLERY_WARNING_RECREATE_THUMBNAILS').'\')){submitbutton(\'phocagalleryimg.recreate\');}}" class="toolbar"><span class="icon-32-recreate" title="'.JText::_('COM_PHOCAGALLERY_RECREATE_THUMBS').'" type="Custom"></span>'.JText::_('COM_PHOCAGALLERY_RECREATE').'</a>');*/
         $dhtml = '<button class="btn btn-small" onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\'' . JText::_('COM_PHOCAGALLERY_WARNING_RECREATE_MAKE_SELECTION') . '\');}else{if(confirm(\'' . JText::_('COM_PHOCAGALLERY_WARNING_RECREATE_THUMBNAILS') . '\')){submitbutton(\'phocagalleryimg.recreate\');}}" ><i class="icon-recreate" title="' . JText::_('COM_PHOCAGALLERY_RECREATE_THUMBS') . '"></i> ' . JText::_('COM_PHOCAGALLERY_RECREATE_THUMBS') . '</button>';
         $bar->appendButton('Custom', $dhtml);
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::divider();
         JToolBarHelper::custom('phocagalleryimgs.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::custom('phocagalleryimgs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
         JToolBarHelper::custom('phocagalleryimgs.approve', 'approve.png', '', 'COM_PHOCAGALLERY_APPROVE', true);
         JToolBarHelper::custom('phocagalleryimgs.disapprove', 'disapprove.png', '', 'COM_PHOCAGALLERY_NOT_APPROVE', true);
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList(JText::_('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS'), 'phocagalleryimgs.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\">\r\n\t\t\t\t\t\t<i class=\"icon-checkbox-partial\" title=\"{$title}\"></i>\r\n\t\t\t\t\t\t{$title}</button>";
         $bar->appendButton('Custom', $dhtml, 'batch');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.phocagallery', true);
 }