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;
     }
     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);
 }
 protected function getAssignedCategories($criteriagroup_id)
 {
     $user = JFactory::getUser();
     $db = JFactory::getDbo();
     $query = "SELECT id, title FROM #__judirectory_categories WHERE criteriagroup_id={$criteriagroup_id} ORDER BY level, lft";
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     $category_name_arr = array();
     $GroupCanDoCatManage = JUDirectoryHelper::checkGroupPermission("category.edit");
     foreach ($categories as $category) {
         if (($user->authorise('judir.category.edit', 'com_judirectory.category.' . $category->id) || $user->authorise('judir.category.edit.own', 'com_judirectory.category.' . $category->id) && $category->created_by == $user->id) && $GroupCanDoCatManage) {
             $link = "index.php?option=com_judirectory&task=category.edit&id=" . $category->id;
             $category_name_arr[] = "<a href=\"{$link}\" title=\"" . JText::_('COM_JUDIRECTORY_EDIT_THIS_CATEGORY') . "\">" . $category->title . "</a>";
         } else {
             $category_name_arr[] = $category->title;
         }
     }
     return implode(', ', $category_name_arr);
 }
 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();
     $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();
 }
Exemple #7
0
					</th>
				</tr>
				</thead>

				<tfoot>
				<tr>
					<td colspan="8"><?php 
    echo $this->pagination->getListFooter();
    ?>
