forked from joomla/super-powers
Update 2024-09-11 03:45:23
This commit is contained in:
parent
92c4b2881e
commit
b0cdf9d36e
12
README.md
12
README.md
@ -92,8 +92,10 @@ This repository contains an index (see below) of all the approved powers within
|
|||||||
- **abstract class GuidHelper** | [Details](src/9c513baf-b279-43fd-ae29-a585c8cbc4f0) | [Code](src/9c513baf-b279-43fd-ae29-a585c8cbc4f0/code.php) | [Settings](src/9c513baf-b279-43fd-ae29-a585c8cbc4f0/settings.json) | SPK: `Super---9c513baf_b279_43fd_ae29_a585c8cbc4f0---Power`
|
- **abstract class GuidHelper** | [Details](src/9c513baf-b279-43fd-ae29-a585c8cbc4f0) | [Code](src/9c513baf-b279-43fd-ae29-a585c8cbc4f0/code.php) | [Settings](src/9c513baf-b279-43fd-ae29-a585c8cbc4f0/settings.json) | SPK: `Super---9c513baf_b279_43fd_ae29_a585c8cbc4f0---Power`
|
||||||
- **abstract class JsonHelper** | [Details](src/4b225c51-d293-48e4-b3f6-5136cf5c3f18) | [Code](src/4b225c51-d293-48e4-b3f6-5136cf5c3f18/code.php) | [Settings](src/4b225c51-d293-48e4-b3f6-5136cf5c3f18/settings.json) | SPK: `Super---4b225c51_d293_48e4_b3f6_5136cf5c3f18---Power`
|
- **abstract class JsonHelper** | [Details](src/4b225c51-d293-48e4-b3f6-5136cf5c3f18) | [Code](src/4b225c51-d293-48e4-b3f6-5136cf5c3f18/code.php) | [Settings](src/4b225c51-d293-48e4-b3f6-5136cf5c3f18/settings.json) | SPK: `Super---4b225c51_d293_48e4_b3f6_5136cf5c3f18---Power`
|
||||||
- **abstract class MathHelper** | [Details](src/152c8793-8b75-4715-996a-257b9f65451c) | [Code](src/152c8793-8b75-4715-996a-257b9f65451c/code.php) | [Settings](src/152c8793-8b75-4715-996a-257b9f65451c/settings.json) | SPK: `Super---152c8793_8b75_4715_996a_257b9f65451c---Power`
|
- **abstract class MathHelper** | [Details](src/152c8793-8b75-4715-996a-257b9f65451c) | [Code](src/152c8793-8b75-4715-996a-257b9f65451c/code.php) | [Settings](src/152c8793-8b75-4715-996a-257b9f65451c/settings.json) | SPK: `Super---152c8793_8b75_4715_996a_257b9f65451c---Power`
|
||||||
|
- **abstract class MimeHelper** | [Details](src/f11dc790-713e-4706-9a85-a318ed3ad56e) | [Code](src/f11dc790-713e-4706-9a85-a318ed3ad56e/code.php) | [Settings](src/f11dc790-713e-4706-9a85-a318ed3ad56e/settings.json) | SPK: `Super---f11dc790_713e_4706_9a85_a318ed3ad56e---Power`
|
||||||
- **abstract class ObjectHelper** | [Details](src/91004529-94a9-4590-b842-e7c6b624ecf5) | [Code](src/91004529-94a9-4590-b842-e7c6b624ecf5/code.php) | [Settings](src/91004529-94a9-4590-b842-e7c6b624ecf5/settings.json) | SPK: `Super---91004529_94a9_4590_b842_e7c6b624ecf5---Power`
|
- **abstract class ObjectHelper** | [Details](src/91004529-94a9-4590-b842-e7c6b624ecf5) | [Code](src/91004529-94a9-4590-b842-e7c6b624ecf5/code.php) | [Settings](src/91004529-94a9-4590-b842-e7c6b624ecf5/settings.json) | SPK: `Super---91004529_94a9_4590_b842_e7c6b624ecf5---Power`
|
||||||
- **abstract class StringHelper** | [Details](src/1f28cb53-60d9-4db1-b517-3c7dc6b429ef) | [Code](src/1f28cb53-60d9-4db1-b517-3c7dc6b429ef/code.php) | [Settings](src/1f28cb53-60d9-4db1-b517-3c7dc6b429ef/settings.json) | SPK: `Super---1f28cb53_60d9_4db1_b517_3c7dc6b429ef---Power`
|
- **abstract class StringHelper** | [Details](src/1f28cb53-60d9-4db1-b517-3c7dc6b429ef) | [Code](src/1f28cb53-60d9-4db1-b517-3c7dc6b429ef/code.php) | [Settings](src/1f28cb53-60d9-4db1-b517-3c7dc6b429ef/settings.json) | SPK: `Super---1f28cb53_60d9_4db1_b517_3c7dc6b429ef---Power`
|
||||||
|
- **abstract class UploadHelper** | [Details](src/d7600b43-771a-4747-9f5d-952765721799) | [Code](src/d7600b43-771a-4747-9f5d-952765721799/code.php) | [Settings](src/d7600b43-771a-4747-9f5d-952765721799/settings.json) | SPK: `Super---d7600b43_771a_4747_9f5d_952765721799---Power`
|
||||||
- **Namespace**: [VDM\Joomla\Abstraction\Remote](#vdm-joomla-abstraction-remote)
|
- **Namespace**: [VDM\Joomla\Abstraction\Remote](#vdm-joomla-abstraction-remote)
|
||||||
|
|
||||||
- **abstract class Get** | [Details](src/728ee726-3f0f-4762-899d-f8c9430cee58) | [Code](src/728ee726-3f0f-4762-899d-f8c9430cee58/code.php) | [Settings](src/728ee726-3f0f-4762-899d-f8c9430cee58/settings.json) | SPK: `Super---728ee726_3f0f_4762_899d_f8c9430cee58---Power`
|
- **abstract class Get** | [Details](src/728ee726-3f0f-4762-899d-f8c9430cee58) | [Code](src/728ee726-3f0f-4762-899d-f8c9430cee58/code.php) | [Settings](src/728ee726-3f0f-4762-899d-f8c9430cee58/settings.json) | SPK: `Super---728ee726_3f0f_4762_899d_f8c9430cee58---Power`
|
||||||
@ -101,6 +103,13 @@ This repository contains an index (see below) of all the approved powers within
|
|||||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Abstraction](#vdm-joomla-componentbuilder-abstraction)
|
- **Namespace**: [VDM\Joomla\Componentbuilder\Abstraction](#vdm-joomla-componentbuilder-abstraction)
|
||||||
|
|
||||||
- **abstract class BaseRegistry** | [Details](src/b84e947d-2a13-44f7-ac0f-3902ae55ae0c) | [Code](src/b84e947d-2a13-44f7-ac0f-3902ae55ae0c/code.php) | [Settings](src/b84e947d-2a13-44f7-ac0f-3902ae55ae0c/settings.json) | SPK: `Super---b84e947d_2a13_44f7_ac0f_3902ae55ae0c---Power`
|
- **abstract class BaseRegistry** | [Details](src/b84e947d-2a13-44f7-ac0f-3902ae55ae0c) | [Code](src/b84e947d-2a13-44f7-ac0f-3902ae55ae0c/code.php) | [Settings](src/b84e947d-2a13-44f7-ac0f-3902ae55ae0c/settings.json) | SPK: `Super---b84e947d_2a13_44f7_ac0f_3902ae55ae0c---Power`
|
||||||
|
- **Namespace**: [VDM\Joomla\Componentbuilder\File](#vdm-joomla-componentbuilder-file)
|
||||||
|
|
||||||
|
- **abstract class Factory** | [Details](src/884eca78-281f-4eab-b962-d97e355af16d) | [Code](src/884eca78-281f-4eab-b962-d97e355af16d/code.php) | [Settings](src/884eca78-281f-4eab-b962-d97e355af16d/settings.json) | SPK: `Super---884eca78_281f_4eab_b962_d97e355af16d---Power`
|
||||||
|
- **final class Display** | [Details](src/d46c4667-378b-49e8-9782-ffb28d92415a) | [Code](src/d46c4667-378b-49e8-9782-ffb28d92415a/code.php) | [Settings](src/d46c4667-378b-49e8-9782-ffb28d92415a/settings.json) | SPK: `Super---d46c4667_378b_49e8_9782_ffb28d92415a---Power`
|
||||||
|
- **final class Handler** | [Details](src/4144ad3b-2ad5-401f-af0c-a3d856c1e688) | [Code](src/4144ad3b-2ad5-401f-af0c-a3d856c1e688/code.php) | [Settings](src/4144ad3b-2ad5-401f-af0c-a3d856c1e688/settings.json) | SPK: `Super---4144ad3b_2ad5_401f_af0c_a3d856c1e688---Power`
|
||||||
|
- **final class Manager** | [Details](src/67a5e0ca-0ff0-4979-9b41-da0b09988016) | [Code](src/67a5e0ca-0ff0-4979-9b41-da0b09988016/code.php) | [Settings](src/67a5e0ca-0ff0-4979-9b41-da0b09988016/settings.json) | SPK: `Super---67a5e0ca_0ff0_4979_9b41_da0b09988016---Power`
|
||||||
|
- **final class Type** | [Details](src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e) | [Code](src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e/code.php) | [Settings](src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e/settings.json) | SPK: `Super---12a2a8de_a893_4dbb_a53d_b52de4f6cb0e---Power`
|
||||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Table](#vdm-joomla-componentbuilder-table)
|
- **Namespace**: [VDM\Joomla\Componentbuilder\Table](#vdm-joomla-componentbuilder-table)
|
||||||
|
|
||||||
- **final class Schema** | [Details](src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce) | [Code](src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/code.php) | [Settings](src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/settings.json) | SPK: `Super---b3d2ec33_76d4_4c3b_bb2c_86ac14a221ce---Power`
|
- **final class Schema** | [Details](src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce) | [Code](src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/code.php) | [Settings](src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/settings.json) | SPK: `Super---b3d2ec33_76d4_4c3b_bb2c_86ac14a221ce---Power`
|
||||||
@ -156,6 +165,9 @@ This repository contains an index (see below) of all the approved powers within
|
|||||||
- **trait IsString** | [Details](src/ff7d0111-8f79-42aa-ac14-b53ba2c49369) | [Code](src/ff7d0111-8f79-42aa-ac14-b53ba2c49369/code.php) | [Settings](src/ff7d0111-8f79-42aa-ac14-b53ba2c49369/settings.json) | SPK: `Super---ff7d0111_8f79_42aa_ac14_b53ba2c49369---Power`
|
- **trait IsString** | [Details](src/ff7d0111-8f79-42aa-ac14-b53ba2c49369) | [Code](src/ff7d0111-8f79-42aa-ac14-b53ba2c49369/code.php) | [Settings](src/ff7d0111-8f79-42aa-ac14-b53ba2c49369/settings.json) | SPK: `Super---ff7d0111_8f79_42aa_ac14_b53ba2c49369---Power`
|
||||||
- **trait ToString** | [Details](src/7d494d91-ab60-43cd-aecf-d50e07f7f30e) | [Code](src/7d494d91-ab60-43cd-aecf-d50e07f7f30e/code.php) | [Settings](src/7d494d91-ab60-43cd-aecf-d50e07f7f30e/settings.json) | SPK: `Super---7d494d91_ab60_43cd_aecf_d50e07f7f30e---Power`
|
- **trait ToString** | [Details](src/7d494d91-ab60-43cd-aecf-d50e07f7f30e) | [Code](src/7d494d91-ab60-43cd-aecf-d50e07f7f30e/code.php) | [Settings](src/7d494d91-ab60-43cd-aecf-d50e07f7f30e/settings.json) | SPK: `Super---7d494d91_ab60_43cd_aecf_d50e07f7f30e---Power`
|
||||||
- **trait VarExport** | [Details](src/52a1d14f-304a-431c-8fa4-411179942db5) | [Code](src/52a1d14f-304a-431c-8fa4-411179942db5/code.php) | [Settings](src/52a1d14f-304a-431c-8fa4-411179942db5/settings.json) | SPK: `Super---52a1d14f_304a_431c_8fa4_411179942db5---Power`
|
- **trait VarExport** | [Details](src/52a1d14f-304a-431c-8fa4-411179942db5) | [Code](src/52a1d14f-304a-431c-8fa4-411179942db5/code.php) | [Settings](src/52a1d14f-304a-431c-8fa4-411179942db5/settings.json) | SPK: `Super---52a1d14f_304a_431c_8fa4_411179942db5---Power`
|
||||||
|
- **Namespace**: [VDM\Joomla\Componentbuilder\File\Service](#vdm-joomla-componentbuilder-file-service)
|
||||||
|
|
||||||
|
- **class File** | [Details](src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088) | [Code](src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.php) | [Settings](src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/settings.json) | SPK: `Super---202ccd9e_dfcf_4cde_a0ce_bde1fd27f088---Power`
|
||||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Utilities\Exception](#vdm-joomla-componentbuilder-utilities-exception)
|
- **Namespace**: [VDM\Joomla\Componentbuilder\Utilities\Exception](#vdm-joomla-componentbuilder-utilities-exception)
|
||||||
|
|
||||||
- **class NoUserIdFoundException** | [Details](src/1c10a5f1-204d-4f17-ad9f-0e0684f2030d) | [Code](src/1c10a5f1-204d-4f17-ad9f-0e0684f2030d/code.php) | [Settings](src/1c10a5f1-204d-4f17-ad9f-0e0684f2030d/settings.json) | SPK: `Super---1c10a5f1_204d_4f17_ad9f_0e0684f2030d---Power`
|
- **class NoUserIdFoundException** | [Details](src/1c10a5f1-204d-4f17-ad9f-0e0684f2030d) | [Code](src/1c10a5f1-204d-4f17-ad9f-0e0684f2030d/code.php) | [Settings](src/1c10a5f1-204d-4f17-ad9f-0e0684f2030d/settings.json) | SPK: `Super---1c10a5f1_204d_4f17_ad9f_0e0684f2030d---Power`
|
||||||
|
117
src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e/README.md
Normal file
117
src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e/README.md
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
```
|
||||||
|
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||||
|
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||||
|
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||||
|
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||||
|
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||||
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
```
|
||||||
|
# final class Type (Details)
|
||||||
|
> namespace: **VDM\Joomla\Componentbuilder\File**
|
||||||
|
|
||||||
|
```uml
|
||||||
|
@startuml
|
||||||
|
class Type << (F,LightGreen) >> #RoyalBlue {
|
||||||
|
# Item $item
|
||||||
|
# array $fileTypes
|
||||||
|
+ __construct(Item $item)
|
||||||
|
+ get(string $guid, string $target) : ?array
|
||||||
|
+ load(string $guid, string $target) : ?array
|
||||||
|
+ details(string $guid) : ?object
|
||||||
|
# validTarget(object $data, string $target) : bool
|
||||||
|
# getFieldName(object $data) : string
|
||||||
|
# getAllow(object $data) : string
|
||||||
|
# getAllowSpan(object $data) : string
|
||||||
|
# getAllowFormats(object $data) : ?array
|
||||||
|
}
|
||||||
|
|
||||||
|
note right of Type::__construct
|
||||||
|
Constructor.
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
end note
|
||||||
|
|
||||||
|
note left of Type::get
|
||||||
|
Retrieves the file type details (ajax)
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: ?array
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Type::load
|
||||||
|
Retrieves the file type details (upload)
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: ?array
|
||||||
|
end note
|
||||||
|
|
||||||
|
note left of Type::details
|
||||||
|
Retrieves the file type details
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: ?object
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Type::validTarget
|
||||||
|
Valid if this is a correct target trying to call this file type
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: bool
|
||||||
|
end note
|
||||||
|
|
||||||
|
note left of Type::getFieldName
|
||||||
|
Retrieves the field name
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: string
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Type::getAllow
|
||||||
|
Retrieves the allow formats (for script)
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: string
|
||||||
|
end note
|
||||||
|
|
||||||
|
note left of Type::getAllowSpan
|
||||||
|
Retrieves the allow formats (for span)
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: string
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Type::getAllowFormats
|
||||||
|
Retrieves the allow formats
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: ?array
|
||||||
|
end note
|
||||||
|
|
||||||
|
@enduml
|
||||||
|
```
|
||||||
|
|
||||||
|
The Power feature in JCB allows you to write PHP classes and their implementations, making it easy to include them in your Joomla project. JCB handles linking, autoloading, namespacing, and folder structure creation for you.
|
||||||
|
|
||||||
|
By using the SPK (Super Power Key) in your custom code (replacing the class name in your code with the SPK), JCB will automatically pull the power from the repository into your project. This makes it available in your JCB instance, allowing you to edit it and include the class in your generated Joomla component.
|
||||||
|
|
||||||
|
JCB uses placeholders like [[[`NamespacePrefix`]]] and [[[`ComponentNamespace`]]] in namespacing to prevent collisions and improve reusability across different JCB systems. You can also set the **JCB powers path** globally or per component under the **Dynamic Integration** tab, providing flexibility and easy maintainability.
|
||||||
|
|
||||||
|
To add this specific Power to your project in JCB:
|
||||||
|
|
||||||
|
> simply use this SPK
|
||||||
|
```
|
||||||
|
Super---12a2a8de_a893_4dbb_a53d_b52de4f6cb0e---Power
|
||||||
|
```
|
||||||
|
> remember to replace the `---` with `___` to activate this Power in your code
|
||||||
|
|
||||||
|
---
|
||||||
|
```
|
||||||
|
██╗ ██████╗██████╗
|
||||||
|
██║██╔════╝██╔══██╗
|
||||||
|
██║██║ ██████╔╝
|
||||||
|
██ ██║██║ ██╔══██╗
|
||||||
|
╚█████╔╝╚██████╗██████╔╝
|
||||||
|
╚════╝ ╚═════╝╚═════╝
|
||||||
|
```
|
||||||
|
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||||
|
|
229
src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e/code.php
Normal file
229
src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e/code.php
Normal file
@ -0,0 +1,229 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 3rd September, 2020
|
||||||
|
* @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\File;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Interfaces\Data\ItemInterface as Item;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File Type Class
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
final class Type
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Item Class.
|
||||||
|
*
|
||||||
|
* @var Item
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Item $item;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The File Types
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected array $fileTypes = [1 => 'image' , 2 => 'document' , 3 => 'media', 4 => 'file'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Item $item The Item Class.
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function __construct(Item $item)
|
||||||
|
{
|
||||||
|
$this->item = $item;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the file type details (ajax)
|
||||||
|
*
|
||||||
|
* @param string $guid The GUID (Globally Unique Identifier) used as the key to retrieve the file type
|
||||||
|
* @param string $target The entity target name.
|
||||||
|
*
|
||||||
|
* @return array|null The item object if found, or null if the item does not exist.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function get(string $guid, string $target): ?array
|
||||||
|
{
|
||||||
|
if (($fileType = $this->details($guid)) !== null &&
|
||||||
|
$this->validTarget($fileType, $target))
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => $this->getFieldName($fileType),
|
||||||
|
'allow' => $this->getAllow($fileType),
|
||||||
|
'allow_span' => $this->getAllowSpan($fileType),
|
||||||
|
'file_type_span' => $fileType->name ?? 'file',
|
||||||
|
'display_fields' => $fileType->display_fields ?? null,
|
||||||
|
'param_fields' => $fileType->param_fields ?? null,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the file type details (upload)
|
||||||
|
*
|
||||||
|
* @param string $guid The GUID (Globally Unique Identifier) used as the key to retrieve the file type
|
||||||
|
* @param string $target The entity target name.
|
||||||
|
*
|
||||||
|
* @return array|null The item object if found, or null if the item does not exist.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function load(string $guid, string $target): ?array
|
||||||
|
{
|
||||||
|
if (($fileType = $this->details($guid)) !== null &&
|
||||||
|
$this->validTarget($fileType, $target))
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'field' => $this->getFieldName($fileType),
|
||||||
|
'type' => $this->getFieldName($fileType),
|
||||||
|
'formats' => $this->getAllowFormats($fileType) ?? [],
|
||||||
|
'filter' => $fileType->filter ?? null,
|
||||||
|
'path' => $fileType->path ?? null
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the file type details
|
||||||
|
*
|
||||||
|
* @param string $guid The GUID (Globally Unique Identifier) used as the key to retrieve the file type.
|
||||||
|
*
|
||||||
|
* @return object|null The item object if found, or null if the item does not exist.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function details(string $guid): ?object
|
||||||
|
{
|
||||||
|
return $this->item->table('file_type')->get($guid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Valid if this is a correct target trying to call this file type
|
||||||
|
*
|
||||||
|
* @param object $data The type data array
|
||||||
|
* @param string $target The entity target name.
|
||||||
|
*
|
||||||
|
* @return bool True if valid target
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function validTarget(object $data, string $target): bool
|
||||||
|
{
|
||||||
|
$targets = $data->target ?? null;
|
||||||
|
if (!empty($targets))
|
||||||
|
{
|
||||||
|
$targets = (array) $targets;
|
||||||
|
return in_array($target, $targets);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the field name
|
||||||
|
*
|
||||||
|
* @param object $data The type data array
|
||||||
|
*
|
||||||
|
* @return string The field name
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function getFieldName(object $data): string
|
||||||
|
{
|
||||||
|
$type = $data->type ?? 4;
|
||||||
|
if (isset($this->fileTypes[$type]))
|
||||||
|
{
|
||||||
|
return $this->fileTypes[$type];
|
||||||
|
}
|
||||||
|
return 'file';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the allow formats (for script)
|
||||||
|
*
|
||||||
|
* @param object $data The type data array
|
||||||
|
*
|
||||||
|
* @return string The allow values
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function getAllow(object $data): string
|
||||||
|
{
|
||||||
|
$formats = $this->getAllowFormats($data);
|
||||||
|
if (!empty($formats))
|
||||||
|
{
|
||||||
|
return '*.(' . implode('|', $formats) . ')';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the allow formats (for span)
|
||||||
|
*
|
||||||
|
* @param object $data The type data array
|
||||||
|
*
|
||||||
|
* @return string The allow values
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function getAllowSpan(object $data): string
|
||||||
|
{
|
||||||
|
$formats = $this->getAllowFormats($data);
|
||||||
|
if (!empty($formats))
|
||||||
|
{
|
||||||
|
return '(formats allowed: <b>' . implode(', ', $formats) . '</b>)';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the allow formats
|
||||||
|
*
|
||||||
|
* @param object|null $data The type data array
|
||||||
|
*
|
||||||
|
* @return array|null The allow values
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function getAllowFormats(object $data): ?array
|
||||||
|
{
|
||||||
|
$type = $data->type ?? 4;
|
||||||
|
switch ($type)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
$formats = $data->image_formats ?? null;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$formats = $data->document_formats ?? null;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$formats = $data->media_formats ?? null;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$formats = $data->file_formats ?? null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($formats)
|
||||||
|
{
|
||||||
|
return (array) $formats;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
203
src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e/code.power
Normal file
203
src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e/code.power
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
/**
|
||||||
|
* The Item Class.
|
||||||
|
*
|
||||||
|
* @var Item
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Item $item;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The File Types
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected array $fileTypes = [1 => 'image' , 2 => 'document' , 3 => 'media', 4 => 'file'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Item $item The Item Class.
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function __construct(Item $item)
|
||||||
|
{
|
||||||
|
$this->item = $item;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the file type details (ajax)
|
||||||
|
*
|
||||||
|
* @param string $guid The GUID (Globally Unique Identifier) used as the key to retrieve the file type
|
||||||
|
* @param string $target The entity target name.
|
||||||
|
*
|
||||||
|
* @return array|null The item object if found, or null if the item does not exist.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function get(string $guid, string $target): ?array
|
||||||
|
{
|
||||||
|
if (($fileType = $this->details($guid)) !== null &&
|
||||||
|
$this->validTarget($fileType, $target))
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => $this->getFieldName($fileType),
|
||||||
|
'allow' => $this->getAllow($fileType),
|
||||||
|
'allow_span' => $this->getAllowSpan($fileType),
|
||||||
|
'file_type_span' => $fileType->name ?? 'file',
|
||||||
|
'display_fields' => $fileType->display_fields ?? null,
|
||||||
|
'param_fields' => $fileType->param_fields ?? null,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the file type details (upload)
|
||||||
|
*
|
||||||
|
* @param string $guid The GUID (Globally Unique Identifier) used as the key to retrieve the file type
|
||||||
|
* @param string $target The entity target name.
|
||||||
|
*
|
||||||
|
* @return array|null The item object if found, or null if the item does not exist.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function load(string $guid, string $target): ?array
|
||||||
|
{
|
||||||
|
if (($fileType = $this->details($guid)) !== null &&
|
||||||
|
$this->validTarget($fileType, $target))
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'field' => $this->getFieldName($fileType),
|
||||||
|
'type' => $this->getFieldName($fileType),
|
||||||
|
'formats' => $this->getAllowFormats($fileType) ?? [],
|
||||||
|
'filter' => $fileType->filter ?? null,
|
||||||
|
'path' => $fileType->path ?? null
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the file type details
|
||||||
|
*
|
||||||
|
* @param string $guid The GUID (Globally Unique Identifier) used as the key to retrieve the file type.
|
||||||
|
*
|
||||||
|
* @return object|null The item object if found, or null if the item does not exist.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function details(string $guid): ?object
|
||||||
|
{
|
||||||
|
return $this->item->table('file_type')->get($guid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Valid if this is a correct target trying to call this file type
|
||||||
|
*
|
||||||
|
* @param object $data The type data array
|
||||||
|
* @param string $target The entity target name.
|
||||||
|
*
|
||||||
|
* @return bool True if valid target
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function validTarget(object $data, string $target): bool
|
||||||
|
{
|
||||||
|
$targets = $data->target ?? null;
|
||||||
|
if (!empty($targets))
|
||||||
|
{
|
||||||
|
$targets = (array) $targets;
|
||||||
|
return in_array($target, $targets);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the field name
|
||||||
|
*
|
||||||
|
* @param object $data The type data array
|
||||||
|
*
|
||||||
|
* @return string The field name
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function getFieldName(object $data): string
|
||||||
|
{
|
||||||
|
$type = $data->type ?? 4;
|
||||||
|
if (isset($this->fileTypes[$type]))
|
||||||
|
{
|
||||||
|
return $this->fileTypes[$type];
|
||||||
|
}
|
||||||
|
return 'file';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the allow formats (for script)
|
||||||
|
*
|
||||||
|
* @param object $data The type data array
|
||||||
|
*
|
||||||
|
* @return string The allow values
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function getAllow(object $data): string
|
||||||
|
{
|
||||||
|
$formats = $this->getAllowFormats($data);
|
||||||
|
if (!empty($formats))
|
||||||
|
{
|
||||||
|
return '*.(' . implode('|', $formats) . ')';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the allow formats (for span)
|
||||||
|
*
|
||||||
|
* @param object $data The type data array
|
||||||
|
*
|
||||||
|
* @return string The allow values
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function getAllowSpan(object $data): string
|
||||||
|
{
|
||||||
|
$formats = $this->getAllowFormats($data);
|
||||||
|
if (!empty($formats))
|
||||||
|
{
|
||||||
|
return '(formats allowed: <b>' . implode(', ', $formats) . '</b>)';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the allow formats
|
||||||
|
*
|
||||||
|
* @param object|null $data The type data array
|
||||||
|
*
|
||||||
|
* @return array|null The allow values
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function getAllowFormats(object $data): ?array
|
||||||
|
{
|
||||||
|
$type = $data->type ?? 4;
|
||||||
|
switch ($type)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
$formats = $data->image_formats ?? null;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$formats = $data->document_formats ?? null;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$formats = $data->media_formats ?? null;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$formats = $data->file_formats ?? null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($formats)
|
||||||
|
{
|
||||||
|
return (array) $formats;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
24
src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e/settings.json
Normal file
24
src/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e/settings.json
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"add_head": "0",
|
||||||
|
"add_licensing_template": "2",
|
||||||
|
"extends": "",
|
||||||
|
"guid": "12a2a8de-a893-4dbb-a53d-b52de4f6cb0e",
|
||||||
|
"implements": null,
|
||||||
|
"load_selection": null,
|
||||||
|
"name": "Type",
|
||||||
|
"power_version": "1.0.0",
|
||||||
|
"system_name": "Joomla.File.Type",
|
||||||
|
"type": "final class",
|
||||||
|
"use_selection": {
|
||||||
|
"use_selection0": {
|
||||||
|
"use": "05744dd3-4030-4cf8-8dda-a93ab809b473",
|
||||||
|
"as": "Item"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extendsinterfaces": null,
|
||||||
|
"namespace": "[[[NamespacePrefix]]]\\Joomla\\[[[ComponentNamespace]]].File.Type",
|
||||||
|
"description": "File Type Class\r\n\r\n@since 5.0.2",
|
||||||
|
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 3rd September, 2020\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||||
|
"head": "",
|
||||||
|
"composer": ""
|
||||||
|
}
|
84
src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/README.md
Normal file
84
src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/README.md
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
```
|
||||||
|
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||||
|
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||||
|
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||||
|
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||||
|
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||||
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
```
|
||||||
|
# class File (Details)
|
||||||
|
> namespace: **VDM\Joomla\Componentbuilder\File\Service**
|
||||||
|
|
||||||
|
```uml
|
||||||
|
@startuml
|
||||||
|
class File #Gold {
|
||||||
|
+ register(Container $container) : void
|
||||||
|
+ getType(Container $container) : Type
|
||||||
|
+ getHandler(Container $container) : Handler
|
||||||
|
+ getManager(Container $container) : Manager
|
||||||
|
+ getDisplay(Container $container) : Display
|
||||||
|
}
|
||||||
|
|
||||||
|
note right of File::register
|
||||||
|
Registers the service provider with a DI container.
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: void
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of File::getType
|
||||||
|
Get The Type Class.
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: Type
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of File::getHandler
|
||||||
|
Get The Handler Class.
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: Handler
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of File::getManager
|
||||||
|
Get The Manager Class.
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: Manager
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of File::getDisplay
|
||||||
|
Get The Display Class.
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: Display
|
||||||
|
end note
|
||||||
|
|
||||||
|
@enduml
|
||||||
|
```
|
||||||
|
|
||||||
|
The Power feature in JCB allows you to write PHP classes and their implementations, making it easy to include them in your Joomla project. JCB handles linking, autoloading, namespacing, and folder structure creation for you.
|
||||||
|
|
||||||
|
By using the SPK (Super Power Key) in your custom code (replacing the class name in your code with the SPK), JCB will automatically pull the power from the repository into your project. This makes it available in your JCB instance, allowing you to edit it and include the class in your generated Joomla component.
|
||||||
|
|
||||||
|
JCB uses placeholders like [[[`NamespacePrefix`]]] and [[[`ComponentNamespace`]]] in namespacing to prevent collisions and improve reusability across different JCB systems. You can also set the **JCB powers path** globally or per component under the **Dynamic Integration** tab, providing flexibility and easy maintainability.
|
||||||
|
|
||||||
|
To add this specific Power to your project in JCB:
|
||||||
|
|
||||||
|
> simply use this SPK
|
||||||
|
```
|
||||||
|
Super---202ccd9e_dfcf_4cde_a0ce_bde1fd27f088---Power
|
||||||
|
```
|
||||||
|
> remember to replace the `---` with `___` to activate this Power in your code
|
||||||
|
|
||||||
|
---
|
||||||
|
```
|
||||||
|
██╗ ██████╗██████╗
|
||||||
|
██║██╔════╝██╔══██╗
|
||||||
|
██║██║ ██████╔╝
|
||||||
|
██ ██║██║ ██╔══██╗
|
||||||
|
╚█████╔╝╚██████╗██████╔╝
|
||||||
|
╚════╝ ╚═════╝╚═════╝
|
||||||
|
```
|
||||||
|
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||||
|
|
114
src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.php
Normal file
114
src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.php
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?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\File\Service;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\DI\Container;
|
||||||
|
use Joomla\DI\ServiceProviderInterface;
|
||||||
|
use VDM\Joomla\Componentbuilder\File\Type;
|
||||||
|
use VDM\Joomla\Componentbuilder\File\Handler;
|
||||||
|
use VDM\Joomla\Componentbuilder\File\Manager;
|
||||||
|
use VDM\Joomla\Componentbuilder\File\Display;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File Service Provider
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
class File implements ServiceProviderInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Registers the service provider with a DI container.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function register(Container $container)
|
||||||
|
{
|
||||||
|
$container->alias(Type::class, 'File.Type')
|
||||||
|
->share('File.Type', [$this, 'getType'], true);
|
||||||
|
|
||||||
|
$container->alias(Handler::class, 'File.Handler')
|
||||||
|
->share('File.Handler', [$this, 'getHandler'], true);
|
||||||
|
|
||||||
|
$container->alias(Manager::class, 'File.Manager')
|
||||||
|
->share('File.Manager', [$this, 'getManager'], true);
|
||||||
|
|
||||||
|
$container->alias(Display::class, 'File.Display')
|
||||||
|
->share('File.Display', [$this, 'getDisplay'], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Type Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Type
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getType(Container $container): Type
|
||||||
|
{
|
||||||
|
return new Type(
|
||||||
|
$container->get('Data.Item')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Handler Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Handler
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getHandler(Container $container): Handler
|
||||||
|
{
|
||||||
|
return new Handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Manager Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Manager
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getManager(Container $container): Manager
|
||||||
|
{
|
||||||
|
return new Manager(
|
||||||
|
$container->get('Data.Item'),
|
||||||
|
$container->get('Data.Items'),
|
||||||
|
$container->get('File.Type'),
|
||||||
|
$container->get('File.Handler')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Display Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Display
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getDisplay(Container $container): Display
|
||||||
|
{
|
||||||
|
return new Display(
|
||||||
|
$container->get('Data.Items')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
83
src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.power
Normal file
83
src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.power
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
/**
|
||||||
|
* Registers the service provider with a DI container.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function register(Container $container)
|
||||||
|
{
|
||||||
|
$container->alias(Type::class, 'File.Type')
|
||||||
|
->share('File.Type', [$this, 'getType'], true);
|
||||||
|
|
||||||
|
$container->alias(Handler::class, 'File.Handler')
|
||||||
|
->share('File.Handler', [$this, 'getHandler'], true);
|
||||||
|
|
||||||
|
$container->alias(Manager::class, 'File.Manager')
|
||||||
|
->share('File.Manager', [$this, 'getManager'], true);
|
||||||
|
|
||||||
|
$container->alias(Display::class, 'File.Display')
|
||||||
|
->share('File.Display', [$this, 'getDisplay'], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Type Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Type
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getType(Container $container): Type
|
||||||
|
{
|
||||||
|
return new Type(
|
||||||
|
$container->get('Data.Item')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Handler Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Handler
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getHandler(Container $container): Handler
|
||||||
|
{
|
||||||
|
return new Handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Manager Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Manager
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getManager(Container $container): Manager
|
||||||
|
{
|
||||||
|
return new Manager(
|
||||||
|
$container->get('Data.Item'),
|
||||||
|
$container->get('Data.Items'),
|
||||||
|
$container->get('File.Type'),
|
||||||
|
$container->get('File.Handler')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Display Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Display
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getDisplay(Container $container): Display
|
||||||
|
{
|
||||||
|
return new Display(
|
||||||
|
$container->get('Data.Items')
|
||||||
|
);
|
||||||
|
}
|
39
src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/settings.json
Normal file
39
src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/settings.json
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"add_head": "1",
|
||||||
|
"add_licensing_template": "2",
|
||||||
|
"extends": "",
|
||||||
|
"guid": "202ccd9e-dfcf-4cde-a0ce-bde1fd27f088",
|
||||||
|
"implements": [
|
||||||
|
"-1"
|
||||||
|
],
|
||||||
|
"load_selection": null,
|
||||||
|
"name": "File",
|
||||||
|
"power_version": "1.0.0",
|
||||||
|
"system_name": "JCB.File.Service.File",
|
||||||
|
"type": "class",
|
||||||
|
"use_selection": {
|
||||||
|
"use_selection0": {
|
||||||
|
"use": "12a2a8de-a893-4dbb-a53d-b52de4f6cb0e",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection1": {
|
||||||
|
"use": "4144ad3b-2ad5-401f-af0c-a3d856c1e688",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection2": {
|
||||||
|
"use": "67a5e0ca-0ff0-4979-9b41-da0b09988016",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection3": {
|
||||||
|
"use": "d46c4667-378b-49e8-9782-ffb28d92415a",
|
||||||
|
"as": "default"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extendsinterfaces": null,
|
||||||
|
"namespace": "[[[NamespacePrefix]]]\\Joomla\\[[[ComponentNamespace]]].File.Service.File",
|
||||||
|
"description": "File Service Provider\r\n\r\n@since 5.0.3",
|
||||||
|
"implements_custom": "ServiceProviderInterface",
|
||||||
|
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||||
|
"head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;",
|
||||||
|
"composer": ""
|
||||||
|
}
|
107
src/4144ad3b-2ad5-401f-af0c-a3d856c1e688/README.md
Normal file
107
src/4144ad3b-2ad5-401f-af0c-a3d856c1e688/README.md
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
```
|
||||||
|
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||||
|
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||||
|
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||||
|
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||||
|
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||||
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
```
|
||||||
|
# final class Handler (Details)
|
||||||
|
> namespace: **VDM\Joomla\Componentbuilder\File**
|
||||||
|
> extends: **UploadHelper**
|
||||||
|
|
||||||
|
```uml
|
||||||
|
@startuml
|
||||||
|
class Handler << (F,LightGreen) >> #RoyalBlue {
|
||||||
|
+ setUseStreams(bool $useStreams) : self
|
||||||
|
+ setAllowUnsafe(bool $allowUnsafe) : self
|
||||||
|
+ setSafeFileOptions(array $safeFileOptions) : self
|
||||||
|
+ setEnqueueError(bool $enqueueError) : self
|
||||||
|
+ setLegalFormats(array $legalFormats) : self
|
||||||
|
+ getFile(string $field, string $type, ...) : ?array
|
||||||
|
+ getErrors(bool $toString = true) : string|array
|
||||||
|
}
|
||||||
|
|
||||||
|
note right of Handler::setUseStreams
|
||||||
|
Set the $useStreams property to use streams for file handling
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: self
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Handler::setAllowUnsafe
|
||||||
|
Set the $allowUnsafe property to allow or disallow unsafe file uploads.
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: self
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Handler::setSafeFileOptions
|
||||||
|
Set the $safeFileOptions property to define options for file safety checks.
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: self
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Handler::setEnqueueError
|
||||||
|
Set the $enqueueError property to control error reporting behavior.
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: self
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Handler::setLegalFormats
|
||||||
|
Set the $legalFormats property to define legal file formats.
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: self
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Handler::getFile
|
||||||
|
Get a file from the input based on field name and file type, then process it.
|
||||||
|
|
||||||
|
since: 3.0.11
|
||||||
|
return: ?array
|
||||||
|
|
||||||
|
arguments:
|
||||||
|
string $field
|
||||||
|
string $type
|
||||||
|
string $filter = null
|
||||||
|
string $path = null
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Handler::getErrors
|
||||||
|
Get the error messages as a string.
|
||||||
|
|
||||||
|
since: 5.0.3
|
||||||
|
return: string|array
|
||||||
|
end note
|
||||||
|
|
||||||
|
@enduml
|
||||||
|
```
|
||||||
|
|
||||||
|
The Power feature in JCB allows you to write PHP classes and their implementations, making it easy to include them in your Joomla project. JCB handles linking, autoloading, namespacing, and folder structure creation for you.
|
||||||
|
|
||||||
|
By using the SPK (Super Power Key) in your custom code (replacing the class name in your code with the SPK), JCB will automatically pull the power from the repository into your project. This makes it available in your JCB instance, allowing you to edit it and include the class in your generated Joomla component.
|
||||||
|
|
||||||
|
JCB uses placeholders like [[[`NamespacePrefix`]]] and [[[`ComponentNamespace`]]] in namespacing to prevent collisions and improve reusability across different JCB systems. You can also set the **JCB powers path** globally or per component under the **Dynamic Integration** tab, providing flexibility and easy maintainability.
|
||||||
|
|
||||||
|
To add this specific Power to your project in JCB:
|
||||||
|
|
||||||
|
> simply use this SPK
|
||||||
|
```
|
||||||
|
Super---4144ad3b_2ad5_401f_af0c_a3d856c1e688---Power
|
||||||
|
```
|
||||||
|
> remember to replace the `---` with `___` to activate this Power in your code
|
||||||
|
|
||||||
|
---
|
||||||
|
```
|
||||||
|
██╗ ██████╗██████╗
|
||||||
|
██║██╔════╝██╔══██╗
|
||||||
|
██║██║ ██████╔╝
|
||||||
|
██ ██║██║ ██╔══██╗
|
||||||
|
╚█████╔╝╚██████╗██████╔╝
|
||||||
|
╚════╝ ╚═════╝╚═════╝
|
||||||
|
```
|
||||||
|
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||||
|
|
129
src/4144ad3b-2ad5-401f-af0c-a3d856c1e688/code.php
Normal file
129
src/4144ad3b-2ad5-401f-af0c-a3d856c1e688/code.php
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 3rd September, 2020
|
||||||
|
* @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\File;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Utilities\UploadHelper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File Handler Class
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
final class Handler extends UploadHelper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Set the $useStreams property to use streams for file handling
|
||||||
|
*
|
||||||
|
* @param bool $useStreams True to use streams, false otherwise.
|
||||||
|
*
|
||||||
|
* @return self Returns the current instance to allow for method chaining.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function setUseStreams(bool $useStreams): self
|
||||||
|
{
|
||||||
|
static::$useStreams = $useStreams;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the $allowUnsafe property to allow or disallow unsafe file uploads.
|
||||||
|
*
|
||||||
|
* @param bool $allowUnsafe True to allow unsafe file uploads, false otherwise.
|
||||||
|
*
|
||||||
|
* @return self Returns the current instance to allow for method chaining.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function setAllowUnsafe(bool $allowUnsafe): self
|
||||||
|
{
|
||||||
|
static::$allowUnsafe = $allowUnsafe;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the $safeFileOptions property to define options for file safety checks.
|
||||||
|
*
|
||||||
|
* @param array $safeFileOptions An array of options for InputFilter::isSafeFile.
|
||||||
|
*
|
||||||
|
* @return self Returns the current instance to allow for method chaining.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function setSafeFileOptions(array $safeFileOptions): self
|
||||||
|
{
|
||||||
|
static::$safeFileOptions = $safeFileOptions;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the $enqueueError property to control error reporting behavior.
|
||||||
|
*
|
||||||
|
* @param bool $enqueueError True to enqueue error messages, false to store them in the internal error array.
|
||||||
|
*
|
||||||
|
* @return self Returns the current instance to allow for method chaining.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function setEnqueueError(bool $enqueueError): self
|
||||||
|
{
|
||||||
|
static::$enqueueError = $enqueueError;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the $legalFormats property to define legal file formats.
|
||||||
|
*
|
||||||
|
* @param array $legalFormats An array of allowed file formats (e.g., ['jpg', 'png']).
|
||||||
|
*
|
||||||
|
* @return self Returns the current instance to allow for method chaining.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function setLegalFormats(array $legalFormats): self
|
||||||
|
{
|
||||||
|
static::$legalFormats = $legalFormats;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a file from the input based on field name and file type, then process it.
|
||||||
|
*
|
||||||
|
* @param string $field The input field name for the file upload.
|
||||||
|
* @param string $type The type of file (e.g., 'image', 'document').
|
||||||
|
* @param string|null $filter The filter to apply when uploading the file.
|
||||||
|
* @param string|null $path The directory path where the file should be saved.
|
||||||
|
*
|
||||||
|
* @return array|null File details or false on failure.
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public function getFile(string $field, string $type, string $filter = null, string $path = null): ?array
|
||||||
|
{
|
||||||
|
return static::get($field, $type, $filter, $path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the error messages as a string.
|
||||||
|
*
|
||||||
|
* @param bool $toString The option to return errors as a string
|
||||||
|
*
|
||||||
|
* @return string|array Returns the error messages as a single concatenated string.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getErrors(bool $toString = true): string|array
|
||||||
|
{
|
||||||
|
return static::getError($toString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
103
src/4144ad3b-2ad5-401f-af0c-a3d856c1e688/code.power
Normal file
103
src/4144ad3b-2ad5-401f-af0c-a3d856c1e688/code.power
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
/**
|
||||||
|
* Set the $useStreams property to use streams for file handling
|
||||||
|
*
|
||||||
|
* @param bool $useStreams True to use streams, false otherwise.
|
||||||
|
*
|
||||||
|
* @return self Returns the current instance to allow for method chaining.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function setUseStreams(bool $useStreams): self
|
||||||
|
{
|
||||||
|
static::$useStreams = $useStreams;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the $allowUnsafe property to allow or disallow unsafe file uploads.
|
||||||
|
*
|
||||||
|
* @param bool $allowUnsafe True to allow unsafe file uploads, false otherwise.
|
||||||
|
*
|
||||||
|
* @return self Returns the current instance to allow for method chaining.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function setAllowUnsafe(bool $allowUnsafe): self
|
||||||
|
{
|
||||||
|
static::$allowUnsafe = $allowUnsafe;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the $safeFileOptions property to define options for file safety checks.
|
||||||
|
*
|
||||||
|
* @param array $safeFileOptions An array of options for InputFilter::isSafeFile.
|
||||||
|
*
|
||||||
|
* @return self Returns the current instance to allow for method chaining.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function setSafeFileOptions(array $safeFileOptions): self
|
||||||
|
{
|
||||||
|
static::$safeFileOptions = $safeFileOptions;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the $enqueueError property to control error reporting behavior.
|
||||||
|
*
|
||||||
|
* @param bool $enqueueError True to enqueue error messages, false to store them in the internal error array.
|
||||||
|
*
|
||||||
|
* @return self Returns the current instance to allow for method chaining.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function setEnqueueError(bool $enqueueError): self
|
||||||
|
{
|
||||||
|
static::$enqueueError = $enqueueError;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the $legalFormats property to define legal file formats.
|
||||||
|
*
|
||||||
|
* @param array $legalFormats An array of allowed file formats (e.g., ['jpg', 'png']).
|
||||||
|
*
|
||||||
|
* @return self Returns the current instance to allow for method chaining.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function setLegalFormats(array $legalFormats): self
|
||||||
|
{
|
||||||
|
static::$legalFormats = $legalFormats;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a file from the input based on field name and file type, then process it.
|
||||||
|
*
|
||||||
|
* @param string $field The input field name for the file upload.
|
||||||
|
* @param string $type The type of file (e.g., 'image', 'document').
|
||||||
|
* @param string|null $filter The filter to apply when uploading the file.
|
||||||
|
* @param string|null $path The directory path where the file should be saved.
|
||||||
|
*
|
||||||
|
* @return array|null File details or false on failure.
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public function getFile(string $field, string $type, string $filter = null, string $path = null): ?array
|
||||||
|
{
|
||||||
|
return static::get($field, $type, $filter, $path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the error messages as a string.
|
||||||
|
*
|
||||||
|
* @param bool $toString The option to return errors as a string
|
||||||
|
*
|
||||||
|
* @return string|array Returns the error messages as a single concatenated string.
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getErrors(bool $toString = true): string|array
|
||||||
|
{
|
||||||
|
return static::getError($toString);
|
||||||
|
}
|
19
src/4144ad3b-2ad5-401f-af0c-a3d856c1e688/settings.json
Normal file
19
src/4144ad3b-2ad5-401f-af0c-a3d856c1e688/settings.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"add_head": "0",
|
||||||
|
"add_licensing_template": "2",
|
||||||
|
"extends": "d7600b43-771a-4747-9f5d-952765721799",
|
||||||
|
"guid": "4144ad3b-2ad5-401f-af0c-a3d856c1e688",
|
||||||
|
"implements": null,
|
||||||
|
"load_selection": null,
|
||||||
|
"name": "Handler",
|
||||||
|
"power_version": "1.0.0",
|
||||||
|
"system_name": "Joomla.File.Handler",
|
||||||
|
"type": "final class",
|
||||||
|
"use_selection": null,
|
||||||
|
"extendsinterfaces": null,
|
||||||
|
"namespace": "[[[NamespacePrefix]]]\\Joomla\\[[[ComponentNamespace]]].File.Handler",
|
||||||
|
"description": "File Handler Class\r\n\r\n@since 5.0.2",
|
||||||
|
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 3rd September, 2020\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||||
|
"head": "",
|
||||||
|
"composer": ""
|
||||||
|
}
|
@ -15,6 +15,7 @@ class UsersSubform << (F,LightGreen) >> #RoyalBlue {
|
|||||||
# Items $items
|
# Items $items
|
||||||
# string $table
|
# string $table
|
||||||
# array $user
|
# array $user
|
||||||
|
# User $identity
|
||||||
# array $activeUsers
|
# array $activeUsers
|
||||||
+ __construct(Items $items, ?string $table = null)
|
+ __construct(Items $items, ?string $table = null)
|
||||||
+ table(string $table) : self
|
+ table(string $table) : self
|
||||||
|
@ -61,6 +61,14 @@ final class UsersSubform implements GuidInterface, SubformInterface
|
|||||||
*/
|
*/
|
||||||
protected array $user;
|
protected array $user;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current active user
|
||||||
|
*
|
||||||
|
* @var User
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected User $identity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The active users
|
* The active users
|
||||||
*
|
*
|
||||||
@ -85,6 +93,8 @@ final class UsersSubform implements GuidInterface, SubformInterface
|
|||||||
$this->table = $table;
|
$this->table = $table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->identity = Factory::getApplication()->getIdentity();
|
||||||
|
|
||||||
// Retrieve the user properties
|
// Retrieve the user properties
|
||||||
$this->initializeUserProperties();
|
$this->initializeUserProperties();
|
||||||
}
|
}
|
||||||
@ -429,7 +439,11 @@ final class UsersSubform implements GuidInterface, SubformInterface
|
|||||||
{
|
{
|
||||||
$user = $this->loadUser($item, $activeUsers);
|
$user = $this->loadUser($item, $activeUsers);
|
||||||
$details = $this->extractUserDetails($item, $user);
|
$details = $this->extractUserDetails($item, $user);
|
||||||
|
|
||||||
|
if ($this->identity->id != $user->id)
|
||||||
|
{
|
||||||
$this->assignUserGroups($details, $user, $item);
|
$this->assignUserGroups($details, $user, $item);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->saveUserDetails($details, $details['id'] ?? 0);
|
return $this->saveUserDetails($details, $details['id'] ?? 0);
|
||||||
}
|
}
|
||||||
@ -535,7 +549,7 @@ final class UsersSubform implements GuidInterface, SubformInterface
|
|||||||
private function saveUserDetails(array $details, int $userId): int
|
private function saveUserDetails(array $details, int $userId): int
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return UserHelper::save($details);
|
return UserHelper::save($details, 0, ['useractivation' => 0, 'sendpassword' => 1, 'allowUserRegistration' => 1]);
|
||||||
} catch (NoUserIdFoundException $e) {
|
} catch (NoUserIdFoundException $e) {
|
||||||
Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');
|
Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
@ -29,6 +29,14 @@
|
|||||||
*/
|
*/
|
||||||
protected array $user;
|
protected array $user;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current active user
|
||||||
|
*
|
||||||
|
* @var User
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected User $identity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The active users
|
* The active users
|
||||||
*
|
*
|
||||||
@ -53,6 +61,8 @@
|
|||||||
$this->table = $table;
|
$this->table = $table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->identity = Factory::getApplication()->getIdentity();
|
||||||
|
|
||||||
// Retrieve the user properties
|
// Retrieve the user properties
|
||||||
$this->initializeUserProperties();
|
$this->initializeUserProperties();
|
||||||
}
|
}
|
||||||
@ -397,7 +407,11 @@
|
|||||||
{
|
{
|
||||||
$user = $this->loadUser($item, $activeUsers);
|
$user = $this->loadUser($item, $activeUsers);
|
||||||
$details = $this->extractUserDetails($item, $user);
|
$details = $this->extractUserDetails($item, $user);
|
||||||
|
|
||||||
|
if ($this->identity->id != $user->id)
|
||||||
|
{
|
||||||
$this->assignUserGroups($details, $user, $item);
|
$this->assignUserGroups($details, $user, $item);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->saveUserDetails($details, $details['id'] ?? 0);
|
return $this->saveUserDetails($details, $details['id'] ?? 0);
|
||||||
}
|
}
|
||||||
@ -503,7 +517,7 @@
|
|||||||
private function saveUserDetails(array $details, int $userId): int
|
private function saveUserDetails(array $details, int $userId): int
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return UserHelper::save($details);
|
return UserHelper::save($details, 0, ['useractivation' => 0, 'sendpassword' => 1, 'allowUserRegistration' => 1]);
|
||||||
} catch (NoUserIdFoundException $e) {
|
} catch (NoUserIdFoundException $e) {
|
||||||
Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');
|
Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
101
src/67a5e0ca-0ff0-4979-9b41-da0b09988016/README.md
Normal file
101
src/67a5e0ca-0ff0-4979-9b41-da0b09988016/README.md
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
```
|
||||||
|
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||||
|
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||||
|
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||||
|
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||||
|
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||||
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
```
|
||||||
|
# final class Manager (Details)
|
||||||
|
> namespace: **VDM\Joomla\Componentbuilder\File**
|
||||||
|
|
||||||
|
```uml
|
||||||
|
@startuml
|
||||||
|
class Manager << (F,LightGreen) >> #RoyalBlue {
|
||||||
|
# Item $item
|
||||||
|
# Items $items
|
||||||
|
# Type $type
|
||||||
|
# Handler $handler
|
||||||
|
+ __construct(Item $item, Items $items, ...)
|
||||||
|
+ upload(string $guid, string $entity, ...) : void
|
||||||
|
+ delete(string $guid, string $entity, ...) : void
|
||||||
|
# modelFileDetails(array $details, string $guid, ...) : object
|
||||||
|
}
|
||||||
|
|
||||||
|
note right of Manager::__construct
|
||||||
|
Constructor.
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
|
||||||
|
arguments:
|
||||||
|
Item $item
|
||||||
|
Items $items
|
||||||
|
Type $type
|
||||||
|
Handler $handler
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Manager::upload
|
||||||
|
Upload a file, of a given file type and link it to an entity.
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: void
|
||||||
|
|
||||||
|
arguments:
|
||||||
|
string $guid
|
||||||
|
string $entity
|
||||||
|
string $target
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Manager::delete
|
||||||
|
Delete a file of a given entity.
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: void
|
||||||
|
|
||||||
|
arguments:
|
||||||
|
string $guid
|
||||||
|
string $entity
|
||||||
|
string $target
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Manager::modelFileDetails
|
||||||
|
model the file details to store in the file table
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: object
|
||||||
|
|
||||||
|
arguments:
|
||||||
|
array $details
|
||||||
|
string $guid
|
||||||
|
string $entity
|
||||||
|
string $target
|
||||||
|
end note
|
||||||
|
|
||||||
|
@enduml
|
||||||
|
```
|
||||||
|
|
||||||
|
The Power feature in JCB allows you to write PHP classes and their implementations, making it easy to include them in your Joomla project. JCB handles linking, autoloading, namespacing, and folder structure creation for you.
|
||||||
|
|
||||||
|
By using the SPK (Super Power Key) in your custom code (replacing the class name in your code with the SPK), JCB will automatically pull the power from the repository into your project. This makes it available in your JCB instance, allowing you to edit it and include the class in your generated Joomla component.
|
||||||
|
|
||||||
|
JCB uses placeholders like [[[`NamespacePrefix`]]] and [[[`ComponentNamespace`]]] in namespacing to prevent collisions and improve reusability across different JCB systems. You can also set the **JCB powers path** globally or per component under the **Dynamic Integration** tab, providing flexibility and easy maintainability.
|
||||||
|
|
||||||
|
To add this specific Power to your project in JCB:
|
||||||
|
|
||||||
|
> simply use this SPK
|
||||||
|
```
|
||||||
|
Super---67a5e0ca_0ff0_4979_9b41_da0b09988016---Power
|
||||||
|
```
|
||||||
|
> remember to replace the `---` with `___` to activate this Power in your code
|
||||||
|
|
||||||
|
---
|
||||||
|
```
|
||||||
|
██╗ ██████╗██████╗
|
||||||
|
██║██╔════╝██╔══██╗
|
||||||
|
██║██║ ██████╔╝
|
||||||
|
██ ██║██║ ██╔══██╗
|
||||||
|
╚█████╔╝╚██████╗██████╔╝
|
||||||
|
╚════╝ ╚═════╝╚═════╝
|
||||||
|
```
|
||||||
|
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||||
|
|
167
src/67a5e0ca-0ff0-4979-9b41-da0b09988016/code.php
Normal file
167
src/67a5e0ca-0ff0-4979-9b41-da0b09988016/code.php
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 3rd September, 2020
|
||||||
|
* @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\File;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Interfaces\Data\ItemInterface as Item;
|
||||||
|
use VDM\Joomla\Interfaces\Data\ItemsInterface as Items;
|
||||||
|
use VDM\Joomla\Data\Guid;
|
||||||
|
use VDM\Joomla\Componentbuilder\File\Type;
|
||||||
|
use VDM\Joomla\Componentbuilder\File\Handler;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File Manager Class
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
final class Manager
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Globally Unique Identifier.
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
use Guid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Item Class.
|
||||||
|
*
|
||||||
|
* @var Item
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Item $item;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Items Class.
|
||||||
|
*
|
||||||
|
* @var Items
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Items $items;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Type Class.
|
||||||
|
*
|
||||||
|
* @var Type
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Type $type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Handler Class.
|
||||||
|
*
|
||||||
|
* @var Handler
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Handler $handler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Item $item The Item Class.
|
||||||
|
* @param Items $items The Items Class.
|
||||||
|
* @param Type $type The Type Class.
|
||||||
|
* @param Handler $handler The Handler Class.
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function __construct(Item $item, Items $items, Type $type, Handler $handler)
|
||||||
|
{
|
||||||
|
$this->item = $item;
|
||||||
|
$this->items = $items;
|
||||||
|
$this->type = $type;
|
||||||
|
$this->handler = $handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload a file, of a given file type and link it to an entity.
|
||||||
|
*
|
||||||
|
* @param string $guid The file type guid
|
||||||
|
* @param string $entity The entity guid
|
||||||
|
* @param string $target The target entity name
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @throws \InvalidArgumentException If the file type is not valid.
|
||||||
|
* @throws \RuntimeException If there is an error during file upload.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function upload(string $guid, string $entity, string $target): void
|
||||||
|
{
|
||||||
|
if (($fileType = $this->type->load($guid, $target)) === null)
|
||||||
|
{
|
||||||
|
throw new \InvalidArgumentException(Text::sprintf('COM_COMPONENTBUILDER_FILE_TYPE_NOT_VALID_IN_S_AREA', $target));
|
||||||
|
}
|
||||||
|
|
||||||
|
$details = $this->handler
|
||||||
|
->setEnqueueError(false)
|
||||||
|
->setLegalFormats($fileType['formats'])
|
||||||
|
->getFile(
|
||||||
|
$fileType['field'], // The input field name
|
||||||
|
$fileType['type'], // The file type
|
||||||
|
$fileType['filter'], // The filter to use when uploading the file
|
||||||
|
$fileType['path'] // The path to the directory where the file must be placed
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($details === null)
|
||||||
|
{
|
||||||
|
// Throw an exception if file details couldn't be retrieved
|
||||||
|
throw new \RuntimeException($this->handler->getErrors());
|
||||||
|
}
|
||||||
|
|
||||||
|
// store file in the file table
|
||||||
|
$this->item->set(
|
||||||
|
$this->modelFileDetails($details, $guid)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a file of a given entity.
|
||||||
|
*
|
||||||
|
* @param string $guid The file guid
|
||||||
|
* @param string $entity The entity guid
|
||||||
|
* @param string $target The target entity name
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function delete(string $guid, string $entity, string $target): void
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* model the file details to store in the file table
|
||||||
|
*
|
||||||
|
* @param array $details The uploaded file details.
|
||||||
|
* @param string $guid The file type guid
|
||||||
|
* @param string $entity The entity guid
|
||||||
|
* @param string $target The target entity name
|
||||||
|
*
|
||||||
|
* @return object
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function modelFileDetails(array $details, string $guid, string $entity, string $target): object
|
||||||
|
{
|
||||||
|
return (object) [
|
||||||
|
'name' => 'soon',
|
||||||
|
'file_type' => $guid,
|
||||||
|
'ext' => 'me',
|
||||||
|
'size_kb' => 45,
|
||||||
|
'filepath' => $details['full_path'],
|
||||||
|
'entity_type' => $target,
|
||||||
|
'entity' => $guid,
|
||||||
|
'guid' => $this->getGuid('file'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
137
src/67a5e0ca-0ff0-4979-9b41-da0b09988016/code.power
Normal file
137
src/67a5e0ca-0ff0-4979-9b41-da0b09988016/code.power
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
/**
|
||||||
|
* The Globally Unique Identifier.
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
use Guid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Item Class.
|
||||||
|
*
|
||||||
|
* @var Item
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Item $item;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Items Class.
|
||||||
|
*
|
||||||
|
* @var Items
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Items $items;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Type Class.
|
||||||
|
*
|
||||||
|
* @var Type
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Type $type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Handler Class.
|
||||||
|
*
|
||||||
|
* @var Handler
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Handler $handler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Item $item The Item Class.
|
||||||
|
* @param Items $items The Items Class.
|
||||||
|
* @param Type $type The Type Class.
|
||||||
|
* @param Handler $handler The Handler Class.
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function __construct(Item $item, Items $items, Type $type, Handler $handler)
|
||||||
|
{
|
||||||
|
$this->item = $item;
|
||||||
|
$this->items = $items;
|
||||||
|
$this->type = $type;
|
||||||
|
$this->handler = $handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload a file, of a given file type and link it to an entity.
|
||||||
|
*
|
||||||
|
* @param string $guid The file type guid
|
||||||
|
* @param string $entity The entity guid
|
||||||
|
* @param string $target The target entity name
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @throws \InvalidArgumentException If the file type is not valid.
|
||||||
|
* @throws \RuntimeException If there is an error during file upload.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function upload(string $guid, string $entity, string $target): void
|
||||||
|
{
|
||||||
|
if (($fileType = $this->type->load($guid, $target)) === null)
|
||||||
|
{
|
||||||
|
throw new \InvalidArgumentException(Text::sprintf('File type not valid in %s area.', $target));
|
||||||
|
}
|
||||||
|
|
||||||
|
$details = $this->handler
|
||||||
|
->setEnqueueError(false)
|
||||||
|
->setLegalFormats($fileType['formats'])
|
||||||
|
->getFile(
|
||||||
|
$fileType['field'], // The input field name
|
||||||
|
$fileType['type'], // The file type
|
||||||
|
$fileType['filter'], // The filter to use when uploading the file
|
||||||
|
$fileType['path'] // The path to the directory where the file must be placed
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($details === null)
|
||||||
|
{
|
||||||
|
// Throw an exception if file details couldn't be retrieved
|
||||||
|
throw new \RuntimeException($this->handler->getErrors());
|
||||||
|
}
|
||||||
|
|
||||||
|
// store file in the file table
|
||||||
|
$this->item->set(
|
||||||
|
$this->modelFileDetails($details, $guid)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a file of a given entity.
|
||||||
|
*
|
||||||
|
* @param string $guid The file guid
|
||||||
|
* @param string $entity The entity guid
|
||||||
|
* @param string $target The target entity name
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function delete(string $guid, string $entity, string $target): void
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* model the file details to store in the file table
|
||||||
|
*
|
||||||
|
* @param array $details The uploaded file details.
|
||||||
|
* @param string $guid The file type guid
|
||||||
|
* @param string $entity The entity guid
|
||||||
|
* @param string $target The target entity name
|
||||||
|
*
|
||||||
|
* @return object
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function modelFileDetails(array $details, string $guid, string $entity, string $target): object
|
||||||
|
{
|
||||||
|
return (object) [
|
||||||
|
'name' => 'soon',
|
||||||
|
'file_type' => $guid,
|
||||||
|
'ext' => 'me',
|
||||||
|
'size_kb' => 45,
|
||||||
|
'filepath' => $details['full_path'],
|
||||||
|
'entity_type' => $target,
|
||||||
|
'entity' => $guid,
|
||||||
|
'guid' => $this->getGuid('file'),
|
||||||
|
];
|
||||||
|
}
|
40
src/67a5e0ca-0ff0-4979-9b41-da0b09988016/settings.json
Normal file
40
src/67a5e0ca-0ff0-4979-9b41-da0b09988016/settings.json
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"add_head": "0",
|
||||||
|
"add_licensing_template": "2",
|
||||||
|
"extends": "",
|
||||||
|
"guid": "67a5e0ca-0ff0-4979-9b41-da0b09988016",
|
||||||
|
"implements": null,
|
||||||
|
"load_selection": null,
|
||||||
|
"name": "Manager",
|
||||||
|
"power_version": "1.0.0",
|
||||||
|
"system_name": "Joomla.File.Manager",
|
||||||
|
"type": "final class",
|
||||||
|
"use_selection": {
|
||||||
|
"use_selection0": {
|
||||||
|
"use": "05744dd3-4030-4cf8-8dda-a93ab809b473",
|
||||||
|
"as": "Item"
|
||||||
|
},
|
||||||
|
"use_selection1": {
|
||||||
|
"use": "7212e4db-371f-4cfd-8122-32e9bb100d83",
|
||||||
|
"as": "Items"
|
||||||
|
},
|
||||||
|
"use_selection2": {
|
||||||
|
"use": "5acded67-0e3d-4c6b-a6ea-b533b076de0c",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection3": {
|
||||||
|
"use": "12a2a8de-a893-4dbb-a53d-b52de4f6cb0e",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection4": {
|
||||||
|
"use": "4144ad3b-2ad5-401f-af0c-a3d856c1e688",
|
||||||
|
"as": "default"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extendsinterfaces": null,
|
||||||
|
"namespace": "[[[NamespacePrefix]]]\\Joomla\\[[[ComponentNamespace]]].File.Manager",
|
||||||
|
"description": "File Manager Class\r\n\r\n@since 5.0.2",
|
||||||
|
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 3rd September, 2020\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||||
|
"head": "",
|
||||||
|
"composer": ""
|
||||||
|
}
|
53
src/884eca78-281f-4eab-b962-d97e355af16d/README.md
Normal file
53
src/884eca78-281f-4eab-b962-d97e355af16d/README.md
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
```
|
||||||
|
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||||
|
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||||
|
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||||
|
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||||
|
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||||
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
```
|
||||||
|
# abstract class Factory (Details)
|
||||||
|
> namespace: **VDM\Joomla\Componentbuilder\File**
|
||||||
|
> extends: **ExtendingFactory**
|
||||||
|
|
||||||
|
```uml
|
||||||
|
@startuml
|
||||||
|
abstract Factory #Orange {
|
||||||
|
# {static} createContainer() : Container
|
||||||
|
}
|
||||||
|
|
||||||
|
note right of Factory::createContainer
|
||||||
|
Create a container object
|
||||||
|
|
||||||
|
since: 3.2.2
|
||||||
|
return: Container
|
||||||
|
end note
|
||||||
|
|
||||||
|
@enduml
|
||||||
|
```
|
||||||
|
|
||||||
|
The Power feature in JCB allows you to write PHP classes and their implementations, making it easy to include them in your Joomla project. JCB handles linking, autoloading, namespacing, and folder structure creation for you.
|
||||||
|
|
||||||
|
By using the SPK (Super Power Key) in your custom code (replacing the class name in your code with the SPK), JCB will automatically pull the power from the repository into your project. This makes it available in your JCB instance, allowing you to edit it and include the class in your generated Joomla component.
|
||||||
|
|
||||||
|
JCB uses placeholders like [[[`NamespacePrefix`]]] and [[[`ComponentNamespace`]]] in namespacing to prevent collisions and improve reusability across different JCB systems. You can also set the **JCB powers path** globally or per component under the **Dynamic Integration** tab, providing flexibility and easy maintainability.
|
||||||
|
|
||||||
|
To add this specific Power to your project in JCB:
|
||||||
|
|
||||||
|
> simply use this SPK
|
||||||
|
```
|
||||||
|
Super---884eca78_281f_4eab_b962_d97e355af16d---Power
|
||||||
|
```
|
||||||
|
> remember to replace the `---` with `___` to activate this Power in your code
|
||||||
|
|
||||||
|
---
|
||||||
|
```
|
||||||
|
██╗ ██████╗██████╗
|
||||||
|
██║██╔════╝██╔══██╗
|
||||||
|
██║██║ ██████╔╝
|
||||||
|
██ ██║██║ ██╔══██╗
|
||||||
|
╚█████╔╝╚██████╗██████╔╝
|
||||||
|
╚════╝ ╚═════╝╚═════╝
|
||||||
|
```
|
||||||
|
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||||
|
|
48
src/884eca78-281f-4eab-b962-d97e355af16d/code.php
Normal file
48
src/884eca78-281f-4eab-b962-d97e355af16d/code.php
Normal file
@ -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\Componentbuilder\File;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\DI\Container;
|
||||||
|
use VDM\Joomla\Service\Table;
|
||||||
|
use VDM\Joomla\Service\Database;
|
||||||
|
use VDM\Joomla\Service\Model;
|
||||||
|
use VDM\Joomla\Service\Data;
|
||||||
|
use VDM\Joomla\Componentbuilder\File\Service\File;
|
||||||
|
use VDM\Joomla\Interfaces\FactoryInterface;
|
||||||
|
use VDM\Joomla\Abstraction\Factory as ExtendingFactory;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File Factory
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
abstract class Factory extends ExtendingFactory implements FactoryInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a container object
|
||||||
|
*
|
||||||
|
* @return Container
|
||||||
|
* @since 3.2.2
|
||||||
|
*/
|
||||||
|
protected static function createContainer(): Container
|
||||||
|
{
|
||||||
|
return (new Container())
|
||||||
|
->registerServiceProvider(new Table())
|
||||||
|
->registerServiceProvider(new Database())
|
||||||
|
->registerServiceProvider(new Model())
|
||||||
|
->registerServiceProvider(new Data())
|
||||||
|
->registerServiceProvider(new File());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
15
src/884eca78-281f-4eab-b962-d97e355af16d/code.power
Normal file
15
src/884eca78-281f-4eab-b962-d97e355af16d/code.power
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Create a container object
|
||||||
|
*
|
||||||
|
* @return Container
|
||||||
|
* @since 3.2.2
|
||||||
|
*/
|
||||||
|
protected static function createContainer(): Container
|
||||||
|
{
|
||||||
|
return (new Container())
|
||||||
|
->registerServiceProvider(new Table())
|
||||||
|
->registerServiceProvider(new Database())
|
||||||
|
->registerServiceProvider(new Model())
|
||||||
|
->registerServiceProvider(new Data())
|
||||||
|
->registerServiceProvider(new File());
|
||||||
|
}
|
42
src/884eca78-281f-4eab-b962-d97e355af16d/settings.json
Normal file
42
src/884eca78-281f-4eab-b962-d97e355af16d/settings.json
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"add_head": "1",
|
||||||
|
"add_licensing_template": "2",
|
||||||
|
"extends": "2e5bf608-de5c-4b00-a20d-47c26aa350d9",
|
||||||
|
"guid": "884eca78-281f-4eab-b962-d97e355af16d",
|
||||||
|
"implements": [
|
||||||
|
"caf33c5d-858c-4f9a-894f-ab302ec5445a"
|
||||||
|
],
|
||||||
|
"load_selection": null,
|
||||||
|
"name": "Factory",
|
||||||
|
"power_version": "1.0.0",
|
||||||
|
"system_name": "JCB.File.Factory",
|
||||||
|
"type": "abstract class",
|
||||||
|
"use_selection": {
|
||||||
|
"use_selection0": {
|
||||||
|
"use": "19b2ba92-1655-4384-acfb-979c80de8b6d",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection1": {
|
||||||
|
"use": "4815e1c7-a433-443d-a112-d1e03d7df84b",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection2": {
|
||||||
|
"use": "2dcedd6c-c95b-4a37-9cac-95d28faedca3",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection3": {
|
||||||
|
"use": "a5daf189-3345-4b13-8716-c51f686f545b",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection4": {
|
||||||
|
"use": "202ccd9e-dfcf-4cde-a0ce-bde1fd27f088",
|
||||||
|
"as": "default"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extendsinterfaces": null,
|
||||||
|
"namespace": "[[[NamespacePrefix]]]\\Joomla\\[[[ComponentNamespace]]].File.Factory",
|
||||||
|
"description": "File Factory\r\n\r\n@since 5.0.2",
|
||||||
|
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||||
|
"head": "use Joomla\\DI\\Container;",
|
||||||
|
"composer": ""
|
||||||
|
}
|
@ -1546,7 +1546,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'metakey' => [
|
'metakey' => [
|
||||||
@ -2267,7 +2267,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -2907,7 +2907,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -2987,7 +2987,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -3403,7 +3403,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -4891,7 +4891,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -5483,7 +5483,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -6075,7 +6075,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -6235,7 +6235,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -6395,7 +6395,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -6955,7 +6955,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -7179,7 +7179,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -7307,7 +7307,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -7451,7 +7451,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -7499,7 +7499,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -7659,7 +7659,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -7883,7 +7883,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -7963,7 +7963,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -8379,7 +8379,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -8635,7 +8635,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -8731,7 +8731,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -8779,7 +8779,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -8987,7 +8987,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9115,7 +9115,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'TEXT',
|
'type' => 'TEXT',
|
||||||
'default' => 'EMPTY',
|
'default' => 'EMPTY',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'unique_key' => false,
|
'unique_key' => false,
|
||||||
'key' => false,
|
'key' => false,
|
||||||
],
|
],
|
||||||
@ -9131,7 +9131,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'TINYINT(1)',
|
'type' => 'TINYINT(1)',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'unique_key' => false,
|
'unique_key' => false,
|
||||||
'key' => true,
|
'key' => true,
|
||||||
],
|
],
|
||||||
@ -9211,7 +9211,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9437,7 +9437,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9485,7 +9485,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9533,7 +9533,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9581,7 +9581,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9629,7 +9629,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9677,7 +9677,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9725,7 +9725,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9773,7 +9773,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9821,7 +9821,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -9869,7 +9869,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10013,7 +10013,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10061,7 +10061,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10125,7 +10125,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10221,7 +10221,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10253,7 +10253,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'TEXT',
|
'type' => 'TEXT',
|
||||||
'default' => 'EMPTY',
|
'default' => 'EMPTY',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'unique_key' => false,
|
'unique_key' => false,
|
||||||
'key' => false,
|
'key' => false,
|
||||||
],
|
],
|
||||||
@ -10269,7 +10269,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10317,7 +10317,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10365,7 +10365,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10413,7 +10413,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10461,7 +10461,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10573,7 +10573,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10653,7 +10653,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10701,7 +10701,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10813,7 +10813,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10861,7 +10861,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -10909,7 +10909,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -11021,7 +11021,7 @@ final class Table extends BaseTable implements Tableinterface
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
60
src/d46c4667-378b-49e8-9782-ffb28d92415a/README.md
Normal file
60
src/d46c4667-378b-49e8-9782-ffb28d92415a/README.md
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
```
|
||||||
|
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||||
|
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||||
|
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||||
|
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||||
|
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||||
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
```
|
||||||
|
# final class Display (Details)
|
||||||
|
> namespace: **VDM\Joomla\Componentbuilder\File**
|
||||||
|
|
||||||
|
```uml
|
||||||
|
@startuml
|
||||||
|
class Display << (F,LightGreen) >> #RoyalBlue {
|
||||||
|
# Items $items
|
||||||
|
+ __construct(Items $items)
|
||||||
|
+ get(string $entity, string $target) : ?array
|
||||||
|
}
|
||||||
|
|
||||||
|
note right of Display::__construct
|
||||||
|
Constructor.
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Display::get
|
||||||
|
Get the file data that belong to this entity
|
||||||
|
|
||||||
|
since: 5.0.2
|
||||||
|
return: ?array
|
||||||
|
end note
|
||||||
|
|
||||||
|
@enduml
|
||||||
|
```
|
||||||
|
|
||||||
|
The Power feature in JCB allows you to write PHP classes and their implementations, making it easy to include them in your Joomla project. JCB handles linking, autoloading, namespacing, and folder structure creation for you.
|
||||||
|
|
||||||
|
By using the SPK (Super Power Key) in your custom code (replacing the class name in your code with the SPK), JCB will automatically pull the power from the repository into your project. This makes it available in your JCB instance, allowing you to edit it and include the class in your generated Joomla component.
|
||||||
|
|
||||||
|
JCB uses placeholders like [[[`NamespacePrefix`]]] and [[[`ComponentNamespace`]]] in namespacing to prevent collisions and improve reusability across different JCB systems. You can also set the **JCB powers path** globally or per component under the **Dynamic Integration** tab, providing flexibility and easy maintainability.
|
||||||
|
|
||||||
|
To add this specific Power to your project in JCB:
|
||||||
|
|
||||||
|
> simply use this SPK
|
||||||
|
```
|
||||||
|
Super---d46c4667_378b_49e8_9782_ffb28d92415a---Power
|
||||||
|
```
|
||||||
|
> remember to replace the `---` with `___` to activate this Power in your code
|
||||||
|
|
||||||
|
---
|
||||||
|
```
|
||||||
|
██╗ ██████╗██████╗
|
||||||
|
██║██╔════╝██╔══██╗
|
||||||
|
██║██║ ██████╔╝
|
||||||
|
██ ██║██║ ██╔══██╗
|
||||||
|
╚█████╔╝╚██████╗██████╔╝
|
||||||
|
╚════╝ ╚═════╝╚═════╝
|
||||||
|
```
|
||||||
|
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||||
|
|
73
src/d46c4667-378b-49e8-9782-ffb28d92415a/code.php
Normal file
73
src/d46c4667-378b-49e8-9782-ffb28d92415a/code.php
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 3rd September, 2020
|
||||||
|
* @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\File;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Interfaces\Data\ItemsInterface as Items;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File Display Class
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
final class Display
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Items Class.
|
||||||
|
*
|
||||||
|
* @var Items
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Items $items;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Items $items The Items Class.
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function __construct(Items $items)
|
||||||
|
{
|
||||||
|
$this->items = $items;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the file data that belong to this entity
|
||||||
|
*
|
||||||
|
* @param string $entity The entity guid
|
||||||
|
* @param string $target The target entity name
|
||||||
|
*
|
||||||
|
* @return array|null
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function get(string $entity, string $target): ?array
|
||||||
|
{
|
||||||
|
if (($files = $this->items->table->('file')->get([$entity], 'entity')) !== null)
|
||||||
|
{
|
||||||
|
foreach ($files as $n => $file)
|
||||||
|
{
|
||||||
|
if ($file->entity_type !== $target)
|
||||||
|
{
|
||||||
|
unset($files[$n]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the $files array is empty, return null
|
||||||
|
return !empty($files) ? $files : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
47
src/d46c4667-378b-49e8-9782-ffb28d92415a/code.power
Normal file
47
src/d46c4667-378b-49e8-9782-ffb28d92415a/code.power
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/**
|
||||||
|
* The Items Class.
|
||||||
|
*
|
||||||
|
* @var Items
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected Items $items;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Items $items The Items Class.
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function __construct(Items $items)
|
||||||
|
{
|
||||||
|
$this->items = $items;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the file data that belong to this entity
|
||||||
|
*
|
||||||
|
* @param string $entity The entity guid
|
||||||
|
* @param string $target The target entity name
|
||||||
|
*
|
||||||
|
* @return array|null
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function get(string $entity, string $target): ?array
|
||||||
|
{
|
||||||
|
if (($files = $this->items->table->('file')->get([$entity], 'entity')) !== null)
|
||||||
|
{
|
||||||
|
foreach ($files as $n => $file)
|
||||||
|
{
|
||||||
|
if ($file->entity_type !== $target)
|
||||||
|
{
|
||||||
|
unset($files[$n]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the $files array is empty, return null
|
||||||
|
return !empty($files) ? $files : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
24
src/d46c4667-378b-49e8-9782-ffb28d92415a/settings.json
Normal file
24
src/d46c4667-378b-49e8-9782-ffb28d92415a/settings.json
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"add_head": "0",
|
||||||
|
"add_licensing_template": "2",
|
||||||
|
"extends": "",
|
||||||
|
"guid": "d46c4667-378b-49e8-9782-ffb28d92415a",
|
||||||
|
"implements": null,
|
||||||
|
"load_selection": null,
|
||||||
|
"name": "Display",
|
||||||
|
"power_version": "1.0.0",
|
||||||
|
"system_name": "Joomla.File.Display",
|
||||||
|
"type": "final class",
|
||||||
|
"use_selection": {
|
||||||
|
"use_selection0": {
|
||||||
|
"use": "7212e4db-371f-4cfd-8122-32e9bb100d83",
|
||||||
|
"as": "Items"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extendsinterfaces": null,
|
||||||
|
"namespace": "[[[NamespacePrefix]]]\\Joomla\\[[[ComponentNamespace]]].File.Display",
|
||||||
|
"description": "File Display Class\r\n\r\n@since 5.0.2",
|
||||||
|
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 3rd September, 2020\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||||
|
"head": "",
|
||||||
|
"composer": ""
|
||||||
|
}
|
88
src/d7600b43-771a-4747-9f5d-952765721799/README.md
Normal file
88
src/d7600b43-771a-4747-9f5d-952765721799/README.md
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
```
|
||||||
|
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||||
|
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||||
|
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||||
|
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||||
|
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||||
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
```
|
||||||
|
# abstract class UploadHelper (Details)
|
||||||
|
> namespace: **VDM\Joomla\Utilities**
|
||||||
|
|
||||||
|
```uml
|
||||||
|
@startuml
|
||||||
|
abstract UploadHelper #Orange {
|
||||||
|
+ {static} get(string $field, string $type, ...) : ?array
|
||||||
|
+ {static} getError(bool $toString = false) : array|string
|
||||||
|
# {static} check(array $upload, string $type) : array|null
|
||||||
|
# {static} remove(string $fullPath) : boolean
|
||||||
|
# {static} setError(string $message) : void
|
||||||
|
}
|
||||||
|
|
||||||
|
note right of UploadHelper::get
|
||||||
|
Get file/files from a HTTP upload.
|
||||||
|
|
||||||
|
since: 3.0.11
|
||||||
|
return: ?array
|
||||||
|
|
||||||
|
arguments:
|
||||||
|
string $field
|
||||||
|
string $type
|
||||||
|
string $filter = null
|
||||||
|
string $path = null
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of UploadHelper::getError
|
||||||
|
Get the errors
|
||||||
|
|
||||||
|
since: 3.0.11
|
||||||
|
return: array|string
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of UploadHelper::check
|
||||||
|
Check a file and verifies it as a allowed file format file
|
||||||
|
|
||||||
|
return: array|null
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of UploadHelper::remove
|
||||||
|
Clean up temporary uploaded file
|
||||||
|
|
||||||
|
return: boolean
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of UploadHelper::setError
|
||||||
|
Set the errors
|
||||||
|
|
||||||
|
since: 3.0.11
|
||||||
|
return: void
|
||||||
|
end note
|
||||||
|
|
||||||
|
@enduml
|
||||||
|
```
|
||||||
|
|
||||||
|
The Power feature in JCB allows you to write PHP classes and their implementations, making it easy to include them in your Joomla project. JCB handles linking, autoloading, namespacing, and folder structure creation for you.
|
||||||
|
|
||||||
|
By using the SPK (Super Power Key) in your custom code (replacing the class name in your code with the SPK), JCB will automatically pull the power from the repository into your project. This makes it available in your JCB instance, allowing you to edit it and include the class in your generated Joomla component.
|
||||||
|
|
||||||
|
JCB uses placeholders like [[[`NamespacePrefix`]]] and [[[`ComponentNamespace`]]] in namespacing to prevent collisions and improve reusability across different JCB systems. You can also set the **JCB powers path** globally or per component under the **Dynamic Integration** tab, providing flexibility and easy maintainability.
|
||||||
|
|
||||||
|
To add this specific Power to your project in JCB:
|
||||||
|
|
||||||
|
> simply use this SPK
|
||||||
|
```
|
||||||
|
Super---d7600b43_771a_4747_9f5d_952765721799---Power
|
||||||
|
```
|
||||||
|
> remember to replace the `---` with `___` to activate this Power in your code
|
||||||
|
|
||||||
|
---
|
||||||
|
```
|
||||||
|
██╗ ██████╗██████╗
|
||||||
|
██║██╔════╝██╔══██╗
|
||||||
|
██║██║ ██████╔╝
|
||||||
|
██ ██║██║ ██╔══██╗
|
||||||
|
╚█████╔╝╚██████╗██████╔╝
|
||||||
|
╚════╝ ╚═════╝╚═════╝
|
||||||
|
```
|
||||||
|
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||||
|
|
312
src/d7600b43-771a-4747-9f5d-952765721799/code.php
Normal file
312
src/d7600b43-771a-4747-9f5d-952765721799/code.php
Normal file
@ -0,0 +1,312 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 3rd September, 2020
|
||||||
|
* @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\Utilities;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\Filesystem\File;
|
||||||
|
use Joomla\CMS\Filesystem\Folder;
|
||||||
|
use Joomla\CMS\Filesystem\Path;
|
||||||
|
use VDM\Joomla\Utilities\Component\Helper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload Helper
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
abstract class UploadHelper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* True to use streams
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static bool $useStreams = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow the upload of unsafe files
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static bool $allowUnsafe = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Options to InputFilter::isSafeFile
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static array $safeFileOptions = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the error behavior
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static bool $enqueueError = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Legal Formats
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public static array $legalFormats = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Errors
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
protected static array $errors = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get file/files from a HTTP upload.
|
||||||
|
*
|
||||||
|
* @param string $field The input field name
|
||||||
|
* @param string $type The file type
|
||||||
|
* @param string|null $filter The filter to use when uploading the file
|
||||||
|
* @param string|null $path The path to the directory where the file must be placed
|
||||||
|
*
|
||||||
|
* @return array|null File details or false on failure.
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static function get(string $field, string $type, string $filter = null, string $path = null): ?array
|
||||||
|
{
|
||||||
|
// Get the uploaded file information.
|
||||||
|
$input = Factory::getApplication()->input;
|
||||||
|
|
||||||
|
// set the default filter
|
||||||
|
if (empty($filter))
|
||||||
|
{
|
||||||
|
$filter = 'array';
|
||||||
|
}
|
||||||
|
// if raw then also unsafe
|
||||||
|
// see: https://github.com/joomla/joomla-cms/blob/4.1-dev/administrator/components/com_installer/src/Model/InstallModel.php#L259
|
||||||
|
elseif ($filter === 'raw')
|
||||||
|
{
|
||||||
|
static::$allowUnsafe = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if we have a file destination name in the field name
|
||||||
|
$name = null;
|
||||||
|
if (strpos($field, ':') !== false)
|
||||||
|
{
|
||||||
|
list($field, $name) = explode(':', $field);
|
||||||
|
}
|
||||||
|
|
||||||
|
// See JInputFiles::get.
|
||||||
|
$userfile = $input->files->get($field, null, $filter);
|
||||||
|
|
||||||
|
// Make sure that file uploads are enabled in php.
|
||||||
|
if (!(bool) ini_get('file_uploads'))
|
||||||
|
{
|
||||||
|
static::setError(Text::_('COM_COMPONENTBUILDER_WARNING_UPLOAD_ERROR'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there is no uploaded file, we have a problem...
|
||||||
|
if (!is_array($userfile))
|
||||||
|
{
|
||||||
|
static::setError(Text::_('COM_COMPONENTBUILDER_NO_UPLOAD_SELECTED'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is the PHP tmp directory missing?
|
||||||
|
if ($userfile['error'] && ($userfile['error'] == UPLOAD_ERR_NO_TMP_DIR))
|
||||||
|
{
|
||||||
|
static::setError(Text::_('COM_COMPONENTBUILDER_THERE_WAS_AN_ERROR_UPLOADING_TO_THE_SERVER') . '<br>' . Text::_('COM_COMPONENTBUILDER_THE_PHP_TEMPORARY_FOLDER_IS_NOT_SET'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is the max upload size too small in php.ini?
|
||||||
|
if ($userfile['error'] && ($userfile['error'] == UPLOAD_ERR_INI_SIZE))
|
||||||
|
{
|
||||||
|
static::setError(Text::_('COM_COMPONENTBUILDER_THERE_WAS_AN_ERROR_UPLOADING_TO_THE_SERVER') . '<br>' . Text::_('COM_COMPONENTBUILDER_YOUR_FILE_WAS_IS_LARGER_THAN_THE_ALLOWED_SIZE'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if there was a different problem uploading the file.
|
||||||
|
if ($userfile['error'] || $userfile['size'] < 1)
|
||||||
|
{
|
||||||
|
static::setError(Text::_('COM_COMPONENTBUILDER_THERE_WAS_AN_ERROR_UPLOADING_TO_THE_SERVER'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if a path was passed and exist
|
||||||
|
if (is_string($path) && Folder::create($path))
|
||||||
|
{
|
||||||
|
// set the path
|
||||||
|
$userfile['path'] = $path;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// get the Joomla config class
|
||||||
|
$config = Factory::getConfig();
|
||||||
|
// set the path
|
||||||
|
$userfile['path'] = $config->get('tmp_path');
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the random part of the name
|
||||||
|
$userfile['random'] = StringHelper::random(12);
|
||||||
|
|
||||||
|
// set the file name
|
||||||
|
if (empty($name))
|
||||||
|
{
|
||||||
|
// set the file name
|
||||||
|
$userfile['file_name'] = $userfile['random'] . $userfile['name'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// check that his name has file format
|
||||||
|
if (is_string($name) && strpos($name, '.') === false)
|
||||||
|
{
|
||||||
|
$name = $name . '.' . MimeHelper::extension(null, $userfile['type']);
|
||||||
|
}
|
||||||
|
$userfile['file_name'] = $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set full path
|
||||||
|
$userfile['full_path'] = $userfile['path'] . '/' . $userfile['file_name'];
|
||||||
|
|
||||||
|
// Upload the file.
|
||||||
|
if (File::upload($userfile['tmp_name'], $userfile['full_path'], static::$useStreams, static::$allowUnsafe))
|
||||||
|
{
|
||||||
|
// Check that this is a valid file
|
||||||
|
return static::check($userfile, $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the errors
|
||||||
|
*
|
||||||
|
* @param bool $toString The option to return errors as a string
|
||||||
|
*
|
||||||
|
* @return array|string
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static function getError($toString = false)
|
||||||
|
{
|
||||||
|
if ($toString)
|
||||||
|
{
|
||||||
|
return implode(' ' . PHP_EOL, static::$errors);
|
||||||
|
}
|
||||||
|
return static::$errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check a file and verifies it as a allowed file format file
|
||||||
|
*
|
||||||
|
* @param array $upload The uploaded details array
|
||||||
|
* @param string $type The file type
|
||||||
|
*
|
||||||
|
* @return array|null of elements
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected static function check(array $upload, string $type)? ?array
|
||||||
|
{
|
||||||
|
// Default formats
|
||||||
|
$formats = MimeHelper::extensions($type);
|
||||||
|
|
||||||
|
// Clean the path
|
||||||
|
$upload_path = Path::clean($upload['full_path']);
|
||||||
|
|
||||||
|
// Get file extension/format
|
||||||
|
$format = MimeHelper::extension($upload_path);
|
||||||
|
|
||||||
|
// Legal file formats
|
||||||
|
$legal = [];
|
||||||
|
|
||||||
|
// check if the file format is even in the list
|
||||||
|
if (in_array($format, $formats))
|
||||||
|
{
|
||||||
|
// get allowed formats
|
||||||
|
$legal_formats = (array) Helper::getParams()->get($type . '_formats', []);
|
||||||
|
$legal = array_values(array_unique(array_merge($legal_formats, static::$legalFormats)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// check the extension
|
||||||
|
if (!in_array($format, $legal))
|
||||||
|
{
|
||||||
|
// Cleanup the import file
|
||||||
|
static::remove($upload['full_path']);
|
||||||
|
|
||||||
|
static::setError(Text::_('COM_COMPONENTBUILDER_UPLOAD_IS_NOT_A_VALID_TYPE'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $upload;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean up temporary uploaded file
|
||||||
|
*
|
||||||
|
* @param string $fullPath The full path of the uploaded file
|
||||||
|
*
|
||||||
|
* @return boolean True on success
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected static function remove($fullPath)
|
||||||
|
{
|
||||||
|
// Is the package file a valid file?
|
||||||
|
if (is_file($fullPath))
|
||||||
|
{
|
||||||
|
File::delete($fullPath);
|
||||||
|
}
|
||||||
|
elseif (is_file(Path::clean($fullPath)))
|
||||||
|
{
|
||||||
|
// It might also be just a base filename
|
||||||
|
File::delete(Path::clean($fullPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the errors
|
||||||
|
*
|
||||||
|
* @param string $message The error message
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
protected static function setError($message)
|
||||||
|
{
|
||||||
|
if (static::$enqueueError)
|
||||||
|
{
|
||||||
|
Factory::getApplication()->enqueueMessage($message, 'error');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
static::$errors[] = $message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
281
src/d7600b43-771a-4747-9f5d-952765721799/code.power
Normal file
281
src/d7600b43-771a-4747-9f5d-952765721799/code.power
Normal file
@ -0,0 +1,281 @@
|
|||||||
|
/**
|
||||||
|
* True to use streams
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static bool $useStreams = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow the upload of unsafe files
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static bool $allowUnsafe = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Options to InputFilter::isSafeFile
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static array $safeFileOptions = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the error behavior
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static bool $enqueueError = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Legal Formats
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public static array $legalFormats = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Errors
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
protected static array $errors = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get file/files from a HTTP upload.
|
||||||
|
*
|
||||||
|
* @param string $field The input field name
|
||||||
|
* @param string $type The file type
|
||||||
|
* @param string|null $filter The filter to use when uploading the file
|
||||||
|
* @param string|null $path The path to the directory where the file must be placed
|
||||||
|
*
|
||||||
|
* @return array|null File details or false on failure.
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static function get(string $field, string $type, string $filter = null, string $path = null): ?array
|
||||||
|
{
|
||||||
|
// Get the uploaded file information.
|
||||||
|
$input = Factory::getApplication()->input;
|
||||||
|
|
||||||
|
// set the default filter
|
||||||
|
if (empty($filter))
|
||||||
|
{
|
||||||
|
$filter = 'array';
|
||||||
|
}
|
||||||
|
// if raw then also unsafe
|
||||||
|
// see: https://github.com/joomla/joomla-cms/blob/4.1-dev/administrator/components/com_installer/src/Model/InstallModel.php#L259
|
||||||
|
elseif ($filter === 'raw')
|
||||||
|
{
|
||||||
|
static::$allowUnsafe = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if we have a file destination name in the field name
|
||||||
|
$name = null;
|
||||||
|
if (strpos($field, ':') !== false)
|
||||||
|
{
|
||||||
|
list($field, $name) = explode(':', $field);
|
||||||
|
}
|
||||||
|
|
||||||
|
// See JInputFiles::get.
|
||||||
|
$userfile = $input->files->get($field, null, $filter);
|
||||||
|
|
||||||
|
// Make sure that file uploads are enabled in php.
|
||||||
|
if (!(bool) ini_get('file_uploads'))
|
||||||
|
{
|
||||||
|
static::setError(Text::_('Warning, upload error.'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there is no uploaded file, we have a problem...
|
||||||
|
if (!is_array($userfile))
|
||||||
|
{
|
||||||
|
static::setError(Text::_('No upload selected'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is the PHP tmp directory missing?
|
||||||
|
if ($userfile['error'] && ($userfile['error'] == UPLOAD_ERR_NO_TMP_DIR))
|
||||||
|
{
|
||||||
|
static::setError(Text::_('There was an error uploading to the server.') . '<br>' . Text::_('The PHP temporary folder is not set.'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is the max upload size too small in php.ini?
|
||||||
|
if ($userfile['error'] && ($userfile['error'] == UPLOAD_ERR_INI_SIZE))
|
||||||
|
{
|
||||||
|
static::setError(Text::_('There was an error uploading to the server.') . '<br>' . Text::_('Your file was is larger than the allowed size.'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if there was a different problem uploading the file.
|
||||||
|
if ($userfile['error'] || $userfile['size'] < 1)
|
||||||
|
{
|
||||||
|
static::setError(Text::_('There was an error uploading to the server.'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if a path was passed and exist
|
||||||
|
if (is_string($path) && Folder::create($path))
|
||||||
|
{
|
||||||
|
// set the path
|
||||||
|
$userfile['path'] = $path;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// get the Joomla config class
|
||||||
|
$config = Factory::getConfig();
|
||||||
|
// set the path
|
||||||
|
$userfile['path'] = $config->get('tmp_path');
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the random part of the name
|
||||||
|
$userfile['random'] = StringHelper::random(12);
|
||||||
|
|
||||||
|
// set the file name
|
||||||
|
if (empty($name))
|
||||||
|
{
|
||||||
|
// set the file name
|
||||||
|
$userfile['file_name'] = $userfile['random'] . $userfile['name'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// check that his name has file format
|
||||||
|
if (is_string($name) && strpos($name, '.') === false)
|
||||||
|
{
|
||||||
|
$name = $name . '.' . MimeHelper::extension(null, $userfile['type']);
|
||||||
|
}
|
||||||
|
$userfile['file_name'] = $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set full path
|
||||||
|
$userfile['full_path'] = $userfile['path'] . '/' . $userfile['file_name'];
|
||||||
|
|
||||||
|
// Upload the file.
|
||||||
|
if (File::upload($userfile['tmp_name'], $userfile['full_path'], static::$useStreams, static::$allowUnsafe))
|
||||||
|
{
|
||||||
|
// Check that this is a valid file
|
||||||
|
return static::check($userfile, $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the errors
|
||||||
|
*
|
||||||
|
* @param bool $toString The option to return errors as a string
|
||||||
|
*
|
||||||
|
* @return array|string
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
public static function getError($toString = false)
|
||||||
|
{
|
||||||
|
if ($toString)
|
||||||
|
{
|
||||||
|
return implode(' ' . PHP_EOL, static::$errors);
|
||||||
|
}
|
||||||
|
return static::$errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check a file and verifies it as a allowed file format file
|
||||||
|
*
|
||||||
|
* @param array $upload The uploaded details array
|
||||||
|
* @param string $type The file type
|
||||||
|
*
|
||||||
|
* @return array|null of elements
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected static function check(array $upload, string $type)? ?array
|
||||||
|
{
|
||||||
|
// Default formats
|
||||||
|
$formats = MimeHelper::extensions($type);
|
||||||
|
|
||||||
|
// Clean the path
|
||||||
|
$upload_path = Path::clean($upload['full_path']);
|
||||||
|
|
||||||
|
// Get file extension/format
|
||||||
|
$format = MimeHelper::extension($upload_path);
|
||||||
|
|
||||||
|
// Legal file formats
|
||||||
|
$legal = [];
|
||||||
|
|
||||||
|
// check if the file format is even in the list
|
||||||
|
if (in_array($format, $formats))
|
||||||
|
{
|
||||||
|
// get allowed formats
|
||||||
|
$legal_formats = (array) Helper::getParams()->get($type . '_formats', []);
|
||||||
|
$legal = array_values(array_unique(array_merge($legal_formats, static::$legalFormats)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// check the extension
|
||||||
|
if (!in_array($format, $legal))
|
||||||
|
{
|
||||||
|
// Cleanup the import file
|
||||||
|
static::remove($upload['full_path']);
|
||||||
|
|
||||||
|
static::setError(Text::_('Upload is not a valid type.'));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $upload;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean up temporary uploaded file
|
||||||
|
*
|
||||||
|
* @param string $fullPath The full path of the uploaded file
|
||||||
|
*
|
||||||
|
* @return boolean True on success
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected static function remove($fullPath)
|
||||||
|
{
|
||||||
|
// Is the package file a valid file?
|
||||||
|
if (is_file($fullPath))
|
||||||
|
{
|
||||||
|
File::delete($fullPath);
|
||||||
|
}
|
||||||
|
elseif (is_file(Path::clean($fullPath)))
|
||||||
|
{
|
||||||
|
// It might also be just a base filename
|
||||||
|
File::delete(Path::clean($fullPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the errors
|
||||||
|
*
|
||||||
|
* @param string $message The error message
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.0.11
|
||||||
|
*/
|
||||||
|
protected static function setError($message)
|
||||||
|
{
|
||||||
|
if (static::$enqueueError)
|
||||||
|
{
|
||||||
|
Factory::getApplication()->enqueueMessage($message, 'error');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
static::$errors[] = $message;
|
||||||
|
}
|
||||||
|
}
|
31
src/d7600b43-771a-4747-9f5d-952765721799/settings.json
Normal file
31
src/d7600b43-771a-4747-9f5d-952765721799/settings.json
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"add_head": "1",
|
||||||
|
"add_licensing_template": "2",
|
||||||
|
"extends": "",
|
||||||
|
"guid": "d7600b43-771a-4747-9f5d-952765721799",
|
||||||
|
"implements": null,
|
||||||
|
"load_selection": {
|
||||||
|
"load_selection0": {
|
||||||
|
"load": "f11dc790-713e-4706-9a85-a318ed3ad56e"
|
||||||
|
},
|
||||||
|
"load_selection1": {
|
||||||
|
"load": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "UploadHelper",
|
||||||
|
"power_version": "1.0.0",
|
||||||
|
"system_name": "Utilities UploadHelper",
|
||||||
|
"type": "abstract class",
|
||||||
|
"use_selection": {
|
||||||
|
"use_selection0": {
|
||||||
|
"use": "640b5352-fb09-425f-a26e-cd44eda03f15",
|
||||||
|
"as": "default"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extendsinterfaces": null,
|
||||||
|
"namespace": "[[[NamespacePrefix]]]\\Joomla\\Utilities.UploadHelper",
|
||||||
|
"description": "Upload Helper\r\n\r\n@since 3.0.11",
|
||||||
|
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 3rd September, 2020\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||||
|
"head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Language\\Text;\r\nuse Joomla\\CMS\\Filesystem\\File;\r\nuse Joomla\\CMS\\Filesystem\\Folder;\r\nuse Joomla\\CMS\\Filesystem\\Path;",
|
||||||
|
"composer": ""
|
||||||
|
}
|
@ -65,7 +65,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'comment' => 'FK to the #__assets table.'
|
'comment' => 'FK to the #__assets table.'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@ -80,7 +80,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(11)',
|
'type' => 'INT(11)',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'published' => [
|
'published' => [
|
||||||
@ -94,7 +94,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'TINYINT(3)',
|
'type' => 'TINYINT(3)',
|
||||||
'default' => '1',
|
'default' => '1',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'state'
|
'key_name' => 'state'
|
||||||
]
|
]
|
||||||
@ -110,7 +110,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'modifiedby'
|
'key_name' => 'modifiedby'
|
||||||
]
|
]
|
||||||
@ -126,7 +126,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'DATETIME',
|
'type' => 'DATETIME',
|
||||||
'default' => '0000-00-00 00:00:00',
|
'default' => '0000-00-00 00:00:00',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'created_by' => [
|
'created_by' => [
|
||||||
@ -140,7 +140,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'createdby'
|
'key_name' => 'createdby'
|
||||||
]
|
]
|
||||||
@ -156,7 +156,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'DATETIME',
|
'type' => 'DATETIME',
|
||||||
'default' => '0000-00-00 00:00:00',
|
'default' => '0000-00-00 00:00:00',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'checked_out' => [
|
'checked_out' => [
|
||||||
@ -170,7 +170,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'checkout'
|
'key_name' => 'checkout'
|
||||||
]
|
]
|
||||||
@ -186,7 +186,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'DATETIME',
|
'type' => 'DATETIME',
|
||||||
'default' => '0000-00-00 00:00:00',
|
'default' => '0000-00-00 00:00:00',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'hits' => [
|
'hits' => [
|
||||||
@ -200,7 +200,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'version' => [
|
'version' => [
|
||||||
@ -214,7 +214,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '1',
|
'default' => '1',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'params' => [
|
'params' => [
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'comment' => 'FK to the #__assets table.'
|
'comment' => 'FK to the #__assets table.'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@ -56,7 +56,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(11)',
|
'type' => 'INT(11)',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'published' => [
|
'published' => [
|
||||||
@ -70,7 +70,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'TINYINT(3)',
|
'type' => 'TINYINT(3)',
|
||||||
'default' => '1',
|
'default' => '1',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'state'
|
'key_name' => 'state'
|
||||||
]
|
]
|
||||||
@ -86,7 +86,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'modifiedby'
|
'key_name' => 'modifiedby'
|
||||||
]
|
]
|
||||||
@ -102,7 +102,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'DATETIME',
|
'type' => 'DATETIME',
|
||||||
'default' => '0000-00-00 00:00:00',
|
'default' => '0000-00-00 00:00:00',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'created_by' => [
|
'created_by' => [
|
||||||
@ -116,7 +116,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'createdby'
|
'key_name' => 'createdby'
|
||||||
]
|
]
|
||||||
@ -132,7 +132,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'DATETIME',
|
'type' => 'DATETIME',
|
||||||
'default' => '0000-00-00 00:00:00',
|
'default' => '0000-00-00 00:00:00',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'checked_out' => [
|
'checked_out' => [
|
||||||
@ -146,7 +146,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'checkout'
|
'key_name' => 'checkout'
|
||||||
]
|
]
|
||||||
@ -162,7 +162,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'DATETIME',
|
'type' => 'DATETIME',
|
||||||
'default' => '0000-00-00 00:00:00',
|
'default' => '0000-00-00 00:00:00',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'hits' => [
|
'hits' => [
|
||||||
@ -176,7 +176,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'version' => [
|
'version' => [
|
||||||
@ -190,7 +190,7 @@
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '1',
|
'default' => '1',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'params' => [
|
'params' => [
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||||
```
|
```
|
||||||
# abstract class MimeHelper (Details)
|
# abstract class MimeHelper (Details)
|
||||||
> namespace: **TrueChristianSermon\Joomla\Utilities**
|
> namespace: **VDM\Joomla\Utilities**
|
||||||
|
|
||||||
```uml
|
```uml
|
||||||
@startuml
|
@startuml
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace TrueChristianSermon\Joomla\Utilities;
|
namespace VDM\Joomla\Utilities;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,6 +76,17 @@
|
|||||||
"spk": "Super---1198aecf_84c6_45d2_aea8_d531aa4afdfa---Power",
|
"spk": "Super---1198aecf_84c6_45d2_aea8_d531aa4afdfa---Power",
|
||||||
"guid": "1198aecf-84c6-45d2-aea8-d531aa4afdfa"
|
"guid": "1198aecf-84c6-45d2-aea8-d531aa4afdfa"
|
||||||
},
|
},
|
||||||
|
"12a2a8de-a893-4dbb-a53d-b52de4f6cb0e": {
|
||||||
|
"name": "Type",
|
||||||
|
"type": "final class",
|
||||||
|
"namespace": "VDM\\Joomla\\Componentbuilder\\File",
|
||||||
|
"code": "src\/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e\/code.php",
|
||||||
|
"power": "src\/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e\/code.power",
|
||||||
|
"settings": "src\/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e\/settings.json",
|
||||||
|
"path": "src\/12a2a8de-a893-4dbb-a53d-b52de4f6cb0e",
|
||||||
|
"spk": "Super---12a2a8de_a893_4dbb_a53d_b52de4f6cb0e---Power",
|
||||||
|
"guid": "12a2a8de-a893-4dbb-a53d-b52de4f6cb0e"
|
||||||
|
},
|
||||||
"13c2cac1-a70d-42d7-99fc-eb7ac3443069": {
|
"13c2cac1-a70d-42d7-99fc-eb7ac3443069": {
|
||||||
"name": "ClassHelper",
|
"name": "ClassHelper",
|
||||||
"type": "abstract class",
|
"type": "abstract class",
|
||||||
@ -153,6 +164,17 @@
|
|||||||
"spk": "Super---1f28cb53_60d9_4db1_b517_3c7dc6b429ef---Power",
|
"spk": "Super---1f28cb53_60d9_4db1_b517_3c7dc6b429ef---Power",
|
||||||
"guid": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef"
|
"guid": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef"
|
||||||
},
|
},
|
||||||
|
"202ccd9e-dfcf-4cde-a0ce-bde1fd27f088": {
|
||||||
|
"name": "File",
|
||||||
|
"type": "class",
|
||||||
|
"namespace": "VDM\\Joomla\\Componentbuilder\\File\\Service",
|
||||||
|
"code": "src\/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088\/code.php",
|
||||||
|
"power": "src\/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088\/code.power",
|
||||||
|
"settings": "src\/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088\/settings.json",
|
||||||
|
"path": "src\/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088",
|
||||||
|
"spk": "Super---202ccd9e_dfcf_4cde_a0ce_bde1fd27f088---Power",
|
||||||
|
"guid": "202ccd9e-dfcf-4cde-a0ce-bde1fd27f088"
|
||||||
|
},
|
||||||
"215b35ac-1b26-4838-bbcf-d1fdbbd9353f": {
|
"215b35ac-1b26-4838-bbcf-d1fdbbd9353f": {
|
||||||
"name": "InArray",
|
"name": "InArray",
|
||||||
"type": "trait",
|
"type": "trait",
|
||||||
@ -274,6 +296,17 @@
|
|||||||
"spk": "Super---3fc72954_a303_4cac_b53c_554be38b85e7---Power",
|
"spk": "Super---3fc72954_a303_4cac_b53c_554be38b85e7---Power",
|
||||||
"guid": "3fc72954-a303-4cac-b53c-554be38b85e7"
|
"guid": "3fc72954-a303-4cac-b53c-554be38b85e7"
|
||||||
},
|
},
|
||||||
|
"4144ad3b-2ad5-401f-af0c-a3d856c1e688": {
|
||||||
|
"name": "Handler",
|
||||||
|
"type": "final class",
|
||||||
|
"namespace": "VDM\\Joomla\\Componentbuilder\\File",
|
||||||
|
"code": "src\/4144ad3b-2ad5-401f-af0c-a3d856c1e688\/code.php",
|
||||||
|
"power": "src\/4144ad3b-2ad5-401f-af0c-a3d856c1e688\/code.power",
|
||||||
|
"settings": "src\/4144ad3b-2ad5-401f-af0c-a3d856c1e688\/settings.json",
|
||||||
|
"path": "src\/4144ad3b-2ad5-401f-af0c-a3d856c1e688",
|
||||||
|
"spk": "Super---4144ad3b_2ad5_401f_af0c_a3d856c1e688---Power",
|
||||||
|
"guid": "4144ad3b-2ad5-401f-af0c-a3d856c1e688"
|
||||||
|
},
|
||||||
"43134867-5cb8-4280-9be8-309fd2fd135f": {
|
"43134867-5cb8-4280-9be8-309fd2fd135f": {
|
||||||
"name": "ActiveRegistry",
|
"name": "ActiveRegistry",
|
||||||
"type": "abstract class",
|
"type": "abstract class",
|
||||||
@ -483,6 +516,17 @@
|
|||||||
"spk": "Super---65a0f81a_14fc_4870_9382_b8d830b19937---Power",
|
"spk": "Super---65a0f81a_14fc_4870_9382_b8d830b19937---Power",
|
||||||
"guid": "65a0f81a-14fc-4870-9382-b8d830b19937"
|
"guid": "65a0f81a-14fc-4870-9382-b8d830b19937"
|
||||||
},
|
},
|
||||||
|
"67a5e0ca-0ff0-4979-9b41-da0b09988016": {
|
||||||
|
"name": "Manager",
|
||||||
|
"type": "final class",
|
||||||
|
"namespace": "VDM\\Joomla\\Componentbuilder\\File",
|
||||||
|
"code": "src\/67a5e0ca-0ff0-4979-9b41-da0b09988016\/code.php",
|
||||||
|
"power": "src\/67a5e0ca-0ff0-4979-9b41-da0b09988016\/code.power",
|
||||||
|
"settings": "src\/67a5e0ca-0ff0-4979-9b41-da0b09988016\/settings.json",
|
||||||
|
"path": "src\/67a5e0ca-0ff0-4979-9b41-da0b09988016",
|
||||||
|
"spk": "Super---67a5e0ca_0ff0_4979_9b41_da0b09988016---Power",
|
||||||
|
"guid": "67a5e0ca-0ff0-4979-9b41-da0b09988016"
|
||||||
|
},
|
||||||
"68a41264-64c0-441a-a3d8-8a5e557b1883": {
|
"68a41264-64c0-441a-a3d8-8a5e557b1883": {
|
||||||
"name": "UpdateInterface",
|
"name": "UpdateInterface",
|
||||||
"type": "interface",
|
"type": "interface",
|
||||||
@ -604,6 +648,17 @@
|
|||||||
"spk": "Super---85785701_07b2_4f81_bc1e_0f423700c254---Power",
|
"spk": "Super---85785701_07b2_4f81_bc1e_0f423700c254---Power",
|
||||||
"guid": "85785701-07b2-4f81-bc1e-0f423700c254"
|
"guid": "85785701-07b2-4f81-bc1e-0f423700c254"
|
||||||
},
|
},
|
||||||
|
"884eca78-281f-4eab-b962-d97e355af16d": {
|
||||||
|
"name": "Factory",
|
||||||
|
"type": "abstract class",
|
||||||
|
"namespace": "VDM\\Joomla\\Componentbuilder\\File",
|
||||||
|
"code": "src\/884eca78-281f-4eab-b962-d97e355af16d\/code.php",
|
||||||
|
"power": "src\/884eca78-281f-4eab-b962-d97e355af16d\/code.power",
|
||||||
|
"settings": "src\/884eca78-281f-4eab-b962-d97e355af16d\/settings.json",
|
||||||
|
"path": "src\/884eca78-281f-4eab-b962-d97e355af16d",
|
||||||
|
"spk": "Super---884eca78_281f_4eab_b962_d97e355af16d---Power",
|
||||||
|
"guid": "884eca78-281f-4eab-b962-d97e355af16d"
|
||||||
|
},
|
||||||
"8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff": {
|
"8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff": {
|
||||||
"name": "ModelInterface",
|
"name": "ModelInterface",
|
||||||
"type": "interface",
|
"type": "interface",
|
||||||
@ -945,6 +1000,28 @@
|
|||||||
"spk": "Super---d1de5d5b_bf29_4031_8094_76c4f6c75900---Power",
|
"spk": "Super---d1de5d5b_bf29_4031_8094_76c4f6c75900---Power",
|
||||||
"guid": "d1de5d5b-bf29-4031-8094-76c4f6c75900"
|
"guid": "d1de5d5b-bf29-4031-8094-76c4f6c75900"
|
||||||
},
|
},
|
||||||
|
"d46c4667-378b-49e8-9782-ffb28d92415a": {
|
||||||
|
"name": "Display",
|
||||||
|
"type": "final class",
|
||||||
|
"namespace": "VDM\\Joomla\\Componentbuilder\\File",
|
||||||
|
"code": "src\/d46c4667-378b-49e8-9782-ffb28d92415a\/code.php",
|
||||||
|
"power": "src\/d46c4667-378b-49e8-9782-ffb28d92415a\/code.power",
|
||||||
|
"settings": "src\/d46c4667-378b-49e8-9782-ffb28d92415a\/settings.json",
|
||||||
|
"path": "src\/d46c4667-378b-49e8-9782-ffb28d92415a",
|
||||||
|
"spk": "Super---d46c4667_378b_49e8_9782_ffb28d92415a---Power",
|
||||||
|
"guid": "d46c4667-378b-49e8-9782-ffb28d92415a"
|
||||||
|
},
|
||||||
|
"d7600b43-771a-4747-9f5d-952765721799": {
|
||||||
|
"name": "UploadHelper",
|
||||||
|
"type": "abstract class",
|
||||||
|
"namespace": "VDM\\Joomla\\Utilities",
|
||||||
|
"code": "src\/d7600b43-771a-4747-9f5d-952765721799\/code.php",
|
||||||
|
"power": "src\/d7600b43-771a-4747-9f5d-952765721799\/code.power",
|
||||||
|
"settings": "src\/d7600b43-771a-4747-9f5d-952765721799\/settings.json",
|
||||||
|
"path": "src\/d7600b43-771a-4747-9f5d-952765721799",
|
||||||
|
"spk": "Super---d7600b43_771a_4747_9f5d_952765721799---Power",
|
||||||
|
"guid": "d7600b43-771a-4747-9f5d-952765721799"
|
||||||
|
},
|
||||||
"d8f9ba53-c490-4e8b-8e9f-6757224e069c": {
|
"d8f9ba53-c490-4e8b-8e9f-6757224e069c": {
|
||||||
"name": "DeleteInterface",
|
"name": "DeleteInterface",
|
||||||
"type": "interface",
|
"type": "interface",
|
||||||
@ -1011,6 +1088,17 @@
|
|||||||
"spk": "Super---eb7d69c2_4ee9_4bd0_aacc_ab51a12be895---Power",
|
"spk": "Super---eb7d69c2_4ee9_4bd0_aacc_ab51a12be895---Power",
|
||||||
"guid": "eb7d69c2-4ee9-4bd0-aacc-ab51a12be895"
|
"guid": "eb7d69c2-4ee9-4bd0-aacc-ab51a12be895"
|
||||||
},
|
},
|
||||||
|
"f11dc790-713e-4706-9a85-a318ed3ad56e": {
|
||||||
|
"name": "MimeHelper",
|
||||||
|
"type": "abstract class",
|
||||||
|
"namespace": "VDM\\Joomla\\Utilities",
|
||||||
|
"code": "src\/f11dc790-713e-4706-9a85-a318ed3ad56e\/code.php",
|
||||||
|
"power": "src\/f11dc790-713e-4706-9a85-a318ed3ad56e\/code.power",
|
||||||
|
"settings": "src\/f11dc790-713e-4706-9a85-a318ed3ad56e\/settings.json",
|
||||||
|
"path": "src\/f11dc790-713e-4706-9a85-a318ed3ad56e",
|
||||||
|
"spk": "Super---f11dc790_713e_4706_9a85_a318ed3ad56e---Power",
|
||||||
|
"guid": "f11dc790-713e-4706-9a85-a318ed3ad56e"
|
||||||
|
},
|
||||||
"f3c04c28-bce4-422e-be93-7d163e4e342b": {
|
"f3c04c28-bce4-422e-be93-7d163e4e342b": {
|
||||||
"name": "Schema",
|
"name": "Schema",
|
||||||
"type": "abstract class",
|
"type": "abstract class",
|
||||||
|
Loading…
Reference in New Issue
Block a user