示例#1
0
 /**
  * Add the toolbar and toolbar title.
  *
  * @access  protected
  * @return  void
  *
  * @since 2.0
  */
 protected function addToolbar()
 {
     // Get the results for each action
     $canDo = JoomHelper::getActions();
     JToolBarHelper::title(JText::_('COM_JOOMGALLERY_CATMAN_CATEGORY_MANAGER'), 'folder');
     if ($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('core.create') || count(JoomHelper::getAuthorisedCategories('core.create'))) {
         JToolbarHelper::addNew('new');
     }
     if (($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('core.edit') || count(JoomHelper::getAuthorisedCategories('core.edit'))) && $this->pagination->total) {
         JToolbarHelper::editList('edit');
         JHtml::_('bootstrap.modal', 'collapseModal');
         $title = JText::_('JTOOLBAR_BATCH');
         $dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">\n                  <i class=\"icon-checkbox-partial\" title=\"{$title}\"></i>\n                  {$title}</button>";
         JToolBar::getInstance('toolbar')->appendButton('Custom', $dhtml, 'batch');
         JToolbarHelper::divider();
     }
     if (($this->_config->get('jg_disableunrequiredchecks') || count(JoomHelper::getAuthorisedCategories('core.edit.state'))) && $this->pagination->total) {
         JToolbarHelper::publishList('publish', JText::_('COM_JOOMGALLERY_COMMON_PUBLISH'));
         JToolbarHelper::unpublishList('unpublish', JText::_('COM_JOOMGALLERY_COMMON_UNPUBLISH'));
         JToolbarHelper::divider();
     }
     if (($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('core.delete') || count(JoomHelper::getAuthorisedCategories('core.delete'))) && $this->pagination->total) {
         JToolbarHelper::deleteList('', 'remove');
         JToolbarHelper::divider();
     }
 }
