| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/groups.tar |
tmpl/default_batch_footer.php 0000604 00000001272 15245607203 0012376 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<button type="button" class="btn" onclick="document.getElementById('batch-field-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value=''" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
</button>
<button type="submit" class="btn btn-success" onclick="Joomla.submitbutton('group.batch');return false;">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>
tmpl/default_batch_body.php 0000604 00000001274 15245607203 0012037 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('formbehavior.chosen', 'select');
?>
<div class="container-fluid">
<div class="row-fluid">
<div class="control-group span6">
<div class="controls">
<?php echo JLayoutHelper::render('joomla.html.batch.language', array()); ?>
</div>
</div>
<div class="control-group span6">
<div class="controls">
<?php echo JLayoutHelper::render('joomla.html.batch.access', array()); ?>
</div>
</div>
</div>
</div>
tmpl/default.php 0000604 00000016201 15245607203 0007655 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', 'select');
$app = JFactory::getApplication();
$user = JFactory::getUser();
$userId = $user->get('id');
$component = '';
$parts = FieldsHelper::extract($this->state->get('filter.context'));
if ($parts)
{
$component = $this->escape($parts[0]);
}
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$ordering = ($listOrder == 'a.ordering');
$saveOrder = ($listOrder == 'a.ordering' && strtolower($listDirn) == 'asc');
if ($saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_fields&task=groups.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'groupList', 'adminForm', strtolower($listDirn), $saveOrderingUrl, false, true);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_fields&view=groups'); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<div id="filter-bar" class="js-stools-container-bar pull-left">
<div class="btn-group pull-left">
<?php echo $this->filterForm->getField('context')->input; ?>
</div>
</div>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="groupList">
<thead>
<tr>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="1%" class="center">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th width="1%" class="nowrap center">
<?php echo JHtml::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
</th>
<th>
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
</th>
<th width="5%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?>
</th>
<th width="1%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="9">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php $ordering = ($listOrder == 'a.ordering'); ?>
<?php $canEdit = $user->authorise('core.edit', $component . '.fieldgroup.' . $item->id); ?>
<?php $canCheckin = $user->authorise('core.admin', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; ?>
<?php $canEditOwn = $user->authorise('core.edit.own', $component . '.fieldgroup.' . $item->id) && $item->created_by == $userId; ?>
<?php $canChange = $user->authorise('core.edit.state', $component . '.fieldgroup.' . $item->id) && $canCheckin; ?>
<tr class="row<?php echo $i % 2; ?>" item-id="<?php echo $item->id ?>">
<td class="order nowrap center hidden-phone">
<?php $iconClass = ''; ?>
<?php if (!$canChange) : ?>
<?php $iconClass = ' inactive'; ?>
<?php elseif (!$saveOrder) : ?>
<?php $iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); ?>
<?php endif; ?>
<span class="sortable-handler<?php echo $iconClass; ?>">
<span class="icon-menu" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" />
<?php endif; ?>
</td>
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="center">
<div class="btn-group">
<?php echo JHtml::_('jgrid.published', $item->state, $i, 'groups.', $canChange, 'cb'); ?>
<?php // Create dropdown items and render the dropdown list. ?>
<?php if ($canChange) : ?>
<?php JHtml::_('actionsdropdown.' . ((int) $item->state === 2 ? 'un' : '') . 'archive', 'cb' . $i, 'groups'); ?>
<?php JHtml::_('actionsdropdown.' . ((int) $item->state === -2 ? 'un' : '') . 'trash', 'cb' . $i, 'groups'); ?>
<?php echo JHtml::_('actionsdropdown.render', $this->escape($item->title)); ?>
<?php endif; ?>
</div>
</td>
<td>
<div class="pull-left break-word">
<?php if ($item->checked_out) : ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'groups.', $canCheckin); ?>
<?php endif; ?>
<?php if ($canEdit || $canEditOwn) : ?>
<a href="<?php echo JRoute::_('index.php?option=com_fields&task=group.edit&id=' . $item->id); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
<span class="small break-word">
<?php if ($item->note) : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_NOTE', $this->escape($item->note)); ?>
<?php endif; ?>
</span>
</div>
</td>
<td class="small hidden-phone">
<?php echo $this->escape($item->access_level); ?>
</td>
<td class="small nowrap hidden-phone">
<?php echo JLayoutHelper::render('joomla.content.language', $item); ?>
</td>
<td class="center hidden-phone">
<span><?php echo (int) $item->id; ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php //Load the batch processing form. ?>
<?php if ($user->authorise('core.create', $component)
&& $user->authorise('core.edit', $component)
&& $user->authorise('core.edit.state', $component)) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_FIELDS_VIEW_GROUPS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
view.html.php 0000604 00000011561 15245607203 0007176 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Groups View
*
* @since 3.7.0
*/
class FieldsViewGroups extends JViewLegacy
{
/**
* @var JForm
*
* @since 3.7.0
*/
public $filterForm;
/**
* @var array
*
* @since 3.7.0
*/
public $activeFilters;
/**
* @var array
*
* @since 3.7.0
*/
protected $items;
/**
* @var JPagination
*
* @since 3.7.0
*/
protected $pagination;
/**
* @var JObject
*
* @since 3.7.0
*/
protected $state;
/**
* @var string
*
* @since 3.7.0
*/
protected $sidebar;
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @see JViewLegacy::loadTemplate()
* @since 3.7.0
*/
public function display($tpl = null)
{
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode("\n", $errors), 500);
}
// Display a warning if the fields system plugin is disabled
if (!JPluginHelper::isEnabled('system', 'fields'))
{
$link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . FieldsHelper::getFieldsPluginId());
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_FIELDS_SYSTEM_PLUGIN_NOT_ENABLED', $link), 'warning');
}
$this->addToolbar();
FieldsHelper::addSubmenu($this->state->get('filter.context'), 'groups');
$this->sidebar = JHtmlSidebar::render();
return parent::display($tpl);
}
/**
* Adds the toolbar.
*
* @return void
*
* @since 3.7.0
*/
protected function addToolbar()
{
$groupId = $this->state->get('filter.group_id');
$component = '';
$parts = FieldsHelper::extract($this->state->get('filter.context'));
if ($parts)
{
$component = $parts[0];
}
$canDo = JHelperContent::getActions($component, 'fieldgroup', $groupId);
// Get the toolbar object instance
$bar = JToolbar::getInstance('toolbar');
// Avoid nonsense situation.
if ($component == 'com_fields')
{
return;
}
// Load component language file
$lang = JFactory::getLanguage();
$lang->load($component, JPATH_ADMINISTRATOR)
|| $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component));
$title = JText::sprintf('COM_FIELDS_VIEW_GROUPS_TITLE', JText::_(strtoupper($component)));
// Prepare the toolbar.
JToolbarHelper::title($title, 'puzzle fields ' . substr($component, 4) . '-groups');
if ($canDo->get('core.create'))
{
JToolbarHelper::addNew('group.add');
}
if ($canDo->get('core.edit') || $canDo->get('core.edit.own'))
{
JToolbarHelper::editList('group.edit');
}
if ($canDo->get('core.edit.state'))
{
JToolbarHelper::publish('groups.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('groups.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('groups.archive');
}
if (JFactory::getUser()->authorise('core.admin'))
{
JToolbarHelper::checkin('groups.checkin');
}
// Add a batch button
if ($canDo->get('core.create') && $canDo->get('core.edit') && $canDo->get('core.edit.state'))
{
$title = JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$dhtml = $layout->render(
array(
'title' => $title,
)
);
$bar->appendButton('Custom', $dhtml, 'batch');
}
if ($canDo->get('core.admin') || $canDo->get('core.options'))
{
JToolbarHelper::preferences($component);
}
if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete', $component))
{
JToolbarHelper::deleteList('', 'groups.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($canDo->get('core.edit.state'))
{
JToolbarHelper::trash('groups.trash');
}
JToolbarHelper::help('JHELP_COMPONENTS_FIELDS_FIELD_GROUPS');
}
/**
* Returns the sort fields.
*
* @return array
*
* @since 3.7.0
*/
protected function getSortFields()
{
return array(
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.state' => JText::_('JSTATUS'),
'a.title' => JText::_('JGLOBAL_TITLE'),
'a.access' => JText::_('JGRID_HEADING_ACCESS'),
'language' => JText::_('JGRID_HEADING_LANGUAGE'),
'a.context' => JText::_('JGRID_HEADING_CONTEXT'),
'a.id' => JText::_('JGRID_HEADING_ID'),
);
}
}