示例#1
0
 protected function addToolBar()
 {
     $app = JFactory::getApplication();
     $app->input->set('hidemainmenu', true);
     $isNew = $this->item->id == 0;
     $canDo = JUDirectoryHelper::getActions('com_judirectory');
     $user = JFactory::getUser();
     $userId = $user->id;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     JToolBarHelper::title(JText::_('COM_JUDIRECTORY_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_judirectory/helpers/button");
     $bar->appendButton('JUHelp', 'help', JText::_('JTOOLBAR_HELP'));
 }
示例#2
0
 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_JUDIRECTORY_PAGE_' . ($checkedOut ? 'VIEW_FIELD' : ($isNew ? 'ADD_FIELD' : 'EDIT_FIELD'))), 'field-add');
     $canDo = JUDirectoryHelper::getActions('com_judirectory', 'field', $this->item->id);
     if ($isNew && $user->authorise('core.create', 'com_judirectory')) {
         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_judirectory/helpers/button");
     $bar->appendButton('JUHelp', 'help', JText::_('JTOOLBAR_HELP'));
 }
示例#3
0
 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();
 }
示例#4
0
 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();
 }
示例#5
0
 public function display($tpl = null)
 {
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     $this->item = $this->get('Item');
     $this->form = $this->get('Form');
     $this->canDo = JUDirectoryHelper::getActions('com_judirectory');
     $this->addToolBar();
     parent::display($tpl);
     $this->setDocument();
 }
示例#6
0
 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();
 }
示例#7
0
 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);
 }
示例#8
0
 protected function addToolBar()
 {
     $canDo = JUDirectoryHelper::getActions('com_judirectory');
     JToolBarHelper::title(JText::_('COM_JUDIRECTORY_SEARCH_CATEGORIES'), 'search-categories');
     if ($canDo->get('judir.category.create')) {
         JToolBarHelper::custom($task = 'categories.copycats', $icon = 'copy', $iconOver = 'copy', $alt = JText::_('COM_JUDIRECTORY_COPY_CATS_BTN'), $listSelect = true, $x = false);
     }
     if (($canDo->get('judir.category.edit') || $canDo->get('judir.category.edit.own')) && $canDo->get('judir.category.create')) {
         JToolBarHelper::custom($task = 'categories.movecats', $icon = 'move', $iconOver = 'move', $alt = JText::_('COM_JUDIRECTORY_MOVE_CATS_BTN'), $listSelect = true, $x = false);
     }
     if ($canDo->get('judir.category.delete') || $canDo->get('judir.category.delete.own')) {
         JToolBarHelper::custom($task = 'categories.delete', $icon = 'delete', $iconOver = 'delete', $alt = JText::_('COM_JUDIRECTORY_DELETE_CATS_BTN'), $listSelect = true, $x = false);
     }
     JToolBarHelper::divider();
     $bar = JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_ADMINISTRATOR . "/components/com_judirectory/helpers/button");
     $bar->appendButton('JUHelp', 'help', JText::_('JTOOLBAR_HELP'));
 }
示例#9
0
 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();
 }
示例#10
0
 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();
 }
示例#11
0
 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);
 }
示例#12
0
 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();
 }
示例#13
0
 * @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 = JUDirectoryFrontHelperCategory::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 = JUDirectoryHelper::getActions('com_judirectory', 'category', $cat_id);
if ($actions->get("judir.listing.create")) {
    if ($this->listingGroupCanDoManage && $this->allowAddListing) {
        echo "<li><a class='add-listing' href='index.php?option=com_judirectory&task=listing.add&cat_id={$cat_id}'><i class='icon-file-add'></i>" . JText::_('COM_JUDIRECTORY_ADD_LISTING') . "</a></li>";
    }
}
if ($actions->get("judir.category.create")) {
    if ($this->catGroupCanDoManage) {
        echo "<li><a class='add-category' href='index.php?option=com_judirectory&task=category.add&parent_id={$cat_id}'><i class='icon-folder-plus'></i>" . JText::_('COM_JUDIRECTORY_ADD_CATEGORY') . "</a></li>";
    }
}
if (JUDirectoryHelper::checkGroupPermission(null, "pendinglistings") && JUDIRPROVERSION) {
    echo "<li><a class='approved' href='index.php?option=com_judirectory&view=pendinglistings'><i class='icon-clock'></i>" . JText::sprintf('COM_JUDIRECTORY_PENDING_LISTINGS_N', JUDirectoryHelper::getTotalPendingListings()) . "</a></li>";
}
?>
</ul>
示例#14
0
 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);
 }