Adds new Content class. Adds the intial Package Classes. Removed phpseclib.

This commit is contained in:
2022-12-04 11:23:43 +02:00
parent 6c42b5af61
commit 4217b22f67
174 changed files with 2091 additions and 38444 deletions

View File

@ -175,7 +175,7 @@ class ComponentbuilderModelAjax extends ListModel
// we first use the new encryption
// load phpseclib <https://phpseclib.com/docs/symmetric>
$opened = false;
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael)
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib3\Crypt\Rijndael)
{
// load the system password
ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($password, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt');

View File

@ -186,22 +186,6 @@
</field>
<!-- Load_powers_note Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="load_powers_note" label="COM_COMPONENTBUILDER_POWER_LOAD_POWERS_NOTE_LABEL" description="COM_COMPONENTBUILDER_POWER_LOAD_POWERS_NOTE_DESCRIPTION" heading="h4" class="alert alert-info load_powers_note" />
<!-- Main_class_code Field. Type: Editor. (joomla) -->
<field
type="editor"
name="main_class_code"
label="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_LABEL"
description="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_DESCRIPTION"
width="100%"
height="800px"
cols="40"
rows="300"
buttons="no"
syntax="php"
editor="codemirror|none"
filter="raw"
validate="code"
/>
<!-- Description Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -227,6 +211,63 @@
validate="code"
showon="add_licensing_template:2"
/>
<!-- Composer Field. Type: Subform. (joomla) -->
<field
type="subform"
name="composer"
label="COM_COMPONENTBUILDER_POWER_COMPOSER_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
buttons="add,remove,move"
icon="list"
max="1"
min="0">
<form hidden="true" name="list_composer_modal" repeat="true">
<!-- Access_point Field. Type: Text. (joomla) -->
<field
type="text"
name="access_point"
label="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_LABEL"
size="70"
maxlength="300"
description="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_DESCRIPTION"
class="text_area"
required="true"
filter="PATH"
message="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_MESSAGE"
hint="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_HINT"
/>
<!-- Namespace Field. Type: Subform. (joomla) -->
<field
type="subform"
name="namespace"
label="COM_COMPONENTBUILDER_POWER_NAMESPACE_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
buttons="add,remove,move"
icon="list"
max="30"
min="1"
nested_depth="1">
<form hidden="true" name="list_namespace_modal" repeat="true">
<!-- Use Field. Type: Text. (joomla) -->
<field
type="text"
name="use"
label="COM_COMPONENTBUILDER_POWER_USE_LABEL"
size="70"
maxlength="300"
class="text_area"
required="true"
filter="STRING"
message="COM_COMPONENTBUILDER_POWER_USE_MESSAGE"
hint="COM_COMPONENTBUILDER_POWER_USE_HINT"
autocomplete="on"
/>
</form>
</field>
</form>
</field>
<!-- Property_selection Field. Type: Subform. (joomla) -->
<field
type="subform"
@ -372,21 +413,8 @@
required="false"
validate="code"
/>
<!-- Add_licensing_template Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_licensing_template"
label="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_LABEL"
description="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_POWER_USE_GLOBAL</option>
<option value="2">
COM_COMPONENTBUILDER_POWER_OVERRIDE</option>
</field>
<!-- Autoload_composer_note Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="autoload_composer_note" label="COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_LABEL" description="COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_DESCRIPTION" heading="h4" class="alert alert-info autoload_composer_note" />
<!-- Use_selection Field. Type: Subform. (joomla) -->
<field
type="subform"
@ -425,6 +453,37 @@
/>
</form>
</field>
<!-- Add_licensing_template Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_licensing_template"
label="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_LABEL"
description="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_POWER_USE_GLOBAL</option>
<option value="2">
COM_COMPONENTBUILDER_POWER_OVERRIDE</option>
</field>
<!-- Main_class_code Field. Type: Editor. (joomla) -->
<field
type="editor"
name="main_class_code"
label="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_LABEL"
description="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_DESCRIPTION"
width="100%"
height="800px"
cols="40"
rows="300"
buttons="no"
syntax="php"
editor="codemirror|none"
filter="raw"
validate="code"
/>
<!-- Guid Field. Type: Text. (joomla) -->
<field
type="text"

View File

@ -1096,7 +1096,7 @@ class ComponentbuilderModelImport_joomla_components extends BaseDatabaseModel
// check if we should use the phpseclib decryption
$phpseclip = (isset($this->packageInfo['phpseclib']) && $this->packageInfo['phpseclib']) ? true : $force;
// load phpseclib <https://phpseclib.com/docs/symmetric>
if($phpseclip && ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael)
if($phpseclip && ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib3\Crypt\Rijndael)
{
// load the system password
ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($password, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt');

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
/**
* Joomla_components List Model
@ -1259,7 +1260,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
// $locker = new FOFEncryptAes($this->key, 128);
// $data = $locker->encryptString($data);
// load phpseclib <https://phpseclib.com/docs/symmetric>
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael)
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib3\Crypt\Rijndael)
{
// set the password
ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($this->key, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt');
@ -1313,7 +1314,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
return false;
}
// set info data
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael)
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib3\Crypt\Rijndael)
{
// set system password
$db = 'COM_COMPONENTBUILDER_SZDEQZDMVSMHBTRWFIFTYTSQFLVVXJTMTHREEJTWOIXM';

View File

@ -64,6 +64,12 @@ class ComponentbuilderModelPower extends AdminModel
'add_licensing_template',
'licensing_template'
)
),
'composer' => array(
'fullwidth' => array(
'autoload_composer_note',
'composer'
)
)
);
@ -178,12 +184,6 @@ class ComponentbuilderModelPower extends AdminModel
$item->metadata = $registry->toArray();
}
if (!empty($item->main_class_code))
{
// base64 Decode main_class_code.
$item->main_class_code = base64_decode($item->main_class_code);
}
if (!empty($item->licensing_template))
{
// base64 Decode licensing_template.
@ -196,6 +196,12 @@ class ComponentbuilderModelPower extends AdminModel
$item->head = base64_decode($item->head);
}
if (!empty($item->main_class_code))
{
// base64 Decode main_class_code.
$item->main_class_code = base64_decode($item->main_class_code);
}
if (!empty($item->load_selection))
{
// Convert the load_selection field to an array.
@ -204,6 +210,14 @@ class ComponentbuilderModelPower extends AdminModel
$item->load_selection = $load_selection->toArray();
}
if (!empty($item->composer))
{
// Convert the composer field to an array.
$composer = new Registry;
$composer->loadString($item->composer);
$item->composer = $composer->toArray();
}
if (!empty($item->property_selection))
{
// Convert the property_selection field to an array.
@ -1050,6 +1064,19 @@ class ComponentbuilderModelPower extends AdminModel
$data['load_selection'] = '';
}
// Set the composer items to data.
if (isset($data['composer']) && is_array($data['composer']))
{
$composer = new JRegistry;
$composer->loadArray($data['composer']);
$data['composer'] = (string) $composer;
}
elseif (!isset($data['composer']))
{
// Set the empty composer to data
$data['composer'] = '';
}
// Set the property_selection items to data.
if (isset($data['property_selection']) && is_array($data['property_selection']))
{
@ -1102,12 +1129,6 @@ class ComponentbuilderModelPower extends AdminModel
$data['use_selection'] = '';
}
// Set the main_class_code string to base64 string.
if (isset($data['main_class_code']))
{
$data['main_class_code'] = base64_encode($data['main_class_code']);
}
// Set the licensing_template string to base64 string.
if (isset($data['licensing_template']))
{
@ -1119,6 +1140,12 @@ class ComponentbuilderModelPower extends AdminModel
{
$data['head'] = base64_encode($data['head']);
}
// Set the main_class_code string to base64 string.
if (isset($data['main_class_code']))
{
$data['main_class_code'] = base64_encode($data['main_class_code']);
}
// Set the Params Items to data
if (isset($data['params']) && is_array($data['params']))