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:
@ -16,6 +16,9 @@ use Joomla\CMS\MVC\Model\AdminModel;
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\GuidHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
|
||||
/**
|
||||
* Componentbuilder Snippet Admin Model
|
||||
@ -241,9 +244,9 @@ class ComponentbuilderModelSnippet extends AdminModel
|
||||
// Only load the GUID if new item (or empty)
|
||||
if (0 == $id || !($val = $form->getValue('guid')))
|
||||
{
|
||||
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
|
||||
$form->setValue('guid', null, GuidHelper::get());
|
||||
}
|
||||
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
@ -305,7 +308,7 @@ class ComponentbuilderModelSnippet extends AdminModel
|
||||
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::canEditState($record);
|
||||
}
|
||||
|
||||
@ -575,7 +578,7 @@ class ComponentbuilderModelSnippet extends AdminModel
|
||||
$this->canDo = ComponentbuilderHelper::getActions('snippet');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('core.create') || !$this->canDo->get('core.batch'))
|
||||
if (!$this->canDo->get('core.create') && !$this->canDo->get('snippet.batch'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -718,7 +721,7 @@ class ComponentbuilderModelSnippet extends AdminModel
|
||||
$this->canDo = ComponentbuilderHelper::getActions('snippet');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('core.edit') && !$this->canDo->get('core.batch'))
|
||||
if (!$this->canDo->get('core.edit') && !$this->canDo->get('snippet.batch'))
|
||||
{
|
||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
|
||||
return false;
|
||||
@ -836,7 +839,7 @@ class ComponentbuilderModelSnippet extends AdminModel
|
||||
// get the library name
|
||||
$type = ($name = ComponentbuilderHelper::getVar('snippet_type', $item['type'], 'id', 'name')) ? $name:'No Library';
|
||||
// build the filename
|
||||
$filename = ComponentbuilderHelper::safeString($library . ' - (' . $type . ') ' . $item['name'], 'filename', '', false). '.json';
|
||||
$filename = UtilitiesStringHelper::safe($library . ' - (' . $type . ') ' . $item['name'], 'filename', '', false). '.json';
|
||||
// now get the contributor details (slow)
|
||||
$contributor = ComponentbuilderHelper::getContributorDetails($filename);
|
||||
// now update the local snippet contributor details
|
||||
@ -850,15 +853,15 @@ class ComponentbuilderModelSnippet extends AdminModel
|
||||
if (empty($data['guid']) && $data['id'] > 0)
|
||||
{
|
||||
// get the existing one
|
||||
$data['guid'] = (string) ComponentbuilderHelper::getVar('snippet', $data['id'], 'id', 'guid');
|
||||
$data['guid'] = (string) GetHelper::var('snippet', $data['id'], 'id', 'guid');
|
||||
}
|
||||
|
||||
// Set the GUID if empty or not valid
|
||||
while (!ComponentbuilderHelper::validGUID($data['guid'], "snippet", $data['id']))
|
||||
while (!GuidHelper::valid($data['guid'], "snippet", $data['id']))
|
||||
{
|
||||
// must always be set
|
||||
$data['guid'] = (string) ComponentbuilderHelper::GUID();
|
||||
}
|
||||
|
||||
$data['guid'] = (string) GuidHelper::get();
|
||||
}
|
||||
|
||||
// Set the snippet string to base64 string.
|
||||
if (isset($data['snippet']))
|
||||
|
Reference in New Issue
Block a user