Added Events to Compiler, the beginning of an API. #435

Merged
Llewellyn merged 26 commits from staging into master 2019-07-06 22:38:13 +00:00
16 changed files with 30 additions and 30 deletions
Showing only changes of commit 76449b01ec - Show all commits

View File

@ -146,7 +146,7 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 25th May, 2019
+ *Last Build*: 5th June, 2019
+ *Version*: 2.9.18
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt

View File

@ -146,7 +146,7 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 25th May, 2019
+ *Last Build*: 5th June, 2019
+ *Version*: 2.9.18
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt

View File

@ -121,7 +121,7 @@ class ComponentbuilderControllerAdmin_views extends JControllerAdmin
// set massage
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE');
// check if this user has the right to run expansion
if($user->authorise('compiler.run_expansion', 'com_componentbuilder'))
if($user->authorise('admin_views.run_expansion', 'com_componentbuilder'))
{
// set massage
$message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB');

View File

@ -216,7 +216,7 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
// set page redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false);
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_CLEAR_THE_TMP_FOLDER');
if($user->authorise('core.admin', 'com_componentbuilder'))
if($user->authorise('compiler.clear_tmp', 'com_componentbuilder') && $user->authorise('core.options', 'com_componentbuilder'))
{
// get the model
$model = $this->getModel('compiler');

View File

@ -121,7 +121,7 @@ class ComponentbuilderControllerCustom_codes extends JControllerAdmin
// set massage
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE');
// check if this user has the right to run expansion
if($user->authorise('compiler.run_expansion', 'com_componentbuilder'))
if($user->authorise('custom_codes.run_expansion', 'com_componentbuilder'))
{
// set massage
$message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB');

View File

@ -121,7 +121,7 @@ class ComponentbuilderControllerDynamic_gets extends JControllerAdmin
// set massage
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE');
// check if this user has the right to run expansion
if($user->authorise('compiler.run_expansion', 'com_componentbuilder'))
if($user->authorise('dynamic_gets.run_expansion', 'com_componentbuilder'))
{
// set massage
$message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB');

View File

@ -121,7 +121,7 @@ class ComponentbuilderControllerFields extends JControllerAdmin
// set massage
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE');
// check if this user has the right to run expansion
if($user->authorise('compiler.run_expansion', 'com_componentbuilder'))
if($user->authorise('fields.run_expansion', 'com_componentbuilder'))
{
// set massage
$message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB');

View File

@ -45,7 +45,7 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('joomla_component.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
if ($user->authorise('joomla_component.import_jcb_packages', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
{
$session = JFactory::getSession();
$session->set('backto_VDM_IMPORT', 'joomla_components');

View File

@ -121,7 +121,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
// set massage
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE');
// check if this user has the right to run expansion
if($user->authorise('compiler.run_expansion', 'com_componentbuilder'))
if($user->authorise('joomla_components.run_expansion', 'com_componentbuilder'))
{
// set massage
$message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB');
@ -159,7 +159,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
// set page redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false);
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_CLEAR_THE_TMP_FOLDER');
if($user->authorise('core.admin', 'com_componentbuilder'))
if($user->authorise('joomla_components.clear_tmp', 'com_componentbuilder') && $user->authorise('core.options', 'com_componentbuilder'))
{
// get the model
$model = $this->getModel('compiler');
@ -181,7 +181,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
{
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('joomla_component.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
if ($user->authorise('joomla_component.import_jcb_packages', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
{
$session = JFactory::getSession();
$session->set('backto_VDM_IMPORT', 'joomla_components');
@ -205,7 +205,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
$model = $this->getModel('Joomla_components');
// check if export is allowed for this user.
$model->user = JFactory::getUser();
if ($model->user->authorise('joomla_component.export', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder'))
if ($model->user->authorise('joomla_component.export_jcb_packages', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder'))
{
// Get the input
$input = JFactory::getApplication()->input;
@ -289,7 +289,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
// make sure to set active type (adding this script from custom code :)
$model->activeType = 'manualBackup';
// check if export is allowed for this user. (we need this sorry)
if ($model->user->authorise('joomla_component.export', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder'))
if ($model->user->authorise('joomla_component.export_jcb_packages', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder'))
{
// get all component IDs to backup
$pks = componentbuilderHelper::getComponentIDs();
@ -443,7 +443,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
$model = $this->getModel('Joomla_components');
// check if export is allowed for this user.
$model->user = JFactory::getUser();
if ($model->user->authorise('joomla_component.cloner', 'com_componentbuilder') && $model->user->authorise('core.copy', 'com_componentbuilder'))
if ($model->user->authorise('joomla_component.clone', 'com_componentbuilder') && $model->user->authorise('core.copy', 'com_componentbuilder'))
{
// Get the input
$input = JFactory::getApplication()->input;

View File

@ -10929,29 +10929,29 @@ class Interpretation extends Fields
return '';
}
public function setCategoryFilter($viewName_list)
public function setCategoryFilter($viewName_single, $viewName_list)
{
if (isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list]))
{
// check if category has another name
if (isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list]))
{
$otherViews = $this->catOtherName[$viewName_list]['views'];
$targetView = "." . $this->catOtherName[$viewName_list]['view'];
}
else
{
$otherViews = $viewName_list;
$targetView = "." . $viewName_single;
}
// set component name
$component = ComponentbuilderHelper::safeString($this->componentData->name_code);
$COMONENT = ComponentbuilderHelper::safeString($this->componentData->name_code, 'U');
$COPMONENT = ComponentbuilderHelper::safeString($this->componentData->name_code, 'U');
// set filter
$filter = array();
$filter[] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Category Filter.";
$filter[] = $this->_t(2) . "JHtmlSidebar::addFilter(";
$filter[] = $this->_t(3) . "JText:" . ":_('JOPTION_SELECT_CATEGORY'),";
$filter[] = $this->_t(3) . "'filter_category_id',";
$filter[] = $this->_t(3) . "JHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . "." . $otherViews . "'), 'value', 'text', \$this->state->get('filter.category_id'))";
$filter[] = $this->_t(3) . "JHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . $targetView . "'), 'value', 'text', \$this->state->get('filter.category_id'))";
$filter[] = $this->_t(2) . ");";
@ -10959,9 +10959,9 @@ class Interpretation extends Fields
$filter[] = $this->_t(2) . "{";
$filter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Category Batch selection.";
$filter[] = $this->_t(3) . "JHtmlBatch_::addListSelection(";
$filter[] = $this->_t(4) . "JText:" . ":_('COM_" . $COMONENT . "_KEEP_ORIGINAL_CATEGORY'),";
$filter[] = $this->_t(4) . "JText:" . ":_('COM_" . $COPMONENT . "_KEEP_ORIGINAL_CATEGORY'),";
$filter[] = $this->_t(4) . "'batch[category]',";
$filter[] = $this->_t(4) . "JHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . "." . $otherViews . "'), 'value', 'text')";
$filter[] = $this->_t(4) . "JHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . $targetView . "'), 'value', 'text')";
$filter[] = $this->_t(3) . ");";
$filter[] = $this->_t(2) . "}";

View File

@ -438,7 +438,7 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_list][$this->hhh . 'SORTFIELDS' . $this->hhh] = $this->setSortFields($viewName_list);
// CATEGORYFILTER <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CATEGORYFILTER' . $this->hhh] = $this->setCategoryFilter($viewName_list);
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CATEGORYFILTER' . $this->hhh] = $this->setCategoryFilter($viewName_single, $viewName_list);
// CATEGORY_VIEWS
if (!isset($this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh]))

File diff suppressed because one or more lines are too long

View File

@ -195,7 +195,7 @@ class ComponentbuilderViewFields extends JViewLegacy
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_CATEGORY'),
'filter_category_id',
JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fields'), 'value', 'text', $this->state->get('filter.category_id'))
JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.field'), 'value', 'text', $this->state->get('filter.category_id'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
@ -204,7 +204,7 @@ class ComponentbuilderViewFields extends JViewLegacy
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'),
'batch[category]',
JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fields'), 'value', 'text')
JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.field'), 'value', 'text')
);
}

View File

@ -190,7 +190,7 @@ class ComponentbuilderViewFieldtypes extends JViewLegacy
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_CATEGORY'),
'filter_category_id',
JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fieldtypes'), 'value', 'text', $this->state->get('filter.category_id'))
JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fieldtype'), 'value', 'text', $this->state->get('filter.category_id'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
@ -199,7 +199,7 @@ class ComponentbuilderViewFieldtypes extends JViewLegacy
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'),
'batch[category]',
JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fieldtypes'), 'value', 'text')
JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fieldtype'), 'value', 'text')
);
}
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>25th May, 2019</creationDate>
<creationDate>5th June, 2019</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>

View File

@ -266,7 +266,7 @@ class ComponentbuilderControllerApi extends JControllerForm
// make sure to set active type (adding this script from custom code :)
$model->activeType = 'backup';
// check if export is allowed for this user. (we need this sorry)
if ($model->user->authorise('joomla_component.export', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder'))
if ($model->user->authorise('joomla_component.export_jcb_packages', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder'))
{
// get all component IDs to backup
$pks = componentbuilderHelper::getComponentIDs();