Compare commits

...

36 Commits

Author SHA1 Message Date
e36b84f301 Stable Release of version 2.8.5 2018-07-30 08:10:50 +02:00
a6013c4b22 fixed gh-325 that caused a security token validation error. 2018-07-23 17:07:13 +02:00
812857da81 Fixed gh-324 that had a typo with the storing of the PHPx values. Improved the safeString helper method 2018-07-23 04:53:59 +02:00
6dd654c745 Improved the Admin Fields Relations area to allow more custom coding without the need of selecting Join Field/s. Improved the dynamic get string fixing implementation to avoid conflict when the same field name is used in multiple joined tables requiering string fixing. Fixed gh-322 to insure ID is always readonly even if override detected. Added new feature to control access and view/hide control per/field. 2018-07-21 09:10:37 +02:00
0a7b91829f Fixed gh-318 so that default and other none database fields will not trigger SQL update and version increment. Fixed gh-317 that had conflict variable naming in the jsonToString helper method. Improved the refresh method for JCB package area. 2018-07-12 18:35:38 +02:00
b42a3a5420 Fixed issue that cause the WHMCS implementation to still not work 2018-07-10 17:09:21 +02:00
2cf6f6ab11 Added notice to the compiler when the WHMCS class could not be added to explain why. 2018-07-09 01:17:04 +02:00
21254738a8 Fixed the sql dump import issue that broke when import values not set correctly. Made more corrections to the whmcs implementation. 2018-07-09 00:49:50 +02:00
a62476d260 Added the update server url to the xml update-server file 2018-07-08 22:26:08 +02:00
0ca49414d2 Fixed gh-315 to insure all the WHMCS features work as expected 2018-07-08 22:19:01 +02:00
3a4a0e613b Added the table and field validation to avoid import breakages due to new table or fields not found in the older local install of JCB. 2018-07-07 02:12:13 +02:00
9fd59f2353 Added none as the fallback if an editor gets unpublished. 2018-07-07 00:27:29 +02:00
2b39af94a2 fixed gh-312 that caused an error when creating a new component. 2018-07-07 00:01:30 +02:00
1a19a510dc fixed line spacing in getform method 2018-07-06 17:56:29 +02:00
769e31061c fixed line spacing in getform method 2018-07-06 17:52:24 +02:00
69d358ca06 fixed line spacing in getform method 2018-07-06 17:47:27 +02:00
a9a0952ff3 Added a global editor switch for all editors in JCB, the default is none. gh-305 Added two new fields to the admin view to target the getform method in the model. 2018-07-06 15:46:30 +02:00
25650efa47 Added Joomla volunteers banner. Fixed a syntax error in the custom admin view called get snippets. 2018-06-29 04:19:50 +02:00
1312e45d4a Converting the textarea fields to editor fields, in the rest of JCB where code is being edited. gh-305 2018-06-25 22:54:26 +02:00
fd93feac42 added a validation rule to allow the submition of code in JCB 2018-06-25 04:26:05 +02:00
e774bf1002 Converting the textarea fields to editor fields, starting in the admin view. gh-305 2018-06-25 04:25:10 +02:00
568ff0ff9c Fixed gh-303 to insure that the export data headers are set 2018-06-21 16:27:38 +02:00
2b3acf5368 added the option to set headers in the email helper class 2018-06-21 16:25:49 +02:00
0c7d7265dd Improved the table detection in the mapping of the extrusion class when building table/fields from mysql dump 2018-06-15 15:31:23 +02:00
3db9deb534 removed field relations from sql dump since the views for those relations are not shipped with JCB 2018-06-13 22:44:50 +02:00
8402051a94 fixed mismatch on field import of JCB packages 2018-06-13 22:38:32 +02:00
2ca5419106 fixed the dashboard JCB package import that did not update the ID in the Joomla Component Area 2018-06-12 17:39:13 +02:00
ffbd380b10 Fixed gh-301 to insure the sql dump of tables will build new fields and views using the new subform method 2018-06-09 23:11:04 +02:00
01149bfb7c Mode some improvements to the new relation area. Fixed the notice message regarding the linked fields. 2018-05-31 12:31:44 +02:00
640c96ce38 Little tweak to speed up the tab/space method 2018-05-30 13:40:25 +02:00
7f325b1233 Fixed a notice in the JCB package exporter. 2018-05-29 06:59:08 +02:00
a7c3a6e8f2 Fixed the javascript in the new relation area. Fixed gh-294 that hade count not array errors. Added the option to over-ride the column name in the new relation area. 2018-05-29 05:45:16 +02:00
f7be7ddad0 Resolved gh-287 that adds the feature to join/combine results of multiple fields in the admin list view. Update the tab string to make tabs dynamic in nature. Imporved the compiler building of the admin list view 2018-05-26 12:03:08 +02:00
fef3460772 Refactored the compiler list view body builder, in preparation of the relation fields. Added more options to the relation admin fields. gh-287 2018-05-24 15:58:48 +02:00
84b683182a Refactored the compiler update file method 2018-05-22 22:35:39 +02:00
2543d11277 Updated compiler to allow dynamic update for language strings. Started adding the field relationship feature requested in gh-287 2018-05-22 21:01:55 +02:00
275 changed files with 18427 additions and 13193 deletions

View File

@ -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 safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.10) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.8.5) 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)
@ -125,14 +125,14 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 18th May, 2018
+ *Version*: 2.7.10
+ *Last Build*: 30th July, 2018
+ *Version*: 2.8.5
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **181594**
+ *Field count*: **1036**
+ *File count*: **1203**
+ *Folder count*: **193**
+ *Line count*: **186360**
+ *Field count*: **1059**
+ *File count*: **1239**
+ *Folder count*: **197**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
@ -140,6 +140,6 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
## Donations
Come on buy VDM a coffee :)
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief)
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) (Asseblief = Please) in Afrikaans
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218

View File

@ -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 safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.10) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.8.5) 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)
@ -125,14 +125,14 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 18th May, 2018
+ *Version*: 2.7.10
+ *Last Build*: 30th July, 2018
+ *Version*: 2.8.5
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **181594**
+ *Field count*: **1036**
+ *File count*: **1203**
+ *Folder count*: **193**
+ *Line count*: **186360**
+ *Field count*: **1059**
+ *File count*: **1239**
+ *Folder count*: **197**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
@ -140,6 +140,6 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
## Donations
Come on buy VDM a coffee :)
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief)
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) (Asseblief = Please) in Afrikaans
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218

View File

@ -50,6 +50,16 @@
<action name="admin_fields.edit.own" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_OWN" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_OWN_DESC" />
<action name="admin_fields.edit.state" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE_DESC" />
<action name="admin_fields.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION_DESC" />
<action name="admin_fields_relations.access" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC" />
<action name="admin_fields_relations.batch" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE_DESC" />
<action name="admin_fields_relations.create" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC" />
<action name="admin_fields_relations.delete" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC" />
<action name="admin_fields_relations.edit" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC" />
<action name="admin_fields_relations.edit.created_by" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC" />
<action name="admin_fields_relations.edit.created" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC" />
<action name="admin_fields_relations.edit.own" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC" />
<action name="admin_fields_relations.edit.state" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC" />
<action name="admin_fields_relations.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC" />
<action name="compiler.access" title="COM_COMPONENTBUILDER_COMPILER_ACCESS" description="COM_COMPONENTBUILDER_COMPILER_ACCESS_DESC" />
<action name="compiler.clear_tmp" title="COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS_DESC" />
<action name="compiler.dashboard_list" title="COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST_DESC" />
@ -199,16 +209,16 @@
<action name="fieldtype.dashboard_add" title="COM_COMPONENTBUILDER_FIELDTYPES_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_FIELDTYPES_DASHBOARD_ADD_DESC" />
<action name="fieldtype.dashboard_list" title="COM_COMPONENTBUILDER_FIELDTYPES_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_FIELDTYPES_DASHBOARD_LIST_DESC" />
<action name="fieldtype.delete" title="COM_COMPONENTBUILDER_FIELDTYPES_DELETE" description="COM_COMPONENTBUILDER_FIELDTYPES_DELETE_DESC" />
<action name="fieldtype..description" title="COM_COMPONENTBUILDER_FIELDTYPES_DESCRIPTION" description="COM_COMPONENTBUILDER_FIELDTYPES_DESCRIPTION_DESC" />
<action name="fieldtype.edit" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESC" />
<action name="fieldtype.edit.description" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESCRIPTION" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESCRIPTION_DESC" />
<action name="fieldtype.edit.name" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_NAME" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_NAME_DESC" />
<action name="fieldtype.edit.own" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_OWN" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_OWN_DESC" />
<action name="fieldtype.edit.properties" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_PROPERTIES" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_PROPERTIES_DESC" />
<action name="fieldtype.edit.short_description" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_SHORT_DESCRIPTION" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_SHORT_DESCRIPTION_DESC" />
<action name="fieldtype.edit.state" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_STATE" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_STATE_DESC" />
<action name="fieldtype.version" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION_DESC" />
<action name="fieldtype.export" title="COM_COMPONENTBUILDER_FIELDTYPES_EXPORT" description="COM_COMPONENTBUILDER_FIELDTYPES_EXPORT_DESC" />
<action name="fieldtype.import" title="COM_COMPONENTBUILDER_FIELDTYPES_IMPORT" description="COM_COMPONENTBUILDER_FIELDTYPES_IMPORT_DESC" />
<action name="fieldtype..name" title="COM_COMPONENTBUILDER_FIELDTYPES_NAME" description="COM_COMPONENTBUILDER_FIELDTYPES_NAME_DESC" />
<action name="fieldtype..properties" title="COM_COMPONENTBUILDER_FIELDTYPES_PROPERTIES" description="COM_COMPONENTBUILDER_FIELDTYPES_PROPERTIES_DESC" />
<action name="fieldtype..short_description" title="COM_COMPONENTBUILDER_FIELDTYPES_SHORT_DESCRIPTION" description="COM_COMPONENTBUILDER_FIELDTYPES_SHORT_DESCRIPTION_DESC" />
<action name="fieldtype.submenu" title="COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU" description="COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU_DESC" />
<action name="get_snippets.access" title="COM_COMPONENTBUILDER_GET_SNIPPETS_ACCESS" description="COM_COMPONENTBUILDER_GET_SNIPPETS_ACCESS_DESC" />
<action name="get_snippets.custom_admin_views" title="COM_COMPONENTBUILDER_GET_SNIPPETS_CUSTOM_ADMIN_VIEWS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_GET_SNIPPETS_CUSTOM_ADMIN_VIEWS_BUTTON_ACCESS_DESC" />
@ -495,10 +505,10 @@
<action name="fieldtype.create" title="COM_COMPONENTBUILDER_FIELDTYPES_CREATE" description="COM_COMPONENTBUILDER_FIELDTYPES_CREATE_DESC" />
<action name="fieldtype.delete" title="COM_COMPONENTBUILDER_FIELDTYPES_DELETE" description="COM_COMPONENTBUILDER_FIELDTYPES_DELETE_DESC" />
<action name="fieldtype.access" title="COM_COMPONENTBUILDER_FIELDTYPES_ACCESS" description="COM_COMPONENTBUILDER_FIELDTYPES_ACCESS_DESC" />
<action name="fieldtype.edit.name" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_NAME" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_NAME_DESC" />
<action name="fieldtype.edit.properties" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_PROPERTIES" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_PROPERTIES_DESC" />
<action name="fieldtype.edit.description" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESCRIPTION" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESCRIPTION_DESC" />
<action name="fieldtype.edit.short_description" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_SHORT_DESCRIPTION" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_SHORT_DESCRIPTION_DESC" />
<action name="fieldtype..name" title="COM_COMPONENTBUILDER_FIELDTYPES_NAME" description="COM_COMPONENTBUILDER_FIELDTYPES_NAME_DESC" />
<action name="fieldtype..properties" title="COM_COMPONENTBUILDER_FIELDTYPES_PROPERTIES" description="COM_COMPONENTBUILDER_FIELDTYPES_PROPERTIES_DESC" />
<action name="fieldtype..description" title="COM_COMPONENTBUILDER_FIELDTYPES_DESCRIPTION" description="COM_COMPONENTBUILDER_FIELDTYPES_DESCRIPTION_DESC" />
<action name="fieldtype..short_description" title="COM_COMPONENTBUILDER_FIELDTYPES_SHORT_DESCRIPTION" description="COM_COMPONENTBUILDER_FIELDTYPES_SHORT_DESCRIPTION_DESC" />
<action name="fieldtype.version" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION_DESC" />
</section>
<section name="language_translation">
@ -561,6 +571,17 @@
<action name="admin_fields_conditions.access" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_ACCESS" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_ACCESS_DESC" />
<action name="admin_fields_conditions.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_EDIT_VERSION_DESC" />
</section>
<section name="admin_fields_relations">
<action name="admin_fields_relations.edit" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC" />
<action name="admin_fields_relations.edit.own" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC" />
<action name="admin_fields_relations.edit.state" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC" />
<action name="admin_fields_relations.edit.created_by" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC" />
<action name="admin_fields_relations.edit.created" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC" />
<action name="admin_fields_relations.create" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC" />
<action name="admin_fields_relations.delete" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC" />
<action name="admin_fields_relations.access" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC" />
<action name="admin_fields_relations.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC" />
</section>
<section name="component_admin_views">
<action name="component_admin_views.edit" title="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT" description="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_DESC" />
<action name="component_admin_views.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_OWN_DESC" />

View File

@ -0,0 +1,16 @@
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/* CSS Document */
.codefield {
width: 500px;
}

View File

@ -0,0 +1,13 @@
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/* CSS Document */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 393 KiB

After

Width:  |  Height:  |  Size: 395 KiB

View File

