Resolved gh-441 to allow fieldtype name prefixing. Resolved gh-443 to allow Alphanumeric+dot in fieldtype name. Fixed gh-446 to insure that JFormRuleInt validates correctly in the admin field realtions. Improved the new plugin area to also have system name and option to add custom header code. gh-436

This commit is contained in:
2019-07-19 04:17:15 +02:00
parent a5ae94b93a
commit affaeb72f8
77 changed files with 4338 additions and 3890 deletions

View File

@ -63,12 +63,12 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_plugins&task=joomla_p
<td class="nowrap">
<div class="name">
<?php if ($canDo->get('joomla_plugin.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->name); ?></a>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'joomla_plugins.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->name); ?>
<?php echo $this->escape($item->system_name); ?>
<?php endif; ?>
</div>
</td>

View File

@ -30,7 +30,7 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_LABEL', 'name', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_SYSTEM_NAME_LABEL', 'system_name', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CLASS_EXTENDS_LABEL', 'class_extends_name', $this->listDirn, $this->listOrder); ?>

View File

@ -127,11 +127,6 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('joomla_plugins.trash');
}
if ($this->canDo->get('core.export') && $this->canDo->get('joomla_plugin.export'))
{
JToolBarHelper::custom('joomla_plugins.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
}
}
if ($this->user->authorise('joomla_plugin.run_expansion', 'com_componentbuilder'))
@ -153,11 +148,6 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy
{
// add Properties button.
JToolBarHelper::custom('joomla_plugins.openClassProperties', 'joomla', '', 'COM_COMPONENTBUILDER_PROPERTIES', false);
}
if ($this->canDo->get('core.import') && $this->canDo->get('joomla_plugin.import'))
{
JToolBarHelper::custom('joomla_plugins.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false);
}
// set help url for this view if found
@ -206,36 +196,6 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy
);
}
// Set Name Selection
$this->nameOptions = $this->getTheNameSelections();
// We do some sanitation for Name filter
if (ComponentbuilderHelper::checkArray($this->nameOptions) &&
isset($this->nameOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->nameOptions[0]->value))
{
unset($this->nameOptions[0]);
}
// Only load Name filter if it has values
if (ComponentbuilderHelper::checkArray($this->nameOptions))
{
// Name Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_LABEL').' -',
'filter_name',
JHtml::_('select.options', $this->nameOptions, 'value', 'text', $this->state->get('filter.name'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_LABEL').' -',
'batch[name]',
JHtml::_('select.options', $this->nameOptions, 'value', 'text')
);
}
}
// Set Class Extends Name Selection
$this->class_extendsNameOptions = JFormHelper::loadFieldType('Classextends')->options;
// We do some sanitation for Class Extends Name filter
@ -340,42 +300,10 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy
return array(
'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_LABEL'),
'a.system_name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_SYSTEM_NAME_LABEL'),
'g.name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CLASS_EXTENDS_LABEL'),
'h.name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_JOOMLA_PLUGIN_GROUP_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
protected function getTheNameSelections()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('name'));
$query->from($db->quoteName('#__componentbuilder_joomla_plugin'));
$query->order($db->quoteName('name') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
if ($results)
{
$results = array_unique($results);
$_filter = array();
foreach ($results as $name)
{
// Now add the name and its text to the options array
$_filter[] = JHtml::_('select.option', $name, $name);
}
return $_filter;
}
return false;
}
}