示例#2
0
 /**
  * Add the toolbar and toolbar title.
  *
  * @access  protected
  * @return  void
  *
  * @since 2.0
  */
 protected function addToolbar()
 {
     // Get the results for each action
     $canDo = JoomHelper::getActions();
     JToolBarHelper::title(JText::_('COM_JOOMGALLERY_CATMAN_CATEGORY_MANAGER'), 'folder');
     if ($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('core.create') || count(JoomHelper::getAuthorisedCategories('core.create'))) {
         JToolbarHelper::addNew('new');
     }
     if (($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('core.edit') || count(JoomHelper::getAuthorisedCategories('core.edit'))) && $this->pagination->total) {
         JToolbarHelper::editList('edit');
         JHtml::_('bootstrap.modal', 'collapseModal');
         $title = JText::_('JTOOLBAR_BATCH');
         $dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">\n                  <i class=\"icon-checkbox-partial\" title=\"{$title}\"></i>\n                  {$title}</button>";
         JToolBar::getInstance('toolbar')->appendButton('Custom', $dhtml, 'batch');
         JToolbarHelper::divider();
     }
     if (($this->_config->get('jg_disableunrequiredchecks') || count(JoomHelper::getAuthorisedCategories('core.edit.state'))) && $this->pagination->total) {
         JToolbarHelper::publishList('publish', JText::_('COM_JOOMGALLERY_COMMON_PUBLISH'));
         JToolbarHelper::unpublishList('unpublish', JText::_('COM_JOOMGALLERY_COMMON_UNPUBLISH'));
         JToolbarHelper::divider();
     }
     if (($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('core.delete') || count(JoomHelper::getAuthorisedCategories('core.delete'))) && $this->pagination->total) {
         JToolbarHelper::deleteList('', 'remove');
         JToolbarHelper::divider();
     }
     $options = array(JHtml::_('select.option', 1, JText::_('COM_JOOMGALLERY_COMMON_OPTION_PUBLISHED_ONLY')), JHtml::_('select.option', 0, JText::_('COM_JOOMGALLERY_COMMON_OPTION_NOT_PUBLISHED_ONLY')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', $options, 'value', 'text', $this->state->get('filter.published'), true));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
     $options = array(JHtml::_('select.option', 1, JText::_('COM_JOOMGALLERY_CATMAN_OPTION_USERCATEGORIES_ONLY')), JHtml::_('select.option', 2, JText::_('COM_JOOMGALLERY_CATMAN_OPTION_BACKENDCATEGORIES_ONLY')));
     JHtmlSidebar::addFilter(JText::_('COM_JOOMGALLERY_COMMON_OPTION_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', $options, 'value', 'text', $this->state->get('filter.type'), true));
 }
示例#3
0
 /**
  * Add the toolbar and toolbar title.
  *
  * @access  protected
  * @return  void
  *
  * @since 2.0
  */
 protected function addToolbar()
 {
     // Get the results for each action
     $canDo = JoomHelper::getActions();
     JToolBarHelper::title(JText::_('COM_JOOMGALLERY_IMGMAN_IMAGE_MANAGER'), 'images');
     if (($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('joom.upload') || count(JoomHelper::getAuthorisedCategories('joom.upload'))) && $this->pagination->total) {
         JToolbarHelper::addNew('new');
     }
     if (($canDo->get('core.edit') || $canDo->get('core.edit.own')) && $this->pagination->total) {
         JToolbarHelper::editList();
         JToolbarHelper::custom('edit', 'checkbox-partial', 'checkbox-partial', 'JTOOLBAR_BATCH');
         JToolbarHelper::custom('showmove', 'move.png', 'move.png', 'COM_JOOMGALLERY_COMMON_TOOLBAR_MOVE');
         JToolbarHelper::custom('recreate', 'refresh.png', 'refresh.png', 'COM_JOOMGALLERY_COMMON_TOOLBAR_RECREATE');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.edit.state') && $this->pagination->total) {
         JToolbarHelper::publishList('publish', JText::_('COM_JOOMGALLERY_COMMON_PUBLISH'));
         JToolbarHelper::unpublishList('unpublish', JText::_('COM_JOOMGALLERY_COMMON_UNPUBLISH'));
         JToolbarHelper::custom('approve', 'upload.png', 'upload_f2.png', 'COM_JOOMGALLERY_IMGMAN_TOOLBAR_APPROVE');
         JToolbarHelper::divider();
     }
     //if($canDo->get('core.delete'))
     //{
     JToolbarHelper::deleteList('', 'remove');
     //}
 }
示例#4
0
 protected function addToolbar()
 {
     // Get the results for each action
     $canDo = JoomHelper::getActions();
     JToolBarHelper::title(JText::_('COM_JOOMGALLERY_IMGMAN_IMAGE_MANAGER'), 'images');
     if (($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('joom.upload') || count(JoomHelper::getAuthorisedCategories('joom.upload'))) && $this->pagination->total) {
         JToolbarHelper::addNew('new');
     }
     if (($canDo->get('core.edit') || $canDo->get('core.edit.own')) && $this->pagination->total) {
         JToolbarHelper::editList();
         JToolbarHelper::custom('edit', 'checkbox-partial', 'checkbox-partial', 'JTOOLBAR_BATCH');
         JToolbarHelper::custom('showmove', 'move.png', 'move.png', 'COM_JOOMGALLERY_COMMON_TOOLBAR_MOVE');
         JToolbarHelper::custom('recreate', 'refresh.png', 'refresh.png', 'COM_JOOMGALLERY_COMMON_TOOLBAR_RECREATE');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.edit.state') && $this->pagination->total) {
         JToolbarHelper::publishList('publish', JText::_('COM_JOOMGALLERY_COMMON_PUBLISH'));
         JToolbarHelper::unpublishList('unpublish', JText::_('COM_JOOMGALLERY_COMMON_UNPUBLISH'));
         JToolbarHelper::custom('approve', 'upload.png', 'upload_f2.png', 'COM_JOOMGALLERY_IMGMAN_TOOLBAR_APPROVE');
         JToolbarHelper::divider();
     }
     //if($canDo->get('core.delete'))
     //{
     JToolbarHelper::deleteList('', 'remove');
     //}
     // Add filter by state
     $options = array(JHtml::_('select.option', 0, JText::_('JOPTION_SELECT_PUBLISHED')), JHtml::_('select.option', 1, JText::_('COM_JOOMGALLERY_COMMON_OPTION_PUBLISHED_ONLY')), JHtml::_('select.option', 2, JText::_('COM_JOOMGALLERY_COMMON_OPTION_NOT_PUBLISHED_ONLY')), JHtml::_('select.option', 3, JText::_('COM_JOOMGALLERY_COMMON_OPTION_APPROVED_ONLY')), JHtml::_('select.option', 4, JText::_('COM_JOOMGALLERY_COMMON_OPTION_NOT_APPROVED_ONLY')), JHtml::_('select.option', 5, JText::_('COM_JOOMGALLERY_COMMON_OPTION_REJECTED_ONLY')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', $options, 'value', 'text', $this->state->get('filter.state'), false), true);
     // Add filter by category
     if (!$this->_config->get('jg_ajaxcategoryselection')) {
         // TODO must find a better way instead of removing the tags, what about switching to AJAX boxes -> doesn't work
         $options = preg_replace('~^<select[^>]*+>\\s*~', '', trim(JHtml::_('joomselect.categorylist', $this->state->get('filter.category'), 'filter_category', 'class="inputbox" onchange="document.id(\'adminForm\').submit()"', null, '- ', 'filter')));
         $options = preg_replace('~\\s*</select>$~', '', $options);
         JHtmlSidebar::addFilter(JText::_('COM_JOOMGALLERY_COMMON_ALL'), 'filter_category', $options, true);
     }
     // Add filter by access
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
     // Add filter by owner
     $html = JHtml::_('joomselect.userspopup', 'filter_owner', $this->state->get('filter.owner'), 'document.id(\'adminForm\').submit();');
     if (strpos($html, '<select') !== false) {
         // TODO must find a better way instead of removing the tags
         $options = preg_replace('~^<select[^>]*+>\\s*~', '', trim($html));
         $options = preg_replace('~\\s*</select>$~', '', $options);
         JHtmlSidebar::addFilter(JText::_('COM_JOOMGALLERY_COMMON_OPTION_SELECT_OWNER'), 'filter_owner', $options, true);
     }
     // Add filter by type
     $options = array(JHTML::_('select.option', 0, JText::_('COM_JOOMGALLERY_COMMON_OPTION_SELECT_TYPE')), JHTML::_('select.option', 1, JText::_('COM_JOOMGALLERY_COMMON_OPTION_USER_UPLOADED_ONLY')), JHTML::_('select.option', 2, JText::_('COM_JOOMGALLERY_COMMON_OPTION_ADMIN_UPLOADED_ONLY')));
     JHtmlSidebar::addFilter(JText::_('COM_JOOMGALLERY_COMMON_OPTION_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', $options, 'value', 'text', $this->state->get('filter.type'), false), true);
 }
示例#5
0
 /**
  * HTML view display method
  *
  * @param   string  $tpl  The name of the template file to parse
  * @return  void
  * @since   1.5.5
  */
 public function display($tpl = null)
 {
     $this->params = JComponentHelper::getParams('com_joomgallery');
     JToolBarHelper::title(JText::_('COM_JOOMGALLERY_ADMENU_ADMINMENU'), 'joomgallery');
     $this->canDo = JoomHelper::getActions();
     if ($this->canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_joomgallery');
         JToolBarHelper::spacer();
     }
     // Get data from the model
     $model = $this->getModel();
     $this->state = $model->getState();
     $this->items = $model->getData();
     $this->popularImages = $model->getImages('a.hits desc', true, 5, 'a.hits > 0');
     $this->notApprovedImages = $model->getImages('a.imgdate desc', false, 5);
     $this->notApprovedComments = $model->getComments('c.cmtdate desc', false, 5);
     $this->topDownloads = $model->getImages('a.downloads desc', true, 5, 'a.downloads > 0');
     $lang = JFactory::getLanguage();
     $this->modules =& JModuleHelper::getModules('joom_cpanel');
     if ($this->_config->get('jg_checkupdate')) {
         $available_extensions = JoomExtensions::getAvailableExtensions();
         $this->params->set('url_fopen_allowed', @ini_get('allow_url_fopen'));
         $this->params->set('curl_loaded', extension_loaded('curl'));
         // If there weren't any available extensions found
         // loading the RSS feed wasn't successful
         if (count($available_extensions)) {
             $installed_extensions = JoomExtensions::getInstalledExtensions();
             $this->assignRef('available_extensions', $available_extensions);
             $this->assignRef('installed_extensions', $installed_extensions);
             $this->params->set('show_available_extensions', 1);
             $dated_extensions = JoomExtensions::checkUpdate();
             if (count($dated_extensions)) {
                 $this->assignRef('dated_extensions', $dated_extensions);
                 $this->params->set('dated_extensions', 1);
             } else {
                 $this->params->set('dated_extensions', 0);
                 $this->params->set('show_update_info_text', 1);
             }
         }
     } else {
         $this->params->set('dated_extensions', 0);
     }
     parent::display($tpl);
 }
示例#6
0
 /**
  * Returns the query for loading the menu entries
  *
  * @return  object  The query to be used to retrieve the menu entries from the database
  * @since   1.5.5
  */
 protected function _buildQuery()
 {
     $query = $this->_db->getQuery(true)->select('*')->from('#__menu')->where('parent_id != 1')->where("menutype = 'main'");
     $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=images%'";
     $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=categories%'";
     $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=comments%'";
     $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=migration%'";
     $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=help%'";
     $canDo = JoomHelper::getActions();
     if ($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('joom.upload') || count(JoomHelper::getAuthorisedCategories('joom.upload'))) {
         $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=upload%'";
         $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=ajaxupload%'";
         $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=batchupload%'";
         $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=ftpupload%'";
         $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=jupload%'";
     }
     if ($canDo->get('core.admin')) {
         $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=config%'";
         $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=cssedit%'";
         $where[] = "link LIKE 'index.php?option=com_joomgallery&controller=maintenance%'";
     }
     $query->where('(' . implode(' OR ', $where) . ')')->order('id');
     return $query;
 }
示例#7
0
 /**
  * Add the page title and toolbar.
  *
  * @return  void
  *
  * @since 2.0
  */
 public function addToolbar()
 {
     // Get the results for each action
     $canDo = JoomHelper::getActions('category', $this->item->cid);
     $title = JText::_('COM_JOOMGALLERY_CATMAN_CATEGORY_MANAGER') . ' :: ';
     if ($this->isNew) {
         $title .= JText::_('COM_JOOMGALLERY_CATMAN_ADD_CATEGORY');
     } else {
         $title .= JText::_('COM_JOOMGALLERY_CATMAN_EDIT_CATEGORY');
     }
     $title .= ' ' . JText::_('COM_JOOMGALLERY_COMMON_CATEGORY');
     JToolBarHelper::title($title, 'folder');
     // For new categories check the create permission
     if ($this->isNew && ($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('core.create') || count(JoomHelper::getAuthorisedCategories('core.create')))) {
         JToolBarHelper::apply('apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('save', 'JTOOLBAR_SAVE');
         JToolBarHelper::custom('save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
     } else {
         if ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->owner == $this->_user->get('id')) {
             JToolBarHelper::apply('apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('save', 'JTOOLBAR_SAVE');
             if ($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('core.create') || count(JoomHelper::getAuthorisedCategories('core.create'))) {
                 JToolBarHelper::save2new();
             }
         }
     }
     // If it's an already existing category a copy may be saved (only if creating categories is allowed)
     if (!$this->isNew && ($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('core.create') || count(JoomHelper::getAuthorisedCategories('core.create')))) {
         JToolBarHelper::save2copy();
     }
     if ($this->isNew) {
         JToolBarHelper::cancel('cancel', 'JTOOLBAR_CANCEL');
     } else {
         JToolBarHelper::cancel('cancel', 'JTOOLBAR_CLOSE');
     }
     JToolbarHelper::spacer();
 }