Release of v5.0.0-alpha8
Add power path override option on component level. Fix the sql build feature. #1032.
This commit is contained in:
1
libraries/vendor_jcb/VDM.Joomla/index.html
Normal file
1
libraries/vendor_jcb/VDM.Joomla/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,288 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Activeregistryinterface;
|
||||
|
||||
|
||||
/**
|
||||
* Active Storage Registry.
|
||||
*
|
||||
* Don't use this beyond 10 dimensional depth for best performance.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract class ActiveRegistry implements Activeregistryinterface
|
||||
{
|
||||
/**
|
||||
* The registry array.
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected array $active = [];
|
||||
|
||||
/**
|
||||
* Base switch to add values as string or array
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected bool $addAsArray = false;
|
||||
|
||||
/**
|
||||
* Check if the registry has any content.
|
||||
*
|
||||
* @return bool Returns true if the active array is not empty, false otherwise.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function isActive(): bool
|
||||
{
|
||||
return !empty($this->active);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all value from the active registry.
|
||||
*
|
||||
* @return array The values or empty array.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function allActive(): array
|
||||
{
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a value into the registry using multiple keys.
|
||||
*
|
||||
* @param mixed $value The value to set.
|
||||
* @param string ...$keys The keys to determine the location.
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the keys are not a number or string.
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function setActive($value, string ...$keys): void
|
||||
{
|
||||
if (!$this->validActiveKeys($keys))
|
||||
{
|
||||
throw new \InvalidArgumentException("Keys must only be strings or numbers to set any value.");
|
||||
}
|
||||
|
||||
$array = &$this->active;
|
||||
|
||||
foreach ($keys as $key)
|
||||
{
|
||||
if (!isset($array[$key]))
|
||||
{
|
||||
if (!is_array($array))
|
||||
{
|
||||
$path = '[' . implode('][', $keys) . ']';
|
||||
throw new \InvalidArgumentException("Attempted to use key '{$key}' on a non-array value: {$array}. Path: {$path} Value: {$value}");
|
||||
}
|
||||
|
||||
$array[$key] = [];
|
||||
}
|
||||
$array = &$array[$key];
|
||||
}
|
||||
|
||||
$array = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds content into the registry. If a key exists,
|
||||
* it either appends or concatenates based on the value's type.
|
||||
*
|
||||
* @param mixed $value The value to set.
|
||||
* @param bool|null $asArray Determines if the new value should be treated as an array.
|
||||
* Default is $addAsArray = false (if null) in base class.
|
||||
* Override in child class allowed set class property $addAsArray = true.
|
||||
* @param string ...$keys The keys to determine the location.
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the keys are not a number or string.
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function addActive($value, ?bool $asArray, string ...$keys): void
|
||||
{
|
||||
if (!$this->validActiveKeys($keys))
|
||||
{
|
||||
throw new \InvalidArgumentException("Keys must only be strings or numbers to add any value.");
|
||||
}
|
||||
|
||||
// null fallback to class value
|
||||
if ($asArray === null)
|
||||
{
|
||||
$asArray = $this->addAsArray;
|
||||
}
|
||||
|
||||
$array = &$this->active;
|
||||
|
||||
foreach ($keys as $key)
|
||||
{
|
||||
if (!isset($array[$key]))
|
||||
{
|
||||
if (!is_array($array))
|
||||
{
|
||||
$path = '[' . implode('][', $keys) . ']';
|
||||
throw new \InvalidArgumentException("Attempted to use key '{$key}' on a non-array value: {$array}. Path: {$path} Value: {$value}");
|
||||
}
|
||||
|
||||
$array[$key] = [];
|
||||
}
|
||||
$array = &$array[$key];
|
||||
}
|
||||
|
||||
// add string
|
||||
if (!$asArray && $array === [])
|
||||
{
|
||||
$array = '';
|
||||
}
|
||||
|
||||
// Handle the adding logic at the tip of the array
|
||||
if (is_array($array) || $asArray)
|
||||
{
|
||||
if (!is_array($array))
|
||||
{
|
||||
// Convert to array if it's not already an array
|
||||
$array = [$array];
|
||||
}
|
||||
$array[] = $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_string($value) || is_numeric($value))
|
||||
{
|
||||
$array .= (string) $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$array = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a value (or sub-array) from the registry using multiple keys.
|
||||
*
|
||||
* @param mixed $default The default value if not set.
|
||||
* @param string ...$keys The keys to determine the location.
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the keys are not a number or string.
|
||||
* @return mixed The value or sub-array from the storage. Null if the location doesn't exist.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getActive($default, string ...$keys)
|
||||
{
|
||||
if (!$this->validActiveKeys($keys))
|
||||
{
|
||||
throw new \InvalidArgumentException("Keys must only be strings or numbers to get any value.");
|
||||
}
|
||||
|
||||
$array = $this->active;
|
||||
|
||||
foreach ($keys as $key)
|
||||
{
|
||||
if (!isset($array[$key]))
|
||||
{
|
||||
return $default;
|
||||
}
|
||||
$array = $array[$key];
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a value (or sub-array) from the registry using multiple keys.
|
||||
*
|
||||
* @param string ...$keys The keys to determine the location.
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the keys are not a number or string.
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function removeActive(string ...$keys): void
|
||||
{
|
||||
if (!$this->validActiveKeys($keys))
|
||||
{
|
||||
throw new \InvalidArgumentException("Keys must only be strings or numbers to remove any value.");
|
||||
}
|
||||
|
||||
$array = &$this->active;
|
||||
$lastKey = array_pop($keys);
|
||||
|
||||
foreach ($keys as $key)
|
||||
{
|
||||
if (!isset($array[$key]))
|
||||
{
|
||||
return; // Exit early if the key doesn't exist
|
||||
}
|
||||
$array = &$array[$key];
|
||||
}
|
||||
|
||||
unset($array[$lastKey]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the existence of a particular location in the registry using multiple keys.
|
||||
*
|
||||
* @param string ...$keys The keys to determine the location.
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the keys are not a number or string.
|
||||
* @return bool True if the location exists, false otherwise.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function existsActive(string ...$keys): bool
|
||||
{
|
||||
if (!$this->validActiveKeys($keys))
|
||||
{
|
||||
throw new \InvalidArgumentException("Keys must only be strings or numbers to check if any value exist.");
|
||||
}
|
||||
|
||||
$array = $this->active;
|
||||
|
||||
foreach ($keys as $key)
|
||||
{
|
||||
if (!isset($array[$key]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$array = $array[$key];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the keys are valid
|
||||
*
|
||||
* @param array $keys The keys to determine the location.
|
||||
*
|
||||
* @return bool False if any of the keys are not a number or string.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function validActiveKeys(array $keys): bool
|
||||
{
|
||||
foreach ($keys as $key)
|
||||
{
|
||||
if ($key === '' || (!is_string($key) && !is_numeric($key)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
122
libraries/vendor_jcb/VDM.Joomla/src/Abstraction/BaseConfig.php
Normal file
122
libraries/vendor_jcb/VDM.Joomla/src/Abstraction/BaseConfig.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction;
|
||||
|
||||
|
||||
use Joomla\Registry\Registry as JoomlaRegistry;
|
||||
use VDM\Joomla\Utilities\String\ClassfunctionHelper;
|
||||
|
||||
|
||||
/**
|
||||
* Config
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract class BaseConfig extends JoomlaRegistry
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Instantiate the internal data object.
|
||||
$this->data = new \stdClass();
|
||||
}
|
||||
|
||||
/**
|
||||
* setting any config value
|
||||
*
|
||||
* @param string $key The value's key/path name
|
||||
* @param mixed $value Optional default value, returned if the internal value is null.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __set($key, $value)
|
||||
{
|
||||
$this->set($key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* getting any valid value
|
||||
*
|
||||
* @param string $key The value's key/path name
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @throws \InvalidArgumentException If $key is not a valid function name.
|
||||
*/
|
||||
public function __get($key)
|
||||
{
|
||||
// check if it has been set
|
||||
if (($value = $this->get($key, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_')
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException(sprintf('Argument %s could not be found as function or path.', $key));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a config value.
|
||||
*
|
||||
* @param string $path Registry path (e.g. joomla_content_showauthor)
|
||||
* @param mixed $default Optional default value, returned if the internal value is null.
|
||||
*
|
||||
* @return mixed Value of entry or null
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function get($path, $default = null)
|
||||
{
|
||||
// function name with no underscores
|
||||
$method = 'get' . ucfirst((string) ClassfunctionHelper::safe(str_replace('_', '', $path)));
|
||||
|
||||
// check if it has been set
|
||||
if (($value = parent::get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_')
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
elseif (method_exists($this, $method))
|
||||
{
|
||||
$value = $this->{$method}($default);
|
||||
|
||||
$this->set($path, $value);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append value to a path in registry of an array
|
||||
*
|
||||
* @param string $path Parent registry Path (e.g. joomla.content.showauthor)
|
||||
* @param mixed $value Value of entry
|
||||
*
|
||||
* @return mixed The value of the that has been set.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function appendArray(string $path, $value)
|
||||
{
|
||||
// check if it does not exist
|
||||
if (!$this->exists($path))
|
||||
{
|
||||
$this->set($path, []);
|
||||
}
|
||||
|
||||
return $this->append($path, $value);
|
||||
}
|
||||
}
|
||||
|
364
libraries/vendor_jcb/VDM.Joomla/src/Abstraction/BaseTable.php
Normal file
364
libraries/vendor_jcb/VDM.Joomla/src/Abstraction/BaseTable.php
Normal file
@@ -0,0 +1,364 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Tableinterface;
|
||||
|
||||
|
||||
/**
|
||||
* Base Table
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract class BaseTable implements Tableinterface
|
||||
{
|
||||
/**
|
||||
* All areas/views/tables with their field details
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected array $tables;
|
||||
|
||||
/**
|
||||
* All default fields
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected array $defaults = [
|
||||
'id' => [
|
||||
'order' => -1,
|
||||
'name' => 'id',
|
||||
'label' => 'ID',
|
||||
'type' => 'text',
|
||||
'title' => false,
|
||||
'list' => NULL,
|
||||
'store' => NULL,
|
||||
'tab_name' => NULL
|
||||
],
|
||||
'ordering' => [
|
||||
'name' => 'ordering',
|
||||
'label' => 'Ordering',
|
||||
'type' => 'number',
|
||||
'title' => false,
|
||||
'list' => NULL,
|
||||
'store' => NULL,
|
||||
'tab_name' => NULL
|
||||
],
|
||||
'published' => [
|
||||
'name' => 'published',
|
||||
'label' => 'Status',
|
||||
'type' => 'list',
|
||||
'title' => false,
|
||||
'list' => NULL,
|
||||
'store' => NULL,
|
||||
'tab_name' => NULL
|
||||
],
|
||||
'modified_by' => [
|
||||
'name' => 'modified_by',
|
||||
'label' => 'Modified by',
|
||||
'type' => 'user',
|
||||
'title' => false,
|
||||
'list' => NULL,
|
||||
'store' => NULL,
|
||||
'tab_name' => NULL
|
||||
],
|
||||
'modified' => [
|
||||
'name' => 'modified',
|
||||
'label' => 'Modified',
|
||||
'type' => 'calendar',
|
||||
'title' => false,
|
||||
'list' => NULL,
|
||||
'store' => NULL,
|
||||
'tab_name' => NULL
|
||||
],
|
||||
'created_by' => [
|
||||
'name' => 'created_by',
|
||||
'label' => 'Created by',
|
||||
'type' => 'user',
|
||||
'title' => false,
|
||||
'list' => NULL,
|
||||
'store' => NULL,
|
||||
'tab_name' => NULL
|
||||
],
|
||||
'created' => [
|
||||
'name' => 'created',
|
||||
'label' => 'Created',
|
||||
'type' => 'calendar',
|
||||
'title' => false,
|
||||
'list' => NULL,
|
||||
'store' => NULL,
|
||||
'tab_name' => NULL
|
||||
],
|
||||
'hits' => [
|
||||
'name' => 'hits',
|
||||
'label' => 'Hits',
|
||||
'type' => 'number',
|
||||
'title' => false,
|
||||
'list' => NULL,
|
||||
'store' => NULL,
|
||||
'tab_name' => NULL
|
||||
],
|
||||
'version' => [
|
||||
'name' => 'version',
|
||||
'label' => 'Version',
|
||||
'type' => 'text',
|
||||
'title' => false,
|
||||
'list' => NULL,
|
||||
'store' => NULL,
|
||||
'tab_name' => NULL
|
||||
]
|
||||
];
|
||||
|
||||
/**
|
||||
* Get any value from a item/field/column of an area/view/table
|
||||
* Example: $this->get('table_name', 'field_name', 'value_key');
|
||||
* Get an item/field/column of an area/view/table
|
||||
* Example: $this->get('table_name', 'field_name');
|
||||
* Get all items/fields/columns of an area/view/table
|
||||
* Example: $this->get('table_name');
|
||||
* Get all areas/views/tables with all their item/field/column details
|
||||
* Example: $this->get('All');
|
||||
*
|
||||
* @param string $table The table
|
||||
* @param string|null $field The field
|
||||
* @param string|null $key The value key
|
||||
*
|
||||
* @return mixed
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function get(string $table, ?string $field = null, ?string $key = null)
|
||||
{
|
||||
// return the item/field/column of an area/view/table
|
||||
if (is_string($field) && is_string($key))
|
||||
{
|
||||
// return the value of a item/field/column of an area/view/table
|
||||
if (isset($this->tables[$table][$field][$key]))
|
||||
{
|
||||
return $this->tables[$table][$field][$key];
|
||||
}
|
||||
|
||||
return $this->getDefaultKey($field, $key);
|
||||
}
|
||||
// return the item/field/column of an area/view/table
|
||||
elseif (is_string($field))
|
||||
{
|
||||
if (isset($this->tables[$table][$field]))
|
||||
{
|
||||
return $this->tables[$table][$field];
|
||||
}
|
||||
|
||||
return $this->getDefault($field);
|
||||
}
|
||||
// return an area/view/table
|
||||
elseif ($table !== 'All')
|
||||
{
|
||||
if (isset($this->tables[$table]))
|
||||
{
|
||||
return $this->tables[$table];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// return all
|
||||
return $this->tables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title field from an area/view/table
|
||||
*
|
||||
* @param string $table The area
|
||||
*
|
||||
* @return ?array
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function title(string $table): ?array
|
||||
{
|
||||
// return the title item/field/column of an area/view/table
|
||||
if (($table = $this->get($table)) !== null)
|
||||
{
|
||||
foreach ($table as $item)
|
||||
{
|
||||
if ($item['title'])
|
||||
{
|
||||
return $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// none found
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title field name
|
||||
*
|
||||
* @param string $table The area
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function titleName(string $table): string
|
||||
{
|
||||
// return the title name of an area/view/table
|
||||
if (($field = $this->title($table)) !== null)
|
||||
{
|
||||
return $field['name'];
|
||||
}
|
||||
|
||||
// none found default to ID
|
||||
return 'id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all tables
|
||||
*
|
||||
* @return array
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function tables(): array
|
||||
{
|
||||
// return all areas/views/tables
|
||||
return array_keys($this->tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a table (and field) exist
|
||||
*
|
||||
* @param string $table The area
|
||||
* @param string|null $field The area
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function exist(string $table, ?string $field = null): bool
|
||||
{
|
||||
if (isset($this->tables[$table]))
|
||||
{
|
||||
// if we have a field
|
||||
if (is_string($field))
|
||||
{
|
||||
if (isset($this->tables[$table][$field]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->isDefault($field);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all fields of an area/view/table
|
||||
*
|
||||
* @param string $table The area
|
||||
* @param bool $default Add the default fields
|
||||
*
|
||||
* @return array|null On success an array of fields
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function fields(string $table, bool $default = false): ?array
|
||||
{
|
||||
// return all fields of an area/view/table
|
||||
if (($table = $this->get($table)) !== null)
|
||||
{
|
||||
if ($default)
|
||||
{
|
||||
return $this->addDefault(array_keys($table));
|
||||
}
|
||||
else
|
||||
{
|
||||
return array_keys($table);
|
||||
}
|
||||
}
|
||||
|
||||
// none found
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the default fields
|
||||
*
|
||||
* @param array $fields The table dynamic fields
|
||||
*
|
||||
* @return array Fields (with defaults added)
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function addDefault(array $fields): array
|
||||
{
|
||||
// add default fields
|
||||
foreach ($this->defaults as $default)
|
||||
{
|
||||
// used just for loading the fields
|
||||
$order = $default['order'] ?? 1;
|
||||
unset($default['order']);
|
||||
|
||||
if ($order < 0)
|
||||
{
|
||||
array_unshift($fields, $default['name']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$fields[] = $default['name'];
|
||||
}
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the field is a default field
|
||||
*
|
||||
* @param string $field The field to check
|
||||
*
|
||||
* @return bool True if a default field
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function isDefault(string $field): bool
|
||||
{
|
||||
return isset($this->defaults[$field]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a default field
|
||||
*
|
||||
* @param string $field The field to check
|
||||
*
|
||||
* @return array|null True if a default field
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getDefault(string $field): ?array
|
||||
{
|
||||
return $this->defaults[$field] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a default field property
|
||||
*
|
||||
* @param string $field The field to check
|
||||
* @param string $key The field key/property to check
|
||||
*
|
||||
* @return string|null String value if a default field property exist
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getDefaultKey(string $field, string $key): ?string
|
||||
{
|
||||
return $this->defaults[$field][$key] ?? null;
|
||||
}
|
||||
}
|
||||
|
115
libraries/vendor_jcb/VDM.Joomla/src/Abstraction/Database.php
Normal file
115
libraries/vendor_jcb/VDM.Joomla/src/Abstraction/Database.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction;
|
||||
|
||||
|
||||
use Joomla\CMS\Factory as JoomlaFactory;
|
||||
use VDM\Joomla\Utilities\Component\Helper;
|
||||
|
||||
|
||||
/**
|
||||
* Database
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract class Database
|
||||
{
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Core Component Table Name
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected string $table;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = JoomlaFactory::getDbo();
|
||||
|
||||
// set the component table
|
||||
$this->table = '#__' . Helper::getCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a value based on data type
|
||||
*
|
||||
* @param mixed $value The value to set
|
||||
*
|
||||
* @return mixed
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected function quote($value)
|
||||
{
|
||||
if ($value === null) // hmm the null does pose an issue (will keep an eye on this)
|
||||
{
|
||||
return 'NULL';
|
||||
}
|
||||
|
||||
if (is_numeric($value))
|
||||
{
|
||||
if (filter_var($value, FILTER_VALIDATE_INT))
|
||||
{
|
||||
return (int) $value;
|
||||
}
|
||||
elseif (filter_var($value, FILTER_VALIDATE_FLOAT))
|
||||
{
|
||||
return (float) $value;
|
||||
}
|
||||
}
|
||||
elseif (is_bool($value)) // not sure if this will work well (but its correct)
|
||||
{
|
||||
return $value ? 'TRUE' : 'FALSE';
|
||||
}
|
||||
|
||||
// For date and datetime values
|
||||
if ($value instanceof \DateTime)
|
||||
{
|
||||
return $this->db->quote($value->format('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
// For other data types, just escape it
|
||||
return $this->db->quote($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a table name, adding the
|
||||
* core component as needed
|
||||
*
|
||||
* @param string $table The table string
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected function getTable(string $table): string
|
||||
{
|
||||
if (strpos($table, '#__') === false)
|
||||
{
|
||||
return $this->table . '_' . $table;
|
||||
}
|
||||
|
||||
return $table;
|
||||
}
|
||||
}
|
||||
|
358
libraries/vendor_jcb/VDM.Joomla/src/Abstraction/Model.php
Normal file
358
libraries/vendor_jcb/VDM.Joomla/src/Abstraction/Model.php
Normal file
@@ -0,0 +1,358 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction;
|
||||
|
||||
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Interfaces\Tableinterface as Table;
|
||||
|
||||
|
||||
/**
|
||||
* Base Model
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract class Model
|
||||
{
|
||||
/**
|
||||
* Last ID
|
||||
*
|
||||
* @var array
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected array $last;
|
||||
|
||||
/**
|
||||
* Search Table
|
||||
*
|
||||
* @var Table
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Table $table;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Table $table The search table object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Table $table)
|
||||
{
|
||||
$this->table = $table;
|
||||
}
|
||||
|
||||
/**
|
||||
* Model the value
|
||||
* Example: $this->value(value, 'value_key', 'table_name');
|
||||
*
|
||||
* @param mixed $value The value to model
|
||||
* @param string $field The field key
|
||||
* @param string|null $table The table
|
||||
*
|
||||
* @return mixed
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract public function value($value, string $field, ?string $table = null);
|
||||
|
||||
/**
|
||||
* Model the values of an item
|
||||
* Example: $this->item(Object, 'table_name');
|
||||
*
|
||||
* @param object|null $item The item object
|
||||
* @param string|null $table The table
|
||||
*
|
||||
* @return object|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function item(?object $item, ?string $table = null): ?object
|
||||
{
|
||||
// we must have an object
|
||||
if (empty($item))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// set the table name
|
||||
if (empty($table))
|
||||
{
|
||||
$table = $this->getTable();
|
||||
}
|
||||
|
||||
if (($fields = $this->getTableFields($table, true)) !== null)
|
||||
{
|
||||
// field counter
|
||||
$field_number = 0;
|
||||
|
||||
// check if this is a valid table
|
||||
$item_bucket = new \stdClass();
|
||||
|
||||
foreach ($fields as $field)
|
||||
{
|
||||
// model a value if it exists
|
||||
if(isset($item->{$field}))
|
||||
{
|
||||
if (!$this->validateBefore($item->{$field}, $field, $table))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$item->{$field} = $this->value($item->{$field}, $field, $table);
|
||||
|
||||
if (!$this->validateAfter($item->{$field}, $field, $table))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$item_bucket->{$field} = $item->{$field};
|
||||
|
||||
$field_number++;
|
||||
}
|
||||
}
|
||||
|
||||
// all items must have more than one field or its empty (1 = key)
|
||||
if ($field_number > 1)
|
||||
{
|
||||
return $item_bucket;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Model the values of multiple items
|
||||
* Example: $this->items(Array, 'table_name');
|
||||
*
|
||||
* @param array|null $items The array of item objects
|
||||
* @param string|null $table The table
|
||||
*
|
||||
* @return array|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function items(?array $items = null, ?string $table = null): ?array
|
||||
{
|
||||
// check if this is a valid table
|
||||
if (ArrayHelper::check($items))
|
||||
{
|
||||
// set the table name
|
||||
if (empty($table))
|
||||
{
|
||||
$table = $this->getTable();
|
||||
}
|
||||
|
||||
foreach ($items as $id => &$item)
|
||||
{
|
||||
// model the item
|
||||
if (($item = $this->item($item, $table)) !== null)
|
||||
{
|
||||
// add the last ID
|
||||
$this->last[$table] = $item->id ?? $this->last[$table] ?? null;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($items[$id]);
|
||||
}
|
||||
}
|
||||
|
||||
if (ArrayHelper::check($items))
|
||||
{
|
||||
return $items;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Model the values of an row
|
||||
* Example: $this->item(Array, 'table_name');
|
||||
*
|
||||
* @param array|null $item The item array
|
||||
* @param string|null $table The table
|
||||
*
|
||||
* @return array|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function row(?array $item, ?string $table = null): ?array
|
||||
{
|
||||
// we must have an array
|
||||
if (empty($item))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// set the table name
|
||||
if (empty($table))
|
||||
{
|
||||
$table = $this->getTable();
|
||||
}
|
||||
|
||||
if (($fields = $this->getTableFields($table, true)) !== null)
|
||||
{
|
||||
// field counter
|
||||
$field_number = 0;
|
||||
|
||||
// check if this is a valid table
|
||||
$item_bucket = [];
|
||||
|
||||
foreach ($fields as $field)
|
||||
{
|
||||
// model a value if it exists
|
||||
if(isset($item[$field]))
|
||||
{
|
||||
if (!$this->validateBefore($item[$field], $field, $table))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$item[$field] = $this->value($item[$field], $field, $table);
|
||||
|
||||
if (!$this->validateAfter($item[$field], $field, $table))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$item_bucket[$field] = $item[$field];
|
||||
|
||||
$field_number++;
|
||||
}
|
||||
}
|
||||
|
||||
// all items must have more than one field or its empty (1 = id or guid)
|
||||
if ($field_number > 1)
|
||||
{
|
||||
return $item_bucket;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Model the values of multiple rows
|
||||
* Example: $this->items(Array, 'table_name');
|
||||
*
|
||||
* @param array|null $items The array of item array
|
||||
* @param string|null $table The table
|
||||
*
|
||||
* @return array|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function rows(?array $items = null, ?string $table = null): ?array
|
||||
{
|
||||
// check if this is a valid table
|
||||
if (ArrayHelper::check($items))
|
||||
{
|
||||
// set the table name
|
||||
if (empty($table))
|
||||
{
|
||||
$table = $this->getTable();
|
||||
}
|
||||
|
||||
foreach ($items as $id => &$item)
|
||||
{
|
||||
// model the item
|
||||
if (($item = $this->row($item, $table)) !== null)
|
||||
{
|
||||
// add the last ID
|
||||
$this->last[$table] = $item['id'] ?? $this->last[$table] ?? null;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($items[$id]);
|
||||
}
|
||||
}
|
||||
|
||||
if (ArrayHelper::check($items))
|
||||
{
|
||||
return $items;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get last modeled ID
|
||||
* Example: $this->last('table_name');
|
||||
*
|
||||
* @param string|null $table The table
|
||||
*
|
||||
* @return int|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function last(?string $table = null): ?int
|
||||
{
|
||||
// set the table name
|
||||
if (empty($table))
|
||||
{
|
||||
$table = $this->getTable();
|
||||
}
|
||||
|
||||
// check if this is a valid table
|
||||
if ($table && isset($this->last[$table]))
|
||||
{
|
||||
return $this->last[$table];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current active table's fields (including defaults)
|
||||
*
|
||||
* @param string $table The area
|
||||
* @param bool $default Add the default fields
|
||||
*
|
||||
* @return array
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getTableFields(string $table, bool $default = false): ?array
|
||||
{
|
||||
return $this->table->fields($table, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate before the value is modelled (basic, override in child class)
|
||||
*
|
||||
* @param mixed $value The field value
|
||||
* @param string|null $field The field key
|
||||
* @param string|null $table The table
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract protected function validateBefore(&$value, ?string $field = null, ?string $table = null): bool;
|
||||
|
||||
/**
|
||||
* Validate after the value is modelled (basic, override in child class)
|
||||
*
|
||||
* @param mixed $value The field value
|
||||
* @param string|null $field The field key
|
||||
* @param string|null $table The table
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool;
|
||||
|
||||
/**
|
||||
* Get the current active table
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract protected function getTable(): string;
|
||||
}
|
||||
|
184
libraries/vendor_jcb/VDM.Joomla/src/Abstraction/Registry.php
Normal file
184
libraries/vendor_jcb/VDM.Joomla/src/Abstraction/Registry.php
Normal file
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Activeregistryinterface;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\ActiveRegistry;
|
||||
|
||||
|
||||
/**
|
||||
* VDM Basic Registry.
|
||||
*
|
||||
* Don't use this beyond 10 dimensional depth for best performance.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract class Registry extends ActiveRegistry implements Activeregistryinterface, Registryinterface
|
||||
{
|
||||
/**
|
||||
* Path separator
|
||||
*
|
||||
* @var string|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ?string $separator = '.';
|
||||
|
||||
/**
|
||||
* Sets a value into the registry using multiple keys.
|
||||
*
|
||||
* @param string $path Registry path (e.g. vdm.content.builder)
|
||||
* @param mixed $value Value of entry
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the path values are not a number or string.
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function set(string $path, $value): void
|
||||
{
|
||||
if (($keys = $this->getActiveKeys($path)) === null)
|
||||
{
|
||||
throw new \InvalidArgumentException("Path must only be strings or numbers to set any value.");
|
||||
}
|
||||
|
||||
$this->setActive($value, ...$keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds content into the registry. If a key exists,
|
||||
* it either appends or concatenates based on $asArray switch.
|
||||
*
|
||||
* @param string $path Registry path (e.g. vdm.content.builder)
|
||||
* @param mixed $value Value of entry
|
||||
* @param bool|null $asArray Determines if the new value should be treated as an array.
|
||||
* Default is $addAsArray = false (if null) in base class.
|
||||
* Override in child class allowed set class property $addAsArray = true.
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the path values are not a number or string.
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function add(string $path, $value, ?bool $asArray = null): void
|
||||
{
|
||||
if (($keys = $this->getActiveKeys($path)) === null)
|
||||
{
|
||||
throw new \InvalidArgumentException("Path must only be strings or numbers to add any value.");
|
||||
}
|
||||
|
||||
$this->addActive($value, $asArray, ...$keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a value (or sub-array) from the registry using multiple keys.
|
||||
*
|
||||
* @param string $path Registry path (e.g. vdm.content.builder)
|
||||
* @param mixed $default Optional default value, returned if the internal doesn't exist.
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the path values are not a number or string.
|
||||
* @return mixed The value or sub-array from the storage. Null if the location doesn't exist.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function get(string $path, $default = null)
|
||||
{
|
||||
if (($keys = $this->getActiveKeys($path)) === null)
|
||||
{
|
||||
throw new \InvalidArgumentException("Path must only be strings or numbers to get any value.");
|
||||
}
|
||||
|
||||
return $this->getActive($default, ...$keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a value (or sub-array) from the registry using multiple keys.
|
||||
*
|
||||
* @param string $path Registry path (e.g. vdm.content.builder)
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the path values are not a number or string.
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function remove(string $path): void
|
||||
{
|
||||
if (($keys = $this->getActiveKeys($path)) === null)
|
||||
{
|
||||
throw new \InvalidArgumentException("Path must only be strings or numbers to remove any value.");
|
||||
}
|
||||
|
||||
$this->removeActive(...$keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the existence of a particular location in the registry using multiple keys.
|
||||
*
|
||||
* @param string $path Registry path (e.g. vdm.content.builder)
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the path values are not a number or string.
|
||||
* @return bool True if the location exists, false otherwise.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function exists(string $path): bool
|
||||
{
|
||||
if (($keys = $this->getActiveKeys($path)) === null)
|
||||
{
|
||||
throw new \InvalidArgumentException("Path must only be strings or numbers to check if any value exist.");
|
||||
}
|
||||
|
||||
return $this->existsActive(...$keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a separator value
|
||||
*
|
||||
* @param string|null $value The value to set.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function setSeparator(?string $value): void
|
||||
{
|
||||
$this->separator = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get that the active keys from a path
|
||||
*
|
||||
* @param string $path The path to determine the location registry.
|
||||
*
|
||||
* @return array|null The valid array of keys
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getActiveKeys(string $path): ?array
|
||||
{
|
||||
// empty path no allowed
|
||||
if ($path === '')
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Flatten the path
|
||||
if ($this->separator === null || $this->separator === '')
|
||||
{
|
||||
return [$path];
|
||||
}
|
||||
|
||||
$keys = array_values(array_filter(explode($this->separator, $path), 'strlen'));
|
||||
|
||||
if (empty($keys))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return $keys;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction\Registry\Traits;
|
||||
|
||||
|
||||
/**
|
||||
* Count Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
trait Count
|
||||
{
|
||||
/**
|
||||
* Retrieves number of values (or sub-array) from the storage using multiple keys.
|
||||
*
|
||||
* @param string $path Storage path (e.g. vdm.content.builder)
|
||||
*
|
||||
* @throws \InvalidArgumentException If any of the path values are not a number or string.
|
||||
* @return int The number of values
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function count(string $path): int
|
||||
{
|
||||
if (($values = $this->get($path)) === null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_array($values))
|
||||
{
|
||||
return count($values);
|
||||
}
|
||||
|
||||
if (is_object($values))
|
||||
{
|
||||
return count((array) $values);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction\Registry\Traits;
|
||||
|
||||
|
||||
/**
|
||||
* Get String Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
trait GetString
|
||||
{
|
||||
/**
|
||||
* Get a registry path if the return value is a string
|
||||
*
|
||||
* @param string $path Registry path (e.g. joomla.content.showauthor)
|
||||
* @param string|null $default A default value
|
||||
*
|
||||
* @return string|null
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function getString(string $path, ?string $default = null): ?string
|
||||
{
|
||||
// Return default value if path is empty
|
||||
if (empty($path))
|
||||
{
|
||||
return $default;
|
||||
}
|
||||
|
||||
// get the value
|
||||
if (($node = $this->get($path)) !== null
|
||||
&& is_string($node)
|
||||
&& strlen((string) $node) > 0)
|
||||
{
|
||||
return $node;
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction\Registry\Traits;
|
||||
|
||||
|
||||
/**
|
||||
* Check if a value is in an array
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
trait InArray
|
||||
{
|
||||
/**
|
||||
* Check if a value is found in an array
|
||||
*
|
||||
* @param mixed $value The value to check for
|
||||
* @param string|null $path Registry path (e.g. joomla.content.showauthor)
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function inArray($value, ?string $path = null): bool
|
||||
{
|
||||
// Check base array if no path is given
|
||||
if (empty($path))
|
||||
{
|
||||
return in_array($value, $this->active);
|
||||
}
|
||||
|
||||
// get the value
|
||||
if (($node = $this->get($path)) !== null
|
||||
&& is_array($node)
|
||||
&& in_array($value, $node))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction\Registry\Traits;
|
||||
|
||||
|
||||
/**
|
||||
* Check if a value is in an array
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
trait IsArray
|
||||
{
|
||||
/**
|
||||
* Check if a path is an array
|
||||
*
|
||||
* @param string $path Registry path (e.g. joomla.content.showauthor)
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function isArray(string $path): bool
|
||||
{
|
||||
// Check base array if no path is given
|
||||
if (empty($path))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the value
|
||||
if (($node = $this->get($path)) !== null
|
||||
&& is_array($node))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction\Registry\Traits;
|
||||
|
||||
|
||||
/**
|
||||
* Is String Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
trait IsString
|
||||
{
|
||||
/**
|
||||
* Check if a registry path exists and is a string
|
||||
*
|
||||
* @param string $path Registry path (e.g. joomla.content.showauthor)
|
||||
*
|
||||
* @return boolean
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function isString(string $path): bool
|
||||
{
|
||||
// Return default value if path is empty
|
||||
if (empty($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the value
|
||||
if (($node = $this->get($path)) !== null
|
||||
&& is_string($node)
|
||||
&& strlen((string) $node) > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction\Registry\Traits;
|
||||
|
||||
|
||||
/**
|
||||
* To String Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
trait ToString
|
||||
{
|
||||
/**
|
||||
* Convert an array of values to a string (or return string)
|
||||
*
|
||||
* @param string $path Registry path (e.g. joomla.content.showauthor)
|
||||
* @param string $seperator Return string separator
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function toString(string $path, string $separator = ''): string
|
||||
{
|
||||
// Return default value if path is empty
|
||||
if (empty($path))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
// get the value
|
||||
if (($node = $this->get($path)) !== null)
|
||||
{
|
||||
if (is_array($node) && $node !== [])
|
||||
{
|
||||
return implode($separator, $node);
|
||||
}
|
||||
elseif (is_string($node) && strlen((string) $node) > 0)
|
||||
{
|
||||
return $node;
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Abstraction\Registry\Traits;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
|
||||
|
||||
/**
|
||||
* Var Export Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
trait VarExport
|
||||
{
|
||||
/**
|
||||
* Default indentation value
|
||||
*
|
||||
* @var int
|
||||
* @since 3.4.0
|
||||
*/
|
||||
protected int $indent = 2;
|
||||
|
||||
/**
|
||||
* Method to export a set of values to a PHP array
|
||||
*
|
||||
* @param string|null $path Registry path (e.g. joomla.content.showauthor)
|
||||
* @param int $indentation The default indentation
|
||||
*
|
||||
* @return ?string The var set being exported as a PHP array
|
||||
* @since 3.4.0
|
||||
*/
|
||||
public function varExport(?string $path = null, int $indentation = 2): ?string
|
||||
{
|
||||
// Load the data array
|
||||
if ($path === null && $this->isActive())
|
||||
{
|
||||
$data = $this->allActive();
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = $this->get($path);
|
||||
}
|
||||
|
||||
// check if we have data
|
||||
if ($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// set the default indentation value
|
||||
$this->indent = $indentation;
|
||||
|
||||
// convert to string
|
||||
$data = var_export($data, true);
|
||||
|
||||
// replace all space with system indentation
|
||||
$data = preg_replace_callback("/^(\s{2})(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(.*)/m", [$this, 'convertIndent'], $data);
|
||||
|
||||
// convert all array to []
|
||||
$array = preg_split("/\r\n|\n|\r/", $data);
|
||||
$array = preg_replace(["/\s*array\s\($/", "/\)(,)?$/", "/\s=>\s$/"], [NULL, ']$1', ' => ['], $array);
|
||||
$data = implode(PHP_EOL, array_filter(["["] + $array));
|
||||
|
||||
// add needed indentation to the last ]
|
||||
$data = preg_replace("/^(\])/m", Indent::_($indentation) . '$1', $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to convert found of grouped spaces to system indentation
|
||||
*
|
||||
* @param array $matches The regex array of matching values
|
||||
*
|
||||
* @return string The resulting string.
|
||||
* @since 3.4.0
|
||||
*/
|
||||
protected function convertIndent(array $matches): string
|
||||
{
|
||||
// set number to indent by default
|
||||
$indent = Indent::_($this->indent);
|
||||
|
||||
// update each found space (group) with one indentation
|
||||
foreach (range(1, 11) as $space)
|
||||
{
|
||||
if (strlen((string) $matches[$space]) > 0)
|
||||
{
|
||||
$indent .= Indent::_(1);
|
||||
}
|
||||
}
|
||||
|
||||
return $indent . $matches[12];
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Abstraction;
|
||||
|
||||
|
||||
use Joomla\Registry\Registry as JoomlaRegistry;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\Input\Input;
|
||||
use VDM\Joomla\Abstraction\BaseConfig as Config;
|
||||
use VDM\Joomla\Utilities\Component\Helper;
|
||||
use VDM\Joomla\Utilities\String\ClassfunctionHelper;
|
||||
|
||||
|
||||
/**
|
||||
* Config
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract class BaseConfig extends Config
|
||||
{
|
||||
/**
|
||||
* Hold a JInput object for easier access to the input variables.
|
||||
*
|
||||
* @var Input
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Input $input;
|
||||
|
||||
/**
|
||||
* The Params
|
||||
*
|
||||
* @var JoomlaRegistry
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected JoomlaRegistry $params;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Input|null $input Input
|
||||
* @param Registry|null $params The component parameters
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Input $input = null, ?JoomlaRegistry $params = null)
|
||||
{
|
||||
$this->input = $input ?: Factory::getApplication()->input;
|
||||
$this->params = $params ?: Helper::getParams('com_componentbuilder');
|
||||
|
||||
// run parent constructor
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Abstraction;
|
||||
|
||||
|
||||
use Joomla\Registry\Registry as JoomlaRegistry;
|
||||
|
||||
|
||||
/**
|
||||
* Registry
|
||||
*
|
||||
* So we have full control over this class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
abstract class BaseRegistry extends JoomlaRegistry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable
|
||||
{
|
||||
/**
|
||||
* Method to iterate over any part of the registry
|
||||
*
|
||||
* @param string $path Registry path (e.g. joomla.content.showauthor)
|
||||
*
|
||||
* @return \ArrayIterator|null This object represented as an ArrayIterator.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
public function _(string $path): ?\ArrayIterator
|
||||
{
|
||||
$data = $this->extract($path);
|
||||
|
||||
if ($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return $data->getIterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Append value to a path in registry of an array
|
||||
*
|
||||
* @param string $path Parent registry Path (e.g. joomla.content.showauthor)
|
||||
* @param mixed $value Value of entry
|
||||
*
|
||||
* @return mixed The value of the that has been set.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function appendArray(string $path, $value)
|
||||
{
|
||||
// check if it does not exist
|
||||
if (!$this->exists($path))
|
||||
{
|
||||
$this->set($path, []);
|
||||
}
|
||||
|
||||
return $this->append($path, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a registry path exists and is an array
|
||||
*
|
||||
* @param string $path Registry path (e.g. joomla.content.showauthor)
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function isArray(string $path): bool
|
||||
{
|
||||
// Return default value if path is empty
|
||||
if (empty($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the value
|
||||
if (($node = $this->get($path)) !== null
|
||||
&& is_array($node)
|
||||
&& $node !== [])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a registry path exists and is a string
|
||||
*
|
||||
* @param string $path Registry path (e.g. joomla.content.showauthor)
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function isString(string $path): bool
|
||||
{
|
||||
// Return default value if path is empty
|
||||
if (empty($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the value
|
||||
if (($node = $this->get($path)) !== null
|
||||
&& is_string($node)
|
||||
&& strlen((string) $node) > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a registry path exists and is numeric
|
||||
*
|
||||
* @param string $path Registry path (e.g. joomla.content.showauthor)
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function isNumeric(string $path): bool
|
||||
{
|
||||
// Return default value if path is empty
|
||||
if (empty($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the value
|
||||
if (($node = $this->get($path)) !== null
|
||||
&& is_numeric($node))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,515 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Adminview;
|
||||
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model\CustomtabsInterface as Customtabs;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Tabs;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Fields;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Historyadminview as History;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Permissions;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Conditions;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Relations;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Linkedviews;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Javascriptadminview as Javascript;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Cssadminview as Css;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Phpadminview as Php;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Custombuttons;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Customimportscripts;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Ajaxadmin as Ajax;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Customalias;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Sql;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Mysqlsettings;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\SiteEditView;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\JsonHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
|
||||
|
||||
/**
|
||||
* Admin View Data Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
class Data
|
||||
{
|
||||
/**
|
||||
* The Config Class.
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* The EventInterface Class.
|
||||
*
|
||||
* @var Event
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Event $event;
|
||||
|
||||
/**
|
||||
* The Placeholder Class.
|
||||
*
|
||||
* @var Placeholder
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Placeholder $placeholder;
|
||||
|
||||
/**
|
||||
* The Dispenser Class.
|
||||
*
|
||||
* @var Dispenser
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Dispenser $dispenser;
|
||||
|
||||
/**
|
||||
* The Customtabs Class.
|
||||
*
|
||||
* @var Customtabs
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Customtabs $customtabs;
|
||||
|
||||
/**
|
||||
* The Tabs Class.
|
||||
*
|
||||
* @var Tabs
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Tabs $tabs;
|
||||
|
||||
/**
|
||||
* The Fields Class.
|
||||
*
|
||||
* @var Fields
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Fields $fields;
|
||||
|
||||
/**
|
||||
* The Historyadminview Class.
|
||||
*
|
||||
* @var History
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected History $history;
|
||||
|
||||
/**
|
||||
* The Permissions Class.
|
||||
*
|
||||
* @var Permissions
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permissions $permissions;
|
||||
|
||||
/**
|
||||
* The Conditions Class.
|
||||
*
|
||||
* @var Conditions
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Conditions $conditions;
|
||||
|
||||
/**
|
||||
* The Relations Class.
|
||||
*
|
||||
* @var Relations
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Relations $relations;
|
||||
|
||||
/**
|
||||
* The Linkedviews Class.
|
||||
*
|
||||
* @var Linkedviews
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Linkedviews $linkedviews;
|
||||
|
||||
/**
|
||||
* The Javascriptadminview Class.
|
||||
*
|
||||
* @var Javascript
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Javascript $javascript;
|
||||
|
||||
/**
|
||||
* The Cssadminview Class.
|
||||
*
|
||||
* @var Css
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Css $css;
|
||||
|
||||
/**
|
||||
* The Phpadminview Class.
|
||||
*
|
||||
* @var Php
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Php $php;
|
||||
|
||||
/**
|
||||
* The Custombuttons Class.
|
||||
*
|
||||
* @var Custombuttons
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Custombuttons $custombuttons;
|
||||
|
||||
/**
|
||||
* The Customimportscripts Class.
|
||||
*
|
||||
* @var Customimportscripts
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Customimportscripts $customimportscripts;
|
||||
|
||||
/**
|
||||
* The Ajaxadmin Class.
|
||||
*
|
||||
* @var Ajax
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Ajax $ajax;
|
||||
|
||||
/**
|
||||
* The Customalias Class.
|
||||
*
|
||||
* @var Customalias
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Customalias $customalias;
|
||||
|
||||
/**
|
||||
* The Sql Class.
|
||||
*
|
||||
* @var Sql
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Sql $sql;
|
||||
|
||||
/**
|
||||
* The Mysqlsettings Class.
|
||||
*
|
||||
* @var Mysqlsettings
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Mysqlsettings $mysqlsettings;
|
||||
|
||||
/**
|
||||
* The SiteEditView Class.
|
||||
*
|
||||
* @var SiteEditView
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected SiteEditView $siteeditview;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Event $event The EventInterface Class.
|
||||
* @param Placeholder $placeholder The Placeholder Class.
|
||||
* @param Dispenser $dispenser The Dispenser Class.
|
||||
* @param Customtabs $customtabs The Customtabs Class.
|
||||
* @param Tabs $tabs The Tabs Class.
|
||||
* @param Fields $fields The Fields Class.
|
||||
* @param History $history The Historyadminview Class.
|
||||
* @param Permissions $permissions The Permissions Class.
|
||||
* @param Conditions $conditions The Conditions Class.
|
||||
* @param Relations $relations The Relations Class.
|
||||
* @param Linkedviews $linkedviews The Linkedviews Class.
|
||||
* @param Javascript $javascript The Javascriptadminview Class.
|
||||
* @param Css $css The Cssadminview Class.
|
||||
* @param Php $php The Phpadminview Class.
|
||||
* @param Custombuttons $custombuttons The Custombuttons Class.
|
||||
* @param Customimportscripts $customimportscripts The Customimportscripts Class.
|
||||
* @param Ajax $ajax The Ajaxadmin Class.
|
||||
* @param Customalias $customalias The Customalias Class.
|
||||
* @param Sql $sql The Sql Class.
|
||||
* @param Mysqlsettings $mysqlsettings The Mysqlsettings Class.
|
||||
* @param SiteEditView $siteeditview The SiteEditView Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Event $event, Placeholder $placeholder, Dispenser $dispenser, Customtabs $customtabs, Tabs $tabs, Fields $fields,
|
||||
History $history, Permissions $permissions, Conditions $conditions, Relations $relations, Linkedviews $linkedviews, Javascript $javascript,
|
||||
Css $css, Php $php, Custombuttons $custombuttons, Customimportscripts $customimportscripts, Ajax $ajax, Customalias $customalias, Sql $sql,
|
||||
Mysqlsettings $mysqlsettings, SiteEditView $siteeditview)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->event = $event;
|
||||
$this->placeholder = $placeholder;
|
||||
$this->dispenser = $dispenser;
|
||||
$this->customtabs = $customtabs;
|
||||
$this->tabs = $tabs;
|
||||
$this->fields = $fields;
|
||||
$this->history = $history;
|
||||
$this->permissions = $permissions;
|
||||
$this->conditions = $conditions;
|
||||
$this->relations = $relations;
|
||||
$this->linkedviews = $linkedviews;
|
||||
$this->javascript = $javascript;
|
||||
$this->css = $css;
|
||||
$this->php = $php;
|
||||
$this->custombuttons = $custombuttons;
|
||||
$this->customimportscripts = $customimportscripts;
|
||||
$this->ajax = $ajax;
|
||||
$this->customalias = $customalias;
|
||||
$this->sql = $sql;
|
||||
$this->mysqlsettings = $mysqlsettings;
|
||||
$this->siteeditview = $siteeditview;
|
||||
$this->db = Factory::getDbo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Admin View Data
|
||||
*
|
||||
* @param int $id The view ID
|
||||
*
|
||||
* @return object|null The view data
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function get(int $id): ?object
|
||||
{
|
||||
if (!isset($this->data[$id]))
|
||||
{
|
||||
// Create a new query object.
|
||||
$query = $this->db->getQuery(true);
|
||||
|
||||
$query->select('a.*');
|
||||
$query->select(
|
||||
$this->db->quoteName(
|
||||
array(
|
||||
'b.addfields',
|
||||
'b.id',
|
||||
'c.addconditions',
|
||||
'c.id',
|
||||
'r.addrelations',
|
||||
't.tabs'
|
||||
), array(
|
||||
'addfields',
|
||||
'addfields_id',
|
||||
'addconditions',
|
||||
'addconditions_id',
|
||||
'addrelations',
|
||||
'customtabs'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$query->from('#__componentbuilder_admin_view AS a');
|
||||
$query->join(
|
||||
'LEFT',
|
||||
$this->db->quoteName('#__componentbuilder_admin_fields', 'b')
|
||||
. ' ON (' . $this->db->quoteName('a.id') . ' = '
|
||||
. $this->db->quoteName('b.admin_view') . ')'
|
||||
);
|
||||
|
||||
$query->join(
|
||||
'LEFT', $this->db->quoteName(
|
||||
'#__componentbuilder_admin_fields_conditions', 'c'
|
||||
) . ' ON (' . $this->db->quoteName('a.id') . ' = '
|
||||
. $this->db->quoteName('c.admin_view') . ')'
|
||||
);
|
||||
|
||||
$query->join(
|
||||
'LEFT', $this->db->quoteName(
|
||||
'#__componentbuilder_admin_fields_relations', 'r'
|
||||
) . ' ON (' . $this->db->quoteName('a.id') . ' = '
|
||||
. $this->db->quoteName('r.admin_view') . ')'
|
||||
);
|
||||
|
||||
$query->join(
|
||||
'LEFT', $this->db->quoteName(
|
||||
'#__componentbuilder_admin_custom_tabs', 't'
|
||||
) . ' ON (' . $this->db->quoteName('a.id') . ' = '
|
||||
. $this->db->quoteName('t.admin_view') . ')'
|
||||
);
|
||||
|
||||
$query->where($this->db->quoteName('a.id') . ' = ' . (int) $id);
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeQueryViewData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeQueryViewData', [&$id, &$query, &$this->db]
|
||||
);
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$this->db->setQuery($query);
|
||||
|
||||
// Load the results as a list of stdClass objects (see later for more options on retrieving data).
|
||||
$view = $this->db->loadObject();
|
||||
|
||||
// setup single view code names to use in storing the data
|
||||
$view->name_single_code = 'oops_hmm_' . $id;
|
||||
if (isset($view->name_single) && $view->name_single != 'null')
|
||||
{
|
||||
$view->name_single_code = StringHelper::safe(
|
||||
$view->name_single
|
||||
);
|
||||
}
|
||||
|
||||
// setup list view code name to use in storing the data
|
||||
$view->name_list_code = 'oops_hmmm_' . $id;
|
||||
if (isset($view->name_list) && $view->name_list != 'null')
|
||||
{
|
||||
$view->name_list_code = StringHelper::safe(
|
||||
$view->name_list
|
||||
);
|
||||
}
|
||||
|
||||
// check the length of the view name (+5 for com_ and _)
|
||||
$name_length = $this->config->component_code_name_length + strlen(
|
||||
(string) $view->name_single_code
|
||||
) + 5;
|
||||
// when the name is larger than 49 we need to add the assets' table name fix
|
||||
if ($name_length > 49)
|
||||
{
|
||||
$this->config->set('add_assets_table_name_fix', true);
|
||||
}
|
||||
|
||||
// setup token check
|
||||
if (!isset($this->dispenser->hub['token']))
|
||||
{
|
||||
$this->dispenser->hub['token'] = [];
|
||||
}
|
||||
$this->dispenser->hub['token'][$view->name_single_code] = false;
|
||||
$this->dispenser->hub['token'][$view->name_list_code] = false;
|
||||
|
||||
// set some placeholders
|
||||
$this->placeholder->set('view', $view->name_single_code);
|
||||
$this->placeholder->set('views', $view->name_list_code);
|
||||
$this->placeholder->set('View', StringHelper::safe(
|
||||
$view->name_single, 'F'
|
||||
));
|
||||
$this->placeholder->set('Views', StringHelper::safe(
|
||||
$view->name_list, 'F'
|
||||
));
|
||||
$this->placeholder->set('VIEW', StringHelper::safe(
|
||||
$view->name_single, 'U'
|
||||
));
|
||||
$this->placeholder->set('VIEWS', StringHelper::safe(
|
||||
$view->name_list, 'U'
|
||||
));
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeModelViewData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeModelViewData', [&$view]
|
||||
);
|
||||
|
||||
// add the tables
|
||||
$view->addtables = (isset($view->addtables)
|
||||
&& JsonHelper::check($view->addtables))
|
||||
? json_decode((string) $view->addtables, true) : null;
|
||||
if (ArrayHelper::check($view->addtables))
|
||||
{
|
||||
$view->tables = array_values($view->addtables);
|
||||
}
|
||||
unset($view->addtables);
|
||||
|
||||
// set custom tabs
|
||||
$this->customtabs->set($view);
|
||||
|
||||
// set the local tabs
|
||||
$this->tabs->set($view);
|
||||
|
||||
// set permissions
|
||||
$this->permissions->set($view);
|
||||
|
||||
// set fields
|
||||
$this->fields->set($view);
|
||||
|
||||
// build update SQL
|
||||
$this->history->set($view);
|
||||
|
||||
// set the conditions
|
||||
$this->conditions->set($view);
|
||||
|
||||
// set the relations
|
||||
$this->relations->set($view);
|
||||
|
||||
// set linked views
|
||||
$this->linkedviews->set($view);
|
||||
|
||||
// set the lang target
|
||||
$this->config->lang_target = 'admin';
|
||||
if ($this->siteeditview->exists($id))
|
||||
{
|
||||
$this->config->lang_target = 'both';
|
||||
}
|
||||
|
||||
// set javascript
|
||||
$this->javascript->set($view);
|
||||
|
||||
// set css
|
||||
$this->css->set($view);
|
||||
|
||||
// set php
|
||||
$this->php->set($view);
|
||||
|
||||
// set custom buttons
|
||||
$this->custombuttons->set($view);
|
||||
|
||||
// set custom import scripts
|
||||
$this->customimportscripts->set($view);
|
||||
|
||||
// set Ajax for this view
|
||||
$this->ajax->set($view);
|
||||
|
||||
// activate alias builder
|
||||
$this->customalias->set($view);
|
||||
|
||||
// set sql
|
||||
$this->sql->set($view);
|
||||
|
||||
// set mySql Table Settings
|
||||
$this->mysqlsettings->set($view);
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterModelViewData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterModelViewData', [&$view]
|
||||
);
|
||||
|
||||
// clear placeholders
|
||||
$this->placeholder->remove('view');
|
||||
$this->placeholder->remove('views');
|
||||
$this->placeholder->remove('View');
|
||||
$this->placeholder->remove('Views');
|
||||
$this->placeholder->remove('VIEW');
|
||||
$this->placeholder->remove('VIEWS');
|
||||
|
||||
// store this view to class object
|
||||
$this->data[$id] = $view;
|
||||
}
|
||||
|
||||
// return the found view data
|
||||
return $this->data[$id];
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Adminview;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\HasPermissions;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
|
||||
|
||||
/**
|
||||
* Admin View Permission Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class Permission
|
||||
{
|
||||
/**
|
||||
* The HasPermissions Class.
|
||||
*
|
||||
* @var HasPermissions
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected HasPermissions $haspermissions;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param HasPermissions $haspermissions The HasPermissions Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(HasPermissions $haspermissions)
|
||||
{
|
||||
$this->haspermissions = $haspermissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if a view has permissions
|
||||
*
|
||||
* @param array $view View details
|
||||
* @param string $nameSingleCode View Single Code Name
|
||||
*
|
||||
* @return bool true if it has permissions
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function check(array &$view, string &$nameSingleCode): bool
|
||||
{
|
||||
// first check if we have checked this already
|
||||
if (!$this->haspermissions->exists($nameSingleCode))
|
||||
{
|
||||
// when a view has history, it has permissions
|
||||
// since it tracks the version access
|
||||
if (isset($view['history']) && $view['history'] == 1)
|
||||
{
|
||||
// set the permission for later
|
||||
$this->haspermissions->set($nameSingleCode, true);
|
||||
|
||||
// break out here
|
||||
return true;
|
||||
}
|
||||
// check if the view has permissions
|
||||
if (isset($view['settings'])
|
||||
&& ArrayHelper::check(
|
||||
$view['settings']->permissions, true
|
||||
))
|
||||
{
|
||||
foreach ($view['settings']->permissions as $per)
|
||||
{
|
||||
// check if the permission targets the view
|
||||
// 1 = view
|
||||
// 3 = both view & component
|
||||
if (isset($per['implementation'])
|
||||
&& (
|
||||
$per['implementation'] == 1
|
||||
|| $per['implementation'] == 3
|
||||
))
|
||||
{
|
||||
// set the permission for later
|
||||
$this->haspermissions->set($nameSingleCode, true);
|
||||
|
||||
// break out here
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// check if the fields has permissions
|
||||
if (isset($view['settings'])
|
||||
&& ArrayHelper::check(
|
||||
$view['settings']->fields, true
|
||||
))
|
||||
{
|
||||
foreach ($view['settings']->fields as $field)
|
||||
{
|
||||
// if a field has any permissions
|
||||
// the a view has permissions
|
||||
if (isset($field['permission'])
|
||||
&& ArrayHelper::check(
|
||||
$field['permission'], true
|
||||
))
|
||||
{
|
||||
// set the permission for later
|
||||
$this->haspermissions->set($nameSingleCode, true);
|
||||
|
||||
// break out here
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->haspermissions->exists($nameSingleCode);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,263 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Alias;
|
||||
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Registry;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Loader;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Libraries;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
|
||||
/**
|
||||
* Alias Data Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
class Data
|
||||
{
|
||||
/**
|
||||
* Compiler Config
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* The compiler registry
|
||||
*
|
||||
* @var Registry
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Registry $registry;
|
||||
|
||||
/**
|
||||
* Compiler Customcode
|
||||
*
|
||||
* @var Customcode
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Customcode $customcode;
|
||||
|
||||
/**
|
||||
* Compiler Customcode in Gui
|
||||
*
|
||||
* @var Gui
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected Gui $gui;
|
||||
|
||||
/**
|
||||
* Compiler Auto Loader
|
||||
*
|
||||
* @var Loader
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Loader $loader;
|
||||
|
||||
/**
|
||||
* Compiler Libraries Model
|
||||
*
|
||||
* @var Libraries
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Libraries $libraries;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Config|null $config The compiler config object.
|
||||
* @param Registry|null $registry The compiler registry object.
|
||||
* @param Customcode|null $customcode The compiler customcode object.
|
||||
* @param Gui|null $gui The compiler customcode gui.
|
||||
* @param Loader|null $load The compiler loader object.
|
||||
* @param Libraries|null $libraries The compiler libraries model object.
|
||||
* @param \JDatabaseDriver|null $db The database object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Config $config = null, ?Registry $registry = null,
|
||||
?Customcode $customcode = null, ?Gui $gui = null,
|
||||
?Loader $loader = null, ?Libraries $libraries = null)
|
||||
{
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->registry = $registry ?: Compiler::_('Registry');
|
||||
$this->customcode = $customcode ?: Compiler::_('Customcode');
|
||||
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
|
||||
$this->loader = $loader ?: Compiler::_('Model.Loader');
|
||||
$this->libraries = $libraries ?: Compiler::_('Model.Libraries');
|
||||
$this->db = Factory::getDbo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Data by Alias
|
||||
*
|
||||
* @param string $alias The alias name
|
||||
* @param string $table The table where to find the alias
|
||||
* @param string $view The view code name
|
||||
*
|
||||
* @return array|null The data found with the alias
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function get(string $alias, string $table, string $view): ?array
|
||||
{
|
||||
// if not set, get all keys in table and set by ID
|
||||
$this->set($table);
|
||||
|
||||
// now check if key is found
|
||||
$name = preg_replace("/[^A-Za-z]/", '', $alias);
|
||||
|
||||
if (($id = $this->registry->get('builder.data_with_alias_keys.' . $table . '.' . $name, null)) === null &&
|
||||
($id = $this->registry->get('builder.data_with_alias_keys.' . $table . '.' . $alias, null)) === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Create a new query object.
|
||||
$query = $this->db->getQuery(true);
|
||||
$query->select('a.*');
|
||||
$query->from('#__componentbuilder_' . $table . ' AS a');
|
||||
$query->where(
|
||||
$this->db->quoteName('a.id') . ' = ' . (int) $id
|
||||
);
|
||||
|
||||
// get the row
|
||||
$this->db->setQuery($query);
|
||||
$item = $this->db->loadObject();
|
||||
|
||||
// get the other target if both
|
||||
$targets = [$this->config->build_target];
|
||||
|
||||
if ($this->config->lang_target === 'both')
|
||||
{
|
||||
$targets = ['site', 'admin'];
|
||||
}
|
||||
|
||||
// we load this layout
|
||||
$php_view = '';
|
||||
if ($item->add_php_view == 1
|
||||
&& StringHelper::check($item->php_view))
|
||||
{
|
||||
$php_view = $this->gui->set(
|
||||
$this->customcode->update(base64_decode((string) $item->php_view)),
|
||||
array(
|
||||
'table' => $table,
|
||||
'field' => 'php_view',
|
||||
'id' => (int) $item->id,
|
||||
'type' => 'php')
|
||||
);
|
||||
}
|
||||
|
||||
$content = $this->gui->set(
|
||||
$this->customcode->update(base64_decode((string) $item->{$table})),
|
||||
array(
|
||||
'table' => $table,
|
||||
'field' => $table,
|
||||
'id' => (int) $item->id,
|
||||
'type' => 'html')
|
||||
);
|
||||
|
||||
// load all targets
|
||||
foreach ($targets as $target)
|
||||
{
|
||||
// set libraries
|
||||
$this->libraries->set($view, $item, $target);
|
||||
|
||||
// auto loaders
|
||||
$this->loader->set($view, $content, $target);
|
||||
$this->loader->set($view, $php_view, $target);
|
||||
}
|
||||
|
||||
// load uikit version 2 if required
|
||||
$this->loader->uikit($view, $content);
|
||||
$this->loader->uikit($view, $php_view);
|
||||
|
||||
return [
|
||||
'id' => $item->id,
|
||||
'html' => $this->gui->set(
|
||||
$content,
|
||||
[
|
||||
'table' => $table,
|
||||
'field' => $table,
|
||||
'id' => $item->id,
|
||||
'type' => 'html'
|
||||
]
|
||||
),
|
||||
'php_view' => $this->gui->set(
|
||||
$php_view,
|
||||
[
|
||||
'table' => $table,
|
||||
'field' => 'php_view',
|
||||
'id' => $item->id,
|
||||
'type' => 'php'
|
||||
]
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Load all alias and ID's of a table
|
||||
*
|
||||
* @param string $table The table where to find the alias
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function set(string $table)
|
||||
{
|
||||
// now check if key is found
|
||||
if (!$this->registry->get('builder.data_with_alias_keys.' . $table, null))
|
||||
{
|
||||
// Create a new query object.
|
||||
$query = $this->db->getQuery(true);
|
||||
$query->select(array('a.id', 'a.alias'));
|
||||
$query->from('#__componentbuilder_' . $table . ' AS a');
|
||||
$this->db->setQuery($query);
|
||||
$items = $this->db->loadObjectList();
|
||||
|
||||
// check if we have an array
|
||||
if (ArrayHelper::check($items))
|
||||
{
|
||||
foreach ($items as $item)
|
||||
{
|
||||
// build the key
|
||||
$k_ey = StringHelper::safe($item->alias);
|
||||
$key = preg_replace("/[^A-Za-z]/", '', (string) $k_ey);
|
||||
|
||||
// set the keys
|
||||
$this->registry->
|
||||
set('builder.data_with_alias_keys.' . $table . '.' . $item->alias, $item->id);
|
||||
$this->registry->
|
||||
set('builder.data_with_alias_keys.' . $table . '.' . $k_ey, $item->id);
|
||||
$this->registry->
|
||||
set('builder.data_with_alias_keys.' . $table . '.' . $key, $item->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Controller Allow Add Class for Joomla 5
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AllowAdd implements AllowAddInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* The Dispenser Class.
|
||||
*
|
||||
* @var Dispenser
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Dispenser $dispenser;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
* @param Dispenser $dispenser The Dispenser Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission,
|
||||
Dispenser $dispenser)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
$this->dispenser = $dispenser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Allow Add Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The allow add method code
|
||||
*/
|
||||
public function get(string $nameSingleCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// prepare custom permission script
|
||||
$custom_allow = $this->dispenser->get(
|
||||
'php_allowadd', $nameSingleCode, '', null, true
|
||||
);
|
||||
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Get user object.";
|
||||
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.access'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Access check.";
|
||||
$allow[] = Indent::_(2) . "\$access = \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.access')
|
||||
. "', 'com_" . $this->component . "');";
|
||||
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
}
|
||||
|
||||
// load custom permission script
|
||||
$allow[] = $custom_allow;
|
||||
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.create'))
|
||||
{
|
||||
// setup the default script
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.create')
|
||||
. "', \$this->option);";
|
||||
}
|
||||
else
|
||||
{
|
||||
// setup the default script
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return parent::allowAdd(\$data);";
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Controller Allow Edit Class for Joomla 5
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AllowEdit implements AllowEditInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* The Dispenser Class.
|
||||
*
|
||||
* @var Dispenser
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Dispenser $dispenser;
|
||||
|
||||
/**
|
||||
* The Category Class.
|
||||
*
|
||||
* @var Category
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Category $category;
|
||||
|
||||
/**
|
||||
* The CategoryOtherName Class.
|
||||
*
|
||||
* @var CategoryOtherName
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CategoryOtherName $categoryothername;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
* @param Dispenser $dispenser The Dispenser Class.
|
||||
* @param Category $category The Category Class.
|
||||
* @param CategoryOtherName $categoryothername The CategoryOtherName Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission,
|
||||
Dispenser $dispenser, Category $category,
|
||||
CategoryOtherName $categoryothername)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
$this->dispenser = $dispenser;
|
||||
$this->category = $category;
|
||||
$this->categoryothername = $categoryothername;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Allow Edit Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
* @param string $nameListCode The list code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The allow edit method code
|
||||
*/
|
||||
public function get(string $nameSingleCode, string $nameListCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// prepare custom permission script
|
||||
$customAllow = $this->dispenser->get(
|
||||
'php_allowedit', $nameSingleCode, '', null, true
|
||||
);
|
||||
|
||||
if ($this->category->exists("{$nameListCode}"))
|
||||
{
|
||||
// check if category has another name
|
||||
$otherViews = $this->categoryothername->
|
||||
get($nameListCode . '.views', $nameListCode);
|
||||
$otherView = $this->categoryothername->
|
||||
get($nameListCode . '.view', $nameSingleCode);
|
||||
// setup the category script
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get user object.";
|
||||
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get record id.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;";
|
||||
// load custom permission script
|
||||
$allow[] = $customAllow;
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->globalExist($otherView, 'core.access'))
|
||||
{
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(
|
||||
__LINE__,__CLASS__
|
||||
) . " Access check.";
|
||||
$allow[] = Indent::_(2) . "\$access = (\$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.access')
|
||||
. "', 'com_" . $this->component . "." . $otherView
|
||||
. ".' . (int) \$recordId) && \$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.access')
|
||||
. "', 'com_" . $this->component . "'));";
|
||||
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
}
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||
. $this->permission->getAction($otherView, 'core.edit') . "', 'com_" . $this->component . "."
|
||||
. $otherView . ".' . (int) \$recordId);";
|
||||
$allow[] = Indent::_(3) . "if (!\$permission)";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(4) . "if (\$user->authorise('"
|
||||
. $this->permission->getAction($otherView, 'core.edit.own') . "', 'com_" . $this->component . "."
|
||||
. $otherView . ".' . \$recordId))";
|
||||
$allow[] = Indent::_(4) . "{";
|
||||
$allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Fallback on edit.own. Now test the owner is the user.";
|
||||
$allow[] = Indent::_(5)
|
||||
. "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;";
|
||||
$allow[] = Indent::_(5) . "if (empty(\$ownerId))";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
$allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Need to do a lookup from the model.";
|
||||
$allow[] = Indent::_(6)
|
||||
. "\$record = \$this->getModel()->getItem(\$recordId);";
|
||||
$allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return false;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " If the owner matches 'me' then do the test.";
|
||||
$allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(6) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.edit.own') . "', 'com_" . $this->component . "'))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return true;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = Indent::_(4) . "}";
|
||||
$allow[] = Indent::_(4) . "return false;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
if ($this->permission->globalExist($otherView, 'core.edit'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.edit') . "', \$this->option);";
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "return parent::allowEdit(\$data, \$key);";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// setup the category script
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get user object.";
|
||||
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get record id.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;";
|
||||
// load custom permission script
|
||||
$allow[] = $customAllow;
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->actionExist($nameSingleCode, 'core.access'))
|
||||
{
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(
|
||||
__LINE__,__CLASS__
|
||||
) . " Access check.";
|
||||
$allow[] = Indent::_(2) . "\$access = (\$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode
|
||||
. ".' . (int) \$recordId) && \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "'));";
|
||||
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
}
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.edit') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . (int) \$recordId);";
|
||||
$allow[] = Indent::_(3) . "if (!\$permission)";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(4) . "if (\$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . \$recordId))";
|
||||
$allow[] = Indent::_(4) . "{";
|
||||
$allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Now test the owner is the user.";
|
||||
$allow[] = Indent::_(5)
|
||||
. "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;";
|
||||
$allow[] = Indent::_(5) . "if (empty(\$ownerId))";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
$allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Need to do a lookup from the model.";
|
||||
$allow[] = Indent::_(6)
|
||||
. "\$record = \$this->getModel()->getItem(\$recordId);";
|
||||
$allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return false;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " If the owner matches 'me' then allow.";
|
||||
$allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(6) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "'))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return true;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = Indent::_(4) . "}";
|
||||
$allow[] = Indent::_(4) . "return false;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.edit'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.edit') . "', \$this->option);";
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "return parent::allowEdit(\$data, \$key);";
|
||||
}
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanDeleteInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Model Can Delete Class for Joomla 5
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CanDelete implements CanDeleteInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Can Delete Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The can delete method code
|
||||
*/
|
||||
public function get(string $nameSingleCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// setup the default script
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->published != -2))";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}" . PHP_EOL;
|
||||
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$this->getCurrentUser()->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . (int) \$record->id);";
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Model Can Edit State Class for Joomla 5
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CanEditState implements CanEditStateInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Can Edit State Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The can edit state method code
|
||||
*/
|
||||
public function get(string $nameSingleCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// setup the default script
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "\$user = \$this->getCurrentUser();";
|
||||
$allow[] = Indent::_(2)
|
||||
. "\$recordId = \$record->id ?? 0;";
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.edit.state')
|
||||
. "', 'com_" . $this->component . "." . $nameSingleCode . ".' . (int) \$recordId);";
|
||||
$allow[] = Indent::_(3)
|
||||
. "if (!\$permission && !is_null(\$permission))";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
$allow[] = Indent::_(4) . "return false;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.edit.state'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.edit.state') . "', 'com_" . $this->component
|
||||
. "');";
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "return parent::canEditState(\$record);";
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Controller Allow Add Class for Joomla 4
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AllowAdd implements AllowAddInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* The Dispenser Class.
|
||||
*
|
||||
* @var Dispenser
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Dispenser $dispenser;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
* @param Dispenser $dispenser The Dispenser Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission,
|
||||
Dispenser $dispenser)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
$this->dispenser = $dispenser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Allow Add Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The allow add method code
|
||||
*/
|
||||
public function get(string $nameSingleCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// prepare custom permission script
|
||||
$custom_allow = $this->dispenser->get(
|
||||
'php_allowadd', $nameSingleCode, '', null, true
|
||||
);
|
||||
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Get user object.";
|
||||
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.access'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Access check.";
|
||||
$allow[] = Indent::_(2) . "\$access = \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.access')
|
||||
. "', 'com_" . $this->component . "');";
|
||||
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
}
|
||||
|
||||
// load custom permission script
|
||||
$allow[] = $custom_allow;
|
||||
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.create'))
|
||||
{
|
||||
// setup the default script
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.create')
|
||||
. "', \$this->option);";
|
||||
}
|
||||
else
|
||||
{
|
||||
// setup the default script
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return parent::allowAdd(\$data);";
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Controller Allow Edit Class for Joomla 4
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AllowEdit implements AllowEditInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* The Dispenser Class.
|
||||
*
|
||||
* @var Dispenser
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Dispenser $dispenser;
|
||||
|
||||
/**
|
||||
* The Category Class.
|
||||
*
|
||||
* @var Category
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Category $category;
|
||||
|
||||
/**
|
||||
* The CategoryOtherName Class.
|
||||
*
|
||||
* @var CategoryOtherName
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CategoryOtherName $categoryothername;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
* @param Dispenser $dispenser The Dispenser Class.
|
||||
* @param Category $category The Category Class.
|
||||
* @param CategoryOtherName $categoryothername The CategoryOtherName Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission,
|
||||
Dispenser $dispenser, Category $category,
|
||||
CategoryOtherName $categoryothername)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
$this->dispenser = $dispenser;
|
||||
$this->category = $category;
|
||||
$this->categoryothername = $categoryothername;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Allow Edit Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
* @param string $nameListCode The list code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The allow edit method code
|
||||
*/
|
||||
public function get(string $nameSingleCode, string $nameListCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// prepare custom permission script
|
||||
$customAllow = $this->dispenser->get(
|
||||
'php_allowedit', $nameSingleCode, '', null, true
|
||||
);
|
||||
|
||||
if ($this->category->exists("{$nameListCode}"))
|
||||
{
|
||||
// check if category has another name
|
||||
$otherViews = $this->categoryothername->
|
||||
get($nameListCode . '.views', $nameListCode);
|
||||
$otherView = $this->categoryothername->
|
||||
get($nameListCode . '.view', $nameSingleCode);
|
||||
// setup the category script
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get user object.";
|
||||
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get record id.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;";
|
||||
// load custom permission script
|
||||
$allow[] = $customAllow;
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->globalExist($otherView, 'core.access'))
|
||||
{
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(
|
||||
__LINE__,__CLASS__
|
||||
) . " Access check.";
|
||||
$allow[] = Indent::_(2) . "\$access = (\$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.access')
|
||||
. "', 'com_" . $this->component . "." . $otherView
|
||||
. ".' . (int) \$recordId) && \$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.access')
|
||||
. "', 'com_" . $this->component . "'));";
|
||||
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
}
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||
. $this->permission->getAction($otherView, 'core.edit') . "', 'com_" . $this->component . "."
|
||||
. $otherView . ".' . (int) \$recordId);";
|
||||
$allow[] = Indent::_(3) . "if (!\$permission)";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(4) . "if (\$user->authorise('"
|
||||
. $this->permission->getAction($otherView, 'core.edit.own') . "', 'com_" . $this->component . "."
|
||||
. $otherView . ".' . \$recordId))";
|
||||
$allow[] = Indent::_(4) . "{";
|
||||
$allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Fallback on edit.own. Now test the owner is the user.";
|
||||
$allow[] = Indent::_(5)
|
||||
. "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;";
|
||||
$allow[] = Indent::_(5) . "if (empty(\$ownerId))";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
$allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Need to do a lookup from the model.";
|
||||
$allow[] = Indent::_(6)
|
||||
. "\$record = \$this->getModel()->getItem(\$recordId);";
|
||||
$allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return false;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " If the owner matches 'me' then do the test.";
|
||||
$allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(6) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.edit.own') . "', 'com_" . $this->component . "'))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return true;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = Indent::_(4) . "}";
|
||||
$allow[] = Indent::_(4) . "return false;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
if ($this->permission->globalExist($otherView, 'core.edit'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.edit') . "', \$this->option);";
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "return parent::allowEdit(\$data, \$key);";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// setup the category script
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get user object.";
|
||||
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get record id.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;";
|
||||
// load custom permission script
|
||||
$allow[] = $customAllow;
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->actionExist($nameSingleCode, 'core.access'))
|
||||
{
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(
|
||||
__LINE__,__CLASS__
|
||||
) . " Access check.";
|
||||
$allow[] = Indent::_(2) . "\$access = (\$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode
|
||||
. ".' . (int) \$recordId) && \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "'));";
|
||||
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
}
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.edit') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . (int) \$recordId);";
|
||||
$allow[] = Indent::_(3) . "if (!\$permission)";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(4) . "if (\$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . \$recordId))";
|
||||
$allow[] = Indent::_(4) . "{";
|
||||
$allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Now test the owner is the user.";
|
||||
$allow[] = Indent::_(5)
|
||||
. "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;";
|
||||
$allow[] = Indent::_(5) . "if (empty(\$ownerId))";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
$allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Need to do a lookup from the model.";
|
||||
$allow[] = Indent::_(6)
|
||||
. "\$record = \$this->getModel()->getItem(\$recordId);";
|
||||
$allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return false;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " If the owner matches 'me' then allow.";
|
||||
$allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(6) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "'))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return true;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = Indent::_(4) . "}";
|
||||
$allow[] = Indent::_(4) . "return false;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.edit'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.edit') . "', \$this->option);";
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "return parent::allowEdit(\$data, \$key);";
|
||||
}
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanDeleteInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Model Can Delete Class for Joomla 4
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CanDelete implements CanDeleteInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Can Delete Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The can delete method code
|
||||
*/
|
||||
public function get(string $nameSingleCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// setup the default script
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->published != -2))";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}" . PHP_EOL;
|
||||
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$this->getCurrentUser()->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . (int) \$record->id);";
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Model Can Edit State Class for Joomla 4
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CanEditState implements CanEditStateInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Can Edit State Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The can edit state method code
|
||||
*/
|
||||
public function get(string $nameSingleCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// setup the default script
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "\$user = \$this->getCurrentUser();";
|
||||
$allow[] = Indent::_(2)
|
||||
. "\$recordId = \$record->id ?? 0;";
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.edit.state')
|
||||
. "', 'com_" . $this->component . "." . $nameSingleCode . ".' . (int) \$recordId);";
|
||||
$allow[] = Indent::_(3)
|
||||
. "if (!\$permission && !is_null(\$permission))";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
$allow[] = Indent::_(4) . "return false;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.edit.state'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.edit.state') . "', 'com_" . $this->component
|
||||
. "');";
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "return parent::canEditState(\$record);";
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Controller Allow Add Class for Joomla 3
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AllowAdd implements AllowAddInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* The Dispenser Class.
|
||||
*
|
||||
* @var Dispenser
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Dispenser $dispenser;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
* @param Dispenser $dispenser The Dispenser Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission,
|
||||
Dispenser $dispenser)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
$this->dispenser = $dispenser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Allow Add Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The allow add method code
|
||||
*/
|
||||
public function get(string $nameSingleCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// prepare custom permission script
|
||||
$custom_allow = $this->dispenser->get(
|
||||
'php_allowadd', $nameSingleCode, '', null, true
|
||||
);
|
||||
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Get user object.";
|
||||
$allow[] = Indent::_(2) . "\$user = Factory::getUser();";
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.access'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Access check.";
|
||||
$allow[] = Indent::_(2) . "\$access = \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.access')
|
||||
. "', 'com_" . $this->component . "');";
|
||||
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
}
|
||||
|
||||
// load custom permission script
|
||||
$allow[] = $custom_allow;
|
||||
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.create'))
|
||||
{
|
||||
// setup the default script
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.create')
|
||||
. "', \$this->option);";
|
||||
}
|
||||
else
|
||||
{
|
||||
// setup the default script
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return parent::allowAdd(\$data);";
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Controller Allow Edit Class for Joomla 3
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AllowEdit implements AllowEditInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* The Dispenser Class.
|
||||
*
|
||||
* @var Dispenser
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Dispenser $dispenser;
|
||||
|
||||
/**
|
||||
* The Category Class.
|
||||
*
|
||||
* @var Category
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Category $category;
|
||||
|
||||
/**
|
||||
* The CategoryOtherName Class.
|
||||
*
|
||||
* @var CategoryOtherName
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CategoryOtherName $categoryothername;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
* @param Dispenser $dispenser The Dispenser Class.
|
||||
* @param Category $category The Category Class.
|
||||
* @param CategoryOtherName $categoryothername The CategoryOtherName Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission,
|
||||
Dispenser $dispenser, Category $category,
|
||||
CategoryOtherName $categoryothername)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
$this->dispenser = $dispenser;
|
||||
$this->category = $category;
|
||||
$this->categoryothername = $categoryothername;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Allow Edit Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
* @param string $nameListCode The list code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The allow edit method code
|
||||
*/
|
||||
public function get(string $nameSingleCode, string $nameListCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// prepare custom permission script
|
||||
$customAllow = $this->dispenser->get(
|
||||
'php_allowedit', $nameSingleCode, '', null, true
|
||||
);
|
||||
|
||||
if ($this->category->exists("{$nameListCode}"))
|
||||
{
|
||||
// check if category has another name
|
||||
$otherViews = $this->categoryothername->
|
||||
get($nameListCode . '.views', $nameListCode);
|
||||
$otherView = $this->categoryothername->
|
||||
get($nameListCode . '.view', $nameSingleCode);
|
||||
// setup the category script
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get user object.";
|
||||
$allow[] = Indent::_(2) . "\$user = Factory::getUser();";
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get record id.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;";
|
||||
// load custom permission script
|
||||
$allow[] = $customAllow;
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->globalExist($otherView, 'core.access'))
|
||||
{
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(
|
||||
__LINE__,__CLASS__
|
||||
) . " Access check.";
|
||||
$allow[] = Indent::_(2) . "\$access = (\$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.access')
|
||||
. "', 'com_" . $this->component . "." . $otherView
|
||||
. ".' . (int) \$recordId) && \$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.access')
|
||||
. "', 'com_" . $this->component . "'));";
|
||||
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
}
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||
. $this->permission->getAction($otherView, 'core.edit') . "', 'com_" . $this->component . "."
|
||||
. $otherView . ".' . (int) \$recordId);";
|
||||
$allow[] = Indent::_(3) . "if (!\$permission)";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(4) . "if (\$user->authorise('"
|
||||
. $this->permission->getAction($otherView, 'core.edit.own') . "', 'com_" . $this->component . "."
|
||||
. $otherView . ".' . \$recordId))";
|
||||
$allow[] = Indent::_(4) . "{";
|
||||
$allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Fallback on edit.own. Now test the owner is the user.";
|
||||
$allow[] = Indent::_(5)
|
||||
. "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;";
|
||||
$allow[] = Indent::_(5) . "if (empty(\$ownerId))";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
$allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Need to do a lookup from the model.";
|
||||
$allow[] = Indent::_(6)
|
||||
. "\$record = \$this->getModel()->getItem(\$recordId);";
|
||||
$allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return false;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " If the owner matches 'me' then do the test.";
|
||||
$allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(6) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.edit.own') . "', 'com_" . $this->component . "'))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return true;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = Indent::_(4) . "}";
|
||||
$allow[] = Indent::_(4) . "return false;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
if ($this->permission->globalExist($otherView, 'core.edit'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($otherView, 'core.edit') . "', \$this->option);";
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "return parent::allowEdit(\$data, \$key);";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// setup the category script
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get user object.";
|
||||
$allow[] = Indent::_(2) . "\$user = Factory::getUser();";
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get record id.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;";
|
||||
// load custom permission script
|
||||
$allow[] = $customAllow;
|
||||
// check if the item has permissions.
|
||||
if ($this->permission->actionExist($nameSingleCode, 'core.access'))
|
||||
{
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(
|
||||
__LINE__,__CLASS__
|
||||
) . " Access check.";
|
||||
$allow[] = Indent::_(2) . "\$access = (\$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode
|
||||
. ".' . (int) \$recordId) && \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "'));";
|
||||
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "return false;";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
}
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.edit') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . (int) \$recordId);";
|
||||
$allow[] = Indent::_(3) . "if (!\$permission)";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(4) . "if (\$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . \$recordId))";
|
||||
$allow[] = Indent::_(4) . "{";
|
||||
$allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Now test the owner is the user.";
|
||||
$allow[] = Indent::_(5)
|
||||
. "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;";
|
||||
$allow[] = Indent::_(5) . "if (empty(\$ownerId))";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
$allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Need to do a lookup from the model.";
|
||||
$allow[] = Indent::_(6)
|
||||
. "\$record = \$this->getModel()->getItem(\$recordId);";
|
||||
$allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return false;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||
. " If the owner matches 'me' then allow.";
|
||||
$allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)";
|
||||
$allow[] = Indent::_(5) . "{";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(6) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "'))";
|
||||
$allow[] = Indent::_(6) . "{";
|
||||
$allow[] = Indent::_(7) . "return true;";
|
||||
$allow[] = Indent::_(6) . "}";
|
||||
$allow[] = Indent::_(5) . "}";
|
||||
$allow[] = Indent::_(4) . "}";
|
||||
$allow[] = Indent::_(4) . "return false;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.edit'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.edit') . "', \$this->option);";
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Since there is no permission, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "return parent::allowEdit(\$data, \$key);";
|
||||
}
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanDeleteInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Model Can Delete Class for Joomla 3
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CanDelete implements CanDeleteInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Model Can Delete Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The can delete method code
|
||||
*/
|
||||
public function get(string $nameSingleCode): string
|
||||
{
|
||||
$allow = [];
|
||||
// setup the default script
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (!empty(\$record->id))";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "if (\$record->published != -2)";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
$allow[] = Indent::_(4) . "return;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
// check if the item has permissions.
|
||||
$allow[] = PHP_EOL . Indent::_(3)
|
||||
. "\$user = Factory::getUser();";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
$allow[] = Indent::_(3) . "return \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . (int) \$record->id);";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
$allow[] = Indent::_(2) . "return false;";
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Model Can Edit State Class for Joomla 3
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CanEditState implements CanEditStateInterface
|
||||
{
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Can Edit State Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The can edit state method code
|
||||
*/
|
||||
public function get(string $nameSingleCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// setup the default script
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "\$user = Factory::getUser();";
|
||||
$allow[] = Indent::_(2)
|
||||
. "\$recordId = \$record->id ?? 0;";
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
// check if the item has permissions.
|
||||
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.edit.state')
|
||||
. "', 'com_" . $this->component . "." . $nameSingleCode . ".' . (int) \$recordId);";
|
||||
$allow[] = Indent::_(3)
|
||||
. "if (!\$permission && !is_null(\$permission))";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
$allow[] = Indent::_(4) . "return false;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
if ($this->permission->globalExist($nameSingleCode, 'core.edit.state'))
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||
. $this->permission->getGlobal($nameSingleCode, 'core.edit.state') . "', 'com_" . $this->component
|
||||
. "');";
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " In the absence of better information, revert to the component permissions.";
|
||||
$allow[] = Indent::_(2)
|
||||
. "return parent::canEditState(\$record);";
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Access Switch Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AccessSwitch extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Access Switch List Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AccessSwitchList extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Admin Filter Type Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AdminFilterType extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Alias Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class Alias extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\IsArray;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Assets Rules Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AssetsRules extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Is an Array
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use IsArray;
|
||||
|
||||
/**
|
||||
* Base switch to add values as string or array
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected bool $addAsArray = true;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Base64 Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class BaseSixFour extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Category Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class Category extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\GetString;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Category Code Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CategoryCode extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Get String Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use GetString;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Category Other Name Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CategoryOtherName extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Check Box Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CheckBox extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\VarExport;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Component Fields Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ComponentFields extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Var Export Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use VarExport;
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Config Field Sets Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ConfigFieldsets extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Base switch to add values as string or array
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected bool $addAsArray = true;
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\IsArray;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Config Field Sets Custom Field Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ConfigFieldsetsCustomfield extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Is an Array
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use IsArray;
|
||||
}
|
||||
|
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\IsArray;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Compiler Content Multi
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
class ContentMulti extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Is an Array
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use IsArray;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setSeparator('|');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get that the active keys from a path
|
||||
*
|
||||
* @param string $path The path to determine the location mapper.
|
||||
*
|
||||
* @return array|null The valid array of keys
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getActiveKeys(string $path): ?array
|
||||
{
|
||||
// Call the parent class's version of this method
|
||||
$keys = parent::getActiveKeys($path);
|
||||
|
||||
if ($keys === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->modelActiveKeys($keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Model that the active key
|
||||
*
|
||||
* @param array $keys The keys to the location mapper.
|
||||
*
|
||||
* @return array|null The valid array of key
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function modelActiveKeys(array $keys): ?array
|
||||
{
|
||||
if (isset($keys[1]))
|
||||
{
|
||||
return [$keys[0], Placefix::_h($keys[1])];
|
||||
}
|
||||
|
||||
if (isset($keys[0]))
|
||||
{
|
||||
return [$keys[0]];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Compiler Content One
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
class ContentOne extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setSeparator(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get that the active keys from a path
|
||||
*
|
||||
* @param string $path The path to determine the location mapper.
|
||||
*
|
||||
* @return array|null The valid array of keys
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function getActiveKeys(string $path): ?array
|
||||
{
|
||||
// Call the parent class's version of this method
|
||||
$keys = parent::getActiveKeys($path);
|
||||
|
||||
if ($keys === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->modelActiveKeys($keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Model that the active key
|
||||
*
|
||||
* @param array $keys The keys to the location mapper.
|
||||
*
|
||||
* @return array The valid array of key
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function modelActiveKeys(array $keys): array
|
||||
{
|
||||
return [Placefix::_h($keys[0])];
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Contributors Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class Contributors extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Custom Alias Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CustomAlias extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Custom Field Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CustomField extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\ToString;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Custom Field Links Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CustomFieldLinks extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* To String Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use ToString;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Custom List Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CustomList extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Custom Tabs Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class CustomTabs extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Database Keys Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class DatabaseKeys extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Database Tables Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class DatabaseTables extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\IsArray;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Database Uninstall Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class DatabaseUninstall extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Is an Array
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use IsArray;
|
||||
|
||||
/**
|
||||
* Base switch to add values as string or array
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected bool $addAsArray = true;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Database Unique Guid Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class DatabaseUniqueGuid extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Database Unique Keys Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class DatabaseUniqueKeys extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Do Not Escape Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class DoNotEscape extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\ToString;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Dynamic Fields Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class DynamicFields extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* To String Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use ToString;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Extension Custom Fields Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ExtensionCustomFields extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\IsArray;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Extensions Params Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ExtensionsParams extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Is an Array
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use IsArray;
|
||||
|
||||
/**
|
||||
* Base switch to add values as string or array
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected bool $addAsArray = true;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Field Group Control Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class FieldGroupControl extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\IsString;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Field Names Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class FieldNames extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Is String Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use IsString;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Field Relations Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class FieldRelations extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Filter Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class Filter extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Footable Scripts Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class FootableScripts extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Front-end Params Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class FrontendParams extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Get As Lookup Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class GetAsLookup extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Get Module Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class GetModule extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Google Chart Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class GoogleChart extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Has Menu Global Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class HasMenuGlobal extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Has Permissions Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class HasPermissions extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\ToString;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Hidden Fields Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class HiddenFields extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* To String Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use ToString;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* History Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class History extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\ToString;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Integer Fields Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class IntegerFields extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* To String Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use ToString;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Items Method Eximport String Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ItemsMethodEximportString extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Items Method List String Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ItemsMethodListString extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Json Item Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class JsonItem extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\InArray;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Json Item Array Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class JsonItemArray extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* In Array
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use InArray;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Json String Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class JsonString extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\IsArray;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Language Messages Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class LanguageMessages extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Is an Array
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use IsArray;
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Abstraction\Registry\Traits\Count;
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Layout Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class Layout extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Count Values
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
use Count;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Layout Data Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class LayoutData extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Library Manager Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class LibraryManager extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* List Field Class Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ListFieldClass extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* List Head Override Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ListHeadOverride extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* List Join Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ListJoin extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Lists Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class Lists extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Main Text Field Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class MainTextField extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user