</td>
				</tr>
				</tfoot>

				<tbody>
				<?php 
    $criteriagroupCandoManage = JUDirectoryHelper::checkGroupPermission("criteriagroup.edit");
    foreach ($this->items as $i => $item) {
        $canEdit = $user->authorise('core.edit', 'com_judirectory') && $this->groupCanDoManage;
        $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0;
        $canEditOwn = $user->authorise('core.edit.own', 'com_judirectory') && $item->created_by == $userId && $this->groupCanDoManage;
        $canChange = $user->authorise('core.edit.state', 'com_judirectory') && $canCheckin && $this->groupCanDoManage;
        ?>
					<tr class="row<?php 
        echo $i % 2;
        ?>
">
						<td class="order nowrap center hidden-phone">
							<?php 
        $iconClass = '';
        if (!$canChange) {
            $iconClass = ' inactive';
JLoader::register('JUDirectoryFrontHelperPluginParams', JPATH_SITE . '/components/com_judirectory/helpers/pluginparams.php');
JLoader::register('JUDirectoryFrontHelperRating', JPATH_SITE . '/components/com_judirectory/helpers/rating.php');
JLoader::register('JUDirectoryFrontHelperSeo', JPATH_SITE . '/components/com_judirectory/helpers/seo.php');
JLoader::register('JUDirectoryFrontHelperString', JPATH_SITE . '/components/com_judirectory/helpers/string.php');
JLoader::register('JUDirectoryFrontHelperTemplate', JPATH_SITE . '/components/com_judirectory/helpers/template.php');
JLoader::register('JUDirectoryHelper', JPATH_ADMINISTRATOR . '/components/com_judirectory/helpers/judirectory.php');
JLoader::register('JUTimThumb', JPATH_ADMINISTRATOR . '/components/com_judirectory/timthumb/timthumb.php');
JLoader::register('Watermark', JPATH_ADMINISTRATOR . '/components/com_judirectory/helpers/watermark.class.php');
JLoader::register('JUDIRViewAdmin', JPATH_ADMINISTRATOR . '/components/com_judirectory/helpers/judirviewadmin.php');
JLoader::register('JUDirectorySearchHelper', JPATH_SITE . '/components/com_judirectory/helpers/search.php');
spl_autoload_register(array('JUDirectoryHelper', 'autoLoadFieldClass'));
jimport('joomla.application.component.controller');
$app = JFactory::getApplication();
$task = $app->input->get('task');
$view = $app->input->get('view');
$permission = JUDirectoryHelper::checkGroupPermission($task, $view);
if (!$permission) {
    return JError::raiseError(403, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'));
}
if (!JFactory::getUser()->authorise('core.manage', 'com_judirectory')) {
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
$document = JFactory::getDocument();
$isJoomla3x = JUDirectoryHelper::isJoomla3x();
if ($isJoomla3x) {
    $document->addStyleSheet(JUri::root(true) . '/administrator/components/com_judirectory/assets/css/styles.css');
} else {
    $document->addStyleSheet(JUri::root(true) . '/administrator/components/com_judirectory/assets/css/styles.j25.css');
    $document->addStyleSheet(JUri::root(true) . '/administrator/components/com_judirectory/assets/css/jicomoon.css');
}
JUDirectoryFrontHelper::loadjQuery();
Exemple #9
0
    ?>
/administrator/components/com_judirectory/assets/img/icon/rebuild-rating.png" />
							<span><?php 
    echo JText::_('COM_JUDIRECTORY_REBUILD_RATING');
    ?>
</span>
						</a>
					</div>
				</div>
			</div>
		<?php 
}
?>

		<?php 
if (JUDirectoryHelper::checkGroupPermission("tools.uploadmultiimages") && JUDIRPROVERSION) {
    ?>
			<div class="cpanel">
				<div class="icon-wrapper">
					<div class="icon">
						<a href="index.php?option=com_judirectory&view=tools&layout=batchimportimages">
							<img alt="<?php 
    echo JText::_('COM_JUDIRECTORY_BATCH_IMPORT_IMAGES');
    ?>
" src="<?php 
    echo JUri::root(true);
    ?>
/administrator/components/com_judirectory/assets/img/icon/import-image.png" />
							<span><?php 
    echo JText::_('COM_JUDIRECTORY_BATCH_IMPORT_IMAGES');
    ?>
    ?>
/administrator/components/com_judirectory/assets/img/icon/global-config.png" />
					<span><?php 
    echo JText::_('COM_JUDIRECTORY_DASHBOARD_GLOBALCONFIG');
    ?>
</span>
				</a>
			</div>
		</div>
	</div>
<?php 
}
?>

<?php 
if (JUDirectoryHelper::checkGroupPermission(null, "tools")) {
    ?>
	<div class="cpanel">
		<div class="icon-wrapper">
			<div class="icon">
				<a href="<?php 
    echo JRoute::_('index.php?option=com_judirectory&amp;view=tools');
    ?>
">
					<img alt="<?php 
    echo JText::_('COM_JUDIRECTORY_DASHBOARD_TOOLS');
    ?>
" src="<?php 
    echo JUri::root(true);
    ?>
/administrator/components/com_judirectory/assets/img/icon/tool.png" />
Exemple #11
0
    ?>
/administrator/components/com_judirectory/assets/img/icon/csv-import.png" />
							<span><?php 
    echo JText::_('COM_JUDIRECTORY_CSV_IMPORT');
    ?>
</span>
						</a>
					</div>
				</div>
			</div>
		<?php 
}
?>

		<?php 
if (JUDirectoryHelper::checkGroupPermission("csvprocess.export")) {
    ?>
			<div class="cpanel">
				<div class="icon-wrapper" style="width: auto">
					<div class="icon">
						<a href="index.php?option=com_judirectory&task=csvprocess.export">
							<img alt="<?php 
    echo JText::_('COM_JUDIRECTORY_CSV_EXPORT');
    ?>
" src="<?php 
    echo JUri::root(true);
    ?>
/administrator/components/com_judirectory/assets/img/icon/csv-export.png" />
							<span><?php 
    echo JText::_('COM_JUDIRECTORY_CSV_EXPORT');
    ?>
?>

<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>

<div class="category-tree">
	<?php 
echo JUDirectoryHelper::getCategoryDTree($cat_id);
?>
</div>

<div id="judir-search" style="margin-top: 15px;">
	<form name="search-form" id="search-form" action="index.php?option=com_judirectory" method="POST">
		<fieldset>
			<div class="input-append">
 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);
 }