@ -248,16 +248,16 @@ abstract class ###Component###Helper
{
if ($external)
{
if ($name = self::getVar(null, $val, $id, $name, '=', $table))
if ($_name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $name;
$names[] = $_name;
}
}
else
{
if ($name = self::getVar($table, $val, $id, $name))
if ($_name = self::getVar($table, $val, $id, $name))
{
$names[] = $name;
$names[] = $_name;
}
}
}
@ -647,7 +647,7 @@ abstract class ###Component###Helper
}
}
// check if there are any view values remaining
if (count($_result))
if (count((array)$_result))
{
$_result = json_encode($_result);
$_result = array($_result);
@ -841,7 +841,7 @@ abstract class ###Component###Helper
**/
public static function checkArray($array, $removeEmptyString = false)
{
if (isset($array) && is_array($array) && count($array) > 0)
if (isset($array) && is_array($array) && count((array)$array) > 0)
{
// also make sure the empty strings are removed
if ($removeEmptyString)
@ -944,7 +944,7 @@ abstract class ###Component###Helper
{
$initial = strlen($string);
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count($words);
$words_count = count((array)$words);
$word_length = 0;
$last_word = 0;
@ -979,7 +979,7 @@ abstract class ###Component###Helper
*
* @returns string on success
**/
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true)
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{
if ($replaceNumbers === true)
{
@ -1008,7 +1008,16 @@ abstract class ###Component###Helper
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
$string = preg_replace("/[^A-Za-z ]/", '', $string);
// remove all and keep only characters
if ($keepOnlyCharacters)
{
$string = preg_replace("/[^A-Za-z ]/", '', $string);
}
// keep both numbers and characters
else
{
$string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
}
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{

View File

@ -45,6 +45,13 @@ abstract class ###Component###Email
*/
public static $mailer = null;
/**
* Custom Headers
*
* @var array
*/
protected static $header = array();
/**
* Get a configuration object
*
@ -58,7 +65,7 @@ abstract class ###Component###Email
return self::$config;
}
/**
* Get a mailer object.
*
@ -131,17 +138,17 @@ abstract class ###Component###Email
$replyto = $conf->get('replyto');
$replytoname = $conf->get('replytoname');
}
// Set global sender
$mail->setSender(array($mailfrom, $fromname));
// set the global reply-to if found
if ($replyto && $replytoname)
{
$mail->ClearReplyTos();
$mail->addReplyTo( array( $replyto, $replytoname ) );
$mail->addReplyTo($replyto, $replytoname);
}
// Set global sender
$mail->setSender(array($mailfrom, $fromname));
// Default mailer is to use PHP's mail function
switch ($mailer)
{
@ -164,6 +171,17 @@ abstract class ###Component###Email
return $mail;
}
/**
* Set a Mail custom header.
*
* @return void
*/
public static function setHeader($target, $value)
{
// set the header
self::$header[$target] = $value;
}
/**
* Send an email
*
@ -172,16 +190,12 @@ abstract class ###Component###Email
*/
public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null)
{
// Get a JMail instance
$mail = self::getMailer();
// set component params
$conf = self::getConfig();
// do some house cleaning
$mail->ClearReplyTos();
// set if we have override
if ($mailfrom && $fromname)
{
@ -199,7 +213,16 @@ abstract class ###Component###Email
{
$mail->addCustomHeader('X-VDMmethodID:'.$idsession);
}
// set headers if found
if (isset(self::$header) && is_array(self::$header) && count((array)self::$header) > 0)
{
foreach (self::$header as $_target => $_value)
{
$mail->addCustomHeader($_target.':'.$_value);
}
}
// set the subject & Body
$mail->setSubject($subject);
$mail->setBody($body);
@ -232,7 +255,7 @@ abstract class ###Component###Email
if (is_array($mailreply))
{
$mail->ClearReplyTos();
$numReplyTo = count($mailreply);
$numReplyTo = count((array)$mailreply);
for ($i=0; $i < $numReplyTo; $i++)
{
$mail->addReplyTo($mailreply[$i], $replyname[$i]);
@ -243,7 +266,7 @@ abstract class ###Component###Email
$mail->ClearReplyTos();
$mail->addReplyTo($mailreply, $replyname);
}
// check if we can add the DKIM to email
if ($conf->get('enable_dkim'))
{
@ -261,20 +284,20 @@ abstract class ###Component###Email
$mail->DKIM_private = $tmp;
}
}
$sendmail = $mail->Send();
if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public')))
{
@unlink($tmp);
}
if (method_exists('###Component###Helper','storeMessage'))
{
// store the massage if the method is set
###Component###Helper::storeMessage($sendmail, $recipient, $subject, $body, $textonly, $mode, 'email');
}
return $sendmail;
}

View File

@ -58,16 +58,16 @@ abstract class ###Component###Helper
{
if ($external)
{
if ($name = self::getVar(null, $val, $id, $name, '=', $table))
if ($_name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $name;
$names[] = $_name;
}
}
else
{
if ($name = self::getVar($table, $val, $id, $name))
if ($_name = self::getVar($table, $val, $id, $name))
{
$names[] = $name;
$names[] = $_name;
}
}
}
@ -293,7 +293,7 @@ abstract class ###Component###Helper
}
}
// check if there are any view values remaining
if (count($_result))
if (count((array)$_result))
{
$_result = json_encode($_result);
$_result = array($_result);
@ -833,7 +833,7 @@ abstract class ###Component###Helper
**/
public static function checkArray($array, $removeEmptyString = false)
{
if (isset($array) && is_array($array) && count($array) > 0)
if (isset($array) && is_array($array) && count((array)$array) > 0)
{
// also make sure the empty strings are removed
if ($removeEmptyString)
@ -936,7 +936,7 @@ abstract class ###Component###Helper
{
$initial = strlen($string);
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count($words);
$words_count = count((array)$words);
$word_length = 0;
$last_word = 0;
@ -971,7 +971,7 @@ abstract class ###Component###Helper
*
* @returns string on success
**/
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true)
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{
if ($replaceNumbers === true)
{
@ -1000,7 +1000,16 @@ abstract class ###Component###Helper
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
$string = preg_replace("/[^A-Za-z ]/", '', $string);
// remove all and keep only characters
if ($keepOnlyCharacters)
{
$string = preg_replace("/[^A-Za-z ]/", '', $string);
}
// keep both numbers and characters
else
{
$string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
}
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{

View File

@ -47,6 +47,20 @@
/>
<field type="spacer" name="spacerHistory" hr="true" />
<!-- Editor Field. Type: Plugins. (joomla) -->
<field
type="plugins"
name="editor"
label="COM_COMPONENTBUILDER_CONFIG_EDITOR_LABEL"
default="none"
description="COM_COMPONENTBUILDER_CONFIG_EDITOR_DESCRIPTION"
folder="editors"
filter="cmd"
/>
<!-- No Manual Options Were Added In Field Settings. -->
<!-- Spacer_hr_one Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_one" hr="true" class="spacer_hr_one" />
<!-- Manage_jcb_package_directories Field. Type: Radio. (joomla) -->
<field
type="radio"
@ -79,8 +93,8 @@
<option value="jcb">
COM_COMPONENTBUILDER_CONFIG_JCB_COMMUNITY_PACKAGES</option>
</field>
<!-- Spacer_hr_one Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_one" hr="true" class="spacer_hr_one" />
<!-- Spacer_hr_two Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_two" hr="true" class="spacer_hr_two" />
<!-- Add_menu_prefix Field. Type: Radio. (joomla) -->
<field
type="radio"
@ -111,8 +125,8 @@
autocomplete="on"
showon="add_menu_prefix:1"
/>
<!-- Spacer_hr_two Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_two" hr="true" class="spacer_hr_two" />
<!-- Spacer_hr_three Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_three" hr="true" class="spacer_hr_three" />
<!-- Minify Field. Type: Radio. (joomla) -->
<field
type="radio"
@ -127,8 +141,8 @@
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option>
</field>
<!-- Spacer_hr_three Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_three" hr="true" class="spacer_hr_three" />
<!-- Spacer_hr_four Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_four" hr="true" class="spacer_hr_four" />
<!-- Set_browser_storage Field. Type: Radio. (joomla) -->
<field
type="radio"
@ -180,8 +194,8 @@
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NEVER_UPDATE</option>
</field>
<!-- Spacer_hr_four Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_four" hr="true" class="spacer_hr_four" />
<!-- Spacer_hr_five Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_five" hr="true" class="spacer_hr_five" />
<!-- Note_language_global Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_language_global" label="COM_COMPONENTBUILDER_CONFIG_NOTE_LANGUAGE_GLOBAL_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_LANGUAGE_GLOBAL_DESCRIPTION" heading="h4" class="alert alert-info note_language_global" />
<!-- Language Field. Type: Lang. (custom) -->
@ -208,8 +222,8 @@
max="100"
step="10"
/>
<!-- Spacer_hr_five Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_five" hr="true" class="spacer_hr_five" />
<!-- Spacer_hr_six Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_six" hr="true" class="spacer_hr_six" />
<!-- Compiler_field_builder_type Field. Type: List. (joomla) -->
<field
type="list"
@ -226,8 +240,8 @@
<option value="2">
COM_COMPONENTBUILDER_CONFIG_SIMPLEXMLELEMENT_CLASS</option>
</field>
<!-- Spacer_hr_six Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_six" hr="true" class="spacer_hr_six" />
<!-- Spacer_hr_seven Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_seven" hr="true" class="spacer_hr_seven" />
<!-- Api Field. Type: User. (joomla) -->
<field
type="user"
@ -235,8 +249,8 @@
label="COM_COMPONENTBUILDER_CONFIG_API_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_API_DESCRIPTION"
/>
<!-- Spacer_hr_seven Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_seven" hr="true" class="spacer_hr_seven" />
<!-- Spacer_hr_eight Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_eight" hr="true" class="spacer_hr_eight" />
<field name="autorTitle"
type="spacer"
label="COM_COMPONENTBUILDER_CONFIG_AUTHOR"
@ -325,7 +339,7 @@
COM_COMPONENTBUILDER_CONFIG_ON</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_OFF</option>
</field>
</field>
<!-- Mailer Field. Type: List. (joomla) -->
<field
type="list"
@ -346,7 +360,7 @@
COM_COMPONENTBUILDER_CONFIG_SENDMAIL</option>
<option value="smtp">
COM_COMPONENTBUILDER_CONFIG_SMTP</option>
</field>
</field>
<!-- Emailfrom Field. Type: Text. (joomla) -->
<field
type="text"
@ -361,7 +375,7 @@
message="Error! Please add email address here."
hint="COM_COMPONENTBUILDER_CONFIG_EMAILFROM_HINT"
showon="mailer:smtp,sendmail,default"
/>
/>
<!-- Fromname Field. Type: Text. (joomla) -->
<field
type="text"
@ -375,7 +389,7 @@
message="Error! Please add some name here."
hint="COM_COMPONENTBUILDER_CONFIG_FROMNAME_HINT"
showon="mailer:smtp,sendmail,default"
/>
/>
<!-- Email reply to Field. Type: Text. (joomla) -->
<field
type="text"
@ -390,7 +404,7 @@
message="Error! Please add email address here."
hint="COM_COMPONENTBUILDER_CONFIG_EMAILREPLY_HINT"
showon="mailer:smtp,sendmail,default"
/>
/>
<!-- Reply to name Field. Type: Text. (joomla) -->
<field
type="text"
@ -404,7 +418,7 @@
message="Error! Please add some name here."
hint="COM_COMPONENTBUILDER_CONFIG_REPLYNAME_HINT"
showon="mailer:smtp,sendmail,default"
/>
/>
<!-- Sendmail Field. Type: Text. (joomla) -->
<field
type="text"
@ -419,7 +433,7 @@
message="Error! Please add path to you local sendmail here."
hint="COM_COMPONENTBUILDER_CONFIG_SENDMAIL_HINT"
showon="mailer:sendmail"
/>
/>
<!-- Smtpauth Field. Type: Radio. (joomla) -->
<field
type="radio"
@ -434,7 +448,7 @@
COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option>
</field>
</field>
<!-- Smtpsecure Field. Type: List. (joomla) -->
<field
type="list"
@ -453,7 +467,7 @@
COM_COMPONENTBUILDER_CONFIG_SSL</option>
<option value="tls">
COM_COMPONENTBUILDER_CONFIG_TLS</option>
</field>
</field>
<!-- Smtpport Field. Type: Text. (joomla) -->
<field
type="text"
@ -468,7 +482,7 @@
message="Error! Please add the port number of your SMTP server here."
hint="COM_COMPONENTBUILDER_CONFIG_SMTPPORT_HINT"
showon="mailer:smtp"
/>
/>
<!-- Smtpuser Field. Type: Text. (joomla) -->
<field
type="text"
@ -482,7 +496,7 @@
message="Error! Please add the username for SMTP server here."
hint="COM_COMPONENTBUILDER_CONFIG_SMTPUSER_HINT"
showon="mailer:smtp"
/>
/>
<!-- Smtppass Field. Type: Password. (joomla) -->
<field
type="password"
@ -494,7 +508,7 @@
filter="raw"
message="Error! Please add the password for SMTP server here."
showon="mailer:smtp"
/>
/>
<!-- Smtphost Field. Type: Text. (joomla) -->
<field
type="text"
@ -529,7 +543,7 @@
COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option>
</field>
</field>
<!-- Dkim_domain Field. Type: Text. (joomla) -->
<field
type="text"
@ -544,7 +558,7 @@
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_DOMAIN_HINT"
showon="dkim:1"
onchange="vdm_dkim();"
/>
/>
<!-- Dkim_selector Field. Type: Text. (joomla) -->
<field
type="text"
@ -560,7 +574,7 @@
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_SELECTOR_HINT"
showon="dkim:1"
onchange="vdm_dkim();"
/>
/>
<!-- Dkim_passphrase Field. Type: Password. (joomla) -->
<field
type="password"
@ -572,7 +586,7 @@
filter="raw"
message="Error! Please add passphrase here."
showon="dkim:1"
/>
/>
<!-- Dkim_identity Field. Type: Text. (joomla) -->
<field
type="text"
@ -586,7 +600,7 @@
message="Error! Please add DKIM Identity here."
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_IDENTITY_HINT"
showon="dkim:1"
/>
/>
<!-- Dkim_private_key Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -597,7 +611,7 @@
description="COM_COMPONENTBUILDER_CONFIG_DKIM_PRIVATE_KEY_DESCRIPTION"
class="input-xxlarge span12"
showon="dkim:1"
/>
/>
<!-- Dkim_public_key Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -609,9 +623,9 @@
class="input-xxlarge span12"
showon="dkim:1"
onchange="vdm_dkim();"
/>
/>
<!-- Note_dkim_use Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_dkim_use" label="COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_DESCRIPTION" heading="h4" class="note_dkim_use" showon="dkim:1" />
<field type="note" name="note_dkim_use" label="COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_DESCRIPTION" heading="h4" class="note_dkim_use" showon="dkim:1" />
<!-- Dkim_key Field. Type: Text. (joomla) -->
<field
type="text"
@ -625,7 +639,7 @@
message="Error! Please add KEY here."
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_KEY_HINT"
showon="dkim:1"
/>
/>
<!-- Dkim_value Field. Type: Text. (joomla) -->
<field
type="text"
@ -1017,6 +1031,7 @@
required="false"
filter="url"
validated="url"
scheme="http,https"
message="COM_COMPONENTBUILDER_CONFIG_EXPORT_BUY_LINK_MESSAGE"
hint="COM_COMPONENTBUILDER_CONFIG_EXPORT_BUY_LINK_HINT"
/>

View File

@ -112,6 +112,7 @@ class ComponentbuilderController extends JControllerLegacy
'help_document' => 'help_documents',
'admin_fields' => 'admins_fields',
'admin_fields_conditions' => 'admins_fields_conditions',
'admin_fields_relations' => 'admins_fields_relations',
'component_admin_views' => 'components_admin_views',
'component_site_views' => 'components_site_views',
'component_custom_admin_views' => 'components_custom_admin_views',

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerAdmin_fields extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerAdmin_fields_conditions extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -0,0 +1,312 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 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');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Admin_fields_relations Controller
*/
class ComponentbuilderControllerAdmin_fields_relations extends JControllerForm
{
/**
* Current or most recently performed task.
*
* @var string
* @since 12.2
* @note Replaces _task.
*/
protected $task;
public function __construct($config = array())
{
$this->view_list = 'Admins_fields_relations'; // 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 = array())
{
// Access check.
$access = JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('admin_fields_relations.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 = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.
$access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder'));
if (!$access)
{
return false;
}
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('admin_fields_relations.edit', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('admin_fields_relations.edit.own', 'com_componentbuilder.admin_fields_relations.' . $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('admin_fields_relations.edit.own', 'com_componentbuilder'))
{
return true;
}
}
}
return false;
}
}
// Since there is no permission, revert to the component permissions.
return $user->authorise('admin_fields_relations.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 12.2
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$tmpl = $this->input->get('tmpl');
$layout = $this->input->get('layout', 'edit', 'string');
$ref = $this->input->get('ref', 0, 'string');
$refid = $this->input->get('refid', 0, 'int');
// Setup redirect info.
$append = '';
if ($refid)
{
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
}
elseif ($ref)
{
$append .= '&ref='.(string)$ref;
}
if ($tmpl)
{
$append .= '&tmpl=' . $tmpl;
}
if ($layout)
{
$append .= '&layout=' . $layout;
}
if ($recordId)
{
$append .= '&' . $urlVar . '=' . $recordId;
}
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)
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Admin_fields_relations', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_relations' . $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 referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
$cancel = parent::cancel($key);
if ($cancel)
{
if ($this->refid)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
}
else
{
// Redirect to the items screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list, 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 referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid)
{
// to make sure the item is checkedin on redirect
$this->task = 'save';
}
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'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 JModel &$model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 11.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
return;
}
}

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.
@ -318,7 +318,8 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm
// linked tables to update
$_tablesArray = array(
'admin_fields',
'admin_fields_conditions'
'admin_fields_conditions',
'admin_fields_relations'
);
foreach($_tablesArray as $_updateTable)
{

View File

@ -0,0 +1,34 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 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');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Admins_fields_relations Controller
*/
class ComponentbuilderControllerAdmins_fields_relations extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Admin_fields_relations', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}

View File

@ -53,6 +53,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('checkRuleName', 'ajax');
$this->registerTask('fieldOptions', 'ajax');
$this->registerTask('getFieldPropertyDesc', 'ajax');
$this->registerTask('getCodeGlueOptions', 'ajax');
$this->registerTask('snippetDetails', 'ajax');
$this->registerTask('setSnippetGithub', 'ajax');
$this->registerTask('getSnippets', 'ajax');
@ -1032,6 +1033,47 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
}
break;
case 'getCodeGlueOptions':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$listfieldValue = $jinput->get('listfield', NULL, 'INT');
$joinfieldsValue = $jinput->get('joinfields', NULL, 'STRING');
$typeValue = $jinput->get('type', NULL, 'INT');
$areaValue = $jinput->get('area', NULL, 'INT');
if($listfieldValue && $joinfieldsValue && $typeValue && $areaValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getCodeGlueOptions($listfieldValue, $joinfieldsValue, $typeValue, $areaValue);
}
else
{
$result = false;
}
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
echo json_encode($result);
}
else
{
echo "(".json_encode($result).");";
}
}
catch(Exception $e)
{
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback."(".json_encode($e).");";
}
else
{
echo "(".json_encode($e).");";
}
}
break;
case 'snippetDetails':
try
{

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_admin_views extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_config extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_dashboard extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_files_folders extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_site_views extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_updates extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerCustom_admin_view extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerCustom_code extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerDynamic_get extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -68,9 +68,9 @@ class ComponentbuilderControllerField extends JControllerForm
*/
protected function allowEdit($data = array(), $key = 'id')
{ // get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -68,9 +68,9 @@ class ComponentbuilderControllerFieldtype extends JControllerForm
*/
protected function allowEdit($data = array(), $key = 'id')
{ // get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerHelp_document extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -33,6 +33,31 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm
{
$this->view_list = 'Joomla_components'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}
public function refresh()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('joomla_component.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
{
$session = JFactory::getSession();
$session->set('backto_VDM_IMPORT', 'joomla_components');
$session->set('dataType_VDM_IMPORTINTO', 'smart_package');
// clear the session
ComponentbuilderHelper::set('vdmGithubPackages', null);
ComponentbuilderHelper::set('communityGithubPackages', null);
// Redirect to import view.
$message = JText::_('COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components&target=smartPackage', false), $message);
return;
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
/**
@ -69,9 +94,9 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -355,6 +355,8 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
public function cloner()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// Get the model
$model = $this->getModel('Joomla_components');
// check if export is allowed for this user.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerLanguage extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerLanguage_translation extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerLayout extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerLibrary extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerLibrary_config extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends JControllerFo
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerServer extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerSite_view extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerSnippet extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerSnippet_type extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerTemplate extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -69,9 +69,9 @@ class ComponentbuilderControllerValidation_rule extends JControllerForm
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.

View File

@ -25,7 +25,6 @@ class Compiler extends Infusion
*
* @var string
*/
private $tempPath;
/*
@ -72,7 +71,7 @@ class Compiler extends Infusion
// first remove the files and folders
$this->removeFolder($this->componentPath . '/site');
// clear form component xml
$xmlPath = $this->componentPath . '/' . $this->fileContentStatic['###component###'] . '.xml';
$xmlPath = $this->componentPath . '/' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.xml';
$componentXML = ComponentbuilderHelper::getFileContents($xmlPath);
$textToSite = ComponentbuilderHelper::getBetween($componentXML, '<files folder="site">', '</files>');
$textToSiteLang = ComponentbuilderHelper::getBetween($componentXML, '<languages folder="site">', '</languages>');
@ -155,7 +154,7 @@ class Compiler extends Infusion
foreach ($mismatch as $string)
{
$constant = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($string, 'U');
$this->app->enqueueMessage(JText::sprintf('The <b>Joomla.JText._(\'%s\')</b> language constant for <b>%s</b> does not have a corresponding <code>JText::script(\'%s\')</code> decalaration, please add it.', $constant, $string, $string), 'Warning');
$this->app->enqueueMessage(JText::sprintf('The <b>Joomla.JText._(&apos;%s&apos;)</b> language constant for <b>%s</b> does not have a corresponding <code>JText::script(&apos;%s&apos;)</code> decalaration, please add it.', $constant, $string, $string), 'Warning');
}
$this->app->enqueueMessage('<hr />', 'Warning');
}
@ -200,9 +199,9 @@ class Compiler extends Infusion
/**
* Set the dynamic data to the created fils
*
*
* @return bool true on success
*
*
*/
protected function updateFiles()
{
@ -215,28 +214,7 @@ class Compiler extends Infusion
{
if (JFile::exists($static['path']))
{
$this->fileContentStatic['###FILENAME###'] = $static['name'];
$php = '';
if (ComponentbuilderHelper::checkFileType($static['name'], 'php'))
{
$php = "<?php\n";
}
$string = ComponentbuilderHelper::getFileContents($static['path']);
if (strpos($string, '###BOM###') !== false)
{
list($wast, $code) = explode('###BOM###', $string);
$string = $php . $bom . $code;
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
// add to zip array
$this->writeFile($static['path'], $answer);
}
else
{
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
// add to zip array
$this->writeFile($static['path'], $answer);
}
$this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL);
$this->setFileContent($static['name'], $static['path'], $bom);
}
}
// now we do the dynamic files
@ -250,32 +228,7 @@ class Compiler extends Infusion
{
if (JFile::exists($file['path']))
{
$this->fileContentStatic['###FILENAME###'] = $file['name'];
// do some weird stuff to improve the verion and dates being added to the license
$this->fixLicenseValues($file);
$php = '';
if (ComponentbuilderHelper::checkFileType($file['name'], 'php'))
{
$php = "<?php\n";
}
$string = ComponentbuilderHelper::getFileContents($file['path']);
if (strpos($string, '###BOM###') !== false)
{
list($bin, $code) = explode('###BOM###', $string);
$string = $php . $bom . $code;
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
// add to zip array
$this->writeFile($file['path'], $answer);
}
else
{
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
// add to zip array
$this->writeFile($file['path'], $answer);
}
$this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL);
$this->setFileContent($file['name'], $file['path'], $bom, $file['view']);
}
}
}
@ -291,10 +244,47 @@ class Compiler extends Infusion
}
/**
* move the local update server xml file to a remote ftp server
*
* set the file content
*
* @return void
*
*
*/
protected function setFileContent(&$name, &$path, &$bom, $view = null)
{
// set the file name
$this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $name;
// check if the file should get PHP opening
$php = '';
if (ComponentbuilderHelper::checkFileType($name, 'php'))
{
$php = "<?php\n";
}
// get content of the file
$string = ComponentbuilderHelper::getFileContents($path);
// see if we should add a BOM
if (strpos($string, $this->hhh . 'BOM' . $this->hhh) !== false)
{
list($wast, $code) = explode($this->hhh . 'BOM' . $this->hhh, $string);
$string = $php . $bom . $code;
}
// set the answer
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
// set the dynamic answer
if ($view)
{
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
}
// add answer back to file
$this->writeFile($path, $answer);
// count the file lines
$this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL);
}
/**
* move the local update server xml file to a remote ftp server
*
* @return void
*
*/
protected function setUpdateServer()
{
@ -321,7 +311,7 @@ class Compiler extends Infusion
{
foreach ($data['config'] as $key => $value)
{
if ('###VERSION###' === $key)
if ($this->hhh . 'VERSION' . $this->hhh === $key)
{
// hmm we sould in some way make it known that this version number
// is not in relation the the project but to the file only... any ideas?
@ -340,9 +330,9 @@ class Compiler extends Infusion
return true;
}
// else insure to reset to global
$this->fileContentStatic['###CREATIONDATE###'] = $this->fileContentStatic['###CREATIONDATE###GLOBAL'];
$this->fileContentStatic['###BUILDDATE###'] = $this->fileContentStatic['###BUILDDATE###GLOBAL'];
$this->fileContentStatic['###VERSION###'] = $this->fileContentStatic['###VERSION###GLOBAL'];
$this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh . 'GLOBAL'];
$this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh . 'GLOBAL'];
$this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh . 'GLOBAL'];
}
// set all global numbers
@ -399,7 +389,7 @@ class Compiler extends Infusion
private function setReadMe($path)
{
// set readme data if not set already
if (!isset($this->fileContentStatic['###LINE_COUNT###']) || $this->fileContentStatic['###LINE_COUNT###'] != $this->lineCount)
if (!isset($this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh]) || $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] != $this->lineCount)
{
$this->buildReadMeData();
}
@ -414,39 +404,39 @@ class Compiler extends Infusion
private function buildReadMeData()
{
// set some defaults
$this->fileContentStatic['###LINE_COUNT###'] = $this->lineCount;
$this->fileContentStatic['###FIELD_COUNT###'] = $this->fieldCount;
$this->fileContentStatic['###FILE_COUNT###'] = $this->fileCount;
$this->fileContentStatic['###FOLDER_COUNT###'] = $this->folderCount;
$this->fileContentStatic['###PAGE_COUNT###'] = $this->pageCount;
$this->fileContentStatic['###folders###'] = $this->folderSeconds;
$this->fileContentStatic['###foldersSeconds###'] = $this->folderSeconds;
$this->fileContentStatic['###files###'] = $this->fileSeconds;
$this->fileContentStatic['###filesSeconds###'] = $this->fileSeconds;
$this->fileContentStatic['###lines###'] = $this->lineSeconds;
$this->fileContentStatic['###linesSeconds###'] = $this->lineSeconds;
$this->fileContentStatic['###seconds###'] = $this->actualSeconds;
$this->fileContentStatic['###actualSeconds###'] = $this->actualSeconds;
$this->fileContentStatic['###totalHours###'] = $this->totalHours;
$this->fileContentStatic['###totalDays###'] = $this->totalDays;
$this->fileContentStatic['###debugging###'] = $this->secondsDebugging;
$this->fileContentStatic['###secondsDebugging###'] = $this->secondsDebugging;
$this->fileContentStatic['###planning###'] = $this->secondsPlanning;
$this->fileContentStatic['###secondsPlanning###'] = $this->secondsPlanning;
$this->fileContentStatic['###mapping###'] = $this->secondsMapping;
$this->fileContentStatic['###secondsMapping###'] = $this->secondsMapping;
$this->fileContentStatic['###office###'] = $this->secondsOffice;
$this->fileContentStatic['###secondsOffice###'] = $this->secondsOffice;
$this->fileContentStatic['###actualTotalHours###'] = $this->actualTotalHours;
$this->fileContentStatic['###actualTotalDays###'] = $this->actualTotalDays;
$this->fileContentStatic['###debuggingHours###'] = $this->debuggingHours;
$this->fileContentStatic['###planningHours###'] = $this->planningHours;
$this->fileContentStatic['###mappingHours###'] = $this->mappingHours;
$this->fileContentStatic['###officeHours###'] = $this->officeHours;
$this->fileContentStatic['###actualHoursSpent###'] = $this->actualHoursSpent;
$this->fileContentStatic['###actualDaysSpent###'] = $this->actualDaysSpent;
$this->fileContentStatic['###projectWeekTime###'] = $this->projectWeekTime;
$this->fileContentStatic['###projectMonthTime###'] = $this->projectMonthTime;
$this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] = $this->lineCount;
$this->fileContentStatic[$this->hhh . 'FIELD_COUNT' . $this->hhh] = $this->fieldCount;
$this->fileContentStatic[$this->hhh . 'FILE_COUNT' . $this->hhh] = $this->fileCount;
$this->fileContentStatic[$this->hhh . 'FOLDER_COUNT' . $this->hhh] = $this->folderCount;
$this->fileContentStatic[$this->hhh . 'PAGE_COUNT' . $this->hhh] = $this->pageCount;
$this->fileContentStatic[$this->hhh . 'folders' . $this->hhh] = $this->folderSeconds;
$this->fileContentStatic[$this->hhh . 'foldersSeconds' . $this->hhh] = $this->folderSeconds;
$this->fileContentStatic[$this->hhh . 'files' . $this->hhh] = $this->fileSeconds;
$this->fileContentStatic[$this->hhh . 'filesSeconds' . $this->hhh] = $this->fileSeconds;
$this->fileContentStatic[$this->hhh . 'lines' . $this->hhh] = $this->lineSeconds;
$this->fileContentStatic[$this->hhh . 'linesSeconds' . $this->hhh] = $this->lineSeconds;
$this->fileContentStatic[$this->hhh . 'seconds' . $this->hhh] = $this->actualSeconds;
$this->fileContentStatic[$this->hhh . 'actualSeconds' . $this->hhh] = $this->actualSeconds;
$this->fileContentStatic[$this->hhh . 'totalHours' . $this->hhh] = $this->totalHours;
$this->fileContentStatic[$this->hhh . 'totalDays' . $this->hhh] = $this->totalDays;
$this->fileContentStatic[$this->hhh . 'debugging' . $this->hhh] = $this->secondsDebugging;
$this->fileContentStatic[$this->hhh . 'secondsDebugging' . $this->hhh] = $this->secondsDebugging;
$this->fileContentStatic[$this->hhh . 'planning' . $this->hhh] = $this->secondsPlanning;
$this->fileContentStatic[$this->hhh . 'secondsPlanning' . $this->hhh] = $this->secondsPlanning;
$this->fileContentStatic[$this->hhh . 'mapping' . $this->hhh] = $this->secondsMapping;
$this->fileContentStatic[$this->hhh . 'secondsMapping' . $this->hhh] = $this->secondsMapping;
$this->fileContentStatic[$this->hhh . 'office' . $this->hhh] = $this->secondsOffice;
$this->fileContentStatic[$this->hhh . 'secondsOffice' . $this->hhh] = $this->secondsOffice;
$this->fileContentStatic[$this->hhh . 'actualTotalHours' . $this->hhh] = $this->actualTotalHours;
$this->fileContentStatic[$this->hhh . 'actualTotalDays' . $this->hhh] = $this->actualTotalDays;
$this->fileContentStatic[$this->hhh . 'debuggingHours' . $this->hhh] = $this->debuggingHours;
$this->fileContentStatic[$this->hhh . 'planningHours' . $this->hhh] = $this->planningHours;
$this->fileContentStatic[$this->hhh . 'mappingHours' . $this->hhh] = $this->mappingHours;
$this->fileContentStatic[$this->hhh . 'officeHours' . $this->hhh] = $this->officeHours;
$this->fileContentStatic[$this->hhh . 'actualHoursSpent' . $this->hhh] = $this->actualHoursSpent;
$this->fileContentStatic[$this->hhh . 'actualDaysSpent' . $this->hhh] = $this->actualDaysSpent;
$this->fileContentStatic[$this->hhh . 'projectWeekTime' . $this->hhh] = $this->projectWeekTime;
$this->fileContentStatic[$this->hhh . 'projectMonthTime' . $this->hhh] = $this->projectMonthTime;
}
private function zipComponent()

View File

@ -18,6 +18,27 @@ defined('_JEXEC') or die('Restricted access');
class Get
{
/**
* The hash placeholder
*
* @var string
*/
public $hhh = '#' . '#' . '#';
/**
* The open bracket placeholder
*
* @var string
*/
public $bbb = '[' . '[' . '[';
/**
* The close bracket placeholder
*
* @var string
*/
public $ddd = ']' . ']' . ']';
/**
* The app
*
@ -466,6 +487,34 @@ class Get
*/
public $catOtherName = array();
/**
* The field relations values
*
* @var array
*/
public $fieldRelations = array();
/**
* Default Fields
*
* @var array
*/
public $defaultFields = array('created', 'created_by', 'modified', 'modified_by', 'published', 'ordering', 'access', 'version', 'hits', 'id');
/**
* The list join fields
*
* @var array
*/
public $listJoinBuilder = array();
/**
* The list head over ride
*
* @var array
*/
public $listHeadOverRide = array();
/**
* The linked admin view tabs
*
@ -620,7 +669,21 @@ class Get
*/
public $setTidyWarning = false;
/* * *
/**
* Tab/spacer bucket (to speed-up the build)
*
* @var array
*/
public $tabSpacerBucket = array();
/**
* Set tab/spacer
*
* @var string
*/
public $tabSpacer = "\t";
/**
* Constructor
*/
@ -710,6 +773,26 @@ class Get
return false;
}
/**
* Set the tab/space
*
* @param int $nr The number of tag/space
*
* @return string
*
*/
public function _t($nr)
{
// check if we already have the string
if (!isset($this->tabSpacerBucket[$nr]))
{
// get the string
$this->tabSpacerBucket[$nr] = str_repeat($this->tabSpacer, (int) $nr);
}
// return stored string
return $this->tabSpacerBucket[$nr];
}
/**
* Set the line number in comments
*
@ -834,12 +917,12 @@ class Get
$component = ComponentbuilderHelper::convertRepeatableFields($component, $searchRepeatables, $updater);
// set component place holders
$this->placeholders['###component###'] = ComponentbuilderHelper::safeString($component->name_code);
$this->placeholders['###Component###'] = ComponentbuilderHelper::safeString($component->name_code, 'F');
$this->placeholders['###COMPONENT###'] = ComponentbuilderHelper::safeString($component->name_code, 'U');
$this->placeholders['[[[component]]]'] = $this->placeholders['###component###'];
$this->placeholders['[[[Component]]]'] = $this->placeholders['###Component###'];
$this->placeholders['[[[COMPONENT]]]'] = $this->placeholders['###COMPONENT###'];
$this->placeholders[$this->hhh . 'component' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code);
$this->placeholders[$this->hhh . 'Component' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code, 'F');
$this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code, 'U');
$this->placeholders[$this->bbb . 'component' . $this->ddd] = $this->placeholders[$this->hhh . 'component' . $this->hhh];
$this->placeholders[$this->bbb . 'Component' . $this->ddd] = $this->placeholders[$this->hhh . 'Component' . $this->hhh];
$this->placeholders[$this->bbb . 'COMPONENT' . $this->ddd] = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh];
// set component sales name
$component->sales_name = ComponentbuilderHelper::safeString($component->system_name);
@ -873,6 +956,35 @@ class Get
// set the uikit switch
$this->uikit = $component->adduikit;
// set whmcs links if needed
if (1 == $component->add_license && (!isset($component->whmcs_buy_link) || !ComponentbuilderHelper::checkString($component->whmcs_buy_link)))
{
// update with the whmcs url
if (isset($component->whmcs_url) && ComponentbuilderHelper::checkString($component->whmcs_url))
{
$component->whmcs_buy_link = $component->whmcs_url;
}
// use the company website
elseif (isset($component->website) && ComponentbuilderHelper::checkString($component->website))
{
$component->whmcs_buy_link = $component->website;
$component->whmcs_url = rtrim($component->website, '/').'/whmcs';
}
// none set
else
{
$component->whmcs_buy_link = '#';
$component->whmcs_url = '#';
}
}
// since the license details are not set clear
elseif (0 == $component->add_license)
{
$component->whmcs_key = '';
$component->whmcs_buy_link = '';
$component->whmcs_url = '';
}
// set the footable switch
if ($component->addfootable)
{
@ -1319,18 +1431,21 @@ class Get
'b.addfields',
'b.id',
'c.addconditions',
'c.id'
'c.id',
'r.addrelations'
), array(
'addfields',
'addfields_id',
'addconditions',
'addconditions_id'
'addconditions_id',
'addrelations'
)
)
);
$query->from('#__componentbuilder_admin_view AS a');
$query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields', 'b') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('b.admin_view') . ')');
$query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_conditions', 'c') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('c.admin_view') . ')');
$query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_relations', 'r') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('r.admin_view') . ')');
$query->where($this->db->quoteName('a.id') . ' = ' . (int) $id);
// Reset the query using our newly populated query object.
@ -1376,18 +1491,18 @@ class Get
$this->customScriptBuilder['token'][$name_single] = false;
$this->customScriptBuilder['token'][$name_list] = false;
// set some placeholders
$this->placeholders['###view###'] = ComponentbuilderHelper::safeString($name_single);
$this->placeholders['###views###'] = ComponentbuilderHelper::safeString($name_list);
$this->placeholders['###View###'] = ComponentbuilderHelper::safeString($name_single, 'F');
$this->placeholders['###Views###'] = ComponentbuilderHelper::safeString($name_list, 'F');
$this->placeholders['###VIEW###'] = ComponentbuilderHelper::safeString($name_single, 'U');
$this->placeholders['###VIEWS###'] = ComponentbuilderHelper::safeString($name_list, 'U');
$this->placeholders['[[[view]]]'] = $this->placeholders['###view###'];
$this->placeholders['[[[views]]]'] = $this->placeholders['###views###'];
$this->placeholders['[[[View]]]'] = $this->placeholders['###View###'];
$this->placeholders['[[[Views]]]'] = $this->placeholders['###Views###'];
$this->placeholders['[[[VIEW]]]'] = $this->placeholders['###VIEW###'];
$this->placeholders['[[[VIEWS]]]'] = $this->placeholders['###VIEWS###'];
$this->placeholders[$this->hhh . 'view' . $this->hhh] = ComponentbuilderHelper::safeString($name_single);
$this->placeholders[$this->hhh . 'views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list);
$this->placeholders[$this->hhh . 'View' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'F');
$this->placeholders[$this->hhh . 'Views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'F');
$this->placeholders[$this->hhh . 'VIEW' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'U');
$this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'U');
$this->placeholders[$this->bbb . 'view' . $this->ddd] = $this->placeholders[$this->hhh . 'view' . $this->hhh];
$this->placeholders[$this->bbb . 'views' . $this->ddd] = $this->placeholders[$this->hhh . 'views' . $this->hhh];
$this->placeholders[$this->bbb . 'View' . $this->ddd] = $this->placeholders[$this->hhh . 'View' . $this->hhh];
$this->placeholders[$this->bbb . 'Views' . $this->ddd] = $this->placeholders[$this->hhh . 'Views' . $this->hhh];
$this->placeholders[$this->bbb . 'VIEW' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEW' . $this->hhh];
$this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh];
// add the tables
$view->addtables = (isset($view->addtables) && ComponentbuilderHelper::checkJson($view->addtables)) ? json_decode($view->addtables, true) : null;
if (ComponentbuilderHelper::checkArray($view->addtables))
@ -1432,112 +1547,123 @@ class Get
$view->addfields = (isset($view->addfields) && ComponentbuilderHelper::checkJson($view->addfields)) ? json_decode($view->addfields, true) : null;
if (ComponentbuilderHelper::checkArray($view->addfields))
{
$ignoreFields = array();
// load the field data
$view->fields = array_map(function($field) use($name_single, $name_list, &$ignoreFields)
{
// set hash
static $hash = 123467890; // (TODO) I found this making duplicates
// load hash
$field['hash'] = md5($field['field'] . $hash);
// increment hash
$hash++;
// set the settings
$field['settings'] = $this->getFieldData($field['field'], $name_single, $name_list);
// set real field name
$field['base_name'] = $this->getFieldName($field);
// set code name for field type
$field['type_name'] = $this->getFieldType($field);
// check if value is array
if (isset($field['permission']) && !ComponentbuilderHelper::checkArray($field['permission']) && is_numeric($field['permission']) && $field['permission'] > 0)
{
$field['permission'] = array($field['permission']);
}
// check if this field is a default field OR
// check if this is none database related field
if (in_array($field['base_name'], $this->defaultFields) ||
ComponentbuilderHelper::fieldCheck($field['type_name'], 'spacer') ||
(isset($field['list']) && $field['list'] == 2)) // 2 = none database
{
$ignoreFields[$field['field']] = $field['field'];
}
// set unigue name keeper
$this->setUniqueNameCounter($field['base_name'], $name_list);
// return field
return $field;
}, array_values($view->addfields));
// build update SQL
if ($old_view = $this->getHistoryWatch('admin_fields', $view->addfields_id))
{
// add new fields were added
if (isset($old_view->addfields) && ComponentbuilderHelper::checkJson($old_view->addfields))
{
$this->setUpdateSQL(json_decode($old_view->addfields, true), $view->addfields, 'field', $name_single);
$this->setUpdateSQL(json_decode($old_view->addfields, true), $view->addfields, 'field', $name_single, $ignoreFields);
}
// clear this data
unset($old_view);
}
if (ComponentbuilderHelper::checkArray($view->addfields))
// sort the fields acording to order
usort($view->fields, function($a, $b)
{
// load the field data
$view->fields = array_map(function($field) use($name_single, $name_list)
if (isset($a['order_list']) && isset($b['order_list']))
{
// set hash
static $hash = 123467890; // (TODO) I found this making duplicates
// load hash
$field['hash'] = md5($field['field'] . $hash);
// increment hash
$hash++;
// set the settings
$field['settings'] = $this->getFieldData($field['field'], $name_single, $name_list);
// set real field name
$field['base_name'] = $this->getFieldName($field);
// set unigue name keeper
$this->setUniqueNameCounter($field['base_name'], $name_list);
// return field
return $field;
}, array_values($view->addfields));
// sort the fields acording to order
usort($view->fields, function($a, $b)
{
if (isset($a['order_list']) && isset($b['order_list']))
if ($a['order_list'] != 0 && $b['order_list'] != 0)
{
return $a['order_list'] - $b['order_list'];
}
elseif ($b['order_list'] != 0 && $a['order_list'] == 0)
{
if ($a['order_list'] != 0 && $b['order_list'] != 0)
{
return $a['order_list'] - $b['order_list'];
}
elseif ($b['order_list'] != 0 && $a['order_list'] == 0)
{
return 1;
}
elseif ($a['order_list'] != 0 && $b['order_list'] == 0)
{
return 0;
}
return 1;
}
return 0;
});
// do some house cleaning (for fields)
foreach ($view->fields as $field)
{
// so first we lock the field name in
$field_name = $this->getFieldName($field, $name_list);
// check if the field changed since the last compilation
if (ComponentbuilderHelper::checkObject($field['settings']->history))
elseif ($a['order_list'] != 0 && $b['order_list'] == 0)
{
// check if the datatype changed
if (isset($field['settings']->history->datatype))
return 0;
}
return 1;
}
return 0;
});
// do some house cleaning (for fields)
foreach ($view->fields as $field)
{
// so first we lock the field name in
$field_name = $this->getFieldName($field, $name_list);
// check if the field changed since the last compilation (default fields never change and are always added)
if (!isset($ignoreFields[$field['field']]) && ComponentbuilderHelper::checkObject($field['settings']->history))
{
// check if the datatype changed
if (isset($field['settings']->history->datatype))
{
$this->setUpdateSQL($field['settings']->history->datatype, $field['settings']->datatype, 'field.datatype', $name_single . '.' . $field_name);
}
// check if the datatype lenght changed
if (isset($field['settings']->history->datalenght) && isset($field['settings']->history->datalenght_other))
{
$this->setUpdateSQL($field['settings']->history->datalenght . $field['settings']->history->datalenght_other, $field['settings']->datalenght . $field['settings']->datalenght_other, 'field.lenght', $name_single . '.' . $field_name);
}
// check if the name changed
if (isset($field['settings']->history->xml) && ComponentbuilderHelper::checkJson($field['settings']->history->xml))
{
// only run if this is not an alias or a tag
if ((!isset($field['alias']) || !$field['alias']) && 'tag' !== $field['settings']->type_name)
{
$this->setUpdateSQL($field['settings']->history->datatype, $field['settings']->datatype, 'field.datatype', $name_single . '.' . $field_name);
}
// check if the datatype lenght changed
if (isset($field['settings']->history->datalenght) && isset($field['settings']->history->datalenght_other))
{
$this->setUpdateSQL($field['settings']->history->datalenght . $field['settings']->history->datalenght_other, $field['settings']->datalenght . $field['settings']->datalenght_other, 'field.lenght', $name_single . '.' . $field_name);
}
// check if the name changed
if (isset($field['settings']->history->xml) && ComponentbuilderHelper::checkJson($field['settings']->history->xml))
{
// only run if this is not an alias or a tag
if ((!isset($field['alias']) || !$field['alias']) && 'tag' !== $field['settings']->type_name)
{
// build temp field bucket
$tmpfield = array();
$tmpfield['settings'] = new stdClass();
// convert the xml json string to normal string
$tmpfield['settings']->xml = $this->setDynamicValues(json_decode($field['settings']->history->xml));
// add properties from current field as it is generic
$tmpfield['settings']->properties = $field['settings']->properties;
// add the old name
$tmpfield['settings']->name = $field['settings']->history->name;
// add the field type from current field since it is generic
$tmpfield['settings']->type_name = $field['settings']->type_name;
// get the old name
$old_field_name = $this->getFieldName($tmpfield);
// build temp field bucket
$tmpfield = array();
$tmpfield['settings'] = new stdClass();
// convert the xml json string to normal string
$tmpfield['settings']->xml = $this->setDynamicValues(json_decode($field['settings']->history->xml));
// add properties from current field as it is generic
$tmpfield['settings']->properties = $field['settings']->properties;
// add the old name
$tmpfield['settings']->name = $field['settings']->history->name;
// add the field type from current field since it is generic
$tmpfield['settings']->type_name = $field['settings']->type_name;
// get the old name
$old_field_name = $this->getFieldName($tmpfield);
// only run this if not a multi field
if (!isset($this->uniqueNames[$name_list]['names'][$field_name]))
{
// this only works when the field is not multiple of the same field
$this->setUpdateSQL($old_field_name, $field_name, 'field.name', $name_single . '.' . $field_name);
}
elseif ($old_field_name !== $field_name)
{
// give a notice atleast that the multi fields could have changed and no DB update was done
$this->app->enqueueMessage(JText::sprintf('You have a field called <b>%s</b> that has been added multiple times to the <b>%s</b> view, the name of that field has changed to <b>%s</b>. Normaly we would automaticly add the update SQL to your component, but with multiple fields this does not work automaticly since it could be that noting changed and it just seems like it did. Therefore you will have to do this manualy if it actualy did change!', $field_name, $name_single, $old_field_name), 'Notice');
}
// remove tmp
unset($tmpfield);
// only run this if not a multi field
if (!isset($this->uniqueNames[$name_list]['names'][$field_name]))
{
// this only works when the field is not multiple of the same field
$this->setUpdateSQL($old_field_name, $field_name, 'field.name', $name_single . '.' . $field_name);
}
elseif ($old_field_name !== $field_name)
{
// give a notice atleast that the multi fields could have changed and no DB update was done
$this->app->enqueueMessage(JText::sprintf('You have a field called <b>%s</b> that has been added multiple times to the <b>%s</b> view, the name of that field has changed to <b>%s</b>. Normaly we would automaticly add the update SQL to your component, but with multiple fields this does not work automaticly since it could be that noting changed and it just seems like it did. Therefore you will have to do this manualy if it actualy did change!', $field_name, $name_single, $old_field_name), 'Notice');
}
// remove tmp
unset($tmpfield);
}
}
}
@ -1603,7 +1729,7 @@ class Get
$conditionValue['match_type'] = $type;
$conditionValue['match_xml'] = $fieldValue['settings']->xml;
// if custom field load field being extended
if (!ComponentbuilderHelper::typeField($type))
if (!ComponentbuilderHelper::fieldCheck($type))
{
$conditionValue['match_extends'] = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml, 'extends="', '"');
}
@ -1621,6 +1747,58 @@ class Get
}
}
unset($view->addconditions);
// prep the buckets
$this->fieldRelations[$name_list] = array();
$this->listJoinBuilder[$name_list] = array();
$this->listHeadOverRide[$name_list] = array();
// set the relations
$view->addrelations = (isset($view->addrelations) && ComponentbuilderHelper::checkJson($view->addrelations)) ? json_decode($view->addrelations, true) : null;
if (ComponentbuilderHelper::checkArray($view->addrelations))
{
foreach ($view->addrelations as $nr => $relationsValue)
{
// only add if list view field is selected and joind fields are set
if (isset($relationsValue['listfield']) && is_numeric($relationsValue['listfield']) && $relationsValue['listfield'] > 0 &&
isset($relationsValue['area']) && is_numeric($relationsValue['area']) && $relationsValue['area'] > 0)
{
// do a dynamic update on the set values
if (isset($relationsValue['set']) && ComponentbuilderHelper::checkString($relationsValue['set']))
{
$relationsValue['set'] = $this->setDynamicValues($relationsValue['set']);
}
// check that the arrays are set
if (!isset($this->fieldRelations[$name_list][(int) $relationsValue['listfield']]) || !ComponentbuilderHelper::checkArray($this->fieldRelations[$name_list][(int) $relationsValue['listfield']]))
{
$this->fieldRelations[$name_list][(int) $relationsValue['listfield']] = array();
}
// load the field relations
$this->fieldRelations[$name_list][ (int) $relationsValue['listfield']][ (int) $relationsValue['area']] = $relationsValue;
// load the list joints
if (isset($relationsValue['joinfields']) && ComponentbuilderHelper::checkArray($relationsValue['joinfields']))
{
foreach ($relationsValue['joinfields'] as $join)
{
$this->listJoinBuilder[$name_list][(int) $join] = (int) $join;
}
}
// set header over-ride
if (isset($relationsValue['column_name']) && ComponentbuilderHelper::checkString($relationsValue['column_name']))
{
$check_column_name = trim(strtolower($relationsValue['column_name']));
// confirm it should really make the over ride
if ('default' !== $check_column_name)
{
$column_name_lang = ComponentbuilderHelper::safeString($name_list, 'U') . '_' . ComponentbuilderHelper::safeString($relationsValue['column_name'], 'U');
$this->langContent['admin'][$column_name_lang] = trim($relationsValue['column_name']);
$this->listHeadOverRide[$name_list][(int) $relationsValue['listfield']] = $column_name_lang;
}
}
}
}
}
unset($view->addrelations);
// set linked views
$this->linkedAdminViews[$name_single] = null;
$view->addlinked_views = (isset($view->addlinked_views) && ComponentbuilderHelper::checkJson($view->addlinked_views)) ? json_decode($view->addlinked_views, true) : null;
@ -1678,7 +1856,7 @@ class Get
}
}
// add_php
$addArrayP = array('php_getitem', 'php_before_save', 'php_save', 'php_postsavehook', 'php_getitems', 'php_getitems_after_all', 'php_getlistquery', 'php_allowedit', 'php_before_delete', 'php_after_delete', 'php_before_publish', 'php_after_publish', 'php_batchcopy', 'php_batchmove', 'php_document');
$addArrayP = array('php_getitem', 'php_before_save', 'php_save', 'php_getform', 'php_postsavehook', 'php_getitems', 'php_getitems_after_all', 'php_getlistquery', 'php_allowedit', 'php_before_delete', 'php_after_delete', 'php_before_publish', 'php_after_publish', 'php_batchcopy', 'php_batchmove', 'php_document');
foreach ($addArrayP as $scripter)
{
if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1)
@ -1819,18 +1997,18 @@ class Get
}
}
// clear placeholders
unset($this->placeholders['###view###']);
unset($this->placeholders['###views###']);
unset($this->placeholders['###View###']);
unset($this->placeholders['###Views###']);
unset($this->placeholders['###VIEW###']);
unset($this->placeholders['###VIEWS###']);
unset($this->placeholders['[[[view]]]']);
unset($this->placeholders['[[[views]]]']);
unset($this->placeholders['[[[View]]]']);
unset($this->placeholders['[[[Views]]]']);
unset($this->placeholders['[[[VIEW]]]']);
unset($this->placeholders['[[[VIEWS]]]']);
unset($this->placeholders[$this->hhh . 'view' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'views' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'View' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'Views' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'VIEW' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]);
unset($this->placeholders[$this->bbb . 'view' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'views' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'View' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'Views' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'VIEW' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'VIEWS' . $this->ddd]);
// store this view to class object
$this->_adminViewData[$id] = $view;
@ -2163,7 +2341,7 @@ class Get
if ($this->validationRules[$validationRule] = ComponentbuilderHelper::getVar('validation_rule', $validationRule, 'name', 'php'))
{
// open and set the validation rule
$this->validationRules[$validationRule] = $this->setDynamicValues(base64_decode($this->validationRules[$validationRule]));
$this->validationRules[$validationRule] = $this->setPlaceholders($this->setDynamicValues(base64_decode($this->validationRules[$validationRule])), $this->placeholders);
}
else
{
@ -2343,6 +2521,11 @@ class Get
*/
public function getFieldType(&$field)
{
// check if we have done this already
if (isset($field['type_name']))
{
return $field['type_name'];
}
// set the type name
$type_name = ComponentbuilderHelper::safeString($field['settings']->type_name);
// check that we have the poperties
@ -2352,16 +2535,17 @@ class Get
{
if ($property['name'] === 'type')
{
// if custom (we must use the xml value)
if ($type_name === 'custom' || $type_name === 'customuser')
{
$type = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($field['settings']->xml, 'type="', '"'));
}
// use field core type
elseif (ComponentbuilderHelper::checkString($type_name))
// use field core type (name)
elseif (ComponentbuilderHelper::checkString($type_name) || (isset($property['example']) && ComponentbuilderHelper::checkString($property['example']) && $property['adjustable'] == 0))
{
$type = $type_name;
}
// make sure none adjustable fields are set (should be same as above)
// make sure none adjustable fields are set (should be same as above) (TODO) hmmm we need look at this again
elseif (isset($property['example']) && ComponentbuilderHelper::checkString($property['example']) && $property['adjustable'] == 0)
{
$type = $property['example'];
@ -2867,11 +3051,12 @@ class Get
* @param mix $new The new values
* @param string $type The type of values
* @param int $key The id/key where values changed
* @param array $ignore The ids to ignore
*
* @return void
*
*/
protected function setUpdateSQL($old, $new, $type, $key = null)
protected function setUpdateSQL($old, $new, $type, $key = null, $ignore = null)
{
// check if there were new items added
if (ComponentbuilderHelper::checkArray($new) && ComponentbuilderHelper::checkArray($old))
@ -2882,8 +3067,14 @@ class Get
foreach ($new[$type] as $item)
{
$newItem = true;
// check if this is an id to ignore
if (ComponentbuilderHelper::checkArray($ignore) && in_array($item, $ignore))
{
// don't add ignored ids
$newItem = false;
}
// check if this is old repeatable field
if (isset($old[$type]) && ComponentbuilderHelper::checkArray($old[$type]))
elseif (isset($old[$type]) && ComponentbuilderHelper::checkArray($old[$type]))
{
if (!in_array($item, $old[$type]))
{
@ -2929,12 +3120,18 @@ class Get
{
foreach ($new as $item)
{
// search to see if this is a new value
$newItem = true;
if (isset($item[$type]))
{
// search to see if this is a new value
$newItem = true;
// check if this is an id to ignore
if (ComponentbuilderHelper::checkArray($ignore) && in_array($item[$type], $ignore))
{
// don't add ignored ids
$newItem = false;
}
// check if this is old repeatable field
if (isset($old[$type]) && ComponentbuilderHelper::checkArray($old[$type]))
elseif (isset($old[$type]) && ComponentbuilderHelper::checkArray($old[$type]))
{
if (in_array($item[$type], $old[$type]))
{
@ -2965,16 +3162,12 @@ class Get
{
$newItem = false;
}
}
else
{
break;
}
// add if new
if ($newItem)
{
// we have a new item, lets add to SQL
$this->setAddSQL($type, $item[$type], $key);
// add if new
if ($newItem)
{
// we have a new item, lets add to SQL
$this->setAddSQL($type, $item[$type], $key);
}
}
}
}
@ -3605,7 +3798,7 @@ class Get
if (ComponentbuilderHelper::checkArray($langStringTargets))
{
// insure string is not broken
$content = str_replace('COM_###COMPONENT###', $this->langPrefix, $content);
$content = str_replace('COM_' . $this->hhh . 'COMPONENT' . $this->hhh, $this->langPrefix, $content);
// reset some buckets
$langHolders = array();
$langCheck = array();
@ -3731,7 +3924,7 @@ class Get
* @param string $method_key The method unique key
* @param string $view_code The code name of the view
* @param string $string The data string
* @param string || INT $asset The asset in question
* @param string $asset The asset in question
* @param string $as The as string
* @param int $row_type The row type
* @param string $type The target type (db||view)
@ -3765,20 +3958,19 @@ class Get
{
if (strpos($line, 'AS') !== false)
{
list($get, $key) = explode("AS", $line);
$lineArray = explode("AS", $line);
}
elseif (strpos($line, 'as') !== false)
{
list($get, $key) = explode("as", $line);
$lineArray = explode("as", $line);
}
else
{
$get = $line;
$key = null;
$lineArray = array($line, null);
}
// set the get and key
$get = trim($get);
$key = trim($key);
$get = trim($lineArray[0]);
$key = trim($lineArray[1]);
// only add the view (we must adapt this)
if (isset($this->getAsLookup[$method_key][$get]) && 'a' != $as && 1 == $row_type && 'view' === $type && strpos('#' . $key, '#' . $view . '_') === false)
{
@ -3800,16 +3992,24 @@ class Get
$this->getAsLookup[$method_key][$get] = $key;
$keys[] = $this->db->quote($key);
}
// make sure we have the view name
if (ComponentbuilderHelper::checkString($view))
{
// prep the field name
$field = str_replace($as . '.', '', $get);
$this->siteFields[$view][$field][$method_key] = array('site' => $view_code, 'get' => $get, 'as' => $as, 'key' => $key);
// make sure the array is set
if (!isset($this->siteFields[$view][$field]))
{
$this->siteFields[$view][$field] = array();
}
// load to the site fields memory bucket
$this->siteFields[$view][$field][$method_key . '___' . $as] = array('site' => $view_code, 'get' => $get, 'as' => $as, 'key' => $key);
}
}
}
if (ComponentbuilderHelper::checkArray($gets) && ComponentbuilderHelper::checkArray($keys))
{
$querySelect = '$query->select($db->quoteName(' . PHP_EOL . "\t\t\t" . 'array(' . implode(',', $gets) . '),' . PHP_EOL . "\t\t\t" . 'array(' . implode(',', $keys) . ')));';
$querySelect = '$query->select($db->quoteName(' . PHP_EOL . $this->_t(3) . 'array(' . implode(',', $gets) . '),' . PHP_EOL . $this->_t(3) . 'array(' . implode(',', $keys) . ')));';
$queryFrom = '$db->quoteName(' . $this->db->quote($table) . ', ' . $this->db->quote($as) . ')';
// return the select query
return array('select' => $querySelect, 'from' => $queryFrom, 'name' => $queryName, 'table' => $table, 'type' => $type, 'select_gets' => $gets, 'select_keys' => $keys);
@ -3938,9 +4138,9 @@ class Get
$data = $this->db->loadObjectList();
// start building the MySql dump
$dump = "--";
$dump .= PHP_EOL . "-- Dumping data for table `#__[[[component]]]_" . $view . "`";
$dump .= PHP_EOL . "-- Dumping data for table `#__" . $this->bbb . "component" . $this->ddd . "_" . $view . "`";
$dump .= PHP_EOL . "--";
$dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__[[[component]]]_" . $view . "` (";
$dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__" . $this->bbb . "component" . $this->ddd . "_" . $view . "` (";
foreach ($data as $line)
{
$comaSet = 0;
@ -4442,7 +4642,7 @@ class Get
}
// check what type of place holders we should load here
$placeholderType = (int) $item['comment_type'] . '2';
if (stripos($item['code'], '[[[view') !== false || stripos($item['code'], '[[[sview') !== false || stripos($item['code'], '[[[arg') !== false)
if (stripos($item['code'], $this->bbb . 'view') !== false || stripos($item['code'], $this->bbb . 'sview') !== false || stripos($item['code'], $this->bbb . 'arg') !== false)
{
// if view is being set dynamicly then we can't update this code via IDE (TODO)
$placeholderType = 3;
@ -4472,7 +4672,7 @@ class Get
$number = 0;
foreach ($values as $value)
{
$this->placeholders['[[[' . $key . $number . ']]]'] = $value;
$this->placeholders[$this->bbb . $key . $number . $this->ddd] = $value;
$number++;
}
}
@ -5043,9 +5243,9 @@ class Get
$fileTypes = array('\.php', '\.js');
// set some local placeholders
$placeholders = array();
$placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = '[[[Component]]]Helper::';
$placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_[[[COMPONENT]]]';
$placeholders['com_' . $this->componentCodeName] = 'com_[[[component]]]';
$placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = $this->bbb . 'Component' . $this->ddd . 'Helper::';
$placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_' . $this->bbb . 'COMPONENT' . $this->ddd;
$placeholders['com_' . $this->componentCodeName] = 'com_' . $this->bbb . 'component' . $this->ddd;
foreach ($paths as $target => $path)
{
// we are changing the working directory to the componet path
@ -5760,7 +5960,7 @@ class Get
return round($val1 + $val2);
break;
// Subtract one number from the other
case 'add':
case 'sub':
return round($val1 - $val2);
break;
}

View File

@ -490,11 +490,11 @@ class Structure extends Get
if ($addLocalFolder)
{
// check if we sould add it to the media xml list
if (!isset($this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = '';
}
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $libFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= PHP_EOL . $this->_t(2) . "<folder>" . $libFolder . "</folder>";
}
}
// if config fields are found load into component config (avoiding dublicates)
@ -755,9 +755,10 @@ class Structure extends Get
// do license check
$LICENSE = false;
$licenseChecker = strtolower($this->componentData->license);
if (strpos($licenseChecker, 'gnu') !== false && strpos($licenseChecker, 'gpl') !== false)
if (strpos($licenseChecker, 'gnu') !== false && strpos($licenseChecker, '2') !== false &&
(strpos($licenseChecker, 'gpl') !== false || strpos($licenseChecker, 'general public license') !== false))
{
$LICENSE = true;
$LICENSE = true; // we only add version 2 auto at this time (TODO)
}
// do README check
$README = false;
@ -890,20 +891,20 @@ class Structure extends Get
if ($view['settings']->name_list != 'null')
{
$target = array('admin' => $view['settings']->name_list);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
if ($view['settings']->name_single != 'null')
{
$target = array('admin' => $view['settings']->name_single);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
{
// setup the front site edit-view files
$target = array('site' => $view['settings']->name_single);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'edit', false, $config);
}
}
@ -927,14 +928,14 @@ class Structure extends Get
{
// set list view
$target = array('site' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
elseif ($view['settings']->main_get->gettype == 1)
{
// set single view
$target = array('site' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
}
@ -950,14 +951,14 @@ class Structure extends Get
{
// set list view$view
$target = array('custom_admin' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
elseif ($view['settings']->main_get->gettype == 1)
{
// set single view
$target = array('custom_admin' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
}
@ -1278,31 +1279,31 @@ class Structure extends Get
$newname = '';
}
// check if we sould add it to the media xml list
if (!isset($this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = '';
}
if (count($pathArray) == 1 && $firstFolder === 'media')
{
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= PHP_EOL . $this->_t(2) . "<folder>" . $lastFolder . "</folder>";
}
// check if we sould add it to the site xml list
if (!isset($this->fileContentStatic['###EXSTRA_SITE_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh] = '';
}
if (count($pathArray) == 1 && $firstFolder === 'site')
{
$this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh] .= PHP_EOL . $this->_t(2) . "<folder>" . $lastFolder . "</folder>";
}
// check if we sould add it to the admin xml list
if (!isset($this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh] = '';
}
if (count($pathArray) == 1 && $firstFolder === 'admin')
{
$this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] .= PHP_EOL . "\t\t\t<folder>" . $lastFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh] .= PHP_EOL . $this->_t(3) . "<folder>" . $lastFolder . "</folder>";
}
// make we have not duplicates
$key_pointer = ComponentbuilderHelper::safeString($custom['folder']) . '_f' . $pointer_tracker;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1801,7 +1801,7 @@ abstract class ComponentbuilderHelper
return $sufix === "" || ($sufix == substr(strrchr($file, "."), -strlen($sufix)));
}
public static function imageInfo($path,$request = 'type')
public static function imageInfo($path, $request = 'type')
{
// set image
$image = JPATH_SITE.'/'.$path;
@ -1914,37 +1914,79 @@ abstract class ComponentbuilderHelper
return array_unique($bucket);
}
public static function typeField($type,$option = 'default')
/**
* Field Grouping https://docs.joomla.org/Form_field
**/
protected static $fieldGroups = array(
'default' => array(
'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox',
'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor',
'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file',
'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite',
'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password',
'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag',
'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag',
'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup'
),
'plain' => array(
'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color',
'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors',
'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite',
'hidden', 'imagelist', 'integer', 'language', 'media', 'menu',
'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules',
'sessionhandler', 'tag', 'tel', 'text', 'textarea',
'timezone', 'url', 'user', 'usergroup'
),
'text' => array(
'calendar','color','editor','email','password','tel','text','textarea','url','number','range'
),
'list' => array(
'checkboxes','checkbox','list','radio'
),
'dynamic' => array(
'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter'
),
'spacer' => array(
'note', 'spacer'
),
'option' => array(
'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql'
),
'special' => array(
'contentlanguage', 'groupedlist', 'moduleposition', 'plugin',
'repeatable', 'templatestyle', 'subform'
)
);
/**
* Field Checker
*
* @param string $type The field type
* @param boolean $option The field grouping
*
* @return boolean if the field was found
*/
public static function fieldCheck($type, $option = 'default')
{
// list of default fields
// https://docs.joomla.org/Form_field
$fields = array(
'default' => array(
'accesslevel','cachehandler','calendar','captcha','category','checkbox',
'checkboxes','color','combo','componentlayout','contentlanguage','editor',
'chromestyle','contenttype','databaseconnection','editors','email','file',
'filelist','folderlist','groupedlist','hidden','file','headertag','helpsite',
'imagelist','integer','language','list','media','menu','note','password',
'plugins','range','radio','repeatable','rules','subform','sessionhandler','spacer','sql','tag',
'tel','menuitem','modulelayout','meter','moduleorder','moduleposition','moduletag',
'templatestyle','text','textarea','timezone','url','user','usergroup'
),
'text' => array(
'calendar','color','editor','email','password','tel','text','textarea','url','number','range'
),
'list' => array(
'checkboxes','checkbox','list','radio'
),
'dynamic' => array(
'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter'
)
);
if (in_array($type,$fields[$option]))
// now check
if (isset(self::$fieldGroups[$option]) && in_array($type, self::$fieldGroups[$option]))
{
return true;
}
return false;
return false;
}
/**
* get the spacer IDs
*
* @return array ids of the spacer field types
*/
public static function getSpacerIds()
{
// get the database object to use quote
$db = JFactory::getDbo();
return self::getVars('fieldtype', (array) array_map(function($name) use($db) { return $db->quote(ucfirst($name)); }, self::$fieldGroups['spacer']), 'name', 'id');
}
/**
@ -3085,15 +3127,15 @@ abstract class ComponentbuilderHelper
}
/**
* Move File to Server
*
* @param string $localPath The local path to the file
* @param string $fileName The the actual file name
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return bool true on success
* Move File to Server
*
* @param string $localPath The local path to the file
* @param string $fileName The the actual file name
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return bool true on success
**/
public static function moveToServer($localPath, $fileName, $serverID, $protocol = null, $permission = 'core.export')
{
@ -3128,23 +3170,23 @@ abstract class ComponentbuilderHelper
}
/**
* the SFTP objects
* the SFTP objects
**/
protected static $sftp = array();
/**
* the FTP objects
* the FTP objects
**/
protected static $ftp = array();
/**
* get the server object
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success server object
* get the server object
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success server object
**/
public static function getServer($serverID, $protocol = null, $permission = 'core.export')
{
@ -3167,12 +3209,12 @@ abstract class ComponentbuilderHelper
}
/**
* get the sftp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with sftp power
* get the sftp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with sftp power
**/
public static function getSftp($serverID, $permission = 'core.export')
{
@ -3326,12 +3368,12 @@ abstract class ComponentbuilderHelper
}
/**
* get the JClientFtp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with ftp power
* get the JClientFtp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with ftp power
**/
public static function getFtp($serverID, $permission)
{
@ -3417,13 +3459,13 @@ abstract class ComponentbuilderHelper
}
/**
* get the server details
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success with server details
* get the server details
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success with server details
**/
public static function getServerDetails($serverID, $protocol = 2, $permission = 'core.export')
{
@ -3604,8 +3646,8 @@ abstract class ComponentbuilderHelper
}
/**
* Load the Component Help URLs.
**/
* Load the Component Help URLs.
**/
public static function getHelpUrl($view)
{
$user = JFactory::getUser();
@ -3642,15 +3684,15 @@ abstract class ComponentbuilderHelper
// set joomla article
case 1:
return self::loadArticleLink($help->article);
break;
break;
// set help text
case 2:
return self::loadHelpTextLink($help->id);
break;
break;
// set Link
case 3:
return $help->url;
break;
break;
}
}
}
@ -3659,16 +3701,16 @@ abstract class ComponentbuilderHelper
}
/**
* Get the Article Link.
**/
* Get the Article Link.
**/
protected static function loadArticleLink($id)
{
return JURI::root().'index.php?option=com_content&view=article&id='.$id.'&tmpl=component&layout=modal';
}
/**
* Get the Help Text Link.
**/
* Get the Help Text Link.
**/
protected static function loadHelpTextLink($id)
{
$token = JSession::getFormToken();
@ -3767,8 +3809,8 @@ abstract class ComponentbuilderHelper
}
/**
* UIKIT Component Classes
**/
* UIKIT Component Classes
**/
public static $uk_components = array(
'data-uk-grid' => array(
'grid' ),
@ -3822,15 +3864,15 @@ abstract class ComponentbuilderHelper
'upload-drop' => array(
'upload', 'form-file' )
);
/**
* Add UIKIT Components
**/
* Add UIKIT Components
**/
public static $uikit = false;
/**
* Get UIKIT Components
**/
* Get UIKIT Components
**/
public static function getUikitComp($content,$classes = array())
{
if (strpos($content,'class="uk-') !== false)
@ -3860,7 +3902,7 @@ abstract class ComponentbuilderHelper
}
return $temp;
}
}
}
if (self::checkArray($classes))
{
return $classes;
@ -3896,19 +3938,19 @@ abstract class ComponentbuilderHelper
{
$subjectTab = 'Sheet1';
}
// make sure the file is loaded
// make sure the file is loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
// Create new PHPExcel object
$objPHPExcel = new PHPExcel();
// Set document properties
$objPHPExcel->getProperties()->setCreator($creator)
->setCompany('Joomla Component Builder')
->setLastModifiedBy($modified)
->setTitle($title)
->setSubject($subjectTab);
->setCompany('Joomla Component Builder')
->setLastModifiedBy($modified)
->setTitle($title)
->setSubject($subjectTab);
if (!$description)
{
$objPHPExcel->getProperties()->setDescription($description);
@ -3921,7 +3963,7 @@ abstract class ComponentbuilderHelper
{
$objPHPExcel->getProperties()->setCategory($category);
}
// Some styles
$headerStyles = array(
'font' => array(
@ -3943,7 +3985,7 @@ abstract class ComponentbuilderHelper
'size' => 11,
'name' => 'Verdana'
));
// Add some data
if (self::checkArray($rows))
{
@ -3970,43 +4012,43 @@ abstract class ComponentbuilderHelper
{
return false;
}
// Rename worksheet
$objPHPExcel->getActiveSheet()->setTitle($subjectTab);
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);
// Redirect output to a client's web browser (Excel5)
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$fileName.'.xls"');
header('Cache-Control: max-age=0');
// If you're serving to IE 9, then the following may be needed
header('Cache-Control: max-age=1');
// If you're serving to IE over SSL, then the following may be needed
header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified
header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
header ('Pragma: public'); // HTTP/1.0
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
jexit();
}
/**
* Get CSV Headers
*/
* Get CSV Headers
*/
public static function getFileHeaders($dataType)
{
// make sure these files are loaded
{
// make sure these files are loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
JLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader');
// get session object
$session = JFactory::getSession();
$package = $session->get('package', null);
$package = json_decode($package, true);
$session = JFactory::getSession();
$package = $session->get('package', null);
$package = json_decode($package, true);
// set the headers
if(isset($package['dir']))
{
@ -4184,16 +4226,16 @@ abstract class ComponentbuilderHelper
{
if ($external)
{
if ($name = self::getVar(null, $val, $id, $name, '=', $table))
if ($_name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $name;
$names[] = $_name;
}
}
else
{
if ($name = self::getVar($table, $val, $id, $name))
if ($_name = self::getVar($table, $val, $id, $name))
{
$names[] = $name;
$names[] = $_name;
}
}
}
@ -4583,7 +4625,7 @@ abstract class ComponentbuilderHelper
}
}
// check if there are any view values remaining
if (count($_result))
if (count((array)$_result))
{
$_result = json_encode($_result);
$_result = array($_result);
@ -4777,7 +4819,7 @@ abstract class ComponentbuilderHelper
**/
public static function checkArray($array, $removeEmptyString = false)
{
if (isset($array) && is_array($array) && count($array) > 0)
if (isset($array) && is_array($array) && count((array)$array) > 0)
{
// also make sure the empty strings are removed
if ($removeEmptyString)
@ -4880,7 +4922,7 @@ abstract class ComponentbuilderHelper
{
$initial = strlen($string);
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count($words);
$words_count = count((array)$words);
$word_length = 0;
$last_word = 0;
@ -4915,7 +4957,7 @@ abstract class ComponentbuilderHelper
*
* @returns string on success
**/
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true)
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{
if ($replaceNumbers === true)
{
@ -4944,7 +4986,16 @@ abstract class ComponentbuilderHelper
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
$string = preg_replace("/[^A-Za-z ]/", '', $string);
// remove all and keep only characters
if ($keepOnlyCharacters)
{
$string = preg_replace("/[^A-Za-z ]/", '', $string);
}
// keep both numbers and characters
else
{
$string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
}
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{

View File

@ -28,6 +28,13 @@ abstract class ComponentbuilderEmail
*/
public static $mailer = null;
/**
* Custom Headers
*
* @var array
*/
protected static $header = array();
/**
* Get a configuration object
*
@ -41,7 +48,7 @@ abstract class ComponentbuilderEmail
return self::$config;
}
/**
* Get a mailer object.
*
@ -114,17 +121,17 @@ abstract class ComponentbuilderEmail
$replyto = $conf->get('replyto');
$replytoname = $conf->get('replytoname');
}
// Set global sender
$mail->setSender(array($mailfrom, $fromname));
// set the global reply-to if found
if ($replyto && $replytoname)
{
$mail->ClearReplyTos();
$mail->addReplyTo( array( $replyto, $replytoname ) );
$mail->addReplyTo($replyto, $replytoname);
}
// Set global sender
$mail->setSender(array($mailfrom, $fromname));
// Default mailer is to use PHP's mail function
switch ($mailer)
{
@ -147,6 +154,17 @@ abstract class ComponentbuilderEmail
return $mail;
}
/**
* Set a Mail custom header.
*
* @return void
*/
public static function setHeader($target, $value)
{
// set the header
self::$header[$target] = $value;
}
/**
* Send an email
*
@ -155,16 +173,12 @@ abstract class ComponentbuilderEmail
*/
public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null)
{
// Get a JMail instance
$mail = self::getMailer();
// set component params
$conf = self::getConfig();
// do some house cleaning
$mail->ClearReplyTos();
// set if we have override
if ($mailfrom && $fromname)
{
@ -182,7 +196,16 @@ abstract class ComponentbuilderEmail
{
$mail->addCustomHeader('X-VDMmethodID:'.$idsession);
}
// set headers if found
if (isset(self::$header) && is_array(self::$header) && count((array)self::$header) > 0)
{
foreach (self::$header as $_target => $_value)
{
$mail->addCustomHeader($_target.':'.$_value);
}
}
// set the subject & Body
$mail->setSubject($subject);
$mail->setBody($body);
@ -215,7 +238,7 @@ abstract class ComponentbuilderEmail
if (is_array($mailreply))
{
$mail->ClearReplyTos();
$numReplyTo = count($mailreply);
$numReplyTo = count((array)$mailreply);
for ($i=0; $i < $numReplyTo; $i++)
{
$mail->addReplyTo($mailreply[$i], $replyname[$i]);
@ -226,7 +249,7 @@ abstract class ComponentbuilderEmail
$mail->ClearReplyTos();
$mail->addReplyTo($mailreply, $replyname);
}
// check if we can add the DKIM to email
if ($conf->get('enable_dkim'))
{
@ -244,20 +267,20 @@ abstract class ComponentbuilderEmail
$mail->DKIM_private = $tmp;
}
}
$sendmail = $mail->Send();
if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public')))
{
@unlink($tmp);
}
if (method_exists('ComponentbuilderHelper','storeMessage'))
{
// store the massage if the method is set
ComponentbuilderHelper::storeMessage($sendmail, $recipient, $subject, $body, $textonly, $mode, 'email');
}
return $sendmail;
}

View File

@ -55,32 +55,33 @@ class Mapping
/**
* The needed set of keys needed to set
*/
protected $setting = array('id' => 'default', 'buildcompsql' => 'base64', 'addadmin_views' => 'json', 'name_code' => 'safeString');
protected $setting = array('id' => 'default', 'buildcompsql' => 'base64', 'name_code' => 'safeString');
/**
* The needed set of keys needed to set
*/
protected $notRequiered = array('id', 'asset_id', 'published',
'created_by', 'modified_by', 'created', 'modified', 'checked_out','checked_out_time',
'version', 'hits', 'access', 'ordering',
'metakey', 'metadesc', 'metadata', 'params');
'created_by', 'modified_by', 'created', 'modified', 'checked_out','checked_out_time',
'version', 'hits', 'access', 'ordering',
'metakey', 'metadesc', 'metadata', 'params');
/**
* The datatypes and it linked field types (basic)
* (TODO) We may need to set this dynamicly
*/
protected $dataTypes = array( 'VARCHAR' => 'Text', 'CHAR' => 'Text',
'MEDIUMTEXT' => 'Textarea', 'LONGTEXT' => 'Textarea',
'TEXT' => 'Textarea', 'DATETIME' => 'Calendar',
'DATE' => 'Text', 'TIME' => 'Text', 'TINYINT' => 'Text',
'BIGINT' => 'Text', 'INT' => 'Text', 'FLOAT' => 'Text',
'DECIMAL' => 'Text', 'DOUBLE' => 'Text');
'MEDIUMTEXT' => 'Textarea', 'LONGTEXT' => 'Textarea',
'TEXT' => 'Textarea', 'DATETIME' => 'Calendar',
'DATE' => 'Text', 'TIME' => 'Text', 'TINYINT' => 'Text',
'BIGINT' => 'Text', 'INT' => 'Text', 'FLOAT' => 'Text',
'DECIMAL' => 'Text', 'DOUBLE' => 'Text');
/**
* The datasize identifiers
*/
protected $dataSize = array( 'CHAR', 'VARCHAR', 'INT', 'TINYINT',
'BIGINT', 'FLOAT', 'DECIMAL', 'DOUBLE');
protected $dataSize = array(
'CHAR', 'VARCHAR', 'INT', 'TINYINT',
'BIGINT', 'FLOAT', 'DECIMAL', 'DOUBLE');
/**
* The default identifiers
@ -100,47 +101,62 @@ class Mapping
{
// set the app to insure messages can be set
$this->app = JFactory::getApplication();
if ($data)
// check that we have data
if (ComponentbuilderHelper::checkArray($data))
{
if (isset($data['buildcomp']) && 1 == $data['buildcomp'] && isset($data['buildcompsql']))
// make sure we have an id
if (isset($data['id']) && $data['id'] > 0)
{
foreach ($data as $key => $value)
if (isset($data['buildcomp']) && 1 == $data['buildcomp'] && isset($data['buildcompsql']))
{
if (isset($this->setting[$key]))
foreach ($data as $key => $value)
{
switch($this->setting[$key])
if (isset($this->setting[$key]))
{
case 'base64':
// set needed value
$this->$key = base64_decode($value);
break;
case 'json':
// set needed value
$this->$key = json_decode($value, true);
break;
case 'safeString':
// set needed value
$this->$key = ComponentbuilderHelper::safeString($value);
break;
default :
$this->$key = $value;
break;
switch($this->setting[$key])
{
case 'base64':
// set needed value
$this->$key = base64_decode($value);
break;
case 'json':
// set needed value
$this->$key = json_decode($value, true);
break;
case 'safeString':
// set needed value
$this->$key = ComponentbuilderHelper::safeString($value);
break;
default :
$this->$key = $value;
break;
}
}
}
// get linked admin views
$addadmin_views = ComponentbuilderHelper::getVar('component_admin_views', $data['id'], 'joomla_component', 'addadmin_views');
if (ComponentbuilderHelper::checkJson($addadmin_views))
{
$this->addadmin_views = json_decode($addadmin_views, true);
}
// set the map of the views needed
if ($this->setMap())
{
return true;
}
$this->app->enqueueMessage(
JText::_('No "CREATE TABLE.." were found, please check your sql.'),
'Error'
);
return false;
}
// set the map of the views needed
if ($this->setMap())
{
return true;
}
$this->app->enqueueMessage(
JText::_('No "CREATE TABLE.." were found, please check your sql.'),
'Error'
);
return false;
return false; // not set so just return without any error
}
return false; // not set so just return without any error
$this->app->enqueueMessage(
JText::_('Please try again, this error usualy happens if it is a new component, beacues we need a component ID to do this build with your sql dump.'),
'Error'
);
return false;
}
$this->app->enqueueMessage(
JText::_('Could not find the data needed to continue.'),
@ -148,7 +164,7 @@ class Mapping
);
return false;
}
/**
* The mapping function
* To Map the views and fields that are needed
@ -162,7 +178,8 @@ class Mapping
foreach ($queries as $query)
{
// only use create table queries
if (strpos($query, 'CREATE TABLE IF NOT EXISTS `') !== false)
if (strpos($query, 'CREATE TABLE IF NOT EXISTS') !== false ||
strpos($query, 'CREATE TABLE') !== false)
{
if ($tableName = $this->getTableName($query))
{
@ -198,15 +215,24 @@ class Mapping
}
return false;
}
/**
* Get the table name
*/
protected function getTableName(&$query)
{
$tableName = ComponentbuilderHelper::getBetween($query, '`#__', "`");
if (strpos($query, '`#__') !== false)
{
// get table name
$tableName = ComponentbuilderHelper::getBetween($query, '`#__', "`");
}
elseif (strpos($query, "'#__") !== false)
{
// get table name
$tableName = ComponentbuilderHelper::getBetween($query, "'#__", "'");
}
// if it still was not found
if (!ComponentbuilderHelper::checkString($tableName))
if (!isset($tableName) || !ComponentbuilderHelper::checkString($tableName))
{
// skip this query
return false;
@ -224,13 +250,13 @@ class Mapping
// skip this query
return false;
}
/**
* Get the field details
*/
protected function getFields(&$query)
{
$rows = array_map('trim', explode("\n", $query));
$rows = array_map('trim', explode(PHP_EOL, $query));
$fields = array();
foreach ($rows as $row)
{
@ -299,7 +325,7 @@ class Mapping
}
return false;
}
/**
* Get the field types
*/
@ -318,7 +344,7 @@ class Mapping
}
return false;
}
/**
* Get the field size
*/
@ -330,7 +356,7 @@ class Mapping
}
return '';
}
/**
* Get the field default
*/
@ -348,7 +374,7 @@ class Mapping
}
return '';
}
/**
* Get the field Null Value
*/
@ -366,7 +392,7 @@ class Mapping
}
return 'NULL';
}
/**
* Get the field key status
*/

View File

@ -37,12 +37,13 @@ class Builder extends Mapping
public $user;
public $today;
public $db;
public $views = array();
protected $fields = array();
protected $title = array();
protected $description = array();
protected $alias = array();
protected $list = array();
public $views = array();
public $admin_fields = array();
protected $fields = array();
protected $title = array();
protected $description = array();
protected $alias = array();
protected $list = array();
/**
* Field that should not be used in name, alias, disc, and list view
@ -62,10 +63,10 @@ class Builder extends Mapping
$data['buildcomp'] = 0;
$data['buildcompsql'] = '';
// set some globals
$this->db = JFactory::getDbo();
$this->user = JFactory::getUser();
$this->today = JFactory::getDate()->toSql();
$this->db = JFactory::getDbo();
$this->user = JFactory::getUser();
$this->today = JFactory::getDate()->toSql();
// no start the building of the views and fields
if ($this->setBuild())
{
@ -100,22 +101,21 @@ class Builder extends Mapping
protected function setView(&$name)
{
// set the view object
$object = new stdClass();
$object->system_name = ComponentbuilderHelper::safeString($name, 'W') . ' (dynamic build)';
$object->name_single = $name;
$object->name_list = $name. 's';
$object->short_description = $name. ' view (dynamic build)';
$object->type = 1;
$object->description = $name. ' view (dynamic build)';
$object->add_fadein = 1;
$object->add_sql = (isset($this->addSql[$name])) ? $this->addSql[$name]: 0;
$object->source = (isset($this->source[$name])) ? $this->source[$name]: 0;
$object->sql = (isset($this->sql[$name])) ? base64_encode($this->sql[$name]): '';
$object->addpermissions = '{"action":["view.edit","view.edit.own","view.edit.state","view.create","view.delete","view.access"],"implementation":["3","3","3","3","3","3"]}';
$object->addfields = $this->addFields($name);
$object->created = $this->today;
$object->created_by = $this->user->id;
$object->published = 1;
$object = new stdClass();
$object->system_name = ComponentbuilderHelper::safeString($name, 'W') . ' (dynamic build)';
$object->name_single = $name;
$object->name_list = $name. 's';
$object->short_description = $name. ' view (dynamic build)';
$object->type = 1;
$object->description = $name. ' view (dynamic build)';
$object->add_fadein = 1;
$object->add_sql = (isset($this->addSql[$name])) ? $this->addSql[$name]: 0;
$object->source = (isset($this->source[$name])) ? $this->source[$name]: 0;
$object->sql = (isset($this->sql[$name])) ? base64_encode($this->sql[$name]): '';
$object->addpermissions = '{"action":["view.edit","view.edit.own","view.edit.state","view.create","view.delete","view.access"],"implementation":["3","3","3","3","3","3"]}';
$object->created = $this->today;
$object->created_by = $this->user->id;
$object->published = 1;
// add to data base
if ($this->db->insertObject('#__componentbuilder_admin_view', $object))
{
@ -124,7 +124,8 @@ class Builder extends Mapping
ComponentbuilderHelper::setAsset($id, 'admin_view');
// load the views
$this->views[] = $id;
return true;
// load the admin view fields
return $this->addFields($name, $id);
}
return false;
}
@ -132,26 +133,12 @@ class Builder extends Mapping
/**
* Add the fields to the view
*/
protected function addFields(&$view)
protected function addFields(&$view, &$view_id)
{
if (isset($this->fields[$view]))
{
// set some defaults
$addField = array (
'field' => array(),
'list' => array(),
'order_list' => array(),
'title' => array(),
'alias' => array(),
'sort' => array(),
'search' => array(),
'filter' => array(),
'link' => array(),
'tab' => array(),
'alignment' => array(),
'order_edit' => array(),
'permission' => array()
);
$addField = array ();
$fixLink = (isset($this->title[$view])) ? 0 : 1;
// build the field data... hmmm
foreach ($this->fields[$view] as $nr => $id)
@ -171,23 +158,32 @@ class Builder extends Mapping
$fixLink = 0;
}
// load the field values
$addField['field'][] = $id;
$addField['list'][] = $isList;
$addField['order_list'][] = ($key) ? $key : 0;
$addField['title'][] = $isTitle;
$addField['alias'][] = $isAlias;
$addField['sort'][] = $isList;
$addField['search'][] = $isList;
$addField['filter'][] = $isList;
$addField['link'][] = $isLink;
$addField['tab'][] = 1;
$addField['alignment'][] = ($isTitle || $isAlias) ? 4 : $alignment;
$addField['order_edit'][] = $nr;
$addField['permission'][] = 0;
$addField['addfields'.$nr]['field'] = $id;
$addField['addfields'.$nr]['list'] = $isList;
$addField['addfields'.$nr]['order_list'] = ($key) ? $key : 0;
$addField['addfields'.$nr]['title'] = $isTitle;
$addField['addfields'.$nr]['alias'] = $isAlias;
$addField['addfields'.$nr]['sort'] = $isList;
$addField['addfields'.$nr]['search'] = $isList;
$addField['addfields'.$nr]['filter'] = $isList;
$addField['addfields'.$nr]['link'] = $isLink;
$addField['addfields'.$nr]['tab'] = 1;
$addField['addfields'.$nr]['alignment'] = ($isTitle || $isAlias) ? 4 : $alignment;
$addField['addfields'.$nr]['order_edit'] = $nr;
$addField['addfields'.$nr]['permission'] = 0;
}
return json_encode($addField);
// set the field object
$object = new stdClass();
$object->admin_view = $view_id;
$object->addfields = json_encode($addField, JSON_FORCE_OBJECT);
$object->created = $this->today;
$object->created_by = $this->user->id;
$object->published = 1;
// add to data base
return $this->db->insertObject('#__componentbuilder_admin_fields', $object);
}
return '';
return false;
}
/**
@ -198,21 +194,21 @@ class Builder extends Mapping
if ($fieldType = $this->getFieldType($field['fieldType']))
{
// set the field object
$object = new stdClass();
$object->name = $field['label'] . ' (dynamic build)';
$object->fieldtype = $fieldType;
$object->datatype = $field['dataType'];
$object->indexes = $field['key'];
$object->null_switch = $field['null'];
$object->datalenght = $field['size'];
$object->datalenght_other = $field['sizeOther'];
$object->datadefault = $field['default'];
$object->datadefault_other = $field['defaultOther'];
$object->created = $this->today;
$object->created_by = $this->user->id;
$object->published = 1;
$object->store = 0;
$object->xml = $this->setFieldXML($field, $fieldType);
$object = new stdClass();
$object->name = $field['label'] . ' (dynamic build)';
$object->fieldtype = $fieldType;
$object->datatype = $field['dataType'];
$object->indexes = $field['key'];
$object->null_switch = $field['null'];
$object->datalenght = $field['size'];
$object->datalenght_other = $field['sizeOther'];
$object->datadefault = $field['default'];
$object->datadefault_other = $field['defaultOther'];
$object->created = $this->today;
$object->created_by = $this->user->id;
$object->published = 1;
$object->store = 0;
$object->xml = $this->setFieldXML($field, $fieldType);
// add to data base
if ($this->db->insertObject('#__componentbuilder_field', $object))
{

View File

@ -40,8 +40,7 @@ class Extrusion extends Builder
if (parent::__construct($data))
{
// link the view data to the component
$data['addadmin_views'] = $this->linkAdminViews();
if (ComponentbuilderHelper::checkJson($data['addadmin_views']))
if ($this->setAdminViews($data['id']))
{
$this->app->enqueueMessage(
JText::_('All the fields and views from your sql dump has been created and linked to this component.'),
@ -56,86 +55,54 @@ class Extrusion extends Builder
/**
* link the build views to the component
*/
protected function linkAdminViews()
protected function setAdminViews(&$component_id)
{
// check if views were set
if (ComponentbuilderHelper::checkArray($this->views))
{
// insure arrays are set
if (!isset($this->addadmin_views['adminview']))
$count = 0;
if (ComponentbuilderHelper::checkArray($this->addadmin_views))
{
$this->addadmin_views['adminview'] = array();
}
if (!isset($this->addadmin_views['icomoon']))
{
$this->addadmin_views['icomoon'] = array();
}
if (!isset($this->addadmin_views['mainmenu']))
{
$this->addadmin_views['mainmenu'] = array();
}
if (!isset($this->addadmin_views['dashboard_add']))
{
$this->addadmin_views['dashboard_add'] = array();
}
if (!isset($this->addadmin_views['dashboard_list']))
{
$this->addadmin_views['dashboard_list'] = array();
}
if (!isset($this->addadmin_views['submenu']))
{
$this->addadmin_views['submenu'] = array();
}
if (!isset($this->addadmin_views['checkin']))
{
$this->addadmin_views['checkin'] = array();
}
if (!isset($this->addadmin_views['history']))
{
$this->addadmin_views['history'] = array();
}
if (!isset($this->addadmin_views['metadata']))
{
$this->addadmin_views['metadata'] = array();
}
if (!isset($this->addadmin_views['access']))
{
$this->addadmin_views['access'] = array();
}
if (!isset($this->addadmin_views['port']))
{
$this->addadmin_views['port'] = array();
}
if (!isset($this->addadmin_views['edit_create_site_view']))
{
$this->addadmin_views['edit_create_site_view'] = array();
}
if (!isset($this->addadmin_views['order']))
{
$this->addadmin_views['order'] = array();
$count = (int) count((array)$this->addadmin_views) + 3;
}
// set the admin view data linking
foreach ($this->views as $id)
foreach ($this->views as $nr => $id)
{
$this->addadmin_views['adminview'][] = $id;
$this->addadmin_views['icomoon'][] = 'joomla';
$this->addadmin_views['mainmenu'][] = 1;
$this->addadmin_views['dashboard_add'][] = 1;
$this->addadmin_views['dashboard_list'][] = 1;
$this->addadmin_views['submenu'][] = 1;
$this->addadmin_views['checkin'][] = 1;
$this->addadmin_views['history'][] = 1;
$this->addadmin_views['metadata'][] = 1;
$this->addadmin_views['access'][] = 1;
$this->addadmin_views['port'][] = 1;
$this->addadmin_views['edit_create_site_view'][] = 0;
$this->addadmin_views['order'][] = count($this->addadmin_views['order']) + 1;
$pointer = $count + $nr;
$this->addadmin_views['addadmin_views'.$pointer]['adminview'] = $id;
$this->addadmin_views['addadmin_views'.$pointer]['icomoon'] = 'joomla';
$this->addadmin_views['addadmin_views'.$pointer]['mainmenu'] = 1;
$this->addadmin_views['addadmin_views'.$pointer]['dashboard_add'] = 1;
$this->addadmin_views['addadmin_views'.$pointer]['dashboard_list'] = 1;
$this->addadmin_views['addadmin_views'.$pointer]['submenu'] = 1;
$this->addadmin_views['addadmin_views'.$pointer]['checkin'] = 1;
$this->addadmin_views['addadmin_views'.$pointer]['history'] = 1;
$this->addadmin_views['addadmin_views'.$pointer]['metadata'] = 1;
$this->addadmin_views['addadmin_views'.$pointer]['access'] = 1;
$this->addadmin_views['addadmin_views'.$pointer]['port'] = 1;
$this->addadmin_views['addadmin_views'.$pointer]['edit_create_site_view'] = 0;
$this->addadmin_views['addadmin_views'.$pointer]['order'] = $pointer + 1;
}
}
if (isset($this->addadmin_views) && ComponentbuilderHelper::checkArray($this->addadmin_views))
{
return json_encode($this->addadmin_views);
// set the field object
$object = new stdClass();
$object->joomla_component = $component_id;
$object->addadmin_views = json_encode($this->addadmin_views, JSON_FORCE_OBJECT);
$object->created = $this->today;
$object->created_by = $this->user->id;
$object->published = 1;
// check if it is already set
if ($item_id = ComponentbuilderHelper::getVar('component_admin_views', $component_id, 'joomla_component', 'id'))
{
// set ID
$object->id = (int) $item_id;
return $this->db->updateObject('#__componentbuilder_component_admin_views', $object, 'id');
}
// add to data base
return $this->db->insertObject('#__componentbuilder_component_admin_views', $object);
}
return '';
return false;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -39,6 +39,26 @@ COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE="Admins Fields Edit State"
COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields"
COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION="Admins Fields Edit Version"
COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS="Admins Fields Relations Access"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC="Allows the users in this group to access access admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE="Admins Fields Relations Batch Use"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE="Admins Fields Relations Create"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC="Allows the users in this group to create create admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE="Admins Fields Relations Delete"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC="Allows the users in this group to delete delete admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT="Admins Fields Relations Edit"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY="Admins Fields Relations Edit Created By"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE="Admins Fields Relations Edit Created Date"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC="Allows the users in this group to edit the admin fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN="Admins Fields Relations Edit Own"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC="Allows the users in this group to edit edit own admins fields relations created by them"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE="Admins Fields Relations Edit State"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION="Admins Fields Relations Edit Version"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields relations"
COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS="Admin Views Access"
COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS_DESC="Allows the users in this group to access access admin views"
COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE="Admin Views Batch Use"
@ -46,9 +66,9 @@ COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE_DESC="Allows users in this group to u
COM_COMPONENTBUILDER_ADMIN_VIEWS_CREATE="Admin Views Create"
COM_COMPONENTBUILDER_ADMIN_VIEWS_CREATE_DESC="Allows the users in this group to create create admin views"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_ADD="Admin Views Dashboard Add"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the admin view"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of admin view"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_LIST="Admin Views Dashboard List"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the admin view"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of admin view"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DELETE="Admin Views Delete"
COM_COMPONENTBUILDER_ADMIN_VIEWS_DELETE_DESC="Allows the users in this group to delete delete admin views"
COM_COMPONENTBUILDER_ADMIN_VIEWS_EDIT="Admin Views Edit"
@ -68,15 +88,15 @@ COM_COMPONENTBUILDER_ADMIN_VIEWS_EXPORT_DESC="Allows the users in this group to
COM_COMPONENTBUILDER_ADMIN_VIEWS_IMPORT="Admin Views Import"
COM_COMPONENTBUILDER_ADMIN_VIEWS_IMPORT_DESC="Allows the users in this group to import import admin views"
COM_COMPONENTBUILDER_ADMIN_VIEWS_SUBMENU="Admin Views Submenu"
COM_COMPONENTBUILDER_ADMIN_VIEWS_SUBMENU_DESC="Allows the users in this group to update the submenu of the admin view"
COM_COMPONENTBUILDER_ADMIN_VIEWS_SUBMENU_DESC="Allows the users in this group to submenu of admin view"
COM_COMPONENTBUILDER_COMPILER_ACCESS="Compiler Access"
COM_COMPONENTBUILDER_COMPILER_ACCESS_DESC=" Allows the users in this group to access compiler."
COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS="Compiler Clear tmp Button Access"
COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS_DESC=" Allows the users in this group to access the clear tmp button."
COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST="Compiler Dashboard List"
COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the Compiler"
COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Compiler"
COM_COMPONENTBUILDER_COMPILER_SUBMENU="Compiler Submenu"
COM_COMPONENTBUILDER_COMPILER_SUBMENU_DESC="Allows the users in this group to update the submenu of the Compiler"
COM_COMPONENTBUILDER_COMPILER_SUBMENU_DESC="Allows the users in this group to submenu of Compiler"
COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_ACCESS="Components Admin Views Access"
COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_ACCESS_DESC="Allows the users in this group to access access components admin views"
COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_BATCH_USE="Components Admin Views Batch Use"
@ -265,9 +285,9 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_BATCH_USE_DESC="Allows users in this gro
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_CREATE="Custom Admin Views Create"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_CREATE_DESC="Allows the users in this group to create create custom admin views"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD="Custom Admin Views Dashboard Add"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the custom admin view"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of custom admin view"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_LIST="Custom Admin Views Dashboard List"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the custom admin view"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of custom admin view"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DELETE="Custom Admin Views Delete"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_DELETE_DESC="Allows the users in this group to delete delete custom admin views"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_EDIT="Custom Admin Views Edit"
@ -283,7 +303,7 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_EXPORT_DESC="Allows the users in this gr
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_IMPORT="Custom Admin Views Import"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_IMPORT_DESC="Allows the users in this group to import import custom admin views"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_SUBMENU="Custom Admin Views Submenu"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_SUBMENU_DESC="Allows the users in this group to update the submenu of the custom admin view"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_SUBMENU_DESC="Allows the users in this group to submenu of custom admin view"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GET_SNIPPETS_BUTTON_ACCESS="Custom Admin View Get Snippets Button Access"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GET_SNIPPETS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the get snippets button."
COM_COMPONENTBUILDER_CUSTOM_CODES_ACCESS="Custom Codes Access"
@ -293,7 +313,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODES_BATCH_USE_DESC="Allows users in this group to
COM_COMPONENTBUILDER_CUSTOM_CODES_CREATE="Custom Codes Create"
COM_COMPONENTBUILDER_CUSTOM_CODES_CREATE_DESC="Allows the users in this group to create create custom codes"
COM_COMPONENTBUILDER_CUSTOM_CODES_DASHBOARD_LIST="Custom Codes Dashboard List"
COM_COMPONENTBUILDER_CUSTOM_CODES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the custom code"
COM_COMPONENTBUILDER_CUSTOM_CODES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of custom code"
COM_COMPONENTBUILDER_CUSTOM_CODES_DELETE="Custom Codes Delete"
COM_COMPONENTBUILDER_CUSTOM_CODES_DELETE_DESC="Allows the users in this group to delete delete custom codes"
COM_COMPONENTBUILDER_CUSTOM_CODES_EDIT="Custom Codes Edit"
@ -313,7 +333,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODES_EXPORT_DESC="Allows the users in this group to
COM_COMPONENTBUILDER_CUSTOM_CODES_IMPORT="Custom Codes Import"
COM_COMPONENTBUILDER_CUSTOM_CODES_IMPORT_DESC="Allows the users in this group to import import custom codes"
COM_COMPONENTBUILDER_CUSTOM_CODES_SUBMENU="Custom Codes Submenu"
COM_COMPONENTBUILDER_CUSTOM_CODES_SUBMENU_DESC="Allows the users in this group to update the submenu of the custom code"
COM_COMPONENTBUILDER_CUSTOM_CODES_SUBMENU_DESC="Allows the users in this group to submenu of custom code"
COM_COMPONENTBUILDER_DYNAMIC_GETS_ACCESS="Dynamic Gets Access"
COM_COMPONENTBUILDER_DYNAMIC_GETS_ACCESS_DESC="Allows the users in this group to access access dynamic gets"
COM_COMPONENTBUILDER_DYNAMIC_GETS_BATCH_USE="Dynamic Gets Batch Use"
@ -321,9 +341,9 @@ COM_COMPONENTBUILDER_DYNAMIC_GETS_BATCH_USE_DESC="Allows users in this group to
COM_COMPONENTBUILDER_DYNAMIC_GETS_CREATE="Dynamic Gets Create"
COM_COMPONENTBUILDER_DYNAMIC_GETS_CREATE_DESC="Allows the users in this group to create create dynamic gets"
COM_COMPONENTBUILDER_DYNAMIC_GETS_DASHBOARD_ADD="Dynamic Gets Dashboard Add"
COM_COMPONENTBUILDER_DYNAMIC_GETS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the dynamic get"
COM_COMPONENTBUILDER_DYNAMIC_GETS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of dynamic get"
COM_COMPONENTBUILDER_DYNAMIC_GETS_DASHBOARD_LIST="Dynamic Gets Dashboard List"
COM_COMPONENTBUILDER_DYNAMIC_GETS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the dynamic get"
COM_COMPONENTBUILDER_DYNAMIC_GETS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of dynamic get"
COM_COMPONENTBUILDER_DYNAMIC_GETS_DELETE="Dynamic Gets Delete"
COM_COMPONENTBUILDER_DYNAMIC_GETS_DELETE_DESC="Allows the users in this group to delete delete dynamic gets"
COM_COMPONENTBUILDER_DYNAMIC_GETS_EDIT="Dynamic Gets Edit"
@ -339,7 +359,7 @@ COM_COMPONENTBUILDER_DYNAMIC_GETS_EXPORT_DESC="Allows the users in this group to
COM_COMPONENTBUILDER_DYNAMIC_GETS_IMPORT="Dynamic Gets Import"
COM_COMPONENTBUILDER_DYNAMIC_GETS_IMPORT_DESC="Allows the users in this group to import import dynamic gets"
COM_COMPONENTBUILDER_DYNAMIC_GETS_SUBMENU="Dynamic Gets Submenu"
COM_COMPONENTBUILDER_DYNAMIC_GETS_SUBMENU_DESC="Allows the users in this group to update the submenu of the dynamic get"
COM_COMPONENTBUILDER_DYNAMIC_GETS_SUBMENU_DESC="Allows the users in this group to submenu of dynamic get"
COM_COMPONENTBUILDER_EDIT_CREATED_BY="Edit Created By"
COM_COMPONENTBUILDER_EDIT_CREATED_BY_DESC=" Allows users in this group to edit created by."
COM_COMPONENTBUILDER_EDIT_CREATED_DATE="Edit Created Date"
@ -355,9 +375,9 @@ COM_COMPONENTBUILDER_FIELDS_BATCH_USE_DESC="Allows users in this group to use ba
COM_COMPONENTBUILDER_FIELDS_CREATE="Fields Create"
COM_COMPONENTBUILDER_FIELDS_CREATE_DESC="Allows the users in this group to create create fields"
COM_COMPONENTBUILDER_FIELDS_DASHBOARD_ADD="Fields Dashboard Add"
COM_COMPONENTBUILDER_FIELDS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the field"
COM_COMPONENTBUILDER_FIELDS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of field"
COM_COMPONENTBUILDER_FIELDS_DASHBOARD_LIST="Fields Dashboard List"
COM_COMPONENTBUILDER_FIELDS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the field"
COM_COMPONENTBUILDER_FIELDS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of field"
COM_COMPONENTBUILDER_FIELDS_DELETE="Fields Delete"
COM_COMPONENTBUILDER_FIELDS_DELETE_DESC="Allows the users in this group to delete delete fields"
COM_COMPONENTBUILDER_FIELDS_EDIT="Fields Edit"
@ -373,7 +393,7 @@ COM_COMPONENTBUILDER_FIELDS_EXPORT_DESC="Allows the users in this group to expor
COM_COMPONENTBUILDER_FIELDS_IMPORT="Fields Import"
COM_COMPONENTBUILDER_FIELDS_IMPORT_DESC="Allows the users in this group to import import fields"
COM_COMPONENTBUILDER_FIELDS_SUBMENU="Fields Submenu"
COM_COMPONENTBUILDER_FIELDS_SUBMENU_DESC="Allows the users in this group to update the submenu of the field"
COM_COMPONENTBUILDER_FIELDS_SUBMENU_DESC="Allows the users in this group to submenu of field"
COM_COMPONENTBUILDER_FIELDTYPES_ACCESS="Fieldtypes Access"
COM_COMPONENTBUILDER_FIELDTYPES_ACCESS_DESC="Allows the users in this group to access access fieldtypes"
COM_COMPONENTBUILDER_FIELDTYPES_BATCH_USE="Fieldtypes Batch Use"
@ -381,23 +401,17 @@ COM_COMPONENTBUILDER_FIELDTYPES_BATCH_USE_DESC="Allows users in this group to us
COM_COMPONENTBUILDER_FIELDTYPES_CREATE="Fieldtypes Create"
COM_COMPONENTBUILDER_FIELDTYPES_CREATE_DESC="Allows the users in this group to create create fieldtypes"
COM_COMPONENTBUILDER_FIELDTYPES_DASHBOARD_ADD="Fieldtypes Dashboard Add"
COM_COMPONENTBUILDER_FIELDTYPES_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_DASHBOARD_LIST="Fieldtypes Dashboard List"
COM_COMPONENTBUILDER_FIELDTYPES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_DELETE="Fieldtypes Delete"
COM_COMPONENTBUILDER_FIELDTYPES_DELETE_DESC="Allows the users in this group to delete delete fieldtypes"
COM_COMPONENTBUILDER_FIELDTYPES_DESCRIPTION="Fieldtypes Description"
COM_COMPONENTBUILDER_FIELDTYPES_DESCRIPTION_DESC="Allows the users in this group to description of fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT="Fieldtypes Edit"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESC="Allows the users in this group to edit the fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESCRIPTION="Fieldtypes Edit Description"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESCRIPTION_DESC="Allows the users in this group to update the edit description of the fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_NAME="Fieldtypes Edit Name"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_NAME_DESC="Allows the users in this group to update the edit name of the fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_OWN="Fieldtypes Edit Own"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_OWN_DESC="Allows the users in this group to edit edit own fieldtypes created by them"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_PROPERTIES="Fieldtypes Edit Properties"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_PROPERTIES_DESC="Allows the users in this group to update the edit properties of the fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_SHORT_DESCRIPTION="Fieldtypes Edit Short Description"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_SHORT_DESCRIPTION_DESC="Allows the users in this group to update the edit short description of the fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_STATE="Fieldtypes Edit State"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_STATE_DESC="Allows the users in this group to update the state of the fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION="Fieldtypes Edit Version"
@ -406,14 +420,20 @@ COM_COMPONENTBUILDER_FIELDTYPES_EXPORT="Fieldtypes Export"
COM_COMPONENTBUILDER_FIELDTYPES_EXPORT_DESC="Allows the users in this group to export export fieldtypes"
COM_COMPONENTBUILDER_FIELDTYPES_IMPORT="Fieldtypes Import"
COM_COMPONENTBUILDER_FIELDTYPES_IMPORT_DESC="Allows the users in this group to import import fieldtypes"
COM_COMPONENTBUILDER_FIELDTYPES_NAME="Fieldtypes Name"
COM_COMPONENTBUILDER_FIELDTYPES_NAME_DESC="Allows the users in this group to name of fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_PROPERTIES="Fieldtypes Properties"
COM_COMPONENTBUILDER_FIELDTYPES_PROPERTIES_DESC="Allows the users in this group to properties of fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_SHORT_DESCRIPTION="Fieldtypes Short Description"
COM_COMPONENTBUILDER_FIELDTYPES_SHORT_DESCRIPTION_DESC="Allows the users in this group to short description of fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU="Fieldtypes Submenu"
COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU_DESC="Allows the users in this group to update the submenu of the fieldtype"
COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU_DESC="Allows the users in this group to submenu of fieldtype"
COM_COMPONENTBUILDER_GET_SNIPPETS_ACCESS="Get Snippets Access"
COM_COMPONENTBUILDER_GET_SNIPPETS_ACCESS_DESC=" Allows the users in this group to access get snippets."
COM_COMPONENTBUILDER_GET_SNIPPETS_CUSTOM_ADMIN_VIEWS_BUTTON_ACCESS="Get Snippets Custom Admin Views Button Access"
COM_COMPONENTBUILDER_GET_SNIPPETS_CUSTOM_ADMIN_VIEWS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the custom admin views button."
COM_COMPONENTBUILDER_GET_SNIPPETS_DASHBOARD_LIST="Get Snippets Dashboard List"
COM_COMPONENTBUILDER_GET_SNIPPETS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the Get Snippets"
COM_COMPONENTBUILDER_GET_SNIPPETS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Get Snippets"
COM_COMPONENTBUILDER_GET_SNIPPETS_LAYOUTS_BUTTON_ACCESS="Get Snippets Layouts Button Access"
COM_COMPONENTBUILDER_GET_SNIPPETS_LAYOUTS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the layouts button."
COM_COMPONENTBUILDER_GET_SNIPPETS_LIBRARIES_BUTTON_ACCESS="Get Snippets Libraries Button Access"
@ -423,7 +443,7 @@ COM_COMPONENTBUILDER_GET_SNIPPETS_SITE_VIEWS_BUTTON_ACCESS_DESC=" Allows the use
COM_COMPONENTBUILDER_GET_SNIPPETS_SNIPPETS_BUTTON_ACCESS="Get Snippets Snippets Button Access"
COM_COMPONENTBUILDER_GET_SNIPPETS_SNIPPETS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the snippets button."
COM_COMPONENTBUILDER_GET_SNIPPETS_SUBMENU="Get Snippets Submenu"
COM_COMPONENTBUILDER_GET_SNIPPETS_SUBMENU_DESC="Allows the users in this group to update the submenu of the Get Snippets"
COM_COMPONENTBUILDER_GET_SNIPPETS_SUBMENU_DESC="Allows the users in this group to submenu of Get Snippets"
COM_COMPONENTBUILDER_GET_SNIPPETS_TEMPLATES_BUTTON_ACCESS="Get Snippets Templates Button Access"
COM_COMPONENTBUILDER_GET_SNIPPETS_TEMPLATES_BUTTON_ACCESS_DESC=" Allows the users in this group to access the templates button."
COM_COMPONENTBUILDER_HELP_DOCUMENTS_ACCESS="Help Documents Access"
@ -433,7 +453,7 @@ COM_COMPONENTBUILDER_HELP_DOCUMENTS_BATCH_USE_DESC="Allows users in this group t
COM_COMPONENTBUILDER_HELP_DOCUMENTS_CREATE="Help Documents Create"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_CREATE_DESC="Allows the users in this group to create create help documents"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_DASHBOARD_LIST="Help Documents Dashboard List"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the help document"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of help document"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_DELETE="Help Documents Delete"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_DELETE_DESC="Allows the users in this group to delete delete help documents"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_EDIT="Help Documents Edit"
@ -449,7 +469,7 @@ COM_COMPONENTBUILDER_HELP_DOCUMENTS_EXPORT_DESC="Allows the users in this group
COM_COMPONENTBUILDER_HELP_DOCUMENTS_IMPORT="Help Documents Import"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_IMPORT_DESC="Allows the users in this group to import import help documents"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_SUBMENU="Help Documents Submenu"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_SUBMENU_DESC="Allows the users in this group to update the submenu of the help document"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_SUBMENU_DESC="Allows the users in this group to submenu of help document"
COM_COMPONENTBUILDER_IMPORT_DATA="Import Data"
COM_COMPONENTBUILDER_IMPORT_DATA_DESC=" Allows users in this group to import data."
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS="Joomla Components Access"
@ -459,9 +479,9 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_USE_DESC="Allows users in this grou
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_CREATE="Joomla Components Create"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_CREATE_DESC="Allows the users in this group to create create joomla components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD="Joomla Components Dashboard Add"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the joomla component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of joomla component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_LIST="Joomla Components Dashboard List"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the joomla component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of joomla component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DELETE="Joomla Components Delete"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DELETE_DESC="Allows the users in this group to delete delete joomla components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT="Joomla Components Edit"
@ -477,7 +497,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_STATE_DESC="Allows the users in this
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION="Joomla Components Edit Version"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU="Joomla Components Submenu"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU_DESC="Allows the users in this group to update the submenu of the joomla component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU_DESC="Allows the users in this group to submenu of joomla component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_BUTTON_ACCESS="Joomla Component Backup Button Access"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_BUTTON_ACCESS_DESC=" Allows the users in this group to access the backup button."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CLONE_BUTTON_ACCESS="Joomla Component Clone Button Access"
@ -507,7 +527,7 @@ COM_COMPONENTBUILDER_LANGUAGES_EXPORT_DESC="Allows the users in this group to ex
COM_COMPONENTBUILDER_LANGUAGES_IMPORT="Languages Import"
COM_COMPONENTBUILDER_LANGUAGES_IMPORT_DESC="Allows the users in this group to import import languages"
COM_COMPONENTBUILDER_LANGUAGES_SUBMENU="Languages Submenu"
COM_COMPONENTBUILDER_LANGUAGES_SUBMENU_DESC="Allows the users in this group to update the submenu of the language"
COM_COMPONENTBUILDER_LANGUAGES_SUBMENU_DESC="Allows the users in this group to submenu of language"
COM_COMPONENTBUILDER_LANGUAGE_BUILD_BUTTON_ACCESS="Language Build Button Access"
COM_COMPONENTBUILDER_LANGUAGE_BUILD_BUTTON_ACCESS_DESC=" Allows the users in this group to access the build button."
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS="Language Translations Access"
@ -517,7 +537,7 @@ COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_BATCH_USE_DESC="Allows users in this
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE="Language Translations Create"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE_DESC="Allows the users in this group to create create language translations"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DASHBOARD_LIST="Language Translations Dashboard List"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the language translation"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of language translation"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE="Language Translations Delete"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE_DESC="Allows the users in this group to delete delete language translations"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT="Language Translations Edit"
@ -533,7 +553,7 @@ COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EXPORT_DESC="Allows the users in this
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_IMPORT="Language Translations Import"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_IMPORT_DESC="Allows the users in this group to import import language translations"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU="Language Translations Submenu"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU_DESC="Allows the users in this group to update the submenu of the language translation"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU_DESC="Allows the users in this group to submenu of language translation"
COM_COMPONENTBUILDER_LAYOUTS_ACCESS="Layouts Access"
COM_COMPONENTBUILDER_LAYOUTS_ACCESS_DESC="Allows the users in this group to access access layouts"
COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE="Layouts Batch Use"
@ -541,9 +561,9 @@ COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE_DESC="Allows users in this group to use b
COM_COMPONENTBUILDER_LAYOUTS_CREATE="Layouts Create"
COM_COMPONENTBUILDER_LAYOUTS_CREATE_DESC="Allows the users in this group to create create layouts"
COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD="Layouts Dashboard Add"
COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the layout"
COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of layout"
COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_LIST="Layouts Dashboard List"
COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the layout"
COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of layout"
COM_COMPONENTBUILDER_LAYOUTS_DELETE="Layouts Delete"
COM_COMPONENTBUILDER_LAYOUTS_DELETE_DESC="Allows the users in this group to delete delete layouts"
COM_COMPONENTBUILDER_LAYOUTS_EDIT="Layouts Edit"
@ -559,7 +579,7 @@ COM_COMPONENTBUILDER_LAYOUTS_EXPORT_DESC="Allows the users in this group to expo
COM_COMPONENTBUILDER_LAYOUTS_IMPORT="Layouts Import"
COM_COMPONENTBUILDER_LAYOUTS_IMPORT_DESC="Allows the users in this group to import import layouts"
COM_COMPONENTBUILDER_LAYOUTS_SUBMENU="Layouts Submenu"
COM_COMPONENTBUILDER_LAYOUTS_SUBMENU_DESC="Allows the users in this group to update the submenu of the layout"
COM_COMPONENTBUILDER_LAYOUTS_SUBMENU_DESC="Allows the users in this group to submenu of layout"
COM_COMPONENTBUILDER_LAYOUT_GET_SNIPPETS_BUTTON_ACCESS="Layout Get Snippets Button Access"
COM_COMPONENTBUILDER_LAYOUT_GET_SNIPPETS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the get snippets button."
COM_COMPONENTBUILDER_LIBRARIES_ACCESS="Libraries Access"
@ -589,7 +609,7 @@ COM_COMPONENTBUILDER_LIBRARIES_CONFIG_EDIT_VERSION_DESC="Allows users in this gr
COM_COMPONENTBUILDER_LIBRARIES_CREATE="Libraries Create"
COM_COMPONENTBUILDER_LIBRARIES_CREATE_DESC="Allows the users in this group to create create libraries"
COM_COMPONENTBUILDER_LIBRARIES_DASHBOARD_LIST="Libraries Dashboard List"
COM_COMPONENTBUILDER_LIBRARIES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the library"
COM_COMPONENTBUILDER_LIBRARIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of library"
COM_COMPONENTBUILDER_LIBRARIES_DELETE="Libraries Delete"
COM_COMPONENTBUILDER_LIBRARIES_DELETE_DESC="Allows the users in this group to delete delete libraries"
COM_COMPONENTBUILDER_LIBRARIES_EDIT="Libraries Edit"
@ -621,7 +641,7 @@ COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_STATE_DESC="Allows the us
COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_VERSION="Libraries Files Folders Urls Edit Version"
COM_COMPONENTBUILDER_LIBRARIES_FILES_FOLDERS_URLS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version libraries files folders urls"
COM_COMPONENTBUILDER_LIBRARIES_SUBMENU="Libraries Submenu"
COM_COMPONENTBUILDER_LIBRARIES_SUBMENU_DESC="Allows the users in this group to update the submenu of the library"
COM_COMPONENTBUILDER_LIBRARIES_SUBMENU_DESC="Allows the users in this group to submenu of library"
COM_COMPONENTBUILDER_LIBRARY_GET_SNIPPETS_BUTTON_ACCESS="Library Get Snippets Button Access"
COM_COMPONENTBUILDER_LIBRARY_GET_SNIPPETS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the get snippets button."
COM_COMPONENTBUILDER_MENU="&#187; Component Builder"
@ -648,7 +668,7 @@ COM_COMPONENTBUILDER_SERVERS_BATCH_USE_DESC="Allows users in this group to use b
COM_COMPONENTBUILDER_SERVERS_CREATE="Servers Create"
COM_COMPONENTBUILDER_SERVERS_CREATE_DESC="Allows the users in this group to create create servers"
COM_COMPONENTBUILDER_SERVERS_DASHBOARD_LIST="Servers Dashboard List"
COM_COMPONENTBUILDER_SERVERS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the server"
COM_COMPONENTBUILDER_SERVERS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of server"
COM_COMPONENTBUILDER_SERVERS_DELETE="Servers Delete"
COM_COMPONENTBUILDER_SERVERS_DELETE_DESC="Allows the users in this group to delete delete servers"
COM_COMPONENTBUILDER_SERVERS_EDIT="Servers Edit"
@ -668,7 +688,7 @@ COM_COMPONENTBUILDER_SERVERS_EXPORT_DESC="Allows the users in this group to expo
COM_COMPONENTBUILDER_SERVERS_IMPORT="Servers Import"
COM_COMPONENTBUILDER_SERVERS_IMPORT_DESC="Allows the users in this group to import import servers"
COM_COMPONENTBUILDER_SERVERS_SUBMENU="Servers Submenu"
COM_COMPONENTBUILDER_SERVERS_SUBMENU_DESC="Allows the users in this group to update the submenu of the server"
COM_COMPONENTBUILDER_SERVERS_SUBMENU_DESC="Allows the users in this group to submenu of server"
COM_COMPONENTBUILDER_SITE_VIEWS_ACCESS="Site Views Access"
COM_COMPONENTBUILDER_SITE_VIEWS_ACCESS_DESC="Allows the users in this group to access access site views"
COM_COMPONENTBUILDER_SITE_VIEWS_BATCH_USE="Site Views Batch Use"
@ -676,9 +696,9 @@ COM_COMPONENTBUILDER_SITE_VIEWS_BATCH_USE_DESC="Allows users in this group to us
COM_COMPONENTBUILDER_SITE_VIEWS_CREATE="Site Views Create"
COM_COMPONENTBUILDER_SITE_VIEWS_CREATE_DESC="Allows the users in this group to create create site views"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD="Site Views Dashboard Add"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the site view"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of site view"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_LIST="Site Views Dashboard List"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the site view"
COM_COMPONENTBUILDER_SITE_VIEWS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of site view"
COM_COMPONENTBUILDER_SITE_VIEWS_DELETE="Site Views Delete"
COM_COMPONENTBUILDER_SITE_VIEWS_DELETE_DESC="Allows the users in this group to delete delete site views"
COM_COMPONENTBUILDER_SITE_VIEWS_EDIT="Site Views Edit"
@ -694,7 +714,7 @@ COM_COMPONENTBUILDER_SITE_VIEWS_EXPORT_DESC="Allows the users in this group to e
COM_COMPONENTBUILDER_SITE_VIEWS_IMPORT="Site Views Import"
COM_COMPONENTBUILDER_SITE_VIEWS_IMPORT_DESC="Allows the users in this group to import import site views"
COM_COMPONENTBUILDER_SITE_VIEWS_SUBMENU="Site Views Submenu"
COM_COMPONENTBUILDER_SITE_VIEWS_SUBMENU_DESC="Allows the users in this group to update the submenu of the site view"
COM_COMPONENTBUILDER_SITE_VIEWS_SUBMENU_DESC="Allows the users in this group to submenu of site view"
COM_COMPONENTBUILDER_SITE_VIEW_GET_SNIPPETS_BUTTON_ACCESS="Site View Get Snippets Button Access"
COM_COMPONENTBUILDER_SITE_VIEW_GET_SNIPPETS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the get snippets button."
COM_COMPONENTBUILDER_SNIPPETS_ACCESS="Snippets Access"
@ -704,7 +724,7 @@ COM_COMPONENTBUILDER_SNIPPETS_BATCH_USE_DESC="Allows users in this group to use
COM_COMPONENTBUILDER_SNIPPETS_CREATE="Snippets Create"
COM_COMPONENTBUILDER_SNIPPETS_CREATE_DESC="Allows the users in this group to create create snippets"
COM_COMPONENTBUILDER_SNIPPETS_DASHBOARD_LIST="Snippets Dashboard List"
COM_COMPONENTBUILDER_SNIPPETS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the snippet"
COM_COMPONENTBUILDER_SNIPPETS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of snippet"
COM_COMPONENTBUILDER_SNIPPETS_DELETE="Snippets Delete"
COM_COMPONENTBUILDER_SNIPPETS_DELETE_DESC="Allows the users in this group to delete delete snippets"
COM_COMPONENTBUILDER_SNIPPETS_EDIT="Snippets Edit"
@ -720,7 +740,7 @@ COM_COMPONENTBUILDER_SNIPPETS_EXPORT_DESC="Allows the users in this group to exp
COM_COMPONENTBUILDER_SNIPPETS_IMPORT="Snippets Import"
COM_COMPONENTBUILDER_SNIPPETS_IMPORT_DESC="Allows the users in this group to import import snippets"
COM_COMPONENTBUILDER_SNIPPETS_SUBMENU="Snippets Submenu"
COM_COMPONENTBUILDER_SNIPPETS_SUBMENU_DESC="Allows the users in this group to update the submenu of the snippet"
COM_COMPONENTBUILDER_SNIPPETS_SUBMENU_DESC="Allows the users in this group to submenu of snippet"
COM_COMPONENTBUILDER_SNIPPET_GET_SNIPPETS_BUTTON_ACCESS="Snippet Get Snippets Button Access"
COM_COMPONENTBUILDER_SNIPPET_GET_SNIPPETS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the get snippets button."
COM_COMPONENTBUILDER_SNIPPET_SHARE_SNIPPETS_BUTTON_ACCESS="Snippet Share Snippets Button Access"
@ -748,9 +768,9 @@ COM_COMPONENTBUILDER_TEMPLATES_BATCH_USE_DESC="Allows users in this group to use
COM_COMPONENTBUILDER_TEMPLATES_CREATE="Templates Create"
COM_COMPONENTBUILDER_TEMPLATES_CREATE_DESC="Allows the users in this group to create create templates"
COM_COMPONENTBUILDER_TEMPLATES_DASHBOARD_ADD="Templates Dashboard Add"
COM_COMPONENTBUILDER_TEMPLATES_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the template"
COM_COMPONENTBUILDER_TEMPLATES_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of template"
COM_COMPONENTBUILDER_TEMPLATES_DASHBOARD_LIST="Templates Dashboard List"
COM_COMPONENTBUILDER_TEMPLATES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the template"
COM_COMPONENTBUILDER_TEMPLATES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of template"
COM_COMPONENTBUILDER_TEMPLATES_DELETE="Templates Delete"
COM_COMPONENTBUILDER_TEMPLATES_DELETE_DESC="Allows the users in this group to delete delete templates"
COM_COMPONENTBUILDER_TEMPLATES_EDIT="Templates Edit"
@ -766,7 +786,7 @@ COM_COMPONENTBUILDER_TEMPLATES_EXPORT_DESC="Allows the users in this group to ex
COM_COMPONENTBUILDER_TEMPLATES_IMPORT="Templates Import"
COM_COMPONENTBUILDER_TEMPLATES_IMPORT_DESC="Allows the users in this group to import import templates"
COM_COMPONENTBUILDER_TEMPLATES_SUBMENU="Templates Submenu"
COM_COMPONENTBUILDER_TEMPLATES_SUBMENU_DESC="Allows the users in this group to update the submenu of the template"
COM_COMPONENTBUILDER_TEMPLATES_SUBMENU_DESC="Allows the users in this group to submenu of template"
COM_COMPONENTBUILDER_TEMPLATE_GET_SNIPPETS_BUTTON_ACCESS="Template Get Snippets Button Access"
COM_COMPONENTBUILDER_TEMPLATE_GET_SNIPPETS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the get snippets button."
COM_COMPONENTBUILDER_USE_BATCH="Use Batch"
@ -778,7 +798,7 @@ COM_COMPONENTBUILDER_VALIDATION_RULES_BATCH_USE_DESC="Allows users in this group
COM_COMPONENTBUILDER_VALIDATION_RULES_CREATE="Validation Rules Create"
COM_COMPONENTBUILDER_VALIDATION_RULES_CREATE_DESC="Allows the users in this group to create create validation rules"
COM_COMPONENTBUILDER_VALIDATION_RULES_DASHBOARD_LIST="Validation Rules Dashboard List"
COM_COMPONENTBUILDER_VALIDATION_RULES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the validation rule"
COM_COMPONENTBUILDER_VALIDATION_RULES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of validation rule"
COM_COMPONENTBUILDER_VALIDATION_RULES_DELETE="Validation Rules Delete"
COM_COMPONENTBUILDER_VALIDATION_RULES_DELETE_DESC="Allows the users in this group to delete delete validation rules"
COM_COMPONENTBUILDER_VALIDATION_RULES_EDIT="Validation Rules Edit"
@ -794,4 +814,4 @@ COM_COMPONENTBUILDER_VALIDATION_RULES_EXPORT_DESC="Allows the users in this grou
COM_COMPONENTBUILDER_VALIDATION_RULES_IMPORT="Validation Rules Import"
COM_COMPONENTBUILDER_VALIDATION_RULES_IMPORT_DESC="Allows the users in this group to import import validation rules"
COM_COMPONENTBUILDER_VALIDATION_RULES_SUBMENU="Validation Rules Submenu"
COM_COMPONENTBUILDER_VALIDATION_RULES_SUBMENU_DESC="Allows the users in this group to update the submenu of the validation rule"
COM_COMPONENTBUILDER_VALIDATION_RULES_SUBMENU_DESC="Allows the users in this group to submenu of validation rule"

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,44 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 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');
$app = JFactory::getApplication();
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'created',
'created_by',
'modified',
'modified_by'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
foreach ($fields as $field)
{
$field = is_array($field) ? $field : array($field);
foreach ($field as $f)
{
if ($form->getField($f))
{
if (in_array($f, $hiddenFields))
{
$form->setFieldAttribute($f, 'type', 'hidden');
}
echo $form->renderField($f);
break;
}
}
}

View File

@ -0,0 +1,46 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 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');
$app = JFactory::getApplication();
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'published',
'ordering',
'access',
'version',
'hits',
'id'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
foreach ($fields as $field)
{
$field = is_array($field) ? $field : array($field);
foreach ($field as $f)
{
if ($form->getField($f))
{
if (in_array($f, $hiddenFields))
{
$form->setFieldAttribute($f, 'type', 'hidden');
}
echo $form->renderField($f);
break;
}
}
}

View File

@ -0,0 +1,27 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 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');
$form = $displayData->getForm();
$fields = array(
'admin_view'
);
?>
<div class="form-inline form-inline-header">
<?php foreach($fields as $field){
echo $form->renderField($field);
} ?>
</div>

View File

@ -0,0 +1,35 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 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');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'note_on_relations',
'addrelations'
);
?>
<div class="form-vertical">
<?php foreach($fields as $field): ?>
<div class="control-group">
<div class="control-label">
<?php echo $form->getLabel($field); ?>
</div>
<div class="controls">
<?php echo $form->getInput($field); ?>
</div>
</div>
<?php endforeach; ?>
</div>

View File

@ -27,6 +27,8 @@ $fields = $displayData->get('fields') ?: array(
'php_getitems_after_all',
'add_php_getlistquery',
'php_getlistquery',
'add_php_getform',
'php_getform',
'add_php_before_save',
'php_before_save',
'add_php_save',

View File

@ -14,7 +14,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
$items = $displayData->wadfields;
$items = $displayData->waefields;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";
@ -68,14 +68,14 @@ $can = ComponentbuilderHelper::getActions('field');
$canDo = ComponentbuilderHelper::getActions('field',$item,'fields');
?>
<tr>
<td class="nowrap">
<td>
<?php if ($canDo->get('field.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>&ref=fieldtype&refid=<?php echo $id; ?>"><?php echo $displayData->escape($item->name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'fields.', $canCheckin); ?>
<?php endif; ?>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'fields.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<div class="name"><?php echo $displayData->escape($item->name); ?></div>
<?php echo $displayData->escape($item->name); ?>
<?php endif; ?>
</td>
<td>
@ -93,7 +93,7 @@ $can = ComponentbuilderHelper::getActions('field');
<td>
<?php echo JText::_($item->store); ?>
</td>
<td class="nowrap">
<td>
<?php if ($user->authorise('core.edit', 'com_componentbuilder.fields.category.' . (int)$item->catid)): ?>
<a href="index.php?option=com_categories&task=category.edit&id=<?php echo (int)$item->catid; ?>&extension=com_componentbuilder.fields"><?php echo $displayData->escape($item->category_title); ?></a>
<?php else: ?>

View File

@ -25,6 +25,7 @@ $fields = $displayData->get('fields') ?: array(
'note_whmcs_lisencing_note',
'whmcs_key',
'whmcs_url',
'whmcs_buy_link',
'license',
'bom',
'image'

View File

@ -14,7 +14,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
$items = $displayData->wanlinked_components;
$items = $displayData->waolinked_components;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
@ -59,14 +59,14 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
$canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components');
?>
<tr>
<td class="nowrap">
<td>
<?php if ($canDo->get('joomla_component.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>&ref=server&refid=<?php echo $id; ?>"><?php echo $displayData->escape($item->system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?>
<?php endif; ?>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<div class="name"><?php echo $displayData->escape($item->system_name); ?></div>
<?php echo $displayData->escape($item->system_name); ?>
<?php endif; ?>
</td>
<td>

View File

@ -205,7 +205,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -256,7 +255,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -522,7 +521,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -620,7 +619,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -665,7 +664,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -865,13 +864,13 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -205,7 +205,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -256,7 +255,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -522,7 +521,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -620,7 +619,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -665,7 +664,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -855,13 +854,13 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -0,0 +1,857 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 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\Registry\Registry;
// import Joomla modelform library
jimport('joomla.application.component.modeladmin');
/**
* Componentbuilder Admin_fields_relations Model
*/
class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_COMPONENTBUILDER';
/**
* The type alias for this content type.
*
* @var string
* @since 3.2
*/
public $typeAlias = 'com_componentbuilder.admin_fields_relations';
/**
* Returns a Table object, always creating it
*
* @param type $type The table type to instantiate
* @param string $prefix A prefix for the table class name. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return JTable A database object
*
* @since 1.6
*/
public function getTable($type = 'admin_fields_relations', $prefix = 'ComponentbuilderTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
/**
* Method to get a single record.
*
* @param integer $pk The id of the primary key.
*
* @return mixed Object on success, false on failure.
*
* @since 1.6
*/
public function getItem($pk = null)
{
if ($item = parent::getItem($pk))
{
if (!empty($item->params) && !is_array($item->params))
{
// Convert the params field to an array.
$registry = new Registry;
$registry->loadString($item->params);
$item->params = $registry->toArray();
}
if (!empty($item->metadata))
{
// Convert the metadata field to an array.
$registry = new Registry;
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}
if (!empty($item->addrelations))
{
// Convert the addrelations field to an array.
$addrelations = new Registry;
$addrelations->loadString($item->addrelations);
$item->addrelations = $addrelations->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields_relations');
}
}
return $item;
}
/**
* Method to get the record form.
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return mixed A JForm object on success, false on failure
*
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_componentbuilder.admin_fields_relations', 'admin_fields_relations', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
return false;
}
$jinput = JFactory::getApplication()->input;
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
}
$user = JFactory::getUser();
// Check for existing item.
// Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder.admin_fields_relations.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// If this is a new item insure the greated by is set.
if (0 == $id)
{
// Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('admin_fields_relations.edit.created_by', 'com_componentbuilder.admin_fields_relations.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields_relations.edit.created_by', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('admin_fields_relations.edit.created', 'com_componentbuilder.admin_fields_relations.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields_relations.edit.created', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// Only load these values if no id is found
if (0 == $id)
{
// Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
/**
* Method to get the script that have to be included on the form
*
* @return string script files
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/admin_fields_relations.js';
}
/**
* Method to test whether a record can be deleted.
*
* @param object $record A record object.
*
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canDelete($record)
{
if (!empty($record->id))
{
if ($record->published != -2)
{
return;
}
$user = JFactory::getUser();
// The record has been set. Check the record permissions.
return $user->authorise('admin_fields_relations.delete', 'com_componentbuilder.admin_fields_relations.' . (int) $record->id);
}
return false;
}
/**
* Method to test whether a record can have its state edited.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// In the absense of better information, revert to the component permissions.
return $user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder');
}
/**
* 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 2.5
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('admin_fields_relations.edit', 'com_componentbuilder.admin_fields_relations.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('admin_fields_relations.edit', 'com_componentbuilder');
}
/**
* Prepare and sanitise the table data prior to saving.
*
* @param JTable $table A JTable object.
*
* @return void
*
* @since 1.6
*/
protected function prepareTable($table)
{
$date = JFactory::getDate();
$user = JFactory::getUser();
if (isset($table->name))
{
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
}
if (isset($table->alias) && empty($table->alias))
{
$table->generateAlias();
}
if (empty($table->id))
{
$table->created = $date->toSql();
// set the user
if ($table->created_by == 0 || empty($table->created_by))
{
$table->created_by = $user->id;
}
// Set ordering to the last item if not set
if (empty($table->ordering))
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('MAX(ordering)')
->from($db->quoteName('#__componentbuilder_admin_fields_relations'));
$db->setQuery($query);
$max = $db->loadResult();
$table->ordering = $max + 1;
}
}
else
{
$table->modified = $date->toSql();
$table->modified_by = $user->id;
}
if (!empty($table->id))
{
// Increment the items version number.
$table->version++;
}
}
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 1.6
*/
protected function loadFormData()
{
// Check the session for previously entered form data.
$data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.admin_fields_relations.data', array());
if (empty($data))
{
$data = $this->getItem();
}
return $data;
}
/**
* Method to get the unique fields of this table.
*
* @return mixed An array of field names, boolean false if none is set.
*
* @since 3.0
*/
protected function getUniqeFields()
{
return false;
}
/**
* Method to delete one or more records.
*
* @param array &$pks An array of record primary keys.
*
* @return boolean True if successful, false if an error occurs.
*
* @since 12.2
*/
public function delete(&$pks)
{
if (!parent::delete($pks))
{
return false;
}
return true;
}
/**
* Method to change the published state of one or more records.
*
* @param array &$pks A list of the primary keys to change.
* @param integer $value The value of the published state.
*
* @return boolean True on success.
*
* @since 12.2
*/
public function publish(&$pks, $value = 1)
{
if (!parent::publish($pks, $value))
{
return false;
}
return true;
}
/**
* Method to perform batch operations on an item or a set of items.
*
* @param array $commands An array of commands to perform.
* @param array $pks An array of item ids.
* @param array $contexts An array of item contexts.
*
* @return boolean Returns true on success, false on failure.
*
* @since 12.2
*/
public function batch($commands, $pks, $contexts)
{
// Sanitize ids.
$pks = array_unique($pks);
JArrayHelper::toInteger($pks);
// Remove any values of zero.
if (array_search(0, $pks, true))
{
unset($pks[array_search(0, $pks, true)]);
}
if (empty($pks))
{
$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
return false;
}
$done = false;
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations');
$this->batchSet = true;
if (!$this->canDo->get('core.batch'))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
return false;
}
if ($this->type == false)
{
$type = new JUcmType;
$this->type = $type->getTypeByAlias($this->typeAlias);
}
$this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
if (!empty($commands['move_copy']))
{
$cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
if ($cmd == 'c')
{
$result = $this->batchCopy($commands, $pks, $contexts);
if (is_array($result))
{
foreach ($result as $old => $new)
{
$contexts[$new] = $contexts[$old];
}
$pks = array_values($result);
}
else
{
return false;
}
}
elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
{
return false;
}
$done = true;
}
if (!$done)
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
return false;
}
// Clear the cache
$this->cleanCache();
return true;
}
/**
* Batch copy items to a new category or current.
*
* @param integer $values The new values.
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
if (empty($this->batchSet))
{
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations');
}
if (!$this->canDo->get('admin_fields_relations.create') && !$this->canDo->get('admin_fields_relations.batch'))
{
return false;
}
// get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// remove move_copy from array
unset($values['move_copy']);
// make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
}
elseif (isset($values['published']) && !$this->canDo->get('admin_fields_relations.edit.state'))
{
$values['published'] = 0;
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
// Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('admin_fields_relations.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// Fatal error
$this->setError($error);
return false;
}
else
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->admin_view) && !is_numeric($this->table->admin_view))
{
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
if (strlen($value) > 0 && isset($this->table->$key))
{
$this->table->$key = $value;
}
}
}
// update all uniqe fields
if (ComponentbuilderHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
{
$this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
}
}
// Reset the ID because we are making a copy
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
return false;
}
if (!empty($this->type))
{
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
return false;
}
// Get the new item ID
$newId = $this->table->get('id');
// Add the new ID to the array
$newIds[$pk] = $newId;
}
// Clean the cache
$this->cleanCache();
return $newIds;
}
/**
* Batch move items to a new category
*
* @param integer $value The new category ID.
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
if (empty($this->batchSet))
{
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations');
}
if (!$this->canDo->get('admin_fields_relations.edit') && !$this->canDo->get('admin_fields_relations.batch'))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('admin_fields_relations.edit.state'))
{
unset($values['published']);
}
// remove move_copy from array
unset($values['move_copy']);
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('admin_fields_relations.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// Fatal error
$this->setError($error);
return false;
}
else
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// insert all set values.
if (ComponentbuilderHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// Do special action for access.
if ('access' === $key && strlen($value) > 0)
{
$this->table->$key = $value;
}
elseif (strlen($value) > 0 && isset($this->table->$key))
{
$this->table->$key = $value;
}
}
}
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
return false;
}
if (!empty($this->type))
{
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
return false;
}
}
// Clean the cache
$this->cleanCache();
return true;
}
/**
* Method to save the form data.
*
* @param array $data The form data.
*
* @return boolean True on success.
*
* @since 1.6
*/
public function save($data)
{
$input = JFactory::getApplication()->input;
$filter = JFilterInput::getInstance();
// set the metadata to the Item Data
if (isset($data['metadata']) && isset($data['metadata']['author']))
{
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
$metadata = new JRegistry;
$metadata->loadArray($data['metadata']);
$data['metadata'] = (string) $metadata;
}
// Set the addrelations items to data.
if (isset($data['addrelations']) && is_array($data['addrelations']))
{
$addrelations = new JRegistry;
$addrelations->loadArray($data['addrelations']);
$data['addrelations'] = (string) $addrelations;
}
elseif (!isset($data['addrelations']))
{
// Set the empty addrelations to data
$data['addrelations'] = '';
}
// Set the Params Items to data
if (isset($data['params']) && is_array($data['params']))
{
$params = new JRegistry;
$params->loadArray($data['params']);
$data['params'] = (string) $params;
}
// Alter the uniqe field for save as copy
if ($input->get('task') === 'save2copy')
{
// Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (ComponentbuilderHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
{
$data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
}
}
}
if (parent::save($data))
{
return true;
}
return false;
}
/**
* Method to generate a uniqe value.
*
* @param string $field name.
* @param string $value data.
*
* @return string New value.
*
* @since 3.0
*/
protected function generateUniqe($field,$value)
{
// set field value uniqe
$table = $this->getTable();
while ($table->load(array($field => $value)))
{
$value = JString::increment($value);
}
return $value;
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{
// Alter the title
$table = $this->getTable();
while ($table->load(array('title' => $title)))
{
$title = JString::increment($title);
}
return $title;
}
}

View File

@ -86,6 +86,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->php_import_headers))
{
// base64 Decode php_import_headers.
$item->php_import_headers = base64_decode($item->php_import_headers);
}
if (!empty($item->html_import_view))
{
// base64 Decode html_import_view.
@ -98,12 +104,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_import_save = base64_decode($item->php_import_save);
}
if (!empty($item->php_import_headers))
{
// base64 Decode php_import_headers.
$item->php_import_headers = base64_decode($item->php_import_headers);
}
if (!empty($item->php_getitem))
{
// base64 Decode php_getitem.
@ -134,10 +134,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_getlistquery = base64_decode($item->php_getlistquery);
}
if (!empty($item->php_before_save))
if (!empty($item->php_getform))
{
// base64 Decode php_before_save.
$item->php_before_save = base64_decode($item->php_before_save);
// base64 Decode php_getform.
$item->php_getform = base64_decode($item->php_getform);
}
if (!empty($item->css_views))
@ -146,78 +146,84 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->css_views = base64_decode($item->css_views);
}
if (!empty($item->php_before_save))
{
// base64 Decode php_before_save.
$item->php_before_save = base64_decode($item->php_before_save);
}
if (!empty($item->php_save))
{
// base64 Decode php_save.
$item->php_save = base64_decode($item->php_save);
}
if (!empty($item->php_postsavehook))
{
// base64 Decode php_postsavehook.
$item->php_postsavehook = base64_decode($item->php_postsavehook);
}
if (!empty($item->javascript_view_file))
{
// base64 Decode javascript_view_file.
$item->javascript_view_file = base64_decode($item->javascript_view_file);
}
if (!empty($item->php_postsavehook))
{
// base64 Decode php_postsavehook.
$item->php_postsavehook = base64_decode($item->php_postsavehook);
}
if (!empty($item->php_allowedit))
{
// base64 Decode php_allowedit.
$item->php_allowedit = base64_decode($item->php_allowedit);
}
if (!empty($item->php_batchcopy))
{
// base64 Decode php_batchcopy.
$item->php_batchcopy = base64_decode($item->php_batchcopy);
}
if (!empty($item->javascript_view_footer))
{
// base64 Decode javascript_view_footer.
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
}
if (!empty($item->php_batchcopy))
{
// base64 Decode php_batchcopy.
$item->php_batchcopy = base64_decode($item->php_batchcopy);
}
if (!empty($item->php_batchmove))
{
// base64 Decode php_batchmove.
$item->php_batchmove = base64_decode($item->php_batchmove);
}
if (!empty($item->php_before_publish))
{
// base64 Decode php_before_publish.
$item->php_before_publish = base64_decode($item->php_before_publish);
}
if (!empty($item->javascript_views_file))
{
// base64 Decode javascript_views_file.
$item->javascript_views_file = base64_decode($item->javascript_views_file);
}
if (!empty($item->php_before_publish))
{
// base64 Decode php_before_publish.
$item->php_before_publish = base64_decode($item->php_before_publish);
}
if (!empty($item->php_after_publish))
{
// base64 Decode php_after_publish.
$item->php_after_publish = base64_decode($item->php_after_publish);
}
if (!empty($item->php_before_delete))
{
// base64 Decode php_before_delete.
$item->php_before_delete = base64_decode($item->php_before_delete);
}
if (!empty($item->javascript_views_footer))
{
// base64 Decode javascript_views_footer.
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
}
if (!empty($item->php_before_delete))
{
// base64 Decode php_before_delete.
$item->php_before_delete = base64_decode($item->php_before_delete);
}
if (!empty($item->php_after_delete))
{
// base64 Decode php_after_delete.
@ -236,60 +242,68 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_controller = base64_decode($item->php_controller);
}
if (!empty($item->sql))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
}
if (!empty($item->php_model))
{
// base64 Decode php_model.
$item->php_model = base64_decode($item->php_model);
}
if (!empty($item->sql))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
}
if (!empty($item->php_controller_list))
{
// base64 Decode php_controller_list.
$item->php_controller_list = base64_decode($item->php_controller_list);
}
if (!empty($item->php_import_display))
{
// base64 Decode php_import_display.
$item->php_import_display = base64_decode($item->php_import_display);
}
if (!empty($item->php_model_list))
{
// base64 Decode php_model_list.
$item->php_model_list = base64_decode($item->php_model_list);
}
if (!empty($item->php_import_display))
{
// base64 Decode php_import_display.
$item->php_import_display = base64_decode($item->php_import_display);
}
if (!empty($item->php_import))
{
// base64 Decode php_import.
$item->php_import = base64_decode($item->php_import);
}
if (!empty($item->php_import_setdata))
{
// base64 Decode php_import_setdata.
$item->php_import_setdata = base64_decode($item->php_import_setdata);
}
if (!empty($item->php_ajaxmethod))
{
// base64 Decode php_ajaxmethod.
$item->php_ajaxmethod = base64_decode($item->php_ajaxmethod);
}
if (!empty($item->php_import_setdata))
{
// base64 Decode php_import_setdata.
$item->php_import_setdata = base64_decode($item->php_import_setdata);
}
if (!empty($item->php_import_ext))
{
// base64 Decode php_import_ext.
$item->php_import_ext = base64_decode($item->php_import_ext);
}
if (!empty($item->addtables))
{
// Convert the addtables field to an array.
$addtables = new Registry;
$addtables->loadString($item->addtables);
$item->addtables = $addtables->toArray();
}
if (!empty($item->addpermissions))
{
// Convert the addpermissions field to an array.
@ -314,14 +328,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->addlinked_views = $addlinked_views->toArray();
}
if (!empty($item->addtables))
{
// Convert the addtables field to an array.
$addtables = new Registry;
$addtables->loadString($item->addtables);
$item->addtables = $addtables->toArray();
}
if (!empty($item->alias_builder))
{
// Convert the alias_builder field to an array.
@ -500,6 +506,22 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
}
}
// update all editors to use this components global editor
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
// now get all the editor fields
$editors = $form->getXml()->xpath("//field[@type='editor']");
// check if we found any
if (ComponentbuilderHelper::checkArray($editors))
{
foreach ($editors as $editor)
{
// get the field names
$name = (string) $editor['name'];
// set the field editor value (with none as fallback)
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
}
}
return $form;
}
@ -550,7 +572,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -661,18 +683,18 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -729,7 +751,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{
$_tablesArray = array(
'admin_fields',
'admin_fields_conditions'
'admin_fields_conditions',
'admin_fields_relations'
);
foreach($_tablesArray as $_updateTable)
{
@ -769,7 +792,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{
$_tablesArray = array(
'admin_fields',
'admin_fields_conditions'
'admin_fields_conditions',
'admin_fields_relations'
);
foreach($_tablesArray as $_updateTable)
{
@ -892,7 +916,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -984,7 +1008,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -1049,7 +1073,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -1178,6 +1202,19 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['system_name'] = $data['name_single'];
}
// Set the addtables items to data.
if (isset($data['addtables']) && is_array($data['addtables']))
{
$addtables = new JRegistry;
$addtables->loadArray($data['addtables']);
$data['addtables'] = (string) $addtables;
}
elseif (!isset($data['addtables']))
{
// Set the empty addtables to data
$data['addtables'] = '';
}
// Set the addpermissions items to data.
if (isset($data['addpermissions']) && is_array($data['addpermissions']))
{
@ -1217,19 +1254,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['addlinked_views'] = '';
}
// Set the addtables items to data.
if (isset($data['addtables']) && is_array($data['addtables']))
{
$addtables = new JRegistry;
$addtables->loadArray($data['addtables']);
$data['addtables'] = (string) $addtables;
}
elseif (!isset($data['addtables']))
{
// Set the empty addtables to data
$data['addtables'] = '';
}
// Set the alias_builder items to data.
if (isset($data['alias_builder']) && is_array($data['alias_builder']))
{
@ -1269,6 +1293,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['ajax_input'] = '';
}
// Set the php_import_headers string to base64 string.
if (isset($data['php_import_headers']))
{
$data['php_import_headers'] = base64_encode($data['php_import_headers']);
}
// Set the html_import_view string to base64 string.
if (isset($data['html_import_view']))
{
@ -1281,12 +1311,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_import_save'] = base64_encode($data['php_import_save']);
}
// Set the php_import_headers string to base64 string.
if (isset($data['php_import_headers']))
{
$data['php_import_headers'] = base64_encode($data['php_import_headers']);
}
// Set the php_getitem string to base64 string.
if (isset($data['php_getitem']))
{
@ -1317,10 +1341,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_getlistquery'] = base64_encode($data['php_getlistquery']);
}
// Set the php_before_save string to base64 string.
if (isset($data['php_before_save']))
// Set the php_getform string to base64 string.
if (isset($data['php_getform']))
{
$data['php_before_save'] = base64_encode($data['php_before_save']);
$data['php_getform'] = base64_encode($data['php_getform']);
}
// Set the css_views string to base64 string.
@ -1329,78 +1353,84 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['css_views'] = base64_encode($data['css_views']);
}
// Set the php_before_save string to base64 string.
if (isset($data['php_before_save']))
{
$data['php_before_save'] = base64_encode($data['php_before_save']);
}
// Set the php_save string to base64 string.
if (isset($data['php_save']))
{
$data['php_save'] = base64_encode($data['php_save']);
}
// Set the php_postsavehook string to base64 string.
if (isset($data['php_postsavehook']))
{
$data['php_postsavehook'] = base64_encode($data['php_postsavehook']);
}
// Set the javascript_view_file string to base64 string.
if (isset($data['javascript_view_file']))
{
$data['javascript_view_file'] = base64_encode($data['javascript_view_file']);
}
// Set the php_postsavehook string to base64 string.
if (isset($data['php_postsavehook']))
{
$data['php_postsavehook'] = base64_encode($data['php_postsavehook']);
}
// Set the php_allowedit string to base64 string.
if (isset($data['php_allowedit']))
{
$data['php_allowedit'] = base64_encode($data['php_allowedit']);
}
// Set the php_batchcopy string to base64 string.
if (isset($data['php_batchcopy']))
{
$data['php_batchcopy'] = base64_encode($data['php_batchcopy']);
}
// 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 php_batchcopy string to base64 string.
if (isset($data['php_batchcopy']))
{
$data['php_batchcopy'] = base64_encode($data['php_batchcopy']);
}
// Set the php_batchmove string to base64 string.
if (isset($data['php_batchmove']))
{
$data['php_batchmove'] = base64_encode($data['php_batchmove']);
}
// Set the php_before_publish string to base64 string.
if (isset($data['php_before_publish']))
{
$data['php_before_publish'] = base64_encode($data['php_before_publish']);
}
// Set the javascript_views_file string to base64 string.
if (isset($data['javascript_views_file']))
{
$data['javascript_views_file'] = base64_encode($data['javascript_views_file']);
}
// Set the php_before_publish string to base64 string.
if (isset($data['php_before_publish']))
{
$data['php_before_publish'] = base64_encode($data['php_before_publish']);
}
// Set the php_after_publish string to base64 string.
if (isset($data['php_after_publish']))
{
$data['php_after_publish'] = base64_encode($data['php_after_publish']);
}
// Set the php_before_delete string to base64 string.
if (isset($data['php_before_delete']))
{
$data['php_before_delete'] = base64_encode($data['php_before_delete']);
}
// 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 php_before_delete string to base64 string.
if (isset($data['php_before_delete']))
{
$data['php_before_delete'] = base64_encode($data['php_before_delete']);
}
// Set the php_after_delete string to base64 string.
if (isset($data['php_after_delete']))
{
@ -1419,54 +1449,54 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_controller'] = base64_encode($data['php_controller']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
{
$data['sql'] = base64_encode($data['sql']);
}
// Set the php_model string to base64 string.
if (isset($data['php_model']))
{
$data['php_model'] = base64_encode($data['php_model']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
{
$data['sql'] = base64_encode($data['sql']);
}
// Set the php_controller_list string to base64 string.
if (isset($data['php_controller_list']))
{
$data['php_controller_list'] = base64_encode($data['php_controller_list']);
}
// Set the php_import_display string to base64 string.
if (isset($data['php_import_display']))
{
$data['php_import_display'] = base64_encode($data['php_import_display']);
}
// Set the php_model_list string to base64 string.
if (isset($data['php_model_list']))
{
$data['php_model_list'] = base64_encode($data['php_model_list']);
}
// Set the php_import_display string to base64 string.
if (isset($data['php_import_display']))
{
$data['php_import_display'] = base64_encode($data['php_import_display']);
}
// Set the php_import string to base64 string.
if (isset($data['php_import']))
{
$data['php_import'] = base64_encode($data['php_import']);
}
// Set the php_import_setdata string to base64 string.
if (isset($data['php_import_setdata']))
{
$data['php_import_setdata'] = base64_encode($data['php_import_setdata']);
}
// Set the php_ajaxmethod string to base64 string.
if (isset($data['php_ajaxmethod']))
{
$data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']);
}
// Set the php_import_setdata string to base64 string.
if (isset($data['php_import_setdata']))
{
$data['php_import_setdata'] = base64_encode($data['php_import_setdata']);
}
// Set the php_import_ext string to base64 string.
if (isset($data['php_import_ext']))
{

View File

@ -104,11 +104,9 @@ class ComponentbuilderModelAdmin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -194,10 +192,10 @@ class ComponentbuilderModelAdmin_views extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -237,23 +235,21 @@ class ComponentbuilderModelAdmin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
continue;
}
// decode php_import_headers
$item->php_import_headers = base64_decode($item->php_import_headers);
// decode html_import_view
$item->html_import_view = base64_decode($item->html_import_view);
// decode php_import_save
$item->php_import_save = base64_decode($item->php_import_save);
// decode php_import_headers
$item->php_import_headers = base64_decode($item->php_import_headers);
// decode php_getitem
$item->php_getitem = base64_decode($item->php_getitem);
// decode php_getitems
@ -264,56 +260,58 @@ class ComponentbuilderModelAdmin_views extends JModelList
$item->css_view = base64_decode($item->css_view);
// decode php_getlistquery
$item->php_getlistquery = base64_decode($item->php_getlistquery);
// decode php_before_save
$item->php_before_save = base64_decode($item->php_before_save);
// decode php_getform
$item->php_getform = base64_decode($item->php_getform);
// decode css_views
$item->css_views = base64_decode($item->css_views);
// decode php_before_save
$item->php_before_save = base64_decode($item->php_before_save);
// decode php_save
$item->php_save = base64_decode($item->php_save);
// decode php_postsavehook
$item->php_postsavehook = base64_decode($item->php_postsavehook);
// decode javascript_view_file
$item->javascript_view_file = base64_decode($item->javascript_view_file);
// decode php_postsavehook
$item->php_postsavehook = base64_decode($item->php_postsavehook);
// decode php_allowedit
$item->php_allowedit = base64_decode($item->php_allowedit);
// decode php_batchcopy
$item->php_batchcopy = base64_decode($item->php_batchcopy);
// decode javascript_view_footer
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
// decode php_batchcopy
$item->php_batchcopy = base64_decode($item->php_batchcopy);
// decode php_batchmove
$item->php_batchmove = base64_decode($item->php_batchmove);
// decode php_before_publish
$item->php_before_publish = base64_decode($item->php_before_publish);
// decode javascript_views_file
$item->javascript_views_file = base64_decode($item->javascript_views_file);
// decode php_before_publish
$item->php_before_publish = base64_decode($item->php_before_publish);
// decode php_after_publish
$item->php_after_publish = base64_decode($item->php_after_publish);
// decode php_before_delete
$item->php_before_delete = base64_decode($item->php_before_delete);
// decode javascript_views_footer
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
// decode php_before_delete
$item->php_before_delete = base64_decode($item->php_before_delete);
// decode php_after_delete
$item->php_after_delete = base64_decode($item->php_after_delete);
// decode php_document
$item->php_document = base64_decode($item->php_document);
// decode php_controller
$item->php_controller = base64_decode($item->php_controller);
// decode sql
$item->sql = base64_decode($item->sql);
// decode php_model
$item->php_model = base64_decode($item->php_model);
// decode sql
$item->sql = base64_decode($item->sql);
// decode php_controller_list
$item->php_controller_list = base64_decode($item->php_controller_list);
// decode php_import_display
$item->php_import_display = base64_decode($item->php_import_display);
// decode php_model_list
$item->php_model_list = base64_decode($item->php_model_list);
// decode php_import_display
$item->php_import_display = base64_decode($item->php_import_display);
// decode php_import
$item->php_import = base64_decode($item->php_import);
// decode php_import_setdata
$item->php_import_setdata = base64_decode($item->php_import_setdata);
// decode php_ajaxmethod
$item->php_ajaxmethod = base64_decode($item->php_ajaxmethod);
// decode php_import_setdata
$item->php_import_setdata = base64_decode($item->php_import_setdata);
// decode php_import_ext
$item->php_import_ext = base64_decode($item->php_import_ext);
// unset the values we don't want exported.
@ -385,16 +383,16 @@ class ComponentbuilderModelAdmin_views extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelAdmins_fields extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $item->id) && $user->authorise('admin_fields.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelAdmins_fields extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $item->id) && $user->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -0,0 +1,240 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 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');
// import the Joomla modellist library
jimport('joomla.application.component.modellist');
/**
* Admins_fields_relations Model
*/
class ComponentbuilderModelAdmins_fields_relations extends JModelList
{
public function __construct($config = array())
{
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'a.id','id',
'a.published','published',
'a.ordering','ordering',
'a.created_by','created_by',
'a.modified_by','modified_by'
);
}
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* @return void
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
// List state information.
parent::populateState($ordering, $direction);
}
/**
* Method to get an array of data items.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getItems()
{
// check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
$access = (JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
continue;
}
}
}
// return items
return $items;
}
/**
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
*/
protected function getListQuery()
{
// Get the user object.
$user = JFactory::getUser();
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// Select some fields
$query->select('a.*');
// From the componentbuilder_item table
$query->from($db->quoteName('#__componentbuilder_admin_fields_relations', 'a'));
// From the componentbuilder_admin_view table.
$query->select($db->quoteName('g.system_name','admin_view_system_name'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_admin_view', 'g') . ' ON (' . $db->quoteName('a.admin_view') . ' = ' . $db->quoteName('g.id') . ')');
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
$query->where('a.published = ' . (int) $published);
}
elseif ($published === '')
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
{
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
return $query;
}
/**
* Method to get a store id based on model configuration state.
*
* @return string A store id.
*
*/
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');
return parent::getStoreId($id);
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{
// Get a db connection.
$db = JFactory::getDbo();
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__componentbuilder_admin_fields_relations'));
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
// Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// reset query
$query = $db->getQuery(true);
// Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// Check table
$query->update($db->quoteName('#__componentbuilder_admin_fields_relations'))->set($fields)->where($conditions);
$db->setQuery($query);
$db->execute();
}
}
return false;
}
}

View File

@ -193,7 +193,7 @@ class ComponentbuilderModelAjax extends JModelList
}
return $result;
}
protected function hasCurl()
{
return function_exists('curl_version');
@ -233,23 +233,29 @@ class ComponentbuilderModelAjax extends JModelList
return false;
}
protected $rowNumbers = array(
'admin_fields_conditions' => 80,
'admin_fields' => 50
);
protected $buttonArray = array(
'library_config' => 'libraries_config',
'library_files_folders_urls' => 'libraries_files_folders_urls',
'admin_fields' => 'admins_fields',
'admin_fields_conditions' => 'admins_fields_conditions',
'validation_rule' => 'validation_rules',
'field' => 'fields',
'component_admin_views' => 'components_admin_views' ,
'component_site_views' => 'components_site_views',
'component_custom_admin_views' => 'components_custom_views',
'component_updates' => 'components_updates',
'component_mysql_tweaks' => 'components_mysql_tweaks',
'component_custom_admin_menus' => 'components_custom_admin_menus',
'component_config' => 'components_config',
'component_dashboard' => 'components_dashboard',
'component_files_folders' => 'components_files_folders',
'language' => true);
'library_config' => 'libraries_config',
'library_files_folders_urls' => 'libraries_files_folders_urls',
'admin_fields' => 'admins_fields',
'admin_fields_conditions' => 'admins_fields_conditions',
'admin_fields_relations' => 'admins_fields_relations',
'validation_rule' => 'validation_rules',
'field' => 'fields',
'component_admin_views' => 'components_admin_views' ,
'component_site_views' => 'components_site_views',
'component_custom_admin_views' => 'components_custom_views',
'component_updates' => 'components_updates',
'component_mysql_tweaks' => 'components_mysql_tweaks',
'component_custom_admin_menus' => 'components_custom_admin_menus',
'component_config' => 'components_config',
'component_dashboard' => 'components_dashboard',
'component_files_folders' => 'components_files_folders',
'language' => true);
public function getButton($type, $size)
{
@ -410,6 +416,11 @@ class ComponentbuilderModelAjax extends JModelList
'type' => 'setURLType',
// Admin View
'field' => 'setItemNames',
'listfield' => 'setItemNames',
'joinfields' => 'setItemNames',
'area' => 'setAreaName',
'set' => 'setCode',
'join_type' => 'setJoinType',
'list' => 'setAdminBehaviour',
'title' => 'setYesNo',
'alias' => 'setYesNo',
@ -417,7 +428,7 @@ class ComponentbuilderModelAjax extends JModelList
'search' => 'setYesNo',
'filter' => 'setYesNo',
'link' => 'setYesNo',
'permission' => 'setYesNo',
'permission' => 'setPermissions',
'tab' => 'setTabName',
'alignment' => 'setAlignmentName',
'target_field' => 'setItemNames',
@ -456,6 +467,10 @@ class ComponentbuilderModelAjax extends JModelList
'update' => JText::_('COM_COMPONENTBUILDER_UPDATE'),
// Admin View (fields)
'field' => JText::_('COM_COMPONENTBUILDER_FIELD'),
'listfield' => JText::_('COM_COMPONENTBUILDER_LIST_FIELD'),
'joinfields' => JText::_('COM_COMPONENTBUILDER_JOIN_FIELDS'),
'set' => JText::_('COM_COMPONENTBUILDER_GLUECODE'),
'join_type' => JText::_('COM_COMPONENTBUILDER_JOIN_TYPE'),
'list' => JText::_('COM_COMPONENTBUILDER_ADMIN_BEHAVIOUR'),
'order_list' => JText::_('COM_COMPONENTBUILDER_ORDER_IN_LIST_VIEWS'),
'title' => JText::_('COM_COMPONENTBUILDER_TITLE'),
@ -625,6 +640,7 @@ class ComponentbuilderModelAjax extends JModelList
'library_files_folders_urls' => array('addurls','addfiles','addfolders'),
'admin_fields' => 'addfields',
'admin_fields_conditions' => 'addconditions',
'admin_fields_relations' => 'addrelations',
'component_admin_views' => 'addadmin_views',
'component_site_views' => 'addsite_views',
'component_custom_admin_views' => 'addcustom_admin_views');
@ -691,15 +707,17 @@ class ComponentbuilderModelAjax extends JModelList
$this->checkRepeatableConversion($fieldsData, $fieldName, $id, $idName);
// get the table
$table = $this->getSubformTable($type, $fieldsData);
// get row number
$number = (isset($this->rowNumbers[$type]) && $this->rowNumbers[$type]) ? $this->rowNumbers[$type] : false;
// set notice of bad practice
$notice = '';
if ($idName === 'admin_view' && isset($this->rowNumber) && $this->rowNumber > 50)
if ($number && isset($this->rowNumber) && $this->rowNumber > $number)
{
$notice = '<div class="alert alert-warning">' . JText::sprintf('COM_COMPONENTBUILDER_YOU_HAVE_S_S_ADDING_MORE_THEN_FIFTY_S_IS_CONSIDERED_BAD_PRACTICE_YOUR_S_PAGE_LOAD_IN_JCB_WILL_SLOWDOWN_YOU_SHOULD_CONSIDER_DECOUPLING_SOME_OF_THESE_S', $this->rowNumber, $typeName, $typeName, $typeName, $typeName) . '</div>';
$notice = '<div class="alert alert-warning">' . JText::sprintf('COM_COMPONENTBUILDER_YOU_HAVE_S_S_ADDING_MORE_THEN_S_S_IS_CONSIDERED_BAD_PRACTICE_YOUR_S_PAGE_LOAD_IN_JCB_WILL_SLOWDOWN_YOU_SHOULD_CONSIDER_DECOUPLING_SOME_OF_THESE_S', $this->rowNumber, $typeName, $number, $typeName, $typeName, $typeName) . '</div>';
}
elseif ($idName === 'admin_view' && isset($this->rowNumber))
elseif ($number && isset($this->rowNumber))
{
$notice = '<div class="alert alert-info">' . JText::sprintf('COM_COMPONENTBUILDER_YOU_HAVE_S_S_ADDING_MORE_THEN_FIFTY_S_IS_CONSIDERED_BAD_PRACTICE', $this->rowNumber, $typeName, $typeName) . '</div>';
$notice = '<div class="alert alert-info">' . JText::sprintf('COM_COMPONENTBUILDER_YOU_HAVE_S_S_ADDING_MORE_THEN_S_S_IS_CONSIDERED_BAD_PRACTICE', $this->rowNumber, $typeName, $number, $typeName) . '</div>';
}
// return table
return $notice.$table;
@ -755,6 +773,8 @@ class ComponentbuilderModelAjax extends JModelList
'field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'target_field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'match_field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'listfield' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'joinfields' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
// joomla component view
'siteview' => array('table' => 'site_view', 'tables' => 'site_views', 'id' => 'id', 'name' => 'name', 'text' => 'Site View'),
'customadminview' => array('table' => 'custom_admin_view', 'tables' => 'custom_admin_views', 'id' => 'id', 'name' => 'system_name', 'text' => 'Custom Admin View'),
@ -832,6 +852,56 @@ class ComponentbuilderModelAjax extends JModelList
return JText::_('COM_COMPONENTBUILDER_NO_ITEM_FOUND');
}
protected function setPermissions($header, $values)
{
// check if value is array
if (!ComponentbuilderHelper::checkArray($values))
{
$values = array($values);
}
// check if value is array
if (ComponentbuilderHelper::checkArray($values))
{
// Editing, Access, View
$bucket = array();
foreach ($values as $value)
{
switch ($value)
{
case 1:
$bucket[] = JText::_('COM_COMPONENTBUILDER_EDITING');
break;
case 2:
$bucket[] = JText::_('COM_COMPONENTBUILDER_ACCESS');
break;
case 3:
$bucket[] = JText::_('COM_COMPONENTBUILDER_VIEW');
break;
}
}
// check if value is array
if (ComponentbuilderHelper::checkArray($bucket))
{
return implode(', ', $bucket);
}
}
return JText::_('COM_COMPONENTBUILDER_NONE');
}
protected function setJoinType($header, $value)
{
switch ($value)
{
case 1:
return JText::_('COM_COMPONENTBUILDER_CONCATENATE');
break;
case 2:
return JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE');
break;
}
return JText::_('COM_COMPONENTBUILDER_NOT_SET');
}
protected function setURLType($header, $value)
{
switch ($value)
@ -969,6 +1039,28 @@ class ComponentbuilderModelAjax extends JModelList
return JText::_('COM_COMPONENTBUILDER_DETAILS');
}
protected function setAreaName($header, $value)
{
switch ($value)
{
case 1:
return JText::_('COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING');
break;
case 2:
return JText::_('COM_COMPONENTBUILDER_VIEW');
break;
case 3:
return JText::_('COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING');
break;
}
return JText::_('COM_COMPONENTBUILDER_NOT_SET');
}
protected function setCode($header, $value)
{
return nl2br(htmlspecialchars($value));
}
protected function setYesNo($header, $value)
{
if (1 == $value)
@ -1067,7 +1159,7 @@ class ComponentbuilderModelAjax extends JModelList
{
$result = $this->_db->loadObject();
$result->name = strtolower($result->name);
if (ComponentbuilderHelper::typeField($result->name,'list'))
if (ComponentbuilderHelper::fieldCheck($result->name,'list'))
{
// load the values form params
$xml = json_decode($result->xml);
@ -1111,15 +1203,15 @@ class ComponentbuilderModelAjax extends JModelList
// return found field options
return $optionSet;
}
elseif (ComponentbuilderHelper::typeField($result->name,'text'))
elseif (ComponentbuilderHelper::fieldCheck($result->name,'text'))
{
return "keywords=\"\"\nlength=\"\"";
}
elseif (ComponentbuilderHelper::typeField($result->name,'dynamic'))
elseif (ComponentbuilderHelper::fieldCheck($result->name,'dynamic'))
{
return 'dynamic_list';
}
elseif (ComponentbuilderHelper::typeField($result->name))
elseif (ComponentbuilderHelper::fieldCheck($result->name))
{
return 'match field type not supported. Select another!';
}
@ -2061,12 +2153,19 @@ class ComponentbuilderModelAjax extends JModelList
'php_after_delete','php_after_publish','php_ajaxmethod','php_allowedit','php_batchcopy',
'php_batchmove','php_before_delete','php_before_publish','php_before_save','php_controller',
'php_controller_list','php_document','php_getitem','php_getitems','php_getitems_after_all',
'php_getlistquery','php_import','php_import_display','php_import_ext','php_import_headers',
'php_getlistquery','php_import','php_import_display','php_import_ext','php_import_headers','php_getform',
'php_import_save','php_import_setdata','php_model','php_model_list','php_postsavehook','php_save');
$targets['admin_view']['view'] = 'admin_views';
$targets['admin_view']['not_base64'] = array();
$targets['admin_view']['name'] = 'system_name';
// #__componentbuilder_admin_fields_relations
$targets['library'] = array();
$targets['library']['search'] = array('id', 'admin_view', 'addrelations');
$targets['library']['view'] = 'admin_fields_relations';
$targets['library']['not_base64'] = array('addrelations' => 'json');
$targets['library']['name'] = 'admin_view->id:admin_view.system_name';
// #__componentbuilder_custom_admin_view
$targets['custom_admin_view'] = array();
$targets['custom_admin_view']['search'] = array('id', 'system_name', 'default','php_view','php_jview','php_jview_display','php_document',
@ -2114,7 +2213,6 @@ class ComponentbuilderModelAjax extends JModelList
// #__componentbuilder_library
$targets['library'] = array();
$targets['library']['view'] = 'libraries';
$targets['library']['search'] = array('id', 'name', 'php_setdocument');
$targets['library']['view'] = 'libraries';
$targets['library']['not_base64'] = array();
@ -2542,6 +2640,61 @@ class ComponentbuilderModelAjax extends JModelList
return $xml;
}
// Used in admin_fields_relations
public function getCodeGlueOptions($listfield, $joinfields, $type, $area)
{
// CONCATENATE GLUE
if ($type == 1)
{
// MODEL
if ($area == 1 || $area == 3)
{
return ', ';
}
// VIEW
elseif ($area == 2)
{
return '<br />';
}
}
// CUSTOM CODE
elseif ($type == 2)
{
// build fields array
if ('none' !== $joinfields)
{
$fields = array_map( function ($id) {
return (int) $id;
}, (array) explode(',', $joinfields));
// add the list field to array
array_unshift($fields, (int) $listfield);
}
else
{
$fields = array((int) $listfield);
}
// get field names
$names = array_map( function ($id) {
return '[' . $id . ']=> ' . ComponentbuilderHelper::getVar('field', $id, 'id', 'name');
}, $fields);
// MODEL
if ($area == 1 || $area == 3)
{
// create note
$note = "// ". implode('; ', $names);
return $note . PHP_EOL . '$item->{'.(int)$listfield.'} = $item->{' . implode("} . ', ' . \$item->{", $fields) . '};';
}
// VIEW
elseif ($area == 2)
{
// create note
$note = "<!-- " . implode('; ', $names) . " -->";
return '[field=' . implode("]<br />[field=", $fields). ']' . PHP_EOL . PHP_EOL . $note;
}
}
return false;
}
// Used in get_snippets
public function getSnippets($libraries)

View File

@ -122,11 +122,11 @@ class ComponentbuilderModelCompiler extends JModelList
/**
* Get the uikit needed components
*
* @return mixed An array of objects on success.
*
*/
* Get the uikit needed components
*
* @return mixed An array of objects on success.
*
*/
public function getUikitComp()
{
if (isset($this->uikitComp) && ComponentbuilderHelper::checkArray($this->uikitComp))

View File

@ -216,7 +216,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -267,7 +266,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +532,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +630,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +675,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +865,13 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -216,7 +216,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -267,7 +266,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +532,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +630,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +675,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +865,13 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -216,7 +216,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -267,7 +266,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +532,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +630,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +675,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +865,13 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -216,7 +216,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -267,7 +266,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +532,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +630,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +675,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +865,13 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -222,7 +222,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -273,7 +272,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -539,7 +538,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -637,7 +636,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -682,7 +681,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -878,13 +877,13 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -241,7 +241,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -292,7 +291,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -558,7 +557,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -656,7 +655,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -701,7 +700,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -930,13 +929,13 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -216,7 +216,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -267,7 +266,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +532,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +630,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +675,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +865,13 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -216,7 +216,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -267,7 +266,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +532,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +630,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +675,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +865,13 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -216,7 +216,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
@ -267,7 +266,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +532,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +630,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +675,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +865,13 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -131,6 +131,9 @@ class ComponentbuilderModelComponentbuilder extends JModelList
'admin_fields_conditions.create' => 'admin_fields_conditions.create',
'admins_fields_conditions.access' => 'admin_fields_conditions.access',
'admin_fields_conditions.access' => 'admin_fields_conditions.access',
'admin_fields_relations.create' => 'admin_fields_relations.create',
'admins_fields_relations.access' => 'admin_fields_relations.access',
'admin_fields_relations.access' => 'admin_fields_relations.access',
'component_admin_views.create' => 'component_admin_views.create',
'components_admin_views.access' => 'component_admin_views.access',
'component_admin_views.access' => 'component_admin_views.access',

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_admin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $item->id) && $user->authorise('component_admin_views.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $item->id) && JFactory::getUser()->authorise('component_admin_views.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_admin_views extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_config extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $item->id) && $user->authorise('component_config.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $item->id) && JFactory::getUser()->authorise('component_config.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_config extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $item->id) && $user->authorise('component_custom_admin_menus.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $item->id) && JFactory::getUser()->authorise('component_custom_admin_menus.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $item->id) && $user->authorise('component_custom_admin_views.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $item->id) && JFactory::getUser()->authorise('component_custom_admin_views.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_dashboard extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $item->id) && $user->authorise('component_dashboard.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $item->id) && JFactory::getUser()->authorise('component_dashboard.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_dashboard extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_files_folders extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $item->id) && $user->authorise('component_files_folders.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $item->id) && JFactory::getUser()->authorise('component_files_folders.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_files_folders extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $item->id) && $user->authorise('component_mysql_tweaks.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $item->id) && JFactory::getUser()->authorise('component_mysql_tweaks.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_site_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $item->id) && $user->authorise('component_site_views.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $item->id) && JFactory::getUser()->authorise('component_site_views.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_site_views extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_updates extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $item->id) && $user->authorise('component_updates.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $item->id) && JFactory::getUser()->authorise('component_updates.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_updates extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

Some files were not shown because too many files have changed in this diff Show More