Add getFieldsetXML and getFieldXMLString method to build fields in compiler gh-378. Refactoring the compiler to use camelcase for view code names.
This commit is contained in:
@@ -25,11 +25,8 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
|
||||
<td class="order nowrap center hidden-phone">
|
||||
<?php if ($canDo->get('admin_view.edit.state')): ?>
|
||||
<?php
|
||||
if ($this->saveOrder)
|
||||
{
|
||||
$iconClass = ' inactive';
|
||||
}
|
||||
else
|
||||
$iconClass = '';
|
||||
if (!$this->saveOrder)
|
||||
{
|
||||
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
<tr>
|
||||
<?php if ($this->canEdit&& $this->canState): ?>
|
||||
<th width="1%" class="nowrap center hidden-phone">
|
||||
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
|
||||
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
|
||||
</th>
|
||||
<th width="20" class="nowrap center">
|
||||
<?php echo JHtml::_('grid.checkall'); ?>
|
||||
@@ -30,17 +30,17 @@ defined('_JEXEC') or die('Restricted access');
|
||||
</th>
|
||||
<?php endif; ?>
|
||||
<th class="nowrap" >
|
||||
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_SYSTEM_NAME_LABEL', 'a.system_name', $this->listDirn, $this->listOrder); ?>
|
||||
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_SYSTEM_NAME_LABEL', 'a.system_name', $this->listDirn, $this->listOrder); ?>
|
||||
</th>
|
||||
<th class="nowrap hidden-phone" >
|
||||
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEWS_NAMES', 'a.name_single', $this->listDirn, $this->listOrder); ?>
|
||||
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEWS_NAMES', 'a.name_single', $this->listDirn, $this->listOrder); ?>
|
||||
</th>
|
||||
<th class="nowrap hidden-phone" >
|
||||
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEWS_DETAILS', 'a.short_description', $this->listDirn, $this->listOrder); ?>
|
||||
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEWS_DETAILS', 'a.short_description', $this->listDirn, $this->listOrder); ?>
|
||||
</th>
|
||||
<?php if ($this->canState): ?>
|
||||
<th width="10" class="nowrap center" >
|
||||
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
|
||||
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
|
||||
</th>
|
||||
<?php else: ?>
|
||||
<th width="10" class="nowrap center" >
|
||||
@@ -48,6 +48,6 @@ defined('_JEXEC') or die('Restricted access');
|
||||
</th>
|
||||
<?php endif; ?>
|
||||
<th width="5" class="nowrap center hidden-phone" >
|
||||
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
|
||||
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
|
||||
</th>
|
||||
</tr>
|
@@ -34,10 +34,14 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->user = JFactory::getUser();
|
||||
// Load the filter form from xml.
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
// Load the active filters.
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
// Add the list ordering clause.
|
||||
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
|
||||
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
|
||||
$this->saveOrder = $this->listOrder == 'ordering';
|
||||
$this->saveOrder = $this->listOrder == 'a.ordering';
|
||||
// set the return here value
|
||||
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
|
||||
// get global action permissions
|
||||
@@ -190,156 +194,6 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
|
||||
'batch[access]',
|
||||
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
|
||||
);
|
||||
}
|
||||
|
||||
// Set Add Fadein Selection
|
||||
$this->add_fadeinOptions = $this->getTheAdd_fadeinSelections();
|
||||
// We do some sanitation for Add Fadein filter
|
||||
if (ComponentbuilderHelper::checkArray($this->add_fadeinOptions) &&
|
||||
isset($this->add_fadeinOptions[0]->value) &&
|
||||
!ComponentbuilderHelper::checkString($this->add_fadeinOptions[0]->value))
|
||||
{
|
||||
unset($this->add_fadeinOptions[0]);
|
||||
}
|
||||
// Only load Add Fadein filter if it has values
|
||||
if (ComponentbuilderHelper::checkArray($this->add_fadeinOptions))
|
||||
{
|
||||
// Add Fadein Filter
|
||||
JHtmlSidebar::addFilter(
|
||||
'- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_FADEIN_LABEL').' -',
|
||||
'filter_add_fadein',
|
||||
JHtml::_('select.options', $this->add_fadeinOptions, 'value', 'text', $this->state->get('filter.add_fadein'))
|
||||
);
|
||||
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit)
|
||||
{
|
||||
// Add Fadein Batch Selection
|
||||
JHtmlBatch_::addListSelection(
|
||||
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_FADEIN_LABEL').' -',
|
||||
'batch[add_fadein]',
|
||||
JHtml::_('select.options', $this->add_fadeinOptions, 'value', 'text')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Set Type Selection
|
||||
$this->typeOptions = $this->getTheTypeSelections();
|
||||
// We do some sanitation for Type filter
|
||||
if (ComponentbuilderHelper::checkArray($this->typeOptions) &&
|
||||
isset($this->typeOptions[0]->value) &&
|
||||
!ComponentbuilderHelper::checkString($this->typeOptions[0]->value))
|
||||
{
|
||||
unset($this->typeOptions[0]);
|
||||
}
|
||||
// Only load Type filter if it has values
|
||||
if (ComponentbuilderHelper::checkArray($this->typeOptions))
|
||||
{
|
||||
// Type Filter
|
||||
JHtmlSidebar::addFilter(
|
||||
'- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_TYPE_LABEL').' -',
|
||||
'filter_type',
|
||||
JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type'))
|
||||
);
|
||||
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit)
|
||||
{
|
||||
// Type Batch Selection
|
||||
JHtmlBatch_::addListSelection(
|
||||
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_TYPE_LABEL').' -',
|
||||
'batch[type]',
|
||||
JHtml::_('select.options', $this->typeOptions, 'value', 'text')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Set Add Custom Button Selection
|
||||
$this->add_custom_buttonOptions = $this->getTheAdd_custom_buttonSelections();
|
||||
// We do some sanitation for Add Custom Button filter
|
||||
if (ComponentbuilderHelper::checkArray($this->add_custom_buttonOptions) &&
|
||||
isset($this->add_custom_buttonOptions[0]->value) &&
|
||||
!ComponentbuilderHelper::checkString($this->add_custom_buttonOptions[0]->value))
|
||||
{
|
||||
unset($this->add_custom_buttonOptions[0]);
|
||||
}
|
||||
// Only load Add Custom Button filter if it has values
|
||||
if (ComponentbuilderHelper::checkArray($this->add_custom_buttonOptions))
|
||||
{
|
||||
// Add Custom Button Filter
|
||||
JHtmlSidebar::addFilter(
|
||||
'- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -',
|
||||
'filter_add_custom_button',
|
||||
JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text', $this->state->get('filter.add_custom_button'))
|
||||
);
|
||||
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit)
|
||||
{
|
||||
// Add Custom Button Batch Selection
|
||||
JHtmlBatch_::addListSelection(
|
||||
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -',
|
||||
'batch[add_custom_button]',
|
||||
JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Set Add Php Ajax Selection
|
||||
$this->add_php_ajaxOptions = $this->getTheAdd_php_ajaxSelections();
|
||||
// We do some sanitation for Add Php Ajax filter
|
||||
if (ComponentbuilderHelper::checkArray($this->add_php_ajaxOptions) &&
|
||||
isset($this->add_php_ajaxOptions[0]->value) &&
|
||||
!ComponentbuilderHelper::checkString($this->add_php_ajaxOptions[0]->value))
|
||||
{
|
||||
unset($this->add_php_ajaxOptions[0]);
|
||||
}
|
||||
// Only load Add Php Ajax filter if it has values
|
||||
if (ComponentbuilderHelper::checkArray($this->add_php_ajaxOptions))
|
||||
{
|
||||
// Add Php Ajax Filter
|
||||
JHtmlSidebar::addFilter(
|
||||
'- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AJAX_LABEL').' -',
|
||||
'filter_add_php_ajax',
|
||||
JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text', $this->state->get('filter.add_php_ajax'))
|
||||
);
|
||||
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit)
|
||||
{
|
||||
// Add Php Ajax Batch Selection
|
||||
JHtmlBatch_::addListSelection(
|
||||
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AJAX_LABEL').' -',
|
||||
'batch[add_php_ajax]',
|
||||
JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Set Add Custom Import Selection
|
||||
$this->add_custom_importOptions = $this->getTheAdd_custom_importSelections();
|
||||
// We do some sanitation for Add Custom Import filter
|
||||
if (ComponentbuilderHelper::checkArray($this->add_custom_importOptions) &&
|
||||
isset($this->add_custom_importOptions[0]->value) &&
|
||||
!ComponentbuilderHelper::checkString($this->add_custom_importOptions[0]->value))
|
||||
{
|
||||
unset($this->add_custom_importOptions[0]);
|
||||
}
|
||||
// Only load Add Custom Import filter if it has values
|
||||
if (ComponentbuilderHelper::checkArray($this->add_custom_importOptions))
|
||||
{
|
||||
// Add Custom Import Filter
|
||||
JHtmlSidebar::addFilter(
|
||||
'- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
|
||||
'filter_add_custom_import',
|
||||
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text', $this->state->get('filter.add_custom_import'))
|
||||
);
|
||||
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit)
|
||||
{
|
||||
// Add Custom Import Batch Selection
|
||||
JHtmlBatch_::addListSelection(
|
||||
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
|
||||
'batch[add_custom_import]',
|
||||
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,7 +238,7 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
|
||||
protected function getSortFields()
|
||||
{
|
||||
return array(
|
||||
'ordering' => JText::_('JGRID_HEADING_ORDERING'),
|
||||
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
|
||||
'a.published' => JText::_('JSTATUS'),
|
||||
'a.system_name' => JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_SYSTEM_NAME_LABEL'),
|
||||
'a.name_single' => JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_LABEL'),
|
||||
|
Reference in New Issue
Block a user