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 = JUDirectoryHelper::getActions('com_judirectory'); $this->groupCanDoManage = JUDirectoryHelper::checkGroupPermission("comment.edit"); $this->groupCanDoDelete = JUDirectoryHelper::checkGroupPermission("comments.delete"); $this->rootComment = JUDirectoryFrontHelperComment::getRootComment(); foreach ($this->items as &$item) { $this->ordering[$item->parent_id][] = $item->id; } $this->addToolBar(); if (JUDirectoryHelper::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 = JUDirectoryHelper::getActions('com_judirectory'); $this->addToolBar(); if (JUDirectoryHelper::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_JUDIRECTORY_PUBLISHED')); $optionsPublished[] = JHtml::_('select.option', '0', JText::_('COM_JUDIRECTORY_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_judirectory&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_JUDIRECTORY_COPY_LISTINGS'), 'copy-listings'); JToolBarHelper::apply('listings.copyListings', 'JTOOLBAR_APPLY'); JToolBarHelper::cancel('listing.cancel', 'JTOOLBAR_CANCEL'); } elseif ($app->input->get('layout') == 'move') { JToolBarHelper::title(JText::_('COM_JUDIRECTORY_MOVE_LISTINGS'), 'move-listings'); JToolBarHelper::apply('listings.moveListings', 'JTOOLBAR_APPLY'); JToolBarHelper::cancel('listing.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::title(JText::_('COM_JUDIRECTORY_LISTINGS'), 'listings'); $this->totalListings = $this->get('Total'); $this->setDocument(); } if (JUDirectoryHelper::isJoomla3x() && $app->input->get('layout') == 'modal') { $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); } 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_JUDIRECTORY_DEFAULT')); $this->fieldsOption[] = JHTML::_('select.option', 'ignore', JText::_("COM_JUDIRECTORY_IGNORE")); $this->fieldsOption[] = JHTML::_('select.option', '<OPTGROUP>', JText::_('COM_JUDIRECTORY_CORE_FIELDS')); $ignoredFields = array('asset_id', 'introtext', 'fulltext', 'comments'); $coreFields = $this->model->getCoreFields($ignoredFields); foreach ($coreFields as $field) { if (is_object($field)) { $value = $field->id; $label = ucfirst(JText::_($field->caption)); } else { $value = $field; $label = ucfirst(str_replace('_', ' ', $field)); } $this->fieldsOption[] = JHTML::_('select.option', $value, $label); } $extraFields = $this->model->getExtraFields(); foreach ($extraFields as $field) { if (isset($fieldGroups[$field->group_id])) { $fieldGroups[$field->group_id][] = $field; } else { $fieldGroups[$field->group_id] = array($field); } } foreach ($fieldGroups as $groupId => $fields) { $group = JUDirectoryFrontHelperField::getFieldGroupById($groupId); $this->fieldsOption[] = JHTML::_('select.option', '<OPTGROUP>', $group->name); foreach ($fields as $field) { $label = ucfirst(JText::_($field->caption)); $this->fieldsOption[] = JHTML::_('select.option', $field->id, $label); } } $this->fieldsOption[] = JHTML::_('select.option', '<OPTGROUP>', JText::_('COM_JUDIRECTORY_OTHER_FIELDS')); $this->fieldsOption[] = JHTML::_('select.option', 'related_listings', JText::_('COM_JUDIRECTORY_FIELD_RELATED_LISTINGS')); } if ($this->getLayout() == 'config') { $this->form = $this->get('Form'); } 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 = JUDirectoryHelper::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->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) { 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) { 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 = JUDirectoryHelper::getActions('com_judirectory'); $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 = JUDirectoryFrontHelperCategory::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_listings', 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 = JUDirectoryHelper::getActions('com_judirectory', '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 = JUDirectoryHelper::getActions('com_judirectory'); $this->groupCanDoManage = JUDirectoryHelper::checkGroupPermission("globalconfig.save"); $this->isJoomla3x = JUDirectoryHelper::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 = JUDirectoryHelper::getActions('com_judirectory'); $saveMessage = $app->getUserState('com_judirectory.backendpermission.message'); if ($saveMessage) { $app->enqueueMessage($saveMessage); $app->setUserState('com_judirectory.backendpermission.message', ''); } $this->addToolBar(); parent::display($tpl); $this->setDocument(); }
public function display($tpl = null) { if (!JUDirectoryHelper::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 = JUDirectoryHelper::getActions('com_judirectory'); $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 = JUDirectoryHelper::getParams(null, $this->item->id); if ($cat_id == JUDirectoryFrontHelperCategory::getRootCategory()->id && !$this->params->get('allow_add_listing_to_root', 0)) { JError::raiseError(500, JText::_('COM_JUDIRECTORY_CAN_NOT_ADD_LISTING_TO_ROOT_CATEGORY')); return false; } if ($tempListing = JUDirectoryHelper::getTempListing($this->item->id)) { $editPendingListingLink = '<a href="index.php?option=com_judirectory&task=document.edit&approve=1&id=' . $tempListing->id . '">' . $tempListing->title . '</a>'; JError::raiseNotice('', JText::sprintf('COM_JUDIRECTORY_THIS_LISTING_HAS_PENDING_LISTING_X_PLEASE_APPROVE_PENDING_LISTING_FIRST', $editPendingListingLink)); } if ($this->item->approved < 0) { $oriListingId = abs($this->item->approved); $oriListingObj = JUDirectoryHelper::getListingById($oriListingId); $editOriDocLink = '<a href="index.php?option=com_judirectory&task=document.edit&id=' . $oriListingId . '">' . $oriListingObj->title . '</a>'; JError::raiseNotice('', JText::sprintf('COM_JUDIRECTORY_ORIGINAL_LISTING_X', $editOriDocLink)); } $this->script = $this->get('Script'); $this->plugins = $this->get('Plugins'); $this->fieldLocations = $this->get('FieldLocations'); $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 = JUDirectoryFrontHelperField::getField('cat_id', $this->item); $this->fieldGallery = $this->get('GalleryField'); $this->extraFields = $this->get('ExtraFields'); $this->fieldsData = $this->app->getUserState("com_judirectory.edit.listing.fieldsdata", array()); $this->relatedListings = $this->get('RelatedListings'); $this->canDo = JUDirectoryHelper::getActions('com_judirectory', 'category', $this->item->cat_id); $this->addToolBar(); $this->setDocument(); parent::display($tpl); }
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 = JUDirectoryHelper::getActions('com_judirectory'); $this->groupCanDoManage = JUDirectoryHelper::checkGroupPermission("tag.edit"); $this->groupCanDoDelete = JUDirectoryHelper::checkGroupPermission("tags.delete"); $this->addToolBar(); if (JUDirectoryHelper::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_judirectory&view=listcats'); } $this->state = $this->get('State'); if ($app->input->get('layout') == 'copy') { JToolBarHelper::title(JText::_('COM_JUDIRECTORY_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_JUDIRECTORY_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 = JUDirectoryFrontHelperCategory::getRootCategory(); $fastAddError = $app->getUserState('com_judirectory.categories.fastadderror'); $fastAddSuccess = $app->getUserState('com_judirectory.categories.fastaddsuccess'); $this->cat_id = $app->input->getInt('cat_id', $rootCat->id); $this->params = JUDirectoryHelper::getParams($this->cat_id); $this->canDoCat = JUDirectoryHelper::getActions('com_judirectory', 'category', $this->cat_id); $this->rootCat = JUDirectoryFrontHelperCategory::getRootCategory(); $this->allowAddListing = $this->params->get('allow_add_listing_to_root', 0) && $this->cat_id == $this->rootCat->id || $this->cat_id != $this->rootCat->id; $this->listingGroupCanDoManage = $this->groupCanDoCatManage = JUDirectoryHelper::checkGroupPermission("listing.edit"); $this->listingGroupCanDoDelete = $this->groupCanDoCatDelete = JUDirectoryHelper::checkGroupPermission("listings.delete"); $this->catGroupCanDoManage = $this->groupCanDoCatManage = JUDirectoryHelper::checkGroupPermission("category.edit"); $this->catGroupCanDoDelete = $this->groupCanDoCatDelete = JUDirectoryHelper::checkGroupPermission("categories.delete"); // if ($fastAddSuccess) { $app->enqueueMessage($fastAddSuccess); $app->setUserState('com_judirectory.categories.fastaddsuccess', ''); } if ($fastAddError) { $app->enqueueMessage($fastAddError, 'error'); $app->setUserState('com_judirectory.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 (!JUDirectoryHelper::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 = JUDirectoryHelper::getActions('com_judirectory'); $this->groupCanDoManage = JUDirectoryHelper::checkGroupPermission("criteria.edit"); $this->groupCanDoDelete = JUDirectoryHelper::checkGroupPermission("criterias.delete"); $this->addToolBar(); if (JUDirectoryHelper::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_judirectory/helpers/html'); $this->canDo = JUDirectoryHelper::getActions('com_judirectory'); $this->groupCanDoManage = JUDirectoryHelper::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_judirectory.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_judirectory.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_JUDIRECTORY_FRONTEND'), 'backend' => JText::_('COM_JUDIRECTORY_BACKEND')); $this->filterArr = array('none' => JText::_('COM_JUDIRECTORY_NONE_FILTER'), 'empty' => JText::_('COM_JUDIRECTORY_EMPTY_FILTER'), 'warning' => JText::_('COM_JUDIRECTORY_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_judirectory&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_JUDIRECTORY_PAGE_HELP'), 'help'); parent::display(); }