Release of v3.2.2-alpha5
Add repositories for better integration with gitea. Refactored the Data classes. Add new Data classes.
This commit is contained in:
parent
894d691897
commit
7a680bb734
@ -1,12 +1,15 @@
|
||||
# v3.2.2-alpha4
|
||||
# v3.2.2-alpha5
|
||||
|
||||
- Update the Schema class to also update null mismatching if needed
|
||||
- Add repositories for better integration with gitea
|
||||
- Refactored the Data classes
|
||||
- Add new Data classes
|
||||
|
||||
# v3.2.2-alpha
|
||||
|
||||
- Fix auto build from SQL in Joomla 4 and 5.
|
||||
- Fix permission issue for admin views.
|
||||
- Add extending options to interfaces.
|
||||
- Add extending options to interfaces.
|
||||
- Update the Schema class to also update null mismatching if needed
|
||||
|
||||
# v3.2.1
|
||||
|
||||
|
14
README.md
14
README.md
@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
|
||||
|
||||
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
|
||||
|
||||
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.2-alpha4) with **ALL** its features and **ALL** concepts totally open-source and free!
|
||||
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.2-alpha5) with **ALL** its features and **ALL** concepts totally open-source and free!
|
||||
|
||||
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
||||
|
||||
@ -144,14 +144,14 @@ TODO
|
||||
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 7th June, 2024
|
||||
+ *Version*: 3.2.2-alpha4
|
||||
+ *Last Build*: 20th June, 2024
|
||||
+ *Version*: 3.2.2-alpha5
|
||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **765384**
|
||||
+ *Field count*: **2100**
|
||||
+ *File count*: **5304**
|
||||
+ *Folder count*: **471**
|
||||
+ *Line count*: **773763**
|
||||
+ *Field count*: **2104**
|
||||
+ *File count*: **5362**
|
||||
+ *Folder count*: **474**
|
||||
|
||||
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
|
||||
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
|
@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
|
||||
|
||||
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
|
||||
|
||||
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.2-alpha4) with **ALL** its features and **ALL** concepts totally open-source and free!
|
||||
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.2-alpha5) with **ALL** its features and **ALL** concepts totally open-source and free!
|
||||
|
||||
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
||||
|
||||
@ -144,14 +144,14 @@ TODO
|
||||
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 7th June, 2024
|
||||
+ *Version*: 3.2.2-alpha4
|
||||
+ *Last Build*: 20th June, 2024
|
||||
+ *Version*: 3.2.2-alpha5
|
||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **765384**
|
||||
+ *Field count*: **2100**
|
||||
+ *File count*: **5304**
|
||||
+ *Folder count*: **471**
|
||||
+ *Line count*: **773763**
|
||||
+ *Field count*: **2104**
|
||||
+ *File count*: **5362**
|
||||
+ *Folder count*: **474**
|
||||
|
||||
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
|
||||
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
|
@ -521,6 +521,18 @@
|
||||
<action name="power.edit.state" title="COM_COMPONENTBUILDER_POWERS_EDIT_STATE" description="COM_COMPONENTBUILDER_POWERS_EDIT_STATE_DESC" />
|
||||
<action name="power.version" title="COM_COMPONENTBUILDER_POWERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_POWERS_EDIT_VERSION_DESC" />
|
||||
<action name="power.submenu" title="COM_COMPONENTBUILDER_POWERS_SUBMENU" description="COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC" />
|
||||
<action name="repository.access" title="COM_COMPONENTBUILDER_REPOSITORIES_ACCESS" description="COM_COMPONENTBUILDER_REPOSITORIES_ACCESS_DESC" />
|
||||
<action name="repository.batch" title="COM_COMPONENTBUILDER_REPOSITORIES_BATCH_USE" description="COM_COMPONENTBUILDER_REPOSITORIES_BATCH_USE_DESC" />
|
||||
<action name="repository.create" title="COM_COMPONENTBUILDER_REPOSITORIES_CREATE" description="COM_COMPONENTBUILDER_REPOSITORIES_CREATE_DESC" />
|
||||
<action name="repository.dashboard_list" title="COM_COMPONENTBUILDER_REPOSITORIES_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_REPOSITORIES_DASHBOARD_LIST_DESC" />
|
||||
<action name="repository.delete" title="COM_COMPONENTBUILDER_REPOSITORIES_DELETE" description="COM_COMPONENTBUILDER_REPOSITORIES_DELETE_DESC" />
|
||||
<action name="repository.edit" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_DESC" />
|
||||
<action name="repository.edit.created_by" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_BY_DESC" />
|
||||
<action name="repository.edit.created" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="repository.edit.own" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_OWN" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_OWN_DESC" />
|
||||
<action name="repository.edit.state" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_STATE" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_STATE_DESC" />
|
||||
<action name="repository.version" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_VERSION" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_VERSION_DESC" />
|
||||
<action name="repository.submenu" title="COM_COMPONENTBUILDER_REPOSITORIES_SUBMENU" description="COM_COMPONENTBUILDER_REPOSITORIES_SUBMENU_DESC" />
|
||||
<action name="search.access" title="COM_COMPONENTBUILDER_SEARCH_ACCESS" description="COM_COMPONENTBUILDER_SEARCH_ACCESS_DESC" />
|
||||
<action name="search.compiler" title="COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS_DESC" />
|
||||
<action name="search.dashboard_list" title="COM_COMPONENTBUILDER_SEARCH_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_SEARCH_DASHBOARD_LIST_DESC" />
|
||||
@ -814,6 +826,17 @@
|
||||
<action name="server.access" title="COM_COMPONENTBUILDER_SERVERS_ACCESS" description="COM_COMPONENTBUILDER_SERVERS_ACCESS_DESC" />
|
||||
<action name="server.version" title="COM_COMPONENTBUILDER_SERVERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_SERVERS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="repository">
|
||||
<action name="repository.edit" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_DESC" />
|
||||
<action name="repository.edit.own" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_OWN" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_OWN_DESC" />
|
||||
<action name="repository.edit.state" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_STATE" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_STATE_DESC" />
|
||||
<action name="repository.edit.created_by" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_BY_DESC" />
|
||||
<action name="repository.edit.created" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="repository.create" title="COM_COMPONENTBUILDER_REPOSITORIES_CREATE" description="COM_COMPONENTBUILDER_REPOSITORIES_CREATE_DESC" />
|
||||
<action name="repository.delete" title="COM_COMPONENTBUILDER_REPOSITORIES_DELETE" description="COM_COMPONENTBUILDER_REPOSITORIES_DELETE_DESC" />
|
||||
<action name="repository.access" title="COM_COMPONENTBUILDER_REPOSITORIES_ACCESS" description="COM_COMPONENTBUILDER_REPOSITORIES_ACCESS_DESC" />
|
||||
<action name="repository.version" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_VERSION" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="help_document">
|
||||
<action name="help_document.edit" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EDIT" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EDIT_DESC" />
|
||||
<action name="help_document.edit.own" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EDIT_OWN" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EDIT_OWN_DESC" />
|
||||
|
13
admin/assets/css/repositories.css
Normal file
13
admin/assets/css/repositories.css
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
13
admin/assets/css/repository.css
Normal file
13
admin/assets/css/repository.css
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
BIN
admin/assets/images/icons/repositories.png
Normal file
BIN
admin/assets/images/icons/repositories.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
139
admin/config.xml
139
admin/config.xml
@ -756,62 +756,7 @@
|
||||
COM_COMPONENTBUILDER_CONFIG_NO</option>
|
||||
</field>
|
||||
<!-- Note_super_powers_repositories Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="note_super_powers_repositories" label="COM_COMPONENTBUILDER_CONFIG_NOTE_SUPER_POWERS_REPOSITORIES_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_SUPER_POWERS_REPOSITORIES_DESCRIPTION" heading="h4" class="alert alert-info note_super_powers_repositories" showon="powers_repository:1[AND]super_powers_repositories:1" />
|
||||
<!-- Approved_paths Field. Type: Subform. (joomla) -->
|
||||
<field
|
||||
type="subform"
|
||||
name="approved_paths"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_APPROVED_PATHS_LABEL"
|
||||
layout="joomla.form.field.subform.repeatable-table"
|
||||
multiple="true"
|
||||
buttons="add,remove,move"
|
||||
icon="list"
|
||||
max="30"
|
||||
min="1"
|
||||
showon="powers_repository:1[AND]super_powers_repositories:1">
|
||||
<form hidden="true" name="list_approved_paths_modal" repeat="true">
|
||||
<!-- Owner Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="owner"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_OWNER_LABEL"
|
||||
size="70"
|
||||
maxlength="150"
|
||||
class="text_area span12"
|
||||
readonly="false"
|
||||
filter="CMD"
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_OWNER_HINT"
|
||||
autocomplete="on"
|
||||
/>
|
||||
<!-- Repo Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="repo"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_REPO_LABEL"
|
||||
size="70"
|
||||
maxlength="150"
|
||||
class="text_area span12"
|
||||
readonly="false"
|
||||
filter="CMD"
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_REPO_HINT"
|
||||
autocomplete="on"
|
||||
/>
|
||||
<!-- Branch Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="branch"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_BRANCH_LABEL"
|
||||
size="70"
|
||||
maxlength="150"
|
||||
default="default"
|
||||
class="text_area span12"
|
||||
readonly="false"
|
||||
filter="CMD"
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_BRANCH_HINT"
|
||||
autocomplete="on"
|
||||
/>
|
||||
</form>
|
||||
</field>
|
||||
<field type="note" name="note_super_powers_repositories" label="COM_COMPONENTBUILDER_CONFIG_NOTE_SUPER_POWERS_REPOSITORIES_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_SUPER_POWERS_REPOSITORIES_DESCRIPTION" heading="h4" class="alert alert-error note_super_powers_repositories" showon="powers_repository:1[AND]super_powers_repositories:1" />
|
||||
<!-- Note_powers_repository_path Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="note_powers_repository_path" label="COM_COMPONENTBUILDER_CONFIG_NOTE_POWERS_REPOSITORY_PATH_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_POWERS_REPOSITORY_PATH_DESCRIPTION" heading="h4" class="alert alert-info note_powers_repository_path" showon="powers_repository:1" />
|
||||
<!-- Local_powers_repository_path Field. Type: Text. (joomla) -->
|
||||
@ -832,88 +777,6 @@
|
||||
autocomplete="on"
|
||||
showon="powers_repository:1"
|
||||
/>
|
||||
<!-- Add_custom_gitea_url Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="add_custom_gitea_url"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_ADD_CUSTOM_GITEA_URL_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_ADD_CUSTOM_GITEA_URL_DESCRIPTION"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_CONFIG_GITVDMDEV</option>
|
||||
<option value="2">
|
||||
COM_COMPONENTBUILDER_CONFIG_CUSTOMGITEA</option>
|
||||
</field>
|
||||
<!-- Note_custom_gitea_url Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="note_custom_gitea_url" label="COM_COMPONENTBUILDER_CONFIG_NOTE_CUSTOM_GITEA_URL_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_CUSTOM_GITEA_URL_DESCRIPTION" heading="h3" class="alert alert-success note_custom_gitea_url" showon="add_custom_gitea_url:2" />
|
||||
<!-- Custom_gitea_url Field. Type: Url. (joomla) -->
|
||||
<field
|
||||
type="url"
|
||||
name="custom_gitea_url"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_URL_LABEL"
|
||||
size="70"
|
||||
maxlength="150"
|
||||
default="https://git.vdm.dev"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_URL_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="url"
|
||||
validated="url"
|
||||
scheme="http,https"
|
||||
message="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_URL_MESSAGE"
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_URL_HINT"
|
||||
autocomplete="on"
|
||||
showon="add_custom_gitea_url:2"
|
||||
/>
|
||||
<!-- Custom_gitea_token Field. Type: Password. (joomla) -->
|
||||
<field
|
||||
type="password"
|
||||
name="custom_gitea_token"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_TOKEN_LABEL"
|
||||
size="128"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_TOKEN_DESCRIPTION"
|
||||
message="Error! Please add token here."
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="false"
|
||||
filter="STRING"
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_CUSTOM_GITEA_TOKEN_HINT"
|
||||
autocomplete="off"
|
||||
showon="add_custom_gitea_url:2"
|
||||
/>
|
||||
<!-- Super_powers_core_organisation_note Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="super_powers_core_organisation_note" label="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_ORGANISATION_NOTE_LABEL" description="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_ORGANISATION_NOTE_DESCRIPTION" heading="h4" class="alert alert-success super_powers_core_organisation_note" showon="add_custom_gitea_url:2" />
|
||||
<!-- Super_powers_core_organisation Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="super_powers_core_organisation"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_ORGANISATION_LABEL"
|
||||
size="70"
|
||||
maxlength="150"
|
||||
default="joomla"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_ORGANISATION_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="WORD"
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_ORGANISATION_HINT"
|
||||
autocomplete="on"
|
||||
showon="add_custom_gitea_url:2"
|
||||
/>
|
||||
<!-- Super_powers_core Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="super_powers_core"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_LABEL"
|
||||
size="70"
|
||||
maxlength="150"
|
||||
default="joomla/super-powers"
|
||||
class="text_area"
|
||||
filter="PATH"
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_SUPER_POWERS_CORE_HINT"
|
||||
autocomplete="on"
|
||||
showon="add_custom_gitea_url:2"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="compiler_custom_config"
|
||||
|
@ -120,6 +120,7 @@ class ComponentbuilderController extends BaseController
|
||||
'language_translation' => 'language_translations',
|
||||
'language' => 'languages',
|
||||
'server' => 'servers',
|
||||
'repository' => 'repositories',
|
||||
'help_document' => 'help_documents',
|
||||
'admin_fields' => 'admins_fields',
|
||||
'admin_fields_conditions' => 'admins_fields_conditions',
|
||||
|
50
admin/controllers/repositories.php
Normal file
50
admin/controllers/repositories.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
|
||||
/**
|
||||
* Repositories Admin Controller
|
||||
*/
|
||||
class ComponentbuilderControllerRepositories extends AdminController
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_COMPONENTBUILDER_REPOSITORIES';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Repository', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
329
admin/controllers/repository.php
Normal file
329
admin/controllers/repository.php
Normal file
@ -0,0 +1,329 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
/**
|
||||
* Repository Form Controller
|
||||
*/
|
||||
class ComponentbuilderControllerRepository extends FormController
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = [])
|
||||
{
|
||||
$this->view_list = 'Repositories'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = [])
|
||||
{
|
||||
// Get user object.
|
||||
$user = Factory::getUser();
|
||||
// Access check.
|
||||
$access = $user->authorise('repository.access', 'com_componentbuilder');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('repository.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = [], $key = 'id')
|
||||
{
|
||||
// get user object.
|
||||
$user = Factory::getUser();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('repository.access', 'com_componentbuilder.repository.' . (int) $recordId) && $user->authorise('repository.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('repository.edit', 'com_componentbuilder.repository.' . (int) $recordId);
|
||||
if (!$permission)
|
||||
{
|
||||
if ($user->authorise('repository.edit.own', 'com_componentbuilder.repository.' . $recordId))
|
||||
{
|
||||
// Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('repository.edit.own', 'com_componentbuilder'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('repository.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string) $ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Repository', '', []);
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=repositories' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && Uri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string) $this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param BaseDatabaseModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
@ -6173,6 +6173,10 @@ abstract class ComponentbuilderHelper
|
||||
{
|
||||
\JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_SERVERS'), 'index.php?option=com_componentbuilder&view=servers', $submenu === 'servers');
|
||||
}
|
||||
if ($user->authorise('repository.access', 'com_componentbuilder') && $user->authorise('repository.submenu', 'com_componentbuilder'))
|
||||
{
|
||||
\JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_REPOSITORIES'), 'index.php?option=com_componentbuilder&view=repositories', $submenu === 'repositories');
|
||||
}
|
||||
if ($user->authorise('help_document.access', 'com_componentbuilder') && $user->authorise('help_document.submenu', 'com_componentbuilder'))
|
||||
{
|
||||
\JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_HELP_DOCUMENTS'), 'index.php?option=com_componentbuilder&view=help_documents', $submenu === 'help_documents');
|
||||
|
File diff suppressed because one or more lines are too long
@ -1065,6 +1065,30 @@ COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS="Power Reset Button Access"
|
||||
COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button."
|
||||
COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS="Power Run Expansion Button Access"
|
||||
COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button."
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_ACCESS="Repositories Access"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_ACCESS_DESC="Allows the users in this group to access access repositories"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_BATCH_USE="Repositories Batch Use"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_BATCH_USE_DESC="Allows the users in this group to use batch copy/update method of batch repositories"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_CREATE="Repositories Create"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_CREATE_DESC="Allows the users in this group to create create repositories"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_DASHBOARD_LIST="Repositories Dashboard List"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of repository"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_DELETE="Repositories Delete"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_DELETE_DESC="Allows the users in this group to delete delete repositories"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT="Repositories Edit"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_BY="Repositories Edit Created By"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by repositories"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_DATE="Repositories Edit Created Date"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created repositories"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_DESC="Allows the users in this group to edit the repository"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_OWN="Repositories Edit Own"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_OWN_DESC="Allows the users in this group to edit edit own repositories created by them"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_STATE="Repositories Edit State"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_STATE_DESC="Allows the users in this group to update the state of the repository"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_VERSION="Repositories Edit Version"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version repositories"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_SUBMENU="Repositories Submenu"
|
||||
COM_COMPONENTBUILDER_REPOSITORIES_SUBMENU_DESC="Allows the users in this group to submenu of repository"
|
||||
COM_COMPONENTBUILDER_SEARCH_ACCESS="Search Access"
|
||||
COM_COMPONENTBUILDER_SEARCH_ACCESS_DESC="Allows the users in this group to access search."
|
||||
COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS="Search Compiler Button Access"
|
||||
|
@ -31,7 +31,6 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'store',
|
||||
'medium_encryption_note',
|
||||
'basic_encryption_note',
|
||||
'note_whmcs_encryption',
|
||||
'note_expert_field_save_mode',
|
||||
'initiator_on_save_model',
|
||||
'initiator_on_get_model',
|
||||
|
@ -19,7 +19,7 @@ use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
|
||||
// set the defaults
|
||||
$items = $displayData->vxtfields;
|
||||
$items = $displayData->vxsfields;
|
||||
$user = Factory::getUser();
|
||||
$id = $displayData->item->id;
|
||||
// set the edit URL
|
||||
|
@ -30,12 +30,6 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'author',
|
||||
'email',
|
||||
'website',
|
||||
'add_license',
|
||||
'license_type',
|
||||
'note_whmcs_lisencing_note',
|
||||
'whmcs_key',
|
||||
'whmcs_url',
|
||||
'whmcs_buy_link',
|
||||
'license',
|
||||
'bom',
|
||||
'image',
|
||||
|
46
admin/layouts/repository/details_above.php
Normal file
46
admin/layouts/repository/details_above.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'system_name',
|
||||
'target',
|
||||
'access_repo'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
45
admin/layouts/repository/details_left.php
Normal file
45
admin/layouts/repository/details_left.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'type',
|
||||
'base',
|
||||
'username',
|
||||
'token'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
45
admin/layouts/repository/details_right.php
Normal file
45
admin/layouts/repository/details_right.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'organisation',
|
||||
'repository',
|
||||
'read_branch',
|
||||
'write_branch'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
47
admin/layouts/repository/publishing.php
Normal file
47
admin/layouts/repository/publishing.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'guid',
|
||||
'title',
|
||||
'created',
|
||||
'created_by',
|
||||
'modified',
|
||||
'modified_by'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
47
admin/layouts/repository/publlshing.php
Normal file
47
admin/layouts/repository/publlshing.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'published',
|
||||
'ordering',
|
||||
'access',
|
||||
'version',
|
||||
'hits',
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
@ -37,7 +37,7 @@ class ComponentbuilderModelComponentbuilder extends ListModel
|
||||
$icons = [];
|
||||
// view groups array
|
||||
$viewGroups = array(
|
||||
'main' => array('png.compiler', 'png.joomla_components', 'png.joomla_modules', 'png.joomla_plugins', 'png.powers', 'png.search', 'png||importjcbpackages||index.php?option=com_componentbuilder&view=joomla_components&task=joomla_components.smartImport', 'png.admin_views', 'png.custom_admin_views', 'png.site_views', 'png.template.add', 'png.templates', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.placeholders', 'png.libraries', 'png.snippets', 'png.get_snippets', 'png.validation_rules', 'png.field.add', 'png.fields', 'png.fields.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_field', 'png.fieldtypes', 'png.fieldtypes.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_fieldtype', 'png.language_translations', 'png.servers', 'png.help_documents')
|
||||
'main' => array('png.compiler', 'png.joomla_components', 'png.joomla_modules', 'png.joomla_plugins', 'png.powers', 'png.search', 'png||importjcbpackages||index.php?option=com_componentbuilder&view=joomla_components&task=joomla_components.smartImport', 'png.admin_views', 'png.custom_admin_views', 'png.site_views', 'png.template.add', 'png.templates', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.placeholders', 'png.libraries', 'png.snippets', 'png.get_snippets', 'png.validation_rules', 'png.field.add', 'png.fields', 'png.fields.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_field', 'png.fieldtypes', 'png.fieldtypes.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_fieldtype', 'png.language_translations', 'png.servers', 'png.repositories', 'png.help_documents')
|
||||
);
|
||||
// view access array
|
||||
$viewAccess = [
|
||||
@ -155,6 +155,11 @@ class ComponentbuilderModelComponentbuilder extends ListModel
|
||||
'server.access' => 'server.access',
|
||||
'servers.submenu' => 'server.submenu',
|
||||
'servers.dashboard_list' => 'server.dashboard_list',
|
||||
'repository.create' => 'repository.create',
|
||||
'repositories.access' => 'repository.access',
|
||||
'repository.access' => 'repository.access',
|
||||
'repositories.submenu' => 'repository.submenu',
|
||||
'repositories.dashboard_list' => 'repository.dashboard_list',
|
||||
'help_document.create' => 'help_document.create',
|
||||
'help_documents.access' => 'help_document.access',
|
||||
'help_document.access' => 'help_document.access',
|
||||
|
@ -71,7 +71,6 @@ class ComponentbuilderModelField extends AdminModel
|
||||
'store',
|
||||
'medium_encryption_note',
|
||||
'basic_encryption_note',
|
||||
'note_whmcs_encryption',
|
||||
'note_expert_field_save_mode',
|
||||
'initiator_on_save_model',
|
||||
'initiator_on_get_model',
|
||||
@ -215,6 +214,12 @@ class ComponentbuilderModelField extends AdminModel
|
||||
$item->metadata = $registry->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->on_get_model_field))
|
||||
{
|
||||
// base64 Decode on_get_model_field.
|
||||
$item->on_get_model_field = base64_decode($item->on_get_model_field);
|
||||
}
|
||||
|
||||
if (!empty($item->on_save_model_field))
|
||||
{
|
||||
// base64 Decode on_save_model_field.
|
||||
@ -227,10 +232,10 @@ class ComponentbuilderModelField extends AdminModel
|
||||
$item->initiator_on_get_model = base64_decode($item->initiator_on_get_model);
|
||||
}
|
||||
|
||||
if (!empty($item->initiator_on_save_model))
|
||||
if (!empty($item->javascript_view_footer))
|
||||
{
|
||||
// base64 Decode initiator_on_save_model.
|
||||
$item->initiator_on_save_model = base64_decode($item->initiator_on_save_model);
|
||||
// base64 Decode javascript_view_footer.
|
||||
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
|
||||
}
|
||||
|
||||
if (!empty($item->css_views))
|
||||
@ -245,24 +250,18 @@ class ComponentbuilderModelField extends AdminModel
|
||||
$item->css_view = base64_decode($item->css_view);
|
||||
}
|
||||
|
||||
if (!empty($item->on_get_model_field))
|
||||
{
|
||||
// base64 Decode on_get_model_field.
|
||||
$item->on_get_model_field = base64_decode($item->on_get_model_field);
|
||||
}
|
||||
|
||||
if (!empty($item->javascript_view_footer))
|
||||
{
|
||||
// base64 Decode javascript_view_footer.
|
||||
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
|
||||
}
|
||||
|
||||
if (!empty($item->javascript_views_footer))
|
||||
{
|
||||
// base64 Decode javascript_views_footer.
|
||||
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
|
||||
}
|
||||
|
||||
if (!empty($item->initiator_on_save_model))
|
||||
{
|
||||
// base64 Decode initiator_on_save_model.
|
||||
$item->initiator_on_save_model = base64_decode($item->initiator_on_save_model);
|
||||
}
|
||||
|
||||
if (!empty($item->xml))
|
||||
{
|
||||
// JSON Decode xml.
|
||||
@ -1172,6 +1171,12 @@ class ComponentbuilderModelField extends AdminModel
|
||||
$data['xml'] = (string) json_encode($data['xml']);
|
||||
}
|
||||
|
||||
// Set the on_get_model_field string to base64 string.
|
||||
if (isset($data['on_get_model_field']))
|
||||
{
|
||||
$data['on_get_model_field'] = base64_encode($data['on_get_model_field']);
|
||||
}
|
||||
|
||||
// Set the on_save_model_field string to base64 string.
|
||||
if (isset($data['on_save_model_field']))
|
||||
{
|
||||
@ -1184,10 +1189,10 @@ class ComponentbuilderModelField extends AdminModel
|
||||
$data['initiator_on_get_model'] = base64_encode($data['initiator_on_get_model']);
|
||||
}
|
||||
|
||||
// Set the initiator_on_save_model string to base64 string.
|
||||
if (isset($data['initiator_on_save_model']))
|
||||
// Set the javascript_view_footer string to base64 string.
|
||||
if (isset($data['javascript_view_footer']))
|
||||
{
|
||||
$data['initiator_on_save_model'] = base64_encode($data['initiator_on_save_model']);
|
||||
$data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']);
|
||||
}
|
||||
|
||||
// Set the css_views string to base64 string.
|
||||
@ -1202,24 +1207,18 @@ class ComponentbuilderModelField extends AdminModel
|
||||
$data['css_view'] = base64_encode($data['css_view']);
|
||||
}
|
||||
|
||||
// Set the on_get_model_field string to base64 string.
|
||||
if (isset($data['on_get_model_field']))
|
||||
{
|
||||
$data['on_get_model_field'] = base64_encode($data['on_get_model_field']);
|
||||
}
|
||||
|
||||
// Set the javascript_view_footer string to base64 string.
|
||||
if (isset($data['javascript_view_footer']))
|
||||
{
|
||||
$data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']);
|
||||
}
|
||||
|
||||
// Set the javascript_views_footer string to base64 string.
|
||||
if (isset($data['javascript_views_footer']))
|
||||
{
|
||||
$data['javascript_views_footer'] = base64_encode($data['javascript_views_footer']);
|
||||
}
|
||||
|
||||
// Set the initiator_on_save_model string to base64 string.
|
||||
if (isset($data['initiator_on_save_model']))
|
||||
{
|
||||
$data['initiator_on_save_model'] = base64_encode($data['initiator_on_save_model']);
|
||||
}
|
||||
|
||||
// Set the Params Items to data
|
||||
if (isset($data['params']) && is_array($data['params']))
|
||||
{
|
||||
|
@ -346,7 +346,6 @@ class ComponentbuilderModelFields extends ListModel
|
||||
2 => 'COM_COMPONENTBUILDER_FIELD_BASE64',
|
||||
3 => 'COM_COMPONENTBUILDER_FIELD_BASIC_ENCRYPTION_LOCALDBKEY',
|
||||
5 => 'COM_COMPONENTBUILDER_FIELD_MEDIUM_ENCRYPTION_LOCALFILEKEY',
|
||||
4 => 'COM_COMPONENTBUILDER_FIELD_WHMCSKEY_ENCRYPTION',
|
||||
6 => 'COM_COMPONENTBUILDER_FIELD_EXPERT_MODE_CUSTOM'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
@ -721,22 +720,22 @@ class ComponentbuilderModelFields extends ListModel
|
||||
continue;
|
||||
}
|
||||
|
||||
// decode on_get_model_field
|
||||
$item->on_get_model_field = base64_decode($item->on_get_model_field);
|
||||
// decode on_save_model_field
|
||||
$item->on_save_model_field = base64_decode($item->on_save_model_field);
|
||||
// decode initiator_on_get_model
|
||||
$item->initiator_on_get_model = base64_decode($item->initiator_on_get_model);
|
||||
// decode initiator_on_save_model
|
||||
$item->initiator_on_save_model = base64_decode($item->initiator_on_save_model);
|
||||
// decode javascript_view_footer
|
||||
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
|
||||
// decode css_views
|
||||
$item->css_views = base64_decode($item->css_views);
|
||||
// decode css_view
|
||||
$item->css_view = base64_decode($item->css_view);
|
||||
// decode on_get_model_field
|
||||
$item->on_get_model_field = base64_decode($item->on_get_model_field);
|
||||
// decode javascript_view_footer
|
||||
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
|
||||
// decode javascript_views_footer
|
||||
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
|
||||
// decode initiator_on_save_model
|
||||
$item->initiator_on_save_model = base64_decode($item->initiator_on_save_model);
|
||||
// unset the values we don't want exported.
|
||||
unset($item->asset_id);
|
||||
unset($item->checked_out);
|
||||
|
71
admin/models/fields/repositoriesfilterbase.php
Normal file
71
admin/models/fields/repositoriesfilterbase.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Repositoriesfilterbase Form Field class for the Componentbuilder component
|
||||
*/
|
||||
class JFormFieldRepositoriesfilterbase extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The repositoriesfilterbase field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'repositoriesfilterbase';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of Html options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = Factory::getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the text.
|
||||
$query->select($db->quoteName('base'));
|
||||
$query->from($db->quoteName('#__componentbuilder_repository'));
|
||||
$query->order($db->quoteName('base') . ' ASC');
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
|
||||
$_results = $db->loadColumn();
|
||||
$_filter = [];
|
||||
$_filter[] = Html::_('select.option', '', '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_BASE_URL') . ' -');
|
||||
|
||||
if ($_results)
|
||||
{
|
||||
$_results = array_unique($_results);
|
||||
foreach ($_results as $base)
|
||||
{
|
||||
// Now add the base and its text to the options array
|
||||
$_filter[] = Html::_('select.option', $base, $base);
|
||||
}
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
}
|
71
admin/models/fields/repositoriesfilterorganisation.php
Normal file
71
admin/models/fields/repositoriesfilterorganisation.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @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
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Repositoriesfilterorganisation Form Field class for the Componentbuilder component
|
||||
*/
|
||||
class JFormFieldRepositoriesfilterorganisation extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The repositoriesfilterorganisation field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'repositoriesfilterorganisation';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of Html options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = Factory::getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the text.
|
||||
$query->select($db->quoteName('organisation'));
|
||||
$query->from($db->quoteName('#__componentbuilder_repository'));
|
||||
$query->order($db->quoteName('organisation') . ' ASC');
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
|
||||
$_results = $db->loadColumn();
|
||||
$_filter = [] |