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:
@@ -12,7 +12,6 @@
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Field;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\String\TypeHelper;
|
||||
@@ -20,7 +19,7 @@ use VDM\Joomla\Utilities\String\FieldHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Field\UniqueName;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Registry;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName;
|
||||
|
||||
|
||||
/**
|
||||
@@ -30,14 +29,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Registry;
|
||||
*/
|
||||
class Name
|
||||
{
|
||||
/**
|
||||
* The compiler registry
|
||||
*
|
||||
* @var Registry
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Registry $registry;
|
||||
|
||||
/**
|
||||
* Unique Field Names
|
||||
*
|
||||
@@ -47,35 +38,44 @@ class Name
|
||||
protected array $unique;
|
||||
|
||||
/**
|
||||
* Compiler Placeholder
|
||||
* The Placeholder Class.
|
||||
*
|
||||
* @var Placeholder
|
||||
* @var Placeholder
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Placeholder $placeholder;
|
||||
|
||||
/**
|
||||
* Compiler Field Unique Name
|
||||
* The UniqueName Class.
|
||||
*
|
||||
* @var UniqueName
|
||||
* @var UniqueName
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected UniqueName $uniqueName;
|
||||
protected UniqueName $uniquename;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* The CategoryOtherName Class.
|
||||
*
|
||||
* @param Placeholder|null $placeholder The compiler component placeholder object.
|
||||
* @param UniqueName|null $uniqueName The compiler field unique name object.
|
||||
* @param Registry|null $registry The compiler registry object.
|
||||
* @var CategoryOtherName
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CategoryOtherName $categoryothername;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Placeholder $placeholder The Placeholder Class.
|
||||
* @param UniqueName $uniquename The UniqueName Class.
|
||||
* @param CategoryOtherName $categoryothername The CategoryOtherName Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Placeholder $placeholder = null, ?UniqueName $uniqueName = null, ?Registry $registry = null)
|
||||
public function __construct(Placeholder $placeholder, UniqueName $uniquename,
|
||||
CategoryOtherName $categoryothername)
|
||||
{
|
||||
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
|
||||
$this->uniqueName = $uniqueName ?: Compiler::_('Field.Unique.Name');
|
||||
$this->registry = $registry ?: Compiler::_('Registry');
|
||||
$this->placeholder = $placeholder;
|
||||
$this->uniquename = $uniquename;
|
||||
$this->categoryothername = $categoryothername;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,11 +91,8 @@ class Name
|
||||
public function get(array &$field, ?string $listViewName = null, string $amicably = ''): string
|
||||
{
|
||||
// return the unique name if already set
|
||||
if ($listViewName && StringHelper::check($listViewName)
|
||||
&& isset($field['hash'])
|
||||
&& isset(
|
||||
$this->unique[$listViewName . $amicably . $field['hash']]
|
||||
))
|
||||
if ($listViewName && StringHelper::check($listViewName) && isset($field['hash'])
|
||||
&& isset($this->unique[$listViewName . $amicably . $field['hash']]))
|
||||
{
|
||||
return $this->unique[$listViewName . $amicably . $field['hash']];
|
||||
}
|
||||
@@ -161,16 +158,14 @@ class Name
|
||||
$field['settings']->xml, 'view="', '"'
|
||||
)
|
||||
);
|
||||
|
||||
// This is to link other view category
|
||||
if (StringHelper::check($otherName)
|
||||
&& StringHelper::check(
|
||||
$otherViews
|
||||
) && StringHelper::check(
|
||||
$otherView
|
||||
))
|
||||
&& StringHelper::check($otherViews)
|
||||
&& StringHelper::check($otherView))
|
||||
{
|
||||
// set other category details
|
||||
$this->registry->set("category.other.name.${listViewName}", [
|
||||
$this->categoryothername->set($listViewName, [
|
||||
'name' => FieldHelper::safe(
|
||||
$otherName
|
||||
),
|
||||
@@ -220,7 +215,7 @@ class Name
|
||||
if (StringHelper::check($listViewName) && isset($field['hash']))
|
||||
{
|
||||
$this->unique[$listViewName . $amicably . $field['hash']]
|
||||
= $this->uniqueName->get($name, $listViewName . $amicably);
|
||||
= $this->uniquename->get($name, $listViewName . $amicably);
|
||||
|
||||
// now return the unique name
|
||||
return $this->unique[$listViewName . $amicably . $field['hash']];
|
||||
@@ -228,7 +223,6 @@ class Name
|
||||
|
||||
// fall back to global
|
||||
return $name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user