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(); }
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; } $app = JFactory::getApplication(); if ($app->input->get('layout') == null) { $app->redirect('index.php?option=com_judownload&view=listcats'); } $this->items = $this->get('Items'); $this->state = $this->get('State'); $this->authors = $this->get('Authors'); $this->pagination = $this->get('Pagination'); if ($app->input->get('layout') == 'copy') { JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_COPY_DOCUMENTS'), 'copy-documents'); JToolBarHelper::apply('documents.copyDocuments', 'JTOOLBAR_APPLY'); JToolBarHelper::cancel('document.cancel', 'JTOOLBAR_CANCEL'); } elseif ($app->input->get('layout') == 'move') { JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_MOVE_DOCUMENTS'), 'move-documents'); JToolBarHelper::apply('documents.moveDocuments', 'JTOOLBAR_APPLY'); JToolBarHelper::cancel('document.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_DOCUMENTS'), 'documents'); $this->totalDocs = $this->get('Total'); $this->setDocument(); } if (JUDownloadHelper::isJoomla3x() && $app->input->get('layout') == 'modal') { $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); } parent::display($tpl); }
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->addToolBar(); $this->setDocument(); parent::display($tpl); }
public function display($tpl = null) { if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->setDocument(); parent::display($tpl); }
public function display($tpl = null) { JHtml::_('behavior.calendar'); $this->addToolBar(); $this->model = $this->getModel(); if ($this->getLayout() == "fields_mapping") { $this->fieldsOption[] = JHTML::_('select.option', '<OPTGROUP>', JText::_('COM_JUDOWNLOAD_DEFAULT')); $this->fieldsOption[] = JHTML::_('select.option', 'ignore', JText::_("COM_JUDOWNLOAD_IGNORE")); $this->fieldsOption[] = JHTML::_('select.option', '<OPTGROUP>', JText::_('COM_JUDOWNLOAD_CORE_FIELDS')); $coreFieldsHaveFieldClass = $this->model->getFieldsHaveFieldClass('core'); foreach ($coreFieldsHaveFieldClass as $field) { $this->fieldsOption[] = JHTML::_('select.option', $field->id, $field->caption); } $coreFieldsHaveNoFieldClass = $this->model->getDocumentTableFieldsName($coreFieldsHaveFieldClass); if (!empty($coreFieldsHaveNoFieldClass)) { foreach ($coreFieldsHaveNoFieldClass as $field) { $this->fieldsOption[] = JHTML::_('select.option', $field, ucfirst(str_replace('_', ' ', $field))); } } $this->fieldsOption[] = JHTML::_('select.option', '<OPTGROUP>', JText::_('COM_JUDOWNLOAD_EXTRA_FIELDS')); $extraFields = $this->model->getFieldsHaveFieldClass('extra'); foreach ($extraFields as $field) { $this->fieldsOption[] = JHTML::_('select.option', $field->id, $field->caption); } $this->fieldsOption[] = JHTML::_('select.option', '<OPTGROUP>', JText::_('COM_JUDOWNLOAD_OTHER_FIELDS')); $this->fieldsOption[] = JHTML::_('select.option', 'main_cat', JText::_('COM_JUDOWNLOAD_FIELD_MAIN_CATEGORY')); $this->fieldsOption[] = JHTML::_('select.option', 'secondary_cats', JText::_('COM_JUDOWNLOAD_FIELD_SECONDARY_CATEGORIES')); $this->fieldsOption[] = JHTML::_('select.option', 'gallery', JText::_('COM_JUDOWNLOAD_FIELD_GALLERY')); $this->fieldsOption[] = JHTML::_('select.option', 'files', JText::_('COM_JUDOWNLOAD_FIELD_FILES')); $this->fieldsOption[] = JHTML::_('select.option', 'related_docs', JText::_('COM_JUDOWNLOAD_FIELD_RELATED_DOCUMENTS')); } if ($this->getLayout() == 'config') { $this->form = $this->get('Form'); $this->save = "<select id='save_options' name='save_options'>"; $this->save .= "<option value='keep' selected>" . JText::_("COM_JUDOWNLOAD_KEEP_BOTH") . "</option>"; $this->save .= "<option value='skip'>" . JText::_("COM_JUDOWNLOAD_SKIP_EXISTED_DOCUMENTS") . "</option>"; $this->save .= "<option value='replace'>" . JText::_("COM_JUDOWNLOAD_REPLACE_EXISTED_DOCUMENTS") . "</option>"; $this->save .= "</select>"; } if ($this->getLayout() == 'review') { if (isset($this->review['config']['default_icon'])) { $this->review['config']['default_icon'] = str_replace(array(JPATH_ROOT . '\\', "\\"), array(JUri::root(), '/'), $this->review['config']['default_icon']); } } $this->isJoomla3x = JUDownloadHelper::isJoomla3x(); if ($this->getLayout() == "export") { $this->exportForm = $this->get("ExportForm"); } 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->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->searchword = trim($this->state->get('filter.searchword')); $this->addToolBar(); parent::display($tpl); $this->setDocument(); }
public function display($tpl = null) { $app = JFactory::getApplication(); if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $levelOptions = array(); $levelOptions[] = JHtml::_('select.option', 1, 1); $levelOptions[] = JHtml::_('select.option', 5, 5); $levelOptions[] = JHtml::_('select.option', 10, 10); $levelOptions[] = JHtml::_('select.option', 15, 15); $levelOptions[] = JHtml::_('select.option', 20, 20); $levelOptions[] = JHtml::_('select.option', 25, 25); $levelOptions[] = JHtml::_('select.option', 30, 30); $this->levelOptions = $levelOptions; $boolean = array(); $boolean[] = JHtml::_('select.option', 0, JText::_('JNO')); $boolean[] = JHtml::_('select.option', 1, JText::_('JYES')); $this->boolean = $boolean; $this->layout = $this->getLayout(); if ($this->layout == 'rebuildrating' || $this->layout == 'resizeimages') { $categoryList = $this->get('CategoryList'); foreach ($categoryList as $key => $value) { $categoryList[$key]->id = $value->id; $categoryList[$key]->title = '|— ' . $value->title; } $rootCat = JUDownloadFrontHelperCategory::getRootCategory(); array_unshift($categoryList, array('id' => $rootCat->id, 'title' => 'Root')); $this->categoryList = $categoryList; } if ($this->layout == 'rebuildrating') { $this->criteriaGroups = $this->get("CriteriaGroups"); } $errors = $app->getUserState("import_file_errors"); if (isset($errors)) { $this->errors = $errors; $app->setUserState("import_file_errors", null); } $this->addToolBar(); if ($this->getLayout() == "rebuildrating") { $app->setUserState("cats", null); $app->setUserState('criteria_groups', null); $app->setUserState('total_documents', null); } 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.modal'); JHtml::_('behavior.calendar'); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->script = $this->get('Script'); $this->canDo = JUDownloadHelper::getActions('com_judownload', 'fieldgroup', $this->item->group_id); $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(); }
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->model = $this->getModel(); $this->app = JFactory::getApplication(); $cat_id = $this->item->cat_id ? $this->item->cat_id : $this->app->input->get('cat_id'); $this->params = JUDownloadHelper::getParams(null, $this->item->id); if ($cat_id == JUDownloadFrontHelperCategory::getRootCategory()->id && !$this->params->get('allow_add_doc_to_root', 0)) { JError::raiseError(500, JText::_('COM_JUDOWNLOAD_CAN_NOT_ADD_DOCUMENT_TO_ROOT_CATEGORY')); return false; } if ($tempDocument = JUDownloadHelper::getTempDocument($this->item->id)) { $editPendingDocLink = '<a href="index.php?option=com_judownload&task=document.edit&approve=1&id=' . $tempDocument->id . '">' . $tempDocument->title . '</a>'; JError::raiseNotice('', JText::sprintf('COM_JUDOWNLOAD_THIS_DOCUMENT_HAS_PENDING_DOCUMENT_X_PLEASE_APPROVE_PENDING_DOCUMENT_FIRST', $editPendingDocLink)); } if ($this->item->approved < 0) { $oriDocId = abs($this->item->approved); $oriDocObj = JUDownloadHelper::getDocumentById($oriDocId); $editOriDocLink = '<a href="index.php?option=com_judownload&task=document.edit&id=' . $oriDocId . '">' . $oriDocObj->title . '</a>'; JError::raiseNotice('', JText::sprintf('COM_JUDOWNLOAD_ORIGINAL_DOCUMENT_X', $editOriDocLink)); } $this->script = $this->get('Script'); $this->plugins = $this->get('Plugins'); $this->fieldsetDetails = $this->model->getCoreFields('details'); $this->fieldsetPublishing = $this->model->getCoreFields('publishing'); $this->fieldsetTemplateStyleAndLayout = $this->model->getCoreFields('template_style'); $this->fieldsetMetadata = $this->model->getCoreFields('metadata'); $this->fieldCatid = JUDownloadFrontHelperField::getField('cat_id', $this->item); $this->fieldGallery = JUDownloadFrontHelperField::getField('gallery', $this->item); $this->files = $this->get('Files'); $this->changeLogs = $this->get('ChangeLogs'); $this->versions = $this->get('Versions'); $this->extraFields = $this->get('ExtraFields'); $this->fieldsData = $this->app->getUserState("com_judownload.edit.document.fieldsdata", array()); $this->relatedDocuments = $this->get('RelatedDocuments'); $this->canDo = JUDownloadHelper::getActions('com_judownload', 'category', $this->item->cat_id); $this->addToolBar(); $this->setDocument(); parent::display($tpl); }
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; } $simple_search = JFactory::getApplication()->input->get('submit_simple_search'); if (isset($simple_search)) { $model = $this->getModel(); $model->resetState(); } $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->searchword = trim($this->state->get('filter.searchword')); $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 (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $app = JFactory::getApplication(); if ($app->input->get('layout') == null) { $app->redirect('index.php?option=com_judownload&view=listcats'); } $this->state = $this->get('State'); if ($app->input->get('layout') == 'copy') { JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_COPY_CATEGORIES'), 'copy-categories'); JToolBarHelper::apply('categories.copyCats', 'JTOOLBAR_APPLY'); JToolBarHelper::cancel('category.cancel', 'JTOOLBAR_CANCEL'); } elseif ($app->input->get('layout') == 'move') { JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_MOVE_CATEGORIES'), 'move-categories'); JToolBarHelper::apply('categories.moveCats', 'JTOOLBAR_APPLY'); JToolBarHelper::cancel('category.cancel', 'JTOOLBAR_CANCEL'); } 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(); $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) { 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) { 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); }
public function display($tpl = null) { JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_PAGE_HELP'), 'help'); parent::display(); }