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:
2023-10-18 09:26:30 +02:00
parent a77eac9adf
commit e99899f6f1
632 changed files with 30604 additions and 16888 deletions

View File

@@ -14,6 +14,9 @@ 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\ObjectHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Api Form Controller
@@ -79,7 +82,7 @@ class ComponentbuilderControllerApi extends FormController
$messages = ComponentbuilderHelper::unlock($messages);
}
// check if we have any messages
if (ComponentbuilderHelper::checkArray($messages)) {
if (UtilitiesArrayHelper::check($messages)) {
$message[] = implode("<br />\n", $messages);
} else {
// var_dump($messages); // error debug message
@@ -108,7 +111,7 @@ class ComponentbuilderControllerApi extends FormController
$callback($model->messages);
}
// return messages if found
if (ComponentbuilderHelper::checkArray($message))
if (UtilitiesArrayHelper::check($message))
{
echo implode("<br />\n", $message);
}
@@ -135,7 +138,7 @@ class ComponentbuilderControllerApi extends FormController
public function expand()
{
// 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');
}
@@ -148,7 +151,7 @@ class ComponentbuilderControllerApi extends FormController
// get expansion components
$expansion = $this->params->get('expansion', null);
// check if they are set
if (ComponentbuilderHelper::checkObject($expansion))
if (ObjectHelper::check($expansion))
{
// check if user has the right
$user = $this->getApiUser();
@@ -165,7 +168,7 @@ class ComponentbuilderControllerApi extends FormController
$messages = ComponentbuilderHelper::unlock($messages);
}
// check if we have any messages
if (ComponentbuilderHelper::checkArray($messages)) {
if (UtilitiesArrayHelper::check($messages)) {
$message[] = implode("<br />\n", $messages);
} else {
// var_dump($messages); // error debug message
@@ -200,7 +203,7 @@ class ComponentbuilderControllerApi extends FormController
$callback($model->messages);
}
// return messages if found
if (1== $returnOptionsBuild && ComponentbuilderHelper::checkArray($message))
if (1== $returnOptionsBuild && UtilitiesArrayHelper::check($message))
{
echo implode("<br />\n", $message);
}
@@ -258,7 +261,7 @@ class ComponentbuilderControllerApi extends FormController
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');
}
@@ -278,54 +281,54 @@ class ComponentbuilderControllerApi extends FormController
// manual backup message
$backupNotice = array();
// get the data to export
if (ComponentbuilderHelper::checkArray($pks) && $model->getSmartExport($pks))
if (UtilitiesArrayHelper::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']);
@@ -381,12 +384,12 @@ class ComponentbuilderControllerApi extends FormController
{
$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);
@@ -432,7 +435,7 @@ class ComponentbuilderControllerApi extends FormController
// get TYPE
$TYPE = $input->server->get('HTTP_VDM_VALUE_TYPE', null, 'STRING');
// check if correct value is given
if (ComponentbuilderHelper::checkString($DATA) && ComponentbuilderHelper::checkString($TASK) && ComponentbuilderHelper::checkString($TYPE))
if (StringHelper::check($DATA) && StringHelper::check($TASK) && StringHelper::check($TYPE))
{
// get the type of values we are working with ( 2 = array; 1 = string)
$type = ComponentbuilderHelper::unlock($TYPE);
@@ -441,7 +444,7 @@ class ComponentbuilderControllerApi extends FormController
// get the task
$task = ComponentbuilderHelper::unlock($TASK);
// check the for a string
if (1 == $type && ComponentbuilderHelper::checkObject($dataValues) && ComponentbuilderHelper::checkString($task))
if (1 == $type && ObjectHelper::check($dataValues) && StringHelper::check($task))
{
// get model
$model = $this->getModel('api');
@@ -457,7 +460,7 @@ class ComponentbuilderControllerApi extends FormController
// run the model method
$result = $model->{$task}($dataValues);
// check if we have messages
if (ComponentbuilderHelper::checkArray($model->messages))
if (UtilitiesArrayHelper::check($model->messages))
{
// return locked values
echo ComponentbuilderHelper::lock($model->messages);