示例#1
0
 /**
  * Add the page title and toolbar.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = JHelperContent::getActions('com_sibdiet');
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_PROFILES'), 'users profiles');
     if (in_array('profiles', $this->permissions)) {
         if ($canDo->get('core.create')) {
             JToolBarHelper::addNew('profile.add');
         }
         if (isset($this->items[0])) {
             if ($canDo->get('core.edit')) {
                 JToolBarHelper::editList('profile.edit');
             }
             if ($canDo->get('core.edit.state')) {
                 JToolbarHelper::checkin('profiles.checkin');
             }
             if ($canDo->get('core.delete')) {
                 JToolbarHelper::deleteList('', 'profiles.delete');
             }
             // Add a batch button for Merge Files
             if (JFactory::getUser()->get('isRoot')) {
                 JToolbarHelper::modal('collapseModal', 'icon-users', JText::_('COM_SIBDIET_TOOLBAR_MERGE_FILES'));
             }
         }
     }
     JToolBarHelper::help('screen.profiles', true);
 }
示例#2
0
 /**
  * Add the page title and toolbar.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = SibdietHelper::getActions('com_sibdiet');
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_COMPONENT . '/toolbar/button/');
     JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_FOODS'), 'database foods');
     if (in_array('foods', $this->permissions)) {
         if ($canDo->get('core.create')) {
             JToolBarHelper::addNew('food.add');
         }
         if (isset($this->items[0])) {
             if ($canDo->get('core.edit')) {
                 JToolBarHelper::editList('food.edit');
             }
             if ($canDo->get('core.edit.state')) {
                 JToolbarHelper::checkin('foods.checkin');
             }
             if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) {
                 JToolbarHelper::publish('foods.publish', 'JTOOLBAR_PUBLISH', true);
                 JToolbarHelper::deleteList('', 'foods.delete', 'JTOOLBAR_EMPTY_TRASH');
             } elseif ($canDo->get('core.edit.state')) {
                 JToolbarHelper::trash('foods.trash');
             }
             // Copy foods to diet batch button
             if ($canDo->get('core.create')) {
                 JToolbarHelper::modal('copyFoodsCollapseModal', 'icon-checkbox-partial', JText::_('COM_SIBDIET_COPY_FOODS'));
             }
             // Edit foods batch buttons
             if ($canDo->get('core.edit') && $canDo->get('core.edit.state')) {
                 JToolbarHelper::modal('editCompositionsCollapseModal', 'icon-checkbox-partial', JText::_('COM_SIBDIET_EDIT_COMPOSITIONS'));
                 JToolbarHelper::modal('editPreparationsCollapseModal', 'icon-checkbox-partial', JText::_('COM_SIBDIET_EDIT_PRPARATIONS'));
             }
             // Print foods compositions
             $bar->appendButton('Print', 'index.php?option=com_sibdiet&view=printfoods&tmpl=component', 'COM_SIBDIET_PRINT_FOODS');
             // Print foods preparations
             $bar->appendButton('Print', 'index.php?option=com_sibdiet&view=printfoods&tmpl=component&layout=preparations', 'COM_SIBDIET_PRINT_FOODS_PREPARATIONS', false);
         }
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_sibdiet');
     }
 }
示例#3
0
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  *
  * @return  void
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $canDo = JHelperContent::getActions('com_templates');
     if ($canDo->get('core.edit') && $canDo->get('core.create') && $canDo->get('core.admin')) {
         $showButton = true;
     } else {
         $showButton = false;
     }
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     $explodeArray = explode('.', $this->fileName);
     $ext = end($explodeArray);
     JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'eye thememanager');
     // Add a Apply and save button
     if ($this->type == 'file') {
         if ($showButton) {
             JToolbarHelper::apply('template.apply');
             JToolbarHelper::save('template.save');
         }
     } elseif ($this->type == 'image') {
         if ($showButton) {
             JToolbarHelper::custom('template.cropImage', 'move', 'move', 'COM_TEMPLATES_BUTTON_CROP', false, false);
             JToolbarHelper::modal('resizeModal', 'icon-refresh', 'COM_TEMPLATES_BUTTON_RESIZE');
         }
     } elseif ($this->type == 'archive') {
         if ($showButton) {
             JToolbarHelper::custom('template.extractArchive', 'arrow-down', 'arrow-down', 'COM_TEMPLATES_BUTTON_EXTRACT_ARCHIVE', false, false);
         }
     }
     // Add a copy template button
     if ($this->hathor->home == 0) {
         if ($showButton) {
             JToolbarHelper::modal('collapseModal', 'icon-copy', 'COM_TEMPLATES_BUTTON_COPY_TEMPLATE');
         }
     }
     // Add a Template preview button
     if ($this->preview->client_id == 0) {
         $bar->appendButton('Link', 'picture', 'COM_TEMPLATES_BUTTON_PREVIEW', JUri::root() . 'index.php?tp=1&templateStyle=' . $this->preview->id);
     }
     // Add Manage folders button
     if ($showButton) {
         JToolbarHelper::modal('folderModal', 'icon-folder icon white', 'COM_TEMPLATES_BUTTON_FOLDERS');
     }
     // Add a new file button
     if ($showButton) {
         JToolbarHelper::modal('fileModal', 'icon-file', 'COM_TEMPLATES_BUTTON_FILE');
     }
     // Add a Rename file Button
     if ($this->hathor->home == 0) {
         if ($showButton && $this->type != 'home') {
             JToolbarHelper::modal('renameModal', 'icon-refresh', 'COM_TEMPLATES_BUTTON_RENAME_FILE');
         }
     }
     // Add a Delete file Button
     if ($showButton && $this->type != 'home') {
         JToolbarHelper::modal('deleteModal', 'icon-remove', 'COM_TEMPLATES_BUTTON_DELETE_FILE');
     }
     // Add a Compile Button
     if ($showButton) {
         if ($ext == 'less') {
             JToolbarHelper::custom('template.less', 'play', 'play', 'COM_TEMPLATES_BUTTON_LESS', false, false);
         }
     }
     if ($this->type == 'home') {
         JToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
     } else {
         JToolbarHelper::cancel('template.close', 'COM_TEMPLATES_BUTTON_CLOSE_FILE');
     }
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT');
 }
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  *
  * @return  void
  */
 protected function addToolbar()
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $app->input->set('hidemainmenu', true);
     // User is global SuperUser
     $isSuperUser = $user->authorise('core.admin');
     // Get the toolbar object instance
     $bar = JToolbar::getInstance('toolbar');
     $explodeArray = explode('.', $this->fileName);
     $ext = end($explodeArray);
     JToolbarHelper::title(JText::sprintf('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE', ucfirst($this->template->name)), 'eye thememanager');
     // Only show file edit buttons for global SuperUser
     if ($isSuperUser) {
         // Add an Apply and save button
         if ($this->type == 'file') {
             JToolbarHelper::apply('template.apply');
             JToolbarHelper::save('template.save');
         } elseif ($this->type == 'image') {
             JToolbarHelper::custom('template.cropImage', 'move', 'move', 'COM_TEMPLATES_BUTTON_CROP', false);
             JToolbarHelper::modal('resizeModal', 'icon-refresh', 'COM_TEMPLATES_BUTTON_RESIZE');
         } elseif ($this->type == 'archive') {
             JToolbarHelper::custom('template.extractArchive', 'arrow-down', 'arrow-down', 'COM_TEMPLATES_BUTTON_EXTRACT_ARCHIVE', false);
         }
         // Add a copy template button (Hathor override doesn't need the button)
         if ($app->getTemplate() != 'hathor') {
             JToolbarHelper::modal('copyModal', 'icon-copy', 'COM_TEMPLATES_BUTTON_COPY_TEMPLATE');
         }
     }
     // Add a Template preview button
     if ($this->preview->client_id == 0) {
         $bar->appendButton('Popup', 'picture', 'COM_TEMPLATES_BUTTON_PREVIEW', JUri::root() . 'index.php?tp=1&templateStyle=' . $this->preview->id, 800, 520);
     }
     // Only show file manage buttons for global SuperUser
     if ($isSuperUser) {
         // Add Manage folders button
         JToolbarHelper::modal('folderModal', 'icon-folder icon white', 'COM_TEMPLATES_BUTTON_FOLDERS');
         // Add a new file button
         JToolbarHelper::modal('fileModal', 'icon-file', 'COM_TEMPLATES_BUTTON_FILE');
         // Add a Rename file Button (Hathor override doesn't need the button)
         if ($app->getTemplate() != 'hathor' && $this->type != 'home') {
             JToolbarHelper::modal('renameModal', 'icon-refresh', 'COM_TEMPLATES_BUTTON_RENAME_FILE');
         }
         // Add a Delete file Button
         if ($this->type != 'home') {
             JToolbarHelper::modal('deleteModal', 'icon-remove', 'COM_TEMPLATES_BUTTON_DELETE_FILE');
         }
         // Add a Compile Button
         if ($ext == 'less') {
             JToolbarHelper::custom('template.less', 'play', 'play', 'COM_TEMPLATES_BUTTON_LESS', false);
         }
     }
     if ($this->type == 'home') {
         JToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
     } else {
         JToolbarHelper::cancel('template.close', 'COM_TEMPLATES_BUTTON_CLOSE_FILE');
     }
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT');
 }
