primo commit
This commit is contained in:
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,179 @@
|
||||
<?php
|
||||
/*
|
||||
* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @component Phoca Gallery
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
$task = 'phocagalleryc';
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$tasks = $task . 's';
|
||||
$OPT = strtoupper($option);
|
||||
$user = Factory::getUser();
|
||||
$userId = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canOrder = $user->authorise('core.edit.state', $option);
|
||||
$saveOrder = $listOrder == 'a.ordering';
|
||||
$saveOrderingUrl = '';
|
||||
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
|
||||
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->jsJorderTable($listOrder);
|
||||
|
||||
echo '<div class="phoca-thumb-status">' . $this->t['enablethumbcreationstatus'] .'</div>';
|
||||
//echo '<div class="clearfix"></div>';
|
||||
|
||||
|
||||
echo $r->startForm($option, $tasks, 'adminForm');
|
||||
//echo $r->startFilter();
|
||||
//echo $r->endFilter();
|
||||
|
||||
echo $r->startMainContainer();
|
||||
if (isset($this->t['notapproved']->count) && (int)$this->t['notapproved']->count > 0 ) {
|
||||
|
||||
|
||||
echo '<div class="alert alert-error alert-dismissible fade show" role="alert">'. Text::_('COM_PHOCAGALLERY_NOT_APPROVED_CATEGORY_IN_GALLERY').': '
|
||||
.(int)$this->t['notapproved']->count.'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="'.Text::_('COM_PHOCAGALLERY_CLOSE').'"></button></div>';
|
||||
}
|
||||
if ($this->t['search']) {
|
||||
echo '<div class="alert alert-message">' . Text::_('COM_PHOCAGALLERY_SEARCH_FILTER_IS_ACTIVE') .'</div>';
|
||||
}
|
||||
|
||||
/*echo $r->startFilterBar();
|
||||
echo $r->inputFilterSearch($OPT.'_FILTER_SEARCH_LABEL', $OPT.'_FILTER_SEARCH_DESC',
|
||||
$this->escape($this->state->get('filter.search')));
|
||||
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR', (int)$this->pagination->limit);
|
||||
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
|
||||
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
|
||||
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);
|
||||
|
||||
echo $r->startFilterBar(2);
|
||||
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
|
||||
echo $r->selectFilterLevels('COM_PHOCAGALLERY_SELECT_MAX_LEVELS', $this->state->get('filter.level'));
|
||||
echo $r->endFilterBar();
|
||||
|
||||
//echo $r->endFilterBar();*/
|
||||
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
|
||||
|
||||
echo $r->startTable('categoryList');
|
||||
|
||||
echo $r->startTblHeader();
|
||||
|
||||
echo $r->firstColumnHeader($listDirn, $listOrder);
|
||||
echo $r->secondColumnHeader($listDirn, $listOrder);
|
||||
|
||||
|
||||
echo '<th class="ph-title">'.HTMLHelper::_('searchtools.sort', $OPT.'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-published">'.HTMLHelper::_('searchtools.sort', $OPT.'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-approved">'.HTMLHelper::_('searchtools.sort', $OPT.'_APPROVED', 'a.approved', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-parentcattitle">'.HTMLHelper::_('searchtools.sort', $OPT.'_PARENT_CATEGORY', 'parentcat_title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-access">'.Text::_($OPT.'_ACCESS').'</th>'."\n";
|
||||
echo '<th class="ph-owner">'.HTMLHelper::_('searchtools.sort', $OPT.'_OWNER', 'a.owner_id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-rating">'.HTMLHelper::_('searchtools.sort', $OPT.'_RATING', 'ratingavg', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-hits">'.HTMLHelper::_('searchtools.sort', $OPT.'_HITS', 'a.hits', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-language">'.HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-id">'.HTMLHelper::_('searchtools.sort', $OPT.'_ID', 'a.id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
|
||||
echo $r->endTblHeader();
|
||||
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
|
||||
|
||||
|
||||
$originalOrders = array();
|
||||
$parentsStr = "";
|
||||
$j = 0;
|
||||
|
||||
|
||||
if (is_array($this->items)) {
|
||||
foreach ($this->items as $i => $item) {
|
||||
if ($i >= (int)$this->pagination->limitstart && $j < (int)$this->pagination->limit) {
|
||||
$j++;
|
||||
|
||||
$urlEdit = 'index.php?option='.$option.'&task='.$task.'.edit&id=';
|
||||
$orderkey = array_search($item->id, $this->ordering[$item->parent_id]);
|
||||
$ordering = ($listOrder == 'a.ordering');
|
||||
$canCreate = $user->authorise('core.create', $option);
|
||||
$canEdit = $user->authorise('core.edit', $option);
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
|
||||
$canChange = $user->authorise('core.edit.state', $option) && $canCheckin;
|
||||
$linkEdit = Route::_( $urlEdit.(int) $item->id );
|
||||
$linkParent = Route::_( $urlEdit.(int) $item->parent_id );
|
||||
$canEditParent = $user->authorise('core.edit', $option);
|
||||
|
||||
$parentsStr = '';
|
||||
if (isset($item->parentstree)) {
|
||||
$parentsStr = ' '.$item->parentstree;
|
||||
}
|
||||
if (!isset($item->level)) {
|
||||
$item->level = 0;
|
||||
}
|
||||
|
||||
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid : 0, (int)$item->id);
|
||||
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
$checkO = '';
|
||||
if ($item->checked_out) {
|
||||
$checkO .= HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, $tasks.'.', $canCheckin);
|
||||
}
|
||||
if ($canCreate || $canEdit) {
|
||||
$checkO .= '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->title).'</a>';
|
||||
} else {
|
||||
$checkO .= $this->escape($item->title);
|
||||
}
|
||||
$checkO .= ' <span class="smallsub">(<span>'.Text::_($OPT.'_FIELD_ALIAS_LABEL').':</span>'. $this->escape($item->alias).')</span>';
|
||||
|
||||
$indentation = $r->createIndentation($item->level);
|
||||
echo $r->td($indentation . $checkO, "small");
|
||||
echo $r->td(HTMLHelper::_('jgrid.published', $item->published, $i, $tasks.'.', $canChange), "small");
|
||||
echo $r->td(PhocaGalleryJGrid::approved( $item->approved, $i, $tasks.'.', $canChange), "small");
|
||||
|
||||
if ($canEditParent) {
|
||||
$parentO = '<a href="'. Route::_($linkParent).'">'. $this->escape($item->parentcat_title).'</a>';
|
||||
} else {
|
||||
$parentO = $this->escape($item->parentcat_title);
|
||||
}
|
||||
echo $r->td($parentO, "small");
|
||||
echo $r->td($this->escape($item->access_level), "small");
|
||||
|
||||
$usrO = $item->usernameno;
|
||||
if ($item->username) {$usrO = $usrO . ' ('.$item->username.')';}
|
||||
echo $r->td($usrO, "small");
|
||||
echo $r->tdRating($item->ratingavg);
|
||||
echo $r->td($item->hits, "small");
|
||||
echo $r->tdLanguage($item->language, $item->language_title, $this->escape($item->language_title));
|
||||
echo $r->td($item->id, "small");
|
||||
|
||||
echo $r->endTr();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
echo $r->endTblBody();
|
||||
|
||||
echo $r->tblFoot($this->pagination->getListFooter(), 12);
|
||||
echo $r->endTable();
|
||||
|
||||
echo $this->loadTemplate('batch');
|
||||
|
||||
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
|
||||
echo $r->endMainContainer();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/*
|
||||
* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @component Phoca Gallery
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
|
||||
//$published = $this->state->get('filter.published');
|
||||
?>
|
||||
|
||||
<div id="collapseModal" role="dialog" tabindex="-1" class="joomla-modal modal fade">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title"><?php echo Text::_('COM_PHOCAGALLERY_BATCH_OPTIONS_CATEGORIES');?></h3>
|
||||
<button type="button" class="btn-close novalidate" data-bs-dismiss="modal" aria-label="<?php Text::_('COM_PHOCAGALLERY_CLOSE'); ?>">
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="p-3">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo LayoutHelper::render('joomla.html.batch.access', []);?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls">
|
||||
<label id="batch-accessuserid-lbl" for="batch-accessuserid" class="modalTooltip" title="<strong><?php echo Text::_('COM_PHOCAGALLERY_SET_ACCESS_RIGHTS_LEVEL'); ?></strong><br /><?php echo Text::_('COM_PHOCAGALLERY_NOT_MAKING_SELECTION_WILL_KEEP_ORIGINAL_ACCESS_RIGHTS_LEVELS'); ?>"><?php echo Text::_('COM_PHOCAGALLERY_SET_ACCESS_RIGHTS_LEVEL'); ?></label>
|
||||
|
||||
<?php
|
||||
$userList = PhocaGalleryAccess::usersList( 'batch[accessuserid][]', 'batch-accessuserid', -3, 1, NULL, 'name', 0 );
|
||||
echo $userList
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo LayoutHelper::render('joomla.html.batch.language', []); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo PhocaGalleryBatch::item('', 1); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn" type="button" onclick="document.getElementById('batch-category-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value=''" data-bs-dismiss="modal">
|
||||
<?php echo Text::_('JCANCEL'); ?>
|
||||
</button>
|
||||
<button class="btn btn-primary" type="submit" onclick="Joomla.submitbutton('phocagalleryc.batch');" id="batch-submit-button-id" data-submit-task="phocagalleryc.batch">
|
||||
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,307 @@
|
||||
<?php
|
||||
/*
|
||||
* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @component Phoca Gallery
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Pagination\Pagination;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Object\CMSObject;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
phocagalleryimport( 'phocagallery.rate.ratecategory' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryCs extends HtmlView
|
||||
{
|
||||
protected $items;
|
||||
protected $pagination;
|
||||
protected $state;
|
||||
protected $t;
|
||||
protected $r;
|
||||
public $filterForm;
|
||||
public $activeFilters;
|
||||
//protected $_context = 'com_phocagallery.phocagalleryc';
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
|
||||
$model = $this->getModel();
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
$this->r = new PhocaGalleryRenderAdminViews();
|
||||
$this->t = PhocaGalleryUtils::setVars('c');
|
||||
|
||||
// Preprocess the list of items to find ordering divisions.
|
||||
foreach ($this->items as &$item) {
|
||||
$this->ordering[$item->parent_id][] = $item->id;
|
||||
}
|
||||
|
||||
// if search, don't do a tree, only display the searched items
|
||||
$this->t['search'] = $this->state->get('filter.search');
|
||||
/*
|
||||
* We need to load all items because of creating tree
|
||||
* After creating tree we get info from pagination
|
||||
* and will set displaying of categories for current pagination
|
||||
* E.g. pagination is limitstart 5, limit 5 - so only categories from 5 to 10 will be displayed
|
||||
*/
|
||||
|
||||
// the same for max levels
|
||||
$this->t['level'] = $this->state->get('filter.level');
|
||||
|
||||
if (!empty($this->items) && !$this->t['search']) {
|
||||
$text = ''; // text is tree name e.g. Category >> Subcategory
|
||||
$tree = array();
|
||||
|
||||
// Filter max levels
|
||||
if (isset($this->t['level']) && $this->t['level'] > 0) {
|
||||
$maxLevel = (int)$this->t['level'] + 1;
|
||||
} else {
|
||||
$maxLevel = false;
|
||||
}
|
||||
|
||||
$this->items = $this->processTree($this->items, $tree, 0, $text, -1, 0, '', $maxLevel);
|
||||
|
||||
// Re count the pagination
|
||||
$countTotal = count($this->items);
|
||||
$model->setTotal($countTotal);
|
||||
$this->pagination = $model->getPagination();
|
||||
|
||||
/*
|
||||
// PHOCAEDIT
|
||||
// Because of search, we load more items - e.g. if the searched string is in category which is on level 3
|
||||
// we have loaded parent categories of the level 3 category: level3 (searched string) - level2 - level1 (root)
|
||||
// Now we need to limit if, it is a paradox:
|
||||
// a) wee need to get parent categories - but only for creating tree
|
||||
// b) but we don't want to display them - so in model we load it moreover but now we need to remove again + we need to limit pagination
|
||||
|
||||
$app = Factory::getApplication('administrator');
|
||||
$search = $app->getUserStateFromRequest('com_phocagallery.phocagalleryimgs.filter.search', 'filter_search');
|
||||
|
||||
if ($search != '') {
|
||||
foreach ($this->items as $k => $v) {
|
||||
|
||||
$pos = strpos(strtolower($v->title_self), strtolower($search));
|
||||
if ($pos !== false) {
|
||||
|
||||
} else {
|
||||
unset($this->items[$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Correct the pagination
|
||||
$c = count($this->items);
|
||||
$this->pagination = new Pagination($c, $this->pagination->limitstart, $this->pagination->limit);
|
||||
// END PHOCAEDIT */
|
||||
}
|
||||
|
||||
|
||||
//$mainframe = JFactory::getApplication();
|
||||
//$document = JFactory::getDocument();
|
||||
//$uri = \Joomla\CMS\Uri\Uri::getInstance();
|
||||
|
||||
|
||||
|
||||
$this->t['notapproved'] = $this->get( 'NotApprovedCategory' );
|
||||
|
||||
|
||||
$params = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
$this->t['enablethumbcreation'] = $params->get('enable_thumb_creation', 1 );
|
||||
$this->t['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int)$this->t['enablethumbcreation']);
|
||||
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerycs.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaGalleryCsHelper::getActions($state->get('filter.category_id'));
|
||||
$user = Factory::getUser();
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_CATEGORIES' ), 'folder' );
|
||||
if ($canDo->get('core.create')) {
|
||||
ToolbarHelper::addNew('phocagalleryc.add','JToolbar_NEW');
|
||||
}
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::editList('phocagalleryc.edit','JToolbar_EDIT');
|
||||
}
|
||||
|
||||
$dropdown = $bar->dropdownButton('status-group')->text('JTOOLBAR_CHANGE_STATUS')->toggleSplit(false)->icon('icon-ellipsis-h')->buttonClass('btn btn-action')->listCheck(true);
|
||||
$childBar = $dropdown->getChildToolbar();
|
||||
|
||||
|
||||
if ($canDo->get('core.edit.state')) {
|
||||
|
||||
/* ToolbarHelper::divider();
|
||||
ToolbarHelper::custom('phocagallerycs.publish', 'publish.png', 'publish_f2.png','JToolbar_PUBLISH', true);
|
||||
ToolbarHelper::custom('phocagallerycs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JToolbar_UNPUBLISH', true);
|
||||
ToolbarHelper::custom( 'phocagallerycs.approve', 'approve.png', '', 'COM_PHOCAGALLERY_APPROVE' , true);
|
||||
ToolbarHelper::custom( 'phocagallerycs.disapprove', 'disapprove.png', '', 'COM_PHOCAGALLERY_NOT_APPROVE' , true);
|
||||
//ToolbarHelper::custom('phocagallerycs.cooliris', 'cooliris.png', '', 'COM_PHOCAGALLERY_COOLIRIS' , true);*/
|
||||
|
||||
$childBar->publish('phocagallerycs.publish')->listCheck(true);
|
||||
$childBar->unpublish('phocagallerycs.unpublish')->listCheck(true);
|
||||
$childBar->standardButton('approve')->text('COM_PHOCAGALLERY_APPROVE')->task('phocagallerycs.approve')->listCheck(true);
|
||||
$childBar->standardButton('disapprove')->text('COM_PHOCAGALLERY_NOT_APPROVE')->task('phocagallerycs.disapprove')->listCheck(true);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.delete')) {
|
||||
//ToolbarHelper::deleteList( Text::_( 'COM_PHOCAGALLERY_WARNING_DELETE_ITEMS' ), 'phocagallerycs.delete', 'COM_PHOCAGALLERY_DELETE');
|
||||
$childBar->delete('phocagallerycs.delete')->text('COM_PHOCAGALLERY_DELETE')->message('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS')->icon('icon-trash')->listCheck(true);
|
||||
}
|
||||
// Add a batch button
|
||||
if ($user->authorise('core.edit'))
|
||||
{
|
||||
//HTMLHelper::_('bootstrap.renderModal', 'collapseModal');
|
||||
/*$title = Text::_('JToolbar_BATCH');
|
||||
|
||||
|
||||
$dhtml = '<joomla-toolbar-button id="toolbar-batch" list-selection>';
|
||||
$dhtml .= "<button data-bs-toggle=\"modal\" data-bs-target=\"#collapseModal\" class=\"btn btn-primary btn-small\">
|
||||
<i class=\"icon-checkbox-partial\" title=\"$title\"></i>
|
||||
$title</button>";
|
||||
$dhtml .= '</joomla-toolbar-button>';
|
||||
|
||||
$bar->appendButton('Custom', $dhtml, 'batch');*/
|
||||
|
||||
HTMLHelper::_('bootstrap.renderModal', 'collapseModal');
|
||||
$childBar->popupButton('batch')->text('JTOOLBAR_BATCH')->selector('collapseModal')->listCheck(true);
|
||||
|
||||
}
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
|
||||
protected function processTree( $data, $tree, $id = 0, $text='', $currentId = 0, $level = 0, $parentsTreeString = '', $maxLevel = false) {
|
||||
|
||||
|
||||
$countItemsInCat = 0;// Ordering
|
||||
$level = $level + 1;
|
||||
$parentsTreeString = $id . ' '. $parentsTreeString;
|
||||
|
||||
|
||||
|
||||
|
||||
// Limit the level of tree
|
||||
if (!$maxLevel || ($maxLevel && $level < $maxLevel)) {
|
||||
foreach ($data as $key) {
|
||||
$show_text = $text . $key->title;
|
||||
|
||||
static $iCT = 0;// All displayed items
|
||||
|
||||
if ($key->parent_id == $id && $currentId != $id && $currentId != $key->id ) {
|
||||
|
||||
|
||||
$tree[$iCT] = new CMSObject();
|
||||
|
||||
|
||||
|
||||
// Ordering MUST be solved here
|
||||
if ($countItemsInCat > 0) {
|
||||
$tree[$iCT]->orderup = 1;
|
||||
} else {
|
||||
$tree[$iCT]->orderup = 0;
|
||||
}
|
||||
|
||||
if ($countItemsInCat < ($key->countid - 1)) {
|
||||
$tree[$iCT]->orderdown = 1;
|
||||
} else {
|
||||
$tree[$iCT]->orderdown = 0;
|
||||
}
|
||||
|
||||
$tree[$iCT]->level = $level;
|
||||
$tree[$iCT]->parentstree = $parentsTreeString;
|
||||
|
||||
$tree[$iCT]->id = $key->id;
|
||||
$tree[$iCT]->title = $show_text;
|
||||
$tree[$iCT]->title_self = $key->title;
|
||||
$tree[$iCT]->parent_id = $key->parent_id;
|
||||
$tree[$iCT]->owner_id = $key->owner_id;
|
||||
$tree[$iCT]->name = $key->name;
|
||||
$tree[$iCT]->alias = $key->alias;
|
||||
$tree[$iCT]->image = $key->image;
|
||||
$tree[$iCT]->section = $key->section;
|
||||
$tree[$iCT]->image_position = $key->image_position;
|
||||
$tree[$iCT]->description = $key->description;
|
||||
$tree[$iCT]->published = $key->published;
|
||||
$tree[$iCT]->editor = $key->editor;
|
||||
$tree[$iCT]->ordering = $key->ordering;
|
||||
$tree[$iCT]->access = $key->access;
|
||||
$tree[$iCT]->access_level = $key->access_level;
|
||||
$tree[$iCT]->count = $key->count;
|
||||
$tree[$iCT]->params = $key->params;
|
||||
$tree[$iCT]->checked_out = $key->checked_out;
|
||||
$tree[$iCT]->checked_out_time = $key->checked_out_time;
|
||||
$tree[$iCT]->groupname = 0;
|
||||
$tree[$iCT]->username = $key->username;
|
||||
$tree[$iCT]->usernameno = $key->usernameno;
|
||||
$tree[$iCT]->parentcat_title = $key->parentcat_title;
|
||||
$tree[$iCT]->parentcat_id = $key->parentcat_id;
|
||||
$tree[$iCT]->hits = $key->hits;
|
||||
$tree[$iCT]->ratingavg = $key->ratingavg;
|
||||
$tree[$iCT]->accessuserid = $key->accessuserid;
|
||||
$tree[$iCT]->uploaduserid = $key->uploaduserid;
|
||||
$tree[$iCT]->deleteuserid = $key->deleteuserid;
|
||||
$tree[$iCT]->userfolder = $key->userfolder;
|
||||
$tree[$iCT]->latitude = $key->latitude;
|
||||
$tree[$iCT]->longitude = $key->longitude;
|
||||
$tree[$iCT]->zoom = $key->zoom;
|
||||
$tree[$iCT]->geotitle = $key->geotitle;
|
||||
$tree[$iCT]->approved = $key->approved;
|
||||
$tree[$iCT]->language = $key->language;
|
||||
$tree[$iCT]->language_title = $key->language_title;
|
||||
$tree[$iCT]->link = '';
|
||||
$tree[$iCT]->filename = '';// Will be added in View (after items will be reduced)
|
||||
$tree[$iCT]->linkthumbnailpath = '';
|
||||
|
||||
|
||||
$iCT++;
|
||||
|
||||
|
||||
$tree = $this->processTree($data, $tree, $key->id, $show_text . " - ", $currentId, $level, $parentsTreeString, $maxLevel);
|
||||
|
||||
$countItemsInCat++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return($tree);
|
||||
}
|
||||
|
||||
protected function getSortFields() {
|
||||
return array(
|
||||
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
|
||||
'a.title' => Text::_('COM_PHOCAGALLERY_TITLE'),
|
||||
'a.published' => Text::_('COM_PHOCAGALLERY_PUBLISHED'),
|
||||
'a.approved' => Text::_('COM_PHOCAGALLERY_APPROVED'),
|
||||
'parent_title' => Text::_('COM_PHOCAGALLERY_PARENT_CATEGORY'),
|
||||
'a.owner' => Text::_('COM_PHOCAGALLERY_OWNER'),
|
||||
'ratingavg' => Text::_('COM_PHOCAGALLERY_RATING'),
|
||||
'a.hits' => Text::_('COM_PHOCAGALLERY_HITS'),
|
||||
'language' => Text::_('JGRID_HEADING_LANGUAGE'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user