예제 #1
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 = 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();
 }
예제 #2
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 = JUDownloadHelper::getActions('com_judownload');
     $this->groupCanDoManage = JUDownloadHelper::checkGroupPermission("globalconfig.save");
     $this->isJoomla3x = JUDownloadHelper::isJoomla3x();
     $this->setDocument();
     $this->addToolBar();
     parent::display($tpl);
 }
예제 #3
0
 protected function getAssignedCategories($criteriagroup_id)
 {
     $user = JFactory::getUser();
     $db = JFactory::getDbo();
     $query = "SELECT id, title FROM #__judownload_categories WHERE criteriagroup_id={$criteriagroup_id} ORDER BY level, lft";
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     $category_name_arr = array();
     $GroupCanDoCatManage = JUDownloadHelper::checkGroupPermission("category.edit");
     foreach ($categories as $category) {
         if (($user->authorise('judl.category.edit', 'com_judownload.category.' . $category->id) || $user->authorise('judl.category.edit.own', 'com_judownload.category.' . $category->id) && $category->created_by == $user->id) && $GroupCanDoCatManage) {
             $link = "index.php?option=com_judownload&task=category.edit&id=" . $category->id;
             $category_name_arr[] = "<a href=\"{$link}\" title=\"" . JText::_('COM_JUDOWNLOAD_EDIT_THIS_CATEGORY') . "\">" . $category->title . "</a>";
         } else {
             $category_name_arr[] = $category->title;
         }
     }
     return implode(', ', $category_name_arr);
 }
예제 #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 = 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();
 }
예제 #5
0
 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();
 }
예제 #6
0
 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);
 }
예제 #7
0
    ?>
/administrator/components/com_judownload/assets/img/icon/global-config.png" />
					<span><?php 
    echo JText::_('COM_JUDOWNLOAD_DASHBOARD_GLOBALCONFIG');
    ?>
</span>
				</a>
			</div>
		</div>
	</div>
<?php 
}
?>

<?php 
if (JUDownloadHelper::checkGroupPermission(null, "tools")) {
    ?>
	<div class="cpanel">
		<div class="icon-wrapper">
			<div class="icon">
				<a href="<?php 
    echo JRoute::_('index.php?option=com_judownload&amp;view=tools');
    ?>
">
					<img alt="<?php 
    echo JText::_('COM_JUDOWNLOAD_DASHBOARD_TOOLS');
    ?>
" src="<?php 
    echo JUri::root(true);
    ?>
/administrator/components/com_judownload/assets/img/icon/tool.png" />
예제 #8
0
 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);
 }
예제 #9
0
    ?>
/administrator/components/com_judownload/assets/img/icon/import-file.png" />
							<span><?php 
    echo JText::_('COM_JUDOWNLOAD_BATCH_IMPORT_FILES');
    ?>
</span>
						</a>
					</div>
				</div>
			</div>
		<?php 
}
?>

		<?php 
if (JUDownloadHelper::checkGroupPermission("tools.uploadmultiimages") && JUDLPROVERSION) {
    ?>
			<div class="cpanel">
				<div class="icon-wrapper">
					<div class="icon">
						<a href="index.php?option=com_judownload&view=tools&layout=batchimportimages">
							<img alt="<?php 
    echo JText::_('COM_JUDOWNLOAD_BATCH_IMPORT_IMAGES');
    ?>
" src="<?php 
    echo JUri::root(true);
    ?>
/administrator/components/com_judownload/assets/img/icon/import-image.png" />
							<span><?php 
    echo JText::_('COM_JUDOWNLOAD_BATCH_IMPORT_IMAGES');
    ?>
예제 #10
0
?>

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

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

<div id="judl-search" style="margin-top: 15px;">
	<form name="search-form" id="search-form" action="index.php?option=com_judownload" method="POST">
		<fieldset>
			<div class="input-append">
예제 #11
0
JLoader::register('JUDownloadFrontHelperPluginParams', JPATH_SITE . '/components/com_judownload/helpers/pluginparams.php');
JLoader::register('JUDownloadFrontHelperRating', JPATH_SITE . '/components/com_judownload/helpers/rating.php');
JLoader::register('JUDownloadFrontHelperSeo', JPATH_SITE . '/components/com_judownload/helpers/seo.php');
JLoader::register('JUDownloadFrontHelperString', JPATH_SITE . '/components/com_judownload/helpers/string.php');
JLoader::register('JUDownloadFrontHelperTemplate', JPATH_SITE . '/components/com_judownload/helpers/template.php');
JLoader::register('JUDownloadHelper', JPATH_ADMINISTRATOR . '/components/com_judownload/helpers/judownload.php');
JLoader::register('JUTimThumb', JPATH_ADMINISTRATOR . '/components/com_judownload/timthumb/timthumb.php');
JLoader::register('Watermark', JPATH_ADMINISTRATOR . '/components/com_judownload/helpers/watermark.class.php');
JLoader::register('JUDLViewAdmin', JPATH_ADMINISTRATOR . '/components/com_judownload/helpers/judlviewadmin.php');
JLoader::register('JUDownloadSearchHelper', JPATH_SITE . '/components/com_judownload/helpers/search.php');
spl_autoload_register(array('JUDownloadHelper', 'autoLoadFieldClass'));
jimport('joomla.application.component.controller');
$app = JFactory::getApplication();
$task = $app->input->get('task');
$view = $app->input->get('view');
$permission = JUDownloadHelper::checkGroupPermission($task, $view);
if (!$permission) {
    return JError::raiseError(403, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'));
}
if (!JFactory::getUser()->authorise('core.manage', 'com_judownload')) {
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
$document = JFactory::getDocument();
$isJoomla3x = JUDownloadHelper::isJoomla3x();
if ($isJoomla3x) {
    $document->addStyleSheet(JUri::root(true) . '/administrator/components/com_judownload/assets/css/styles.css');
} else {
    $document->addStyleSheet(JUri::root(true) . '/administrator/components/com_judownload/assets/css/styles.j25.css');
    $document->addStyleSheet(JUri::root(true) . '/administrator/components/com_judownload/assets/css/jicomoon.css');
}
JUDownloadFrontHelper::loadjQuery();
예제 #12
0
			</tr>
			</thead>

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

			<tbody>
			<?php 
$ordering = $listOrder == 'ordering';
$criteriagroupCandoManage = JUDownloadHelper::checkGroupPermission("criteriagroup.edit");
foreach ($this->items as $i => $item) {
    $canEdit = $user->authorise('core.edit', 'com_judownload') && $this->groupCanDoManage;
    $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0;
    $canEditOwn = $user->authorise('core.edit.own', 'com_judownload') && $item->created_by == $userId && $this->groupCanDoManage;
    $canChange = $user->authorise('core.edit.state', 'com_judownload') && $canCheckin && $this->groupCanDoManage;
    ?>
				<tr class="row<?php 
    echo $i % 2;
    ?>
">
					<td class="center hidden-phone">
						<?php 
    echo JHtml::_('grid.id', $i, $item->id);
    ?>
					</td>
예제 #13
0
    ?>
/administrator/components/com_judownload/assets/img/icon/csv-import.png" />
							<span><?php 
    echo JText::_('COM_JUDOWNLOAD_CSV_IMPORT');
    ?>
</span>
						</a>
					</div>
				</div>
			</div>
		<?php 
}
?>

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