示例#5
0
 /**
  * Add the page title and toolbar.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = JHelperContent::getActions('com_sibdiet');
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_COMPONENT . '/toolbar/button/');
     JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_CONTROLLER'), 'cogs controller');
     if (in_array('requestschecks', $this->permissions)) {
         if (isset($this->items[0])) {
             if ($canDo->get('core.edit')) {
                 JToolBarHelper::editList('request.edit');
             }
             if ($canDo->get('core.edit.state')) {
                 JToolbarHelper::checkin('requests.checkin');
                 JToolbarHelper::publish('requests.publish', 'JTOOLBAR_PUBLISH', true);
                 JToolbarHelper::unpublish('requests.unpublish', 'JTOOLBAR_UNPUBLISH', true);
                 JToolbarHelper::archiveList('requests.archive', 'COM_SIBDIET_TOOLBAR_WAITING_LIST');
             }
             if ($this->state->get('filter.published') == -2) {
                 JToolbarHelper::deleteList('', 'requests.delete', 'JTOOLBAR_EMPTY_TRASH');
             } else {
                 JToolbarHelper::trash('requests.trash');
             }
             // Add a batch button for tags
             if ($canDo->get('core.edit') && $canDo->get('core.edit.state')) {
                 JToolbarHelper::modal('collapseModal', 'icon-checkbox-partial', JText::_('JTOOLBAR_BATCH'));
             }
         }
     }
 }
示例#6
0
 /**
  * Add the page title and toolbar.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = JHelperContent::getActions('com_sibdiet');
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_COMPONENT . '/toolbar/button/');
     // Get group filter title
     $groupFilter = '';
     if (is_numeric($groupFilterID = $this->state->get('filter.requesting_group_id'))) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true)->select('title')->from('#__usergroups')->where('id = ' . $groupFilterID);
         $db->setQuery($query);
         $groupFilterTitle = $db->loadResult();
         $groupFilter = ' <span class="text-warning">(' . $groupFilterTitle . ')</span>';
     }
     JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_SETDIETS') . $groupFilter, 'health setdiets');
     if (in_array('setdiets', $this->permissions)) {
         if ($canDo->get('core.create')) {
             JToolBarHelper::addNew('setdiet.add');
         }
         if (isset($this->items[0])) {
             if ($canDo->get('core.edit')) {
                 JToolBarHelper::editList('setdiet.edit');
             }
             if ($canDo->get('core.edit.state')) {
                 JToolbarHelper::publish('setdiets.publish', 'JTOOLBAR_PUBLISH', true);
                 JToolbarHelper::unpublish('setdiets.unpublish', 'JTOOLBAR_UNPUBLISH', true);
                 JToolbarHelper::checkin('setdiets.checkin');
             }
             if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
                 JToolbarHelper::deleteList('', 'setdiets.delete', 'JTOOLBAR_EMPTY_TRASH');
             } elseif ($canDo->get('core.edit.state')) {
                 JToolbarHelper::trash('setdiets.trash');
             }
             // Add a batch button for tags
             if ($canDo->get('core.edit') && $canDo->get('core.edit.state')) {
                 JToolbarHelper::modal('collapseModal', 'icon-checkbox-partial', JText::_('JTOOLBAR_BATCH'));
             }
             $bar->appendButton('Print', 'index.php?option=com_sibdiet&view=printdiets&tmpl=component', 'COM_SIBDIET_TOOLBAR_PRINT_DIETS');
             $bar->appendButton('Print', 'index.php?option=com_sibdiet&view=printdiets&tmpl=component&layout=addresses', 'COM_SIBDIET_TOOLBAR_PRINT_ADDRESSES', false);
         }
     }
 }
示例#7
0
 /**
  * Add the page title and toolbar.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = JHelperContent::getActions('com_sibdiet');
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_COMPONENT . '/toolbar/button/');
     JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_REQUESTS'), 'list-view requests');
     if (in_array('requests', $this->permissions)) {
         if ($canDo->get('core.create')) {
             JToolBarHelper::addNew('request.add');
         }
         if (isset($this->items[0])) {
             if ($canDo->get('core.edit')) {
                 JToolBarHelper::editList('request.edit');
             }
             if ($canDo->get('core.edit.state')) {
                 JToolbarHelper::checkin('requests.checkin');
             }
             if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
                 JToolbarHelper::publish('requests.publish', 'JTOOLBAR_PUBLISH', true);
                 JToolbarHelper::deleteList('', 'requests.delete', 'JTOOLBAR_EMPTY_TRASH');
             } elseif ($canDo->get('core.edit.state')) {
                 JToolbarHelper::trash('requests.trash');
             }
             // Add a batch button for tags
             if ($canDo->get('core.edit') && $canDo->get('core.edit.state')) {
                 JToolbarHelper::modal('collapseModal', 'icon-checkbox-partial', JText::_('JTOOLBAR_BATCH'));
             }
             $bar->appendButton('Print', 'index.php?option=com_sibdiet&view=printdiets&tmpl=component', 'COM_SIBDIET_PRINT_DIETS');
         }
     }
 }