Fixed changelog direction so newest changes is listed at top of the file. Finished the init function of super powers. Adds rest function inside super power. Adds super powers to all templates. Updates many helper class methods to now use the utility classes. Adds the method to the component entry file (as-well). Moved most methods from the compiler fields class to powers. #955 Refactored many new builder classes from the registry class. Converted the Content class to two builder classes. Adds option to add additional templates to a module. Resolves #1002 by adding STRING instead of WORD. Ported the FOF encryption class into Powers. https://git.vdm.dev/joomla/fof Changed all CSS and JS to use instead of in compiler code. Adds option to turn jQuery off if UIKIT 3 is added. Adds option to auto write injection boilerplate code in Powers area. Adds option to auto write service provider boilerplate code in the Powers area. Improved the method and all banner locations to fetch from https://git.vdm.dev/joomla/jcb-external/ instead. Major stability improvements all over the new powers complier classes. New [base Registry class](https://git.vdm.dev/joomla/super-powers/src/branch/master/src/7e822c03-1b20-41d1-9427-f5b8d5836af7) has been created specially for JCB. Remember to update all plug-ins with this version update (use the package).
This commit is contained in:
@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('admin_custom_tabs.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('admin_custom_tabs.access', 'com_componentbuilder.admin_custom_tabs.' . (int) $recordId) && $user->authorise('admin_custom_tabs.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('admin_custom_tabs.access', 'com_componentbuilder.admin_custom_tabs.' . (int) $recordId) && $user->authorise('admin_custom_tabs.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('admin_fields.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $recordId) && $user->authorise('admin_fields.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $recordId) && $user->authorise('admin_fields.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('admin_fields_conditions.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $recordId) && $user->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $recordId) && $user->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('admin_fields_relations.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_view extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('admin_view.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerAdmin_view extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $recordId) && $user->authorise('admin_view.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $recordId) && $user->authorise('admin_view.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
/**
|
||||
* Admin_views Admin Controller
|
||||
@ -131,7 +132,7 @@ class ComponentbuilderControllerAdmin_views extends AdminController
|
||||
// run expansion via API
|
||||
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
|
||||
// is there a message returned
|
||||
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
|
||||
if (!is_numeric($result) && StringHelper::check($result))
|
||||
{
|
||||
$this->setRedirect($redirect_url, $result);
|
||||
return true;
|
||||
@ -147,4 +148,4 @@ class ComponentbuilderControllerAdmin_views extends AdminController
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerAdmins_custom_tabs extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerAdmins_fields extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerAdmins_fields_conditions extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerAdmins_fields_relations extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerClass_extendings extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerClass_extends extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('class_extends.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerClass_extends extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('class_extends.access', 'com_componentbuilder.class_extends.' . (int) $recordId) && $user->authorise('class_extends.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('class_extends.access', 'com_componentbuilder.class_extends.' . (int) $recordId) && $user->authorise('class_extends.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerClass_method extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('class_method.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerClass_method extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $recordId) && $user->authorise('class_method.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $recordId) && $user->authorise('class_method.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -106,4 +106,4 @@ class ComponentbuilderControllerClass_methods extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -106,4 +106,4 @@ class ComponentbuilderControllerClass_properties extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerClass_property extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('class_property.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerClass_property extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $recordId) && $user->authorise('class_property.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $recordId) && $user->authorise('class_property.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -15,6 +15,8 @@ defined('_JEXEC') or die('Restricted access');
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
|
||||
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
/**
|
||||
* Compiler Admin Controller
|
||||
@ -125,9 +127,9 @@ class ComponentbuilderControllerCompiler extends AdminController
|
||||
$url = JURI::root() . substr($model->compiler->filepath['component'], $pos + 1);
|
||||
}
|
||||
// check if we have plugins
|
||||
$add_plugin_install = ComponentbuilderHelper::checkArray($model->compiler->filepath['plugins'], true);
|
||||
$add_plugin_install = UtilitiesArrayHelper::check($model->compiler->filepath['plugins'], true);
|
||||
// check if we have modules
|
||||
$add_module_install = ComponentbuilderHelper::checkArray($model->compiler->filepath['modules'], true);
|
||||
$add_module_install = UtilitiesArrayHelper::check($model->compiler->filepath['modules'], true);
|
||||
// if a multi install we set another kind of header
|
||||
if ($add_plugin_install || $add_module_install)
|
||||
{
|
||||
@ -225,7 +227,7 @@ class ComponentbuilderControllerCompiler extends AdminController
|
||||
$message[] = '<br /><small>Hey! you can also download these zip files right now!</small><br />';
|
||||
$message[] = '<a class="btn btn-success" href="' . $url . '" ><span class="icon-download icon-white"></span>Download Component</a> ';
|
||||
// load the module download URL's
|
||||
if (isset($module_urls) && ComponentbuilderHelper::checkArray($module_urls))
|
||||
if (isset($module_urls) && UtilitiesArrayHelper::check($module_urls))
|
||||
{
|
||||
foreach ($module_urls as $module_id => $module_url)
|
||||
{
|
||||
@ -234,7 +236,7 @@ class ComponentbuilderControllerCompiler extends AdminController
|
||||
}
|
||||
}
|
||||
// load the plugin download URL's
|
||||
if (isset($plugin_urls) && ComponentbuilderHelper::checkArray($plugin_urls))
|
||||
if (isset($plugin_urls) && UtilitiesArrayHelper::check($plugin_urls))
|
||||
{
|
||||
foreach ($plugin_urls as $plugin_id => $plugin_url)
|
||||
{
|
||||
@ -259,7 +261,7 @@ class ComponentbuilderControllerCompiler extends AdminController
|
||||
$app->setUserState('com_componentbuilder.success_message',
|
||||
CFactory::_('Placeholder')->update(
|
||||
implode(PHP_EOL, $message),
|
||||
CFactory::_('Content')->active
|
||||
CFactory::_('Compiler.Builder.Content.One')->allActive()
|
||||
)
|
||||
);
|
||||
// set redirect
|
||||
@ -318,9 +320,9 @@ class ComponentbuilderControllerCompiler extends AdminController
|
||||
$fileNames = array();
|
||||
$fileNames[] = $app->getUserState('com_componentbuilder.component_folder_name', null);
|
||||
// check if we have modules
|
||||
$fileNames = ComponentbuilderHelper::mergeArrays(array($fileNames, $app->getUserState('com_componentbuilder.modules_folder_name', array()) ));
|
||||
$fileNames = UtilitiesArrayHelper::merge(array($fileNames, $app->getUserState('com_componentbuilder.modules_folder_name', array()) ));
|
||||
// check if we have plugins
|
||||
$fileNames = ComponentbuilderHelper::mergeArrays(array($fileNames, $app->getUserState('com_componentbuilder.plugins_folder_name', array()) ));
|
||||
$fileNames = UtilitiesArrayHelper::merge(array($fileNames, $app->getUserState('com_componentbuilder.plugins_folder_name', array()) ));
|
||||
|
||||
// wipe out the user c-m-p since we are done with them all
|
||||
$app->setUserState('com_componentbuilder.component_folder_name', '');
|
||||
@ -341,12 +343,12 @@ class ComponentbuilderControllerCompiler extends AdminController
|
||||
}
|
||||
}
|
||||
// catch errors
|
||||
if (ComponentbuilderHelper::checkArray($_message['error']))
|
||||
if (UtilitiesArrayHelper::check($_message['error']))
|
||||
{
|
||||
$app->enqueueMessage(implode('<br />', $_message['error']), 'Error');
|
||||
}
|
||||
// build success message
|
||||
if (ComponentbuilderHelper::checkArray($_message['success']))
|
||||
if (UtilitiesArrayHelper::check($_message['success']))
|
||||
{
|
||||
$this->setRedirect($redirect_url, implode('<br />', $_message['success']), 'message');
|
||||
return true;
|
||||
@ -534,7 +536,7 @@ class ComponentbuilderControllerCompiler extends AdminController
|
||||
// run expansion via API
|
||||
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
|
||||
// is there a message returned
|
||||
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
|
||||
if (!is_numeric($result) && StringHelper::check($result))
|
||||
{
|
||||
$this->setRedirect($redirect_url, $result);
|
||||
return true;
|
||||
@ -615,7 +617,7 @@ class ComponentbuilderControllerCompiler extends AdminController
|
||||
// run translator via API
|
||||
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.translator');
|
||||
// is there a message returned
|
||||
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
|
||||
if (!is_numeric($result) && StringHelper::check($result))
|
||||
{
|
||||
$this->setRedirect($redirect_url, $result);
|
||||
return true;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_admin_views extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_admin_views.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_admin_views extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $recordId) && $user->authorise('component_admin_views.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $recordId) && $user->authorise('component_admin_views.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_config extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_config.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_config extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $recordId) && $user->authorise('component_config.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $recordId) && $user->authorise('component_config.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_custom_admin_menus.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $recordId) && $user->authorise('component_custom_admin_menus.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $recordId) && $user->authorise('component_custom_admin_menus.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_custom_admin_views.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $recordId) && $user->authorise('component_custom_admin_views.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $recordId) && $user->authorise('component_custom_admin_views.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_dashboard extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_dashboard.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_dashboard extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $recordId) && $user->authorise('component_dashboard.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $recordId) && $user->authorise('component_dashboard.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_files_folders.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $recordId) && $user->authorise('component_files_folders.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $recordId) && $user->authorise('component_files_folders.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_modules extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_modules.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_modules extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_modules.access', 'com_componentbuilder.component_modules.' . (int) $recordId) && $user->authorise('component_modules.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_modules.access', 'com_componentbuilder.component_modules.' . (int) $recordId) && $user->authorise('component_modules.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_mysql_tweaks.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $recordId) && $user->authorise('component_mysql_tweaks.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $recordId) && $user->authorise('component_mysql_tweaks.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_placeholders extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_placeholders.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_placeholders extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_placeholders.access', 'com_componentbuilder.component_placeholders.' . (int) $recordId) && $user->authorise('component_placeholders.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_placeholders.access', 'com_componentbuilder.component_placeholders.' . (int) $recordId) && $user->authorise('component_placeholders.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_plugins extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_plugins.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_plugins extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_plugins.access', 'com_componentbuilder.component_plugins.' . (int) $recordId) && $user->authorise('component_plugins.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_plugins.access', 'com_componentbuilder.component_plugins.' . (int) $recordId) && $user->authorise('component_plugins.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_site_views extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_site_views.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_site_views extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $recordId) && $user->authorise('component_site_views.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $recordId) && $user->authorise('component_site_views.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
/**
|
||||
* Component_updates Form Controller
|
||||
@ -62,7 +64,7 @@ class ComponentbuilderControllerComponent_updates extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('component_updates.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +87,7 @@ class ComponentbuilderControllerComponent_updates extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $recordId) && $user->authorise('component_updates.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $recordId) && $user->authorise('component_updates.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
@ -332,9 +334,9 @@ class ComponentbuilderControllerComponent_updates extends FormController
|
||||
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $validData['joomla_component'];
|
||||
if (ComponentbuilderHelper::checkArray($version_update)
|
||||
if (UtilitiesArrayHelper::check($version_update)
|
||||
&& ($component_version = end($version_update)['version'])
|
||||
&& ComponentbuilderHelper::checkString($component_version))
|
||||
&& StringHelper::check($component_version))
|
||||
{
|
||||
$objectUpdate->component_version = $component_version;
|
||||
}
|
||||
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_admin_views extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_config extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_custom_admin_menus extends AdminContr
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_custom_admin_views extends AdminContr
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_dashboard extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_files_folders extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_modules extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_mysql_tweaks extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_placeholders extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_plugins extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_site_views extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_updates extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerCustom_admin_view extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return parent::allowAdd($data);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerCustom_admin_view extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $recordId) && $user->authorise('custom_admin_view.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $recordId) && $user->authorise('custom_admin_view.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -115,4 +115,4 @@ class ComponentbuilderControllerCustom_admin_views extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerCustom_code extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('custom_code.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerCustom_code extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $recordId) && $user->authorise('custom_code.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $recordId) && $user->authorise('custom_code.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
/**
|
||||
* Custom_codes Admin Controller
|
||||
@ -131,7 +132,7 @@ class ComponentbuilderControllerCustom_codes extends AdminController
|
||||
// run expansion via API
|
||||
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
|
||||
// is there a message returned
|
||||
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
|
||||
if (!is_numeric($result) && StringHelper::check($result))
|
||||
{
|
||||
$this->setRedirect($redirect_url, $result);
|
||||
return true;
|
||||
@ -147,4 +148,4 @@ class ComponentbuilderControllerCustom_codes extends AdminController
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerDynamic_get extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('dynamic_get.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerDynamic_get extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $recordId) && $user->authorise('dynamic_get.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $recordId) && $user->authorise('dynamic_get.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
/**
|
||||
* Dynamic_gets Admin Controller
|
||||
@ -131,7 +132,7 @@ class ComponentbuilderControllerDynamic_gets extends AdminController
|
||||
// run expansion via API
|
||||
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
|
||||
// is there a message returned
|
||||
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
|
||||
if (!is_numeric($result) && StringHelper::check($result))
|
||||
{
|
||||
$this->setRedirect($redirect_url, $result);
|
||||
return true;
|
||||
@ -147,4 +148,4 @@ class ComponentbuilderControllerDynamic_gets extends AdminController
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerField extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('field.create', $this->option);
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
/**
|
||||
* Fields Admin Controller
|
||||
@ -131,7 +132,7 @@ class ComponentbuilderControllerFields extends AdminController
|
||||
// run expansion via API
|
||||
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
|
||||
// is there a message returned
|
||||
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
|
||||
if (!is_numeric($result) && StringHelper::check($result))
|
||||
{
|
||||
$this->setRedirect($redirect_url, $result);
|
||||
return true;
|
||||
@ -147,4 +148,4 @@ class ComponentbuilderControllerFields extends AdminController
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerFieldtype extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('fieldtype.create', $this->option);
|
||||
}
|
||||
|
||||
|
@ -106,4 +106,4 @@ class ComponentbuilderControllerFieldtypes extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=fieldtypes', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerHelp_document extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('help_document.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerHelp_document extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $recordId) && $user->authorise('help_document.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $recordId) && $user->authorise('help_document.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -106,4 +106,4 @@ class ComponentbuilderControllerHelp_documents extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=help_documents', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -87,7 +87,7 @@ class ComponentbuilderControllerJoomla_component extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('joomla_component.create', $this->option);
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ class ComponentbuilderControllerJoomla_component extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $recordId) && $user->authorise('joomla_component.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $recordId) && $user->authorise('joomla_component.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -18,6 +18,7 @@ use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
|
||||
use VDM\Joomla\Utilities\ArrayHelper as JCBArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use VDM\Joomla\Utilities\ObjectHelper;
|
||||
|
||||
/**
|
||||
* Joomla_components Admin Controller
|
||||
@ -135,7 +136,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
|
||||
// run expansion via API
|
||||
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
|
||||
// is there a message returned
|
||||
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
|
||||
if (!is_numeric($result) && StringHelper::check($result))
|
||||
{
|
||||
$this->setRedirect($redirect_url, $result);
|
||||
return true;
|
||||
@ -294,7 +295,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
|
||||
public function backup()
|
||||
{
|
||||
// get params first
|
||||
if (!isset($this->params) || !ComponentbuilderHelper::checkObject($this->params))
|
||||
if (!isset($this->params) || !ObjectHelper::check($this->params))
|
||||
{
|
||||
$this->params = JComponentHelper::getParams('com_componentbuilder');
|
||||
}
|
||||
@ -314,54 +315,54 @@ class ComponentbuilderControllerJoomla_components extends AdminController
|
||||
// manual backup message
|
||||
$backupNotice = array();
|
||||
// get the data to export
|
||||
if (ComponentbuilderHelper::checkArray($pks) && $model->getSmartExport($pks))
|
||||
if (JCBArrayHelper::check($pks) && $model->getSmartExport($pks))
|
||||
{
|
||||
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY');
|
||||
$backupNoticeStatus = 'Success';
|
||||
// set the key string
|
||||
if (componentbuilderHelper::checkString($model->key) && strlen($model->key) == 32)
|
||||
if (StringHelper::check($model->key) && strlen($model->key) == 32)
|
||||
{
|
||||
$textNotice = array();
|
||||
$keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
|
||||
$keyNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '</p>';
|
||||
$textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key);
|
||||
// set the package owner info
|
||||
if ((isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner'])))
|
||||
if ((isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner'])))
|
||||
{
|
||||
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '</h2>';
|
||||
$textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS');
|
||||
$ownerDetails .= '<ul>';
|
||||
if (isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company']))
|
||||
if (isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']);
|
||||
}
|
||||
// add value only if set
|
||||
if (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner']))
|
||||
if (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']);
|
||||
}
|
||||
// add value only if set
|
||||
if (isset($model->info['getKeyFrom']['website']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['website']))
|
||||
if (isset($model->info['getKeyFrom']['website']) && StringHelper::check($model->info['getKeyFrom']['website']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']);
|
||||
}
|
||||
// add value only if set
|
||||
if (isset($model->info['getKeyFrom']['email']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['email']))
|
||||
if (isset($model->info['getKeyFrom']['email']) && StringHelper::check($model->info['getKeyFrom']['email']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']);
|
||||
}
|
||||
// add value only if set
|
||||
if (isset($model->info['getKeyFrom']['license']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['license']))
|
||||
if (isset($model->info['getKeyFrom']['license']) && StringHelper::check($model->info['getKeyFrom']['license']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']);
|
||||
}
|
||||
// add value only if set
|
||||
if (isset($model->info['getKeyFrom']['copyright']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['copyright']))
|
||||
if (isset($model->info['getKeyFrom']['copyright']) && StringHelper::check($model->info['getKeyFrom']['copyright']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']);
|
||||
@ -417,12 +418,12 @@ class ComponentbuilderControllerJoomla_components extends AdminController
|
||||
{
|
||||
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR');
|
||||
$backupNoticeStatus = 'Error';
|
||||
if (componentbuilderHelper::checkString($model->packagePath))
|
||||
if (StringHelper::check($model->packagePath))
|
||||
{
|
||||
// clear all if not successful
|
||||
ComponentbuilderHelper::removeFolder($model->packagePath);
|
||||
}
|
||||
if (componentbuilderHelper::checkString($model->zipPath))
|
||||
if (StringHelper::check($model->zipPath))
|
||||
{
|
||||
// clear all if not successful
|
||||
JFile::delete($model->zipPath);
|
||||
@ -509,4 +510,4 @@ class ComponentbuilderControllerJoomla_components extends AdminController
|
||||
return JFactory::getUser();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_module extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('joomla_module.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerJoomla_module extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('joomla_module.access', 'com_componentbuilder.joomla_module.' . (int) $recordId) && $user->authorise('joomla_module.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('joomla_module.access', 'com_componentbuilder.joomla_module.' . (int) $recordId) && $user->authorise('joomla_module.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('joomla_module_files_folders_urls.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder.joomla_module_files_folders_urls.' . (int) $recordId) && $user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder.joomla_module_files_folders_urls.' . (int) $recordId) && $user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
/**
|
||||
* Joomla_module_updates Form Controller
|
||||
@ -62,7 +64,7 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('joomla_module_updates.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +87,7 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('joomla_module_updates.access', 'com_componentbuilder.joomla_module_updates.' . (int) $recordId) && $user->authorise('joomla_module_updates.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('joomla_module_updates.access', 'com_componentbuilder.joomla_module_updates.' . (int) $recordId) && $user->authorise('joomla_module_updates.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
@ -323,9 +325,9 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
|
||||
{
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $validData['joomla_plugin'];
|
||||
if (isset($validData['version_update']) && ComponentbuilderHelper::checkArray($validData['version_update'])
|
||||
if (isset($validData['version_update']) && UtilitiesArrayHelper::check($validData['version_update'])
|
||||
&& ($plugin_version = end($validData['version_update'])['version'])
|
||||
&& ComponentbuilderHelper::checkString($plugin_version))
|
||||
&& StringHelper::check($plugin_version))
|
||||
{
|
||||
$objectUpdate->plugin_version = $plugin_version;
|
||||
}
|
||||
|
@ -115,4 +115,4 @@ class ComponentbuilderControllerJoomla_modules extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerJoomla_modules_files_folders_urls extends AdminC
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerJoomla_modules_updates extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_plugin extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('joomla_plugin.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerJoomla_plugin extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('joomla_plugin.access', 'com_componentbuilder.joomla_plugin.' . (int) $recordId) && $user->authorise('joomla_plugin.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('joomla_plugin.access', 'com_componentbuilder.joomla_plugin.' . (int) $recordId) && $user->authorise('joomla_plugin.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('joomla_plugin_files_folders_urls.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('joomla_plugin_files_folders_urls.access', 'com_componentbuilder.joomla_plugin_files_folders_urls.' . (int) $recordId) && $user->authorise('joomla_plugin_files_folders_urls.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('joomla_plugin_files_folders_urls.access', 'com_componentbuilder.joomla_plugin_files_folders_urls.' . (int) $recordId) && $user->authorise('joomla_plugin_files_folders_urls.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return parent::allowAdd($data);
|
||||
}
|
||||
|
||||
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerJoomla_plugin_groups extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
/**
|
||||
* Joomla_plugin_updates Form Controller
|
||||
@ -62,7 +64,7 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('joomla_plugin_updates.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +87,7 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('joomla_plugin_updates.access', 'com_componentbuilder.joomla_plugin_updates.' . (int) $recordId) && $user->authorise('joomla_plugin_updates.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('joomla_plugin_updates.access', 'com_componentbuilder.joomla_plugin_updates.' . (int) $recordId) && $user->authorise('joomla_plugin_updates.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
@ -323,9 +325,9 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController
|
||||
{
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $validData['joomla_plugin'];
|
||||
if (isset($validData['version_update']) && ComponentbuilderHelper::checkArray($validData['version_update'])
|
||||
if (isset($validData['version_update']) && UtilitiesArrayHelper::check($validData['version_update'])
|
||||
&& ($plugin_version = end($validData['version_update'])['version'])
|
||||
&& ComponentbuilderHelper::checkString($plugin_version))
|
||||
&& StringHelper::check($plugin_version))
|
||||
{
|
||||
$objectUpdate->plugin_version = $plugin_version;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
/**
|
||||
* Joomla_plugins Admin Controller
|
||||
@ -68,7 +69,7 @@ class ComponentbuilderControllerJoomla_plugins extends AdminController
|
||||
// run expansion via API
|
||||
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
|
||||
// is there a message returned
|
||||
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
|
||||
if (!is_numeric($result) && StringHelper::check($result))
|
||||
{
|
||||
$this->setRedirect($redirect_url, $result);
|
||||
return true;
|
||||
@ -136,4 +137,4 @@ class ComponentbuilderControllerJoomla_plugins extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerJoomla_plugins_files_folders_urls extends AdminC
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerJoomla_plugins_updates extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerLanguage extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('language.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerLanguage extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $recordId) && $user->authorise('language.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $recordId) && $user->authorise('language.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerLanguage_translation extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('language_translation.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerLanguage_translation extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $recordId) && $user->authorise('language_translation.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $recordId) && $user->authorise('language_translation.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -106,4 +106,4 @@ class ComponentbuilderControllerLanguage_translations extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -133,4 +133,4 @@ class ComponentbuilderControllerLanguages extends AdminController
|
||||
$this->setRedirect($redirect_url);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerLayout extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return parent::allowAdd($data);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerLayout extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $recordId) && $user->authorise('layout.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $recordId) && $user->authorise('layout.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -115,4 +115,4 @@ class ComponentbuilderControllerLayouts extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -52,4 +52,4 @@ class ComponentbuilderControllerLibraries extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerLibraries_config extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerLibraries_files_folders_urls extends AdminContro
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerLibrary extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('library.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerLibrary extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('library.access', 'com_componentbuilder.library.' . (int) $recordId) && $user->authorise('library.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('library.access', 'com_componentbuilder.library.' . (int) $recordId) && $user->authorise('library.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerLibrary_config extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('library_config.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerLibrary_config extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('library_config.access', 'com_componentbuilder.library_config.' . (int) $recordId) && $user->authorise('library_config.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('library_config.access', 'com_componentbuilder.library_config.' . (int) $recordId) && $user->authorise('library_config.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('library_files_folders_urls.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('library_files_folders_urls.access', 'com_componentbuilder.library_files_folders_urls.' . (int) $recordId) && $user->authorise('library_files_folders_urls.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('library_files_folders_urls.access', 'com_componentbuilder.library_files_folders_urls.' . (int) $recordId) && $user->authorise('library_files_folders_urls.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerPlaceholder extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('placeholder.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerPlaceholder extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('placeholder.access', 'com_componentbuilder.placeholder.' . (int) $recordId) && $user->authorise('placeholder.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('placeholder.access', 'com_componentbuilder.placeholder.' . (int) $recordId) && $user->authorise('placeholder.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -106,4 +106,4 @@ class ComponentbuilderControllerPlaceholders extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=placeholders', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Componentbuilder\Power\Factory;
|
||||
|
||||
/**
|
||||
* Power Form Controller
|
||||
@ -42,92 +43,60 @@ class ComponentbuilderControllerPower extends FormController
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function syncPowers()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// get IDS of the selected powers
|
||||
$item = $this->input->post->get('jform', array(), 'array');
|
||||
|
||||
// check if there is any selections
|
||||
if (empty($item['id']))
|
||||
{
|
||||
// set error message
|
||||
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_NOT_SAVED').'</h1>';
|
||||
$message .= '<p>'.JText::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE').'</p>';
|
||||
// set redirect
|
||||
$redirect_url = \JRoute::_(
|
||||
'index.php?option=com_componentbuilder&view=power'
|
||||
. $this->getRedirectToItemAppend(), false
|
||||
);
|
||||
$this->setRedirect($redirect_url, $message, 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if user has the right
|
||||
$user = JFactory::getUser();
|
||||
if($user->authorise('power.sync', 'com_componentbuilder'))
|
||||
{
|
||||
// set success message
|
||||
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_THIS_SYNC_FEATURE_IS_STILL_UNDER_DEVELOPMENT').'</h1>';
|
||||
$message .= '<p>'.JText::sprintf('COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_SOON_ANDOR_FOLLOW_THE_PROGRESS_ON_SGITVDMDEVA', '<a href="https://git.vdm.dev/joomla/Component-Builder/issues/984" target="_blank">').'</p>';
|
||||
// set redirect
|
||||
$redirect_url = \JRoute::_(
|
||||
'index.php?option=com_componentbuilder&view=power'
|
||||
. $this->getRedirectToItemAppend($item['id']), false
|
||||
);
|
||||
$this->setRedirect($redirect_url, $message);
|
||||
return true;
|
||||
}
|
||||
// set redirect
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
|
||||
$this->setRedirect($redirect_url);
|
||||
return false;
|
||||
}
|
||||
|
||||
public function resetPowers()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// get IDS of the selected powers
|
||||
// get Item posted
|
||||
$item = $this->input->post->get('jform', array(), 'array');
|
||||
|
||||
// check if there is any selections
|
||||
if (empty($item['id']))
|
||||
{
|
||||
// set error message
|
||||
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_NOT_SAVED').'</h1>';
|
||||
$message .= '<p>'.JText::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE').'</p>';
|
||||
// set redirect
|
||||
$redirect_url = \JRoute::_(
|
||||
'index.php?option=com_componentbuilder&view=power'
|
||||
. $this->getRedirectToItemAppend(), false
|
||||
);
|
||||
$this->setRedirect($redirect_url, $message, 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if user has the right
|
||||
$user = JFactory::getUser();
|
||||
if($user->authorise('power.reset', 'com_componentbuilder'))
|
||||
|
||||
// set default error message
|
||||
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
|
||||
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_POWER') . '</p>';
|
||||
$status = 'error';
|
||||
$success = false;
|
||||
|
||||
// load the ID
|
||||
$id = $item['id'] ?? null;
|
||||
$guid = $item['guid'] ?? null;
|
||||
|
||||
// check if there is any selections
|
||||
if ($id === null || $guid === null)
|
||||
{
|
||||
// set success message
|
||||
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_THIS_RESET_FEATURE_IS_STILL_UNDER_DEVELOPMENT').'</h1>';
|
||||
$message .= '<p>'.JText::sprintf('COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_SOON_ANDOR_FOLLOW_THE_PROGRESS_ON_SGITVDMDEVA', '<a href="https://git.vdm.dev/joomla/Component-Builder/issues/984" target="_blank">').'</p>';
|
||||
// set redirect
|
||||
$redirect_url = \JRoute::_(
|
||||
'index.php?option=com_componentbuilder&view=power'
|
||||
. $this->getRedirectToItemAppend($item['id']), false
|
||||
);
|
||||
$this->setRedirect($redirect_url, $message);
|
||||
return true;
|
||||
// set error message
|
||||
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
|
||||
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
|
||||
}
|
||||
elseif($user->authorise('power.reset', 'com_componentbuilder'))
|
||||
{
|
||||
if (Factory::_('Superpower')->reset([$guid]))
|
||||
{
|
||||
// set success message
|
||||
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_SUCCESS').'</h1>';
|
||||
$message .= '<p>'.JText::_('COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_RESET').'</p>';
|
||||
$status = 'success';
|
||||
$success = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
||||
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_POWER_HAS_FAILED') . '</p>';
|
||||
}
|
||||
}
|
||||
|
||||
// set redirect
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
|
||||
$this->setRedirect($redirect_url);
|
||||
return false;
|
||||
$redirect_url = \JRoute::_(
|
||||
'index.php?option=com_componentbuilder&view=power'
|
||||
. $this->getRedirectToItemAppend($id), $success
|
||||
);
|
||||
|
||||
$this->setRedirect($redirect_url, $message, $status);
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -150,7 +119,7 @@ class ComponentbuilderControllerPower extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('power.create', $this->option);
|
||||
}
|
||||
|
||||
@ -173,7 +142,7 @@ class ComponentbuilderControllerPower extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('power.access', 'com_componentbuilder.power.' . (int) $recordId) && $user->authorise('power.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('power.access', 'com_componentbuilder.power.' . (int) $recordId) && $user->authorise('power.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Power\Factory;
|
||||
|
||||
/**
|
||||
* Powers Admin Controller
|
||||
@ -68,7 +70,7 @@ class ComponentbuilderControllerPowers extends AdminController
|
||||
// run expansion via API
|
||||
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
|
||||
// is there a message returned
|
||||
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
|
||||
if (!is_numeric($result) && StringHelper::check($result))
|
||||
{
|
||||
$this->setRedirect($redirect_url, $result);
|
||||
return true;
|
||||
@ -88,63 +90,39 @@ class ComponentbuilderControllerPowers extends AdminController
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// check if user has the right
|
||||
$user = JFactory::getUser();
|
||||
|
||||
// set default error message
|
||||
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
|
||||
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_POWERS') . '</p>';
|
||||
$status = 'error';
|
||||
$success = false;
|
||||
|
||||
if($user->authorise('power.init', 'com_componentbuilder'))
|
||||
{
|
||||
// set success message
|
||||
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_THIS_INIT_FEATURE_IS_STILL_UNDER_DEVELOPMENT').'</h1>';
|
||||
$message .= '<p>'.JText::sprintf('COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_SOON_ANDOR_FOLLOW_THE_PROGRESS_ON_SGITVDMDEVA', '<a href="https://git.vdm.dev/joomla/Component-Builder/issues/984" target="_blank">').'</p>';
|
||||
// set redirect
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
|
||||
$this->setRedirect($redirect_url, $message);
|
||||
return true;
|
||||
if (Factory::_('Superpower')->init())
|
||||
{
|
||||
// set success message
|
||||
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_POWERS') . '</h1>';
|
||||
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES') . '</p>';
|
||||
|
||||
$status = 'success';
|
||||
$success = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . '</h1>';
|
||||
$message .= '<p>' . JText::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_POWERS_HAS_FAILED') . '</p>';
|
||||
}
|
||||
}
|
||||
|
||||
// set redirect
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
|
||||
$this->setRedirect($redirect_url);
|
||||
return false;
|
||||
}
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', $success);
|
||||
$this->setRedirect($redirect_url, $message, $status);
|
||||
|
||||
public function syncPowers()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// get IDS of the selected powers
|
||||
$pks = $this->input->post->get('cid', [], 'array');
|
||||
|
||||
// Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
|
||||
// check if there is any selections
|
||||
if ($pks == [])
|
||||
{
|
||||
// set error message
|
||||
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').'</h1>';
|
||||
$message .= '<p>'.JText::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'</p>';
|
||||
// set redirect
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
|
||||
$this->setRedirect($redirect_url, $message, 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if user has the right
|
||||
$user = JFactory::getUser();
|
||||
if($user->authorise('power.sync', 'com_componentbuilder'))
|
||||
{
|
||||
// set success message
|
||||
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_THIS_SYNC_FEATURE_IS_STILL_UNDER_DEVELOPMENT').'</h1>';
|
||||
$message .= '<p>'.JText::sprintf('COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_SOON_ANDOR_FOLLOW_THE_PROGRESS_ON_SGITVDMDEVA', '<a href="https://git.vdm.dev/joomla/Component-Builder/issues/984" target="_blank">').'</p>';
|
||||
// set redirect
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
|
||||
$this->setRedirect($redirect_url, $message);
|
||||
return true;
|
||||
}
|
||||
// set redirect
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
|
||||
$this->setRedirect($redirect_url);
|
||||
return false;
|
||||
return $success;
|
||||
}
|
||||
|
||||
public function resetPowers()
|
||||
@ -186,6 +164,5 @@ class ComponentbuilderControllerPowers extends AdminController
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false);
|
||||
$this->setRedirect($redirect_url);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerServer extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('server.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerServer extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('server.access', 'com_componentbuilder.server.' . (int) $recordId) && $user->authorise('server.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('server.access', 'com_componentbuilder.server.' . (int) $recordId) && $user->authorise('server.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -106,4 +106,4 @@ class ComponentbuilderControllerServers extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=servers', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerSite_view extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return parent::allowAdd($data);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerSite_view extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('site_view.access', 'com_componentbuilder.site_view.' . (int) $recordId) && $user->authorise('site_view.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('site_view.access', 'com_componentbuilder.site_view.' . (int) $recordId) && $user->authorise('site_view.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -115,4 +115,4 @@ class ComponentbuilderControllerSite_views extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerSnippet extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return parent::allowAdd($data);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerSnippet extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('snippet.access', 'com_componentbuilder.snippet.' . (int) $recordId) && $user->authorise('snippet.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('snippet.access', 'com_componentbuilder.snippet.' . (int) $recordId) && $user->authorise('snippet.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerSnippet_type extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('snippet_type.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerSnippet_type extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('snippet_type.access', 'com_componentbuilder.snippet_type.' . (int) $recordId) && $user->authorise('snippet_type.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('snippet_type.access', 'com_componentbuilder.snippet_type.' . (int) $recordId) && $user->authorise('snippet_type.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -43,4 +43,4 @@ class ComponentbuilderControllerSnippet_types extends AdminController
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
|
||||
/**
|
||||
* Snippets Admin Controller
|
||||
@ -132,7 +133,7 @@ class ComponentbuilderControllerSnippets extends AdminController
|
||||
// Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// check if there is any selections
|
||||
if (!ComponentbuilderHelper::checkArray($pks))
|
||||
if (!UtilitiesArrayHelper::check($pks))
|
||||
{
|
||||
// Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COMPONENTBUILDER_NO_SNIPPETS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN');
|
||||
@ -179,4 +180,4 @@ class ComponentbuilderControllerSnippets extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerTemplate extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return parent::allowAdd($data);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerTemplate extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('template.access', 'com_componentbuilder.template.' . (int) $recordId) && $user->authorise('template.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('template.access', 'com_componentbuilder.template.' . (int) $recordId) && $user->authorise('template.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -115,4 +115,4 @@ class ComponentbuilderControllerTemplates extends AdminController
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ class ComponentbuilderControllerValidation_rule extends FormController
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('validation_rule.create', $this->option);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class ComponentbuilderControllerValidation_rule extends FormController
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('validation_rule.access', 'com_componentbuilder.validation_rule.' . (int) $recordId) && $user->authorise('validation_rule.access', 'com_componentbuilder'));
|
||||
$access = ($user->authorise('validation_rule.access', 'com_componentbuilder.validation_rule.' . (int) $recordId) && $user->authorise('validation_rule.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
|
@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
/**
|
||||
* Validation_rules Admin Controller
|
||||
@ -131,7 +132,7 @@ class ComponentbuilderControllerValidation_rules extends AdminController
|
||||
// run expansion via API
|
||||
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
|
||||
// is there a message returned
|
||||
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
|
||||
if (!is_numeric($result) && StringHelper::check($result))
|
||||
{
|
||||
$this->setRedirect($redirect_url, $result);
|
||||
return true;
|
||||
@ -147,4 +148,4 @@ class ComponentbuilderControllerValidation_rules extends AdminController
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user