protected function addToolBar() { $app = JFactory::getApplication(); $app->input->set('hidemainmenu', true); $isNew = $this->item->id == 0; $user = JFactory::getUser(); $userId = $user->id; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_PAGE_' . ($checkedOut ? 'VIEW_FIELD' : ($isNew ? 'ADD_FIELD' : 'EDIT_FIELD'))), 'field-add'); $canDo = JUDownloadHelper::getActions('com_judownload', 'field', $this->item->id); if ($isNew && $user->authorise('core.create', 'com_judownload')) { JToolBarHelper::apply('field.apply'); JToolBarHelper::save('field.save'); JToolBarHelper::save2new('field.save2new'); JToolBarHelper::cancel('field.cancel'); } else { if (!$checkedOut) { if ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->created_by == $userId) { JToolBarHelper::apply('field.apply'); JToolBarHelper::save('field.save'); if ($canDo->get('core.create')) { JToolBarHelper::save2new('field.save2new'); } } } JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); $bar = JToolBar::getInstance('toolbar'); $bar->addButtonPath(JPATH_ADMINISTRATOR . "/components/com_judownload/helpers/button"); $bar->appendButton('JUHelp', 'help', JText::_('JTOOLBAR_HELP')); }
public function display($tpl = null) { if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->canDo = JUDownloadHelper::getActions('com_judownload'); $this->addToolBar(); if (JUDownloadHelper::isJoomla3x()) { $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); } $options = array(); $options[] = JHtml::_('select.option', '1', JText::_('J1')); $options[] = JHtml::_('select.option', '2', JText::_('J2')); $options[] = JHtml::_('select.option', '3', JText::_('J3')); $options[] = JHtml::_('select.option', '4', JText::_('J4')); $options[] = JHtml::_('select.option', '5', JText::_('J5')); $options[] = JHtml::_('select.option', '6', JText::_('J6')); $options[] = JHtml::_('select.option', '7', JText::_('J7')); $options[] = JHtml::_('select.option', '8', JText::_('J8')); $options[] = JHtml::_('select.option', '9', JText::_('J9')); $options[] = JHtml::_('select.option', '10', JText::_('J10')); $this->f_levels = $options; $optionsPublished = array(); $optionsPublished[] = JHtml::_('select.option', '1', JText::_('COM_JUDOWNLOAD_PUBLISHED')); $optionsPublished[] = JHtml::_('select.option', '0', JText::_('COM_JUDOWNLOAD_UNPUBLISHED')); $this->published_options = $optionsPublished; parent::display($tpl); $this->setDocument(); }
public function display($tpl = null) { if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->canDo = JUDownloadHelper::getActions('com_judownload'); $this->groupCanDoManage = JUDownloadHelper::checkGroupPermission("comment.edit"); $this->groupCanDoDelete = JUDownloadHelper::checkGroupPermission("comments.delete"); $this->rootComment = JUDownloadFrontHelperComment::getRootComment(); foreach ($this->items as &$item) { $this->ordering[$item->parent_id][] = $item->id; } $this->addToolBar(); if (JUDownloadHelper::isJoomla3x()) { $layout = JFactory::getApplication()->input->get('layout', ''); if ($layout != 'modal') { $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); } } parent::display($tpl); $this->setDocument(); }
protected function addToolBar() { $app = JFactory::getApplication(); $app->input->set('hidemainmenu', true); $isNew = $this->item->id == 0; $canDo = JUDownloadHelper::getActions('com_judownload'); $user = JFactory::getUser(); $userId = $user->id; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_PAGE_' . ($checkedOut ? 'VIEW_TEMPLATE_STYLE' : ($isNew ? 'ADD_TEMPLATE_STYLE' : 'EDIT_TEMPLATE_STYLE'))), 'style-add'); if ($isNew) { if ($canDo->get('core.create')) { JToolBarHelper::apply('style.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('style.save2new', 'JTOOLBAR_SAVE_AND_NEW'); JToolBarHelper::save('style.save', 'JTOOLBAR_SAVE'); } JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CANCEL'); } else { if ($canDo->get('core.edit')) { JToolBarHelper::apply('style.apply', 'JTOOLBAR_APPLY'); if ($canDo->get('core.create')) { JToolBarHelper::save('style.save2new', 'JTOOLBAR_SAVE_AND_NEW'); } JToolBarHelper::save('style.save', 'JTOOLBAR_SAVE'); } JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); $bar = JToolBar::getInstance('toolbar'); $bar->addButtonPath(JPATH_ADMINISTRATOR . "/components/com_judownload/helpers/button"); $bar->appendButton('JUHelp', 'help', JText::_('JTOOLBAR_HELP')); }
public function display($tpl = null) { if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->canDo = JUDownloadHelper::getActions('com_judownload'); $this->addToolBar(); parent::display($tpl); $this->setDocument(); }
public function display($tpl = null) { if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } JHtml::_('behavior.calendar'); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->script = $this->get('Script'); $this->canDo = JUDownloadHelper::getActions('com_judownload'); $this->groupCanDoManage = JUDownloadHelper::checkGroupPermission("globalconfig.save"); $this->isJoomla3x = JUDownloadHelper::isJoomla3x(); $this->setDocument(); $this->addToolBar(); parent::display($tpl); }
public function display($tpl = null) { if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $app = JFactory::getApplication(); $this->canDo = JUDownloadHelper::getActions('com_judownload'); $saveMessage = $app->getUserState('com_judownload.backendpermission.message'); if ($saveMessage) { $app->enqueueMessage($saveMessage); $app->setUserState('com_judownload.backendpermission.message', ''); } $this->addToolBar(); parent::display($tpl); $this->setDocument(); }
protected function addToolBar() { $canDo = JUDownloadHelper::getActions('com_judownload'); JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_SEARCH_DOCUMENTS'), 'search-documents'); if ($canDo->get('judl.document.create')) { JToolBarHelper::custom($task = 'documents.copyDocuments', $icon = 'copy', $iconOver = 'copy', $alt = JText::_('COM_JUDOWNLOAD_COPY_DOCUMENTS_BTN'), $listSelect = false, $x = false); } if (($canDo->get('judl.document.edit') || $canDo->get('judl.document.edit.own')) && $canDo->get('judl.document.create')) { JToolBarHelper::custom($task = 'documents.moveDocuments', $icon = 'move', $iconOver = 'move', $alt = JText::_('COM_JUDOWNLOAD_MOVE_DOCUMENTS_BTN'), $listSelect = false, $x = false); } if ($canDo->get('judl.document.delete') || $canDo->get('judl.document.delete.own')) { JToolBarHelper::custom($task = 'documents.delete', $icon = 'delete', $iconOver = 'delete', $alt = JText::_('COM_JUDOWNLOAD_DELETE_DOCUMENTS_BTN'), $listSelect = false, $x = false); } JToolBarHelper::divider(); $bar = JToolBar::getInstance('toolbar'); $bar->addButtonPath(JPATH_ADMINISTRATOR . "/components/com_judownload/helpers/button"); $bar->appendButton('JUHelp', 'help', JText::_('JTOOLBAR_HELP')); }
public function display($tpl = null) { if (!JUDownloadHelper::hasMultiRating()) { JError::raiseError(500, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN')); return false; } if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->script = $this->get('Script'); $this->canDo = JUDownloadHelper::getActions('com_judownload'); $this->addToolBar(); parent::display($tpl); $this->setDocument(); }
public function display($tpl = null) { if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->canDo = JUDownloadHelper::getActions('com_judownload'); $this->groupCanDoManage = JUDownloadHelper::checkGroupPermission("tag.edit"); $this->groupCanDoDelete = JUDownloadHelper::checkGroupPermission("tags.delete"); $this->addToolBar(); if (JUDownloadHelper::isJoomla3x()) { $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); } parent::display($tpl); $this->setDocument(); }
public function display($tpl = null) { if (!JUDownloadHelper::hasMultiRating()) { JError::raiseError(500, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN')); return false; } if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->canDo = JUDownloadHelper::getActions('com_judownload'); $this->groupCanDoManage = JUDownloadHelper::checkGroupPermission("criteria.edit"); $this->groupCanDoDelete = JUDownloadHelper::checkGroupPermission("criterias.delete"); $this->addToolBar(); if (JUDownloadHelper::isJoomla3x()) { $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); } parent::display($tpl); $this->setDocument(); }
public function display($tpl = null) { if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $app = JFactory::getApplication(); $rootCat = JUDownloadFrontHelperCategory::getRootCategory(); $fastAddError = $app->getUserState('com_judownload.categories.fastadderror'); $fastAddSuccess = $app->getUserState('com_judownload.categories.fastaddsuccess'); $this->cat_id = $app->input->getInt('cat_id', $rootCat->id); $this->params = JUDownloadHelper::getParams($this->cat_id); $this->canDoCat = JUDownloadHelper::getActions('com_judownload', 'category', $this->cat_id); $this->rootCat = JUDownloadFrontHelperCategory::getRootCategory(); $this->allowAddDoc = $this->params->get('allow_add_doc_to_root', 0) && $this->cat_id == $this->rootCat->id || $this->cat_id != $this->rootCat->id; $this->docGroupCanDoManage = $this->groupCanDoCatManage = JUDownloadHelper::checkGroupPermission("document.edit"); $this->docGroupCanDoDelete = $this->groupCanDoCatDelete = JUDownloadHelper::checkGroupPermission("documents.delete"); $this->catGroupCanDoManage = $this->groupCanDoCatManage = JUDownloadHelper::checkGroupPermission("category.edit"); $this->catGroupCanDoDelete = $this->groupCanDoCatDelete = JUDownloadHelper::checkGroupPermission("categories.delete"); // if ($fastAddSuccess) { $app->enqueueMessage($fastAddSuccess); $app->setUserState('com_judownload.categories.fastaddsuccess', ''); } if ($fastAddError) { $app->enqueueMessage($fastAddError, 'error'); $app->setUserState('com_judownload.categories.fastadderror', ''); } $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->model = $this->getModel(); $this->addToolBar(); $this->setDocument(); parent::display($tpl); }
public function display($tpl = null) { JHtml::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_judownload/helpers/html'); $this->canDo = JUDownloadHelper::getActions('com_judownload'); $this->groupCanDoManage = JUDownloadHelper::checkGroupPermission("languages.edit"); $model = $this->getModel(); $app = JFactory::getApplication(); $this->state = $this->get('State'); $lang = $this->state->get('language.lang', 'en-GB'); $site = $this->state->get('language.site', 'frontend'); $item = $this->state->get('language.item', '.com_judownload.ini'); if ($site == 'frontend') { $path = JPATH_ROOT . "/" . 'language' . "/" . 'en-GB' . "/" . 'en-GB' . $item; } if ($site == 'backend') { $path = JPATH_ADMINISTRATOR . "/" . 'language' . "/" . 'en-GB' . "/" . 'en-GB' . $item; } if (!JFile::exists($path)) { $item = '.com_judownload.ini'; } $fileLanguages = $model->getFileLanguages($site); $fileArr = array(); foreach ($fileLanguages as $value) { $value = substr($value, 5); $fileArr[$value] = $value; } $languages = $model->getSiteLanguages(); $options = array(); foreach ($languages as $language) { if ($language != 'overrides') { $options[$language] = $language; } } $this->translate = $model->getTranslate($lang, $item, $site); $this->language = $options; $this->siteArr = array('frontend' => JText::_('COM_JUDOWNLOAD_FRONTEND'), 'backend' => JText::_('COM_JUDOWNLOAD_BACKEND')); $this->filterArr = array('none' => JText::_('COM_JUDOWNLOAD_NONE_FILTER'), 'empty' => JText::_('COM_JUDOWNLOAD_EMPTY_FILTER'), 'warning' => JText::_('COM_JUDOWNLOAD_WARNING_FILTER')); $this->fileArr = $fileArr; $this->site = $site; $this->lang = $lang; $this->item = $item; $this->search = $this->escape($this->state->get('filter.search')); $this->filter = $this->escape($this->state->get('language.filter')); $this->original = $this->translate['en-GB'][$this->item]; $this->translation = $this->translate[$this->lang][$this->item]; $this->pagination = $this->get('Pagination'); $this->limitArr = array('50' => '50', '100' => '100', '200' => '200', '300' => '300', '500' => '500'); $model = $this->getModel(); $this->start = $model->getStart(); $comment = ''; if (isset($this->translation['COMMENT'])) { $comment = $this->translation['COMMENT']; if (!empty($comment)) { $commentArr = explode("\n", $comment); function rep($str) { return preg_replace('#^\\s*;#', '', $str); } $newArr = array_map("rep", $commentArr); $comment = implode("\n", $newArr); } } $this->comment = $comment; unset($this->original['COMMENT']); $fileExisted = true; if ($this->site == 'frontend') { $pathFile = JPATH_ROOT . "/" . 'language' . "/" . $this->lang . "/" . $this->lang . $this->item; } elseif ($this->site == 'backend') { $pathFile = JPATH_ADMINISTRATOR . "/" . 'language' . "/" . $this->lang . "/" . $this->lang . $this->item; } if (!JFile::exists($pathFile)) { $fileExisted = false; } $this->fileExisted = $fileExisted; $this->share_link = JRoute::_('index.php?option=com_judownload&view=languages&layout=modal&tmpl=component&share=' . $this->site); $layout = $app->input->get('layout', ''); if ($layout == 'modal') { $this->share_site = $app->input->get('site', 'frontend'); $this->arrLanguageFiles = $model->getFileLanguageList($this->share_site); } $this->setDocument(); $this->addToolBar(); parent::display($tpl); }
* @copyright Copyright (C) 2010-2015 JoomUltra Co., Ltd. All Rights Reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author JoomUltra Co., Ltd * @website http://www.joomultra.com * @----------------------------------------------------------------------@ */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); $rootCat = JUDownloadFrontHelperCategory::getRootCategory(); $cat_id = JFactory::getApplication()->input->getInt("cat_id", $rootCat->id); $search_in = $this->state->get('filter.search_in'); ?> <ul class="manager-actions nav nav-list" style="margin-bottom: 20px;"> <?php $actions = JUDownloadHelper::getActions('com_judownload', 'category', $cat_id); if ($actions->get("judl.document.create")) { if ($this->docGroupCanDoManage && $this->allowAddDoc) { echo "<li><a class='add-document' href='index.php?option=com_judownload&task=document.add&cat_id={$cat_id}'><i class='icon-file-add'></i>" . JText::_('COM_JUDOWNLOAD_ADD_DOCUMENT') . "</a></li>"; } } if ($actions->get("judl.category.create")) { if ($this->catGroupCanDoManage) { echo "<li><a class='add-category' href='index.php?option=com_judownload&task=category.add&parent_id={$cat_id}'><i class='icon-folder-plus'></i>" . JText::_('COM_JUDOWNLOAD_ADD_CATEGORY') . "</a></li>"; } } if (JUDownloadHelper::checkGroupPermission(null, "pendingdocuments") && JUDLPROVERSION) { echo "<li><a class='approved' href='index.php?option=com_judownload&view=pendingdocuments'><i class='icon-clock'></i>" . JText::sprintf('COM_JUDOWNLOAD_PENDING_DOCUMENTS_N', JUDownloadHelper::getTotalPendingDocuments()) . "</a></li>"; } ?> </ul>