Added the Feature to Combine/Join Values/Fields in the admin list view (called field relations) #293

Merged
Llewellyn merged 7 commits from staging into master 2018-05-30 11:46:36 +00:00
153 changed files with 6911 additions and 6779 deletions
Showing only changes of commit f7be7ddad0 - Show all commits

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! 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.11) 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.0) 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) > 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,11 +125,11 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 24th May, 2018 + *Last Build*: 26th May, 2018
+ *Version*: 2.7.11 + *Version*: 2.8.0
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **185617** + *Line count*: **185523**
+ *Field count*: **1053** + *Field count*: **1053**
+ *File count*: **1236** + *File count*: **1236**
+ *Folder count*: **197** + *Folder count*: **197**

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! 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.11) 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.0) 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) > 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,11 +125,11 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 24th May, 2018 + *Last Build*: 26th May, 2018
+ *Version*: 2.7.11 + *Version*: 2.8.0
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **185617** + *Line count*: **185523**
+ *Field count*: **1053** + *Field count*: **1053**
+ *File count*: **1236** + *File count*: **1236**
+ *Folder count*: **197** + *Folder count*: **197**

View File

@ -325,7 +325,7 @@
COM_COMPONENTBUILDER_CONFIG_ON</option> COM_COMPONENTBUILDER_CONFIG_ON</option>
<option value="0"> <option value="0">
COM_COMPONENTBUILDER_CONFIG_OFF</option> COM_COMPONENTBUILDER_CONFIG_OFF</option>
</field> </field>
<!-- Mailer Field. Type: List. (joomla) --> <!-- Mailer Field. Type: List. (joomla) -->
<field <field
type="list" type="list"
@ -346,7 +346,7 @@
COM_COMPONENTBUILDER_CONFIG_SENDMAIL</option> COM_COMPONENTBUILDER_CONFIG_SENDMAIL</option>
<option value="smtp"> <option value="smtp">
COM_COMPONENTBUILDER_CONFIG_SMTP</option> COM_COMPONENTBUILDER_CONFIG_SMTP</option>
</field> </field>
<!-- Emailfrom Field. Type: Text. (joomla) --> <!-- Emailfrom Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -361,7 +361,7 @@
message="Error! Please add email address here." message="Error! Please add email address here."
hint="COM_COMPONENTBUILDER_CONFIG_EMAILFROM_HINT" hint="COM_COMPONENTBUILDER_CONFIG_EMAILFROM_HINT"
showon="mailer:smtp,sendmail,default" showon="mailer:smtp,sendmail,default"
/> />
<!-- Fromname Field. Type: Text. (joomla) --> <!-- Fromname Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -375,7 +375,7 @@
message="Error! Please add some name here." message="Error! Please add some name here."
hint="COM_COMPONENTBUILDER_CONFIG_FROMNAME_HINT" hint="COM_COMPONENTBUILDER_CONFIG_FROMNAME_HINT"
showon="mailer:smtp,sendmail,default" showon="mailer:smtp,sendmail,default"
/> />
<!-- Email reply to Field. Type: Text. (joomla) --> <!-- Email reply to Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -390,7 +390,7 @@
message="Error! Please add email address here." message="Error! Please add email address here."
hint="COM_COMPONENTBUILDER_CONFIG_EMAILREPLY_HINT" hint="COM_COMPONENTBUILDER_CONFIG_EMAILREPLY_HINT"
showon="mailer:smtp,sendmail,default" showon="mailer:smtp,sendmail,default"
/> />
<!-- Reply to name Field. Type: Text. (joomla) --> <!-- Reply to name Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -404,7 +404,7 @@
message="Error! Please add some name here." message="Error! Please add some name here."
hint="COM_COMPONENTBUILDER_CONFIG_REPLYNAME_HINT" hint="COM_COMPONENTBUILDER_CONFIG_REPLYNAME_HINT"
showon="mailer:smtp,sendmail,default" showon="mailer:smtp,sendmail,default"
/> />
<!-- Sendmail Field. Type: Text. (joomla) --> <!-- Sendmail Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -419,7 +419,7 @@
message="Error! Please add path to you local sendmail here." message="Error! Please add path to you local sendmail here."
hint="COM_COMPONENTBUILDER_CONFIG_SENDMAIL_HINT" hint="COM_COMPONENTBUILDER_CONFIG_SENDMAIL_HINT"
showon="mailer:sendmail" showon="mailer:sendmail"
/> />
<!-- Smtpauth Field. Type: Radio. (joomla) --> <!-- Smtpauth Field. Type: Radio. (joomla) -->
<field <field
type="radio" type="radio"
@ -434,7 +434,7 @@
COM_COMPONENTBUILDER_CONFIG_YES</option> COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="0"> <option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option> COM_COMPONENTBUILDER_CONFIG_NO</option>
</field> </field>
<!-- Smtpsecure Field. Type: List. (joomla) --> <!-- Smtpsecure Field. Type: List. (joomla) -->
<field <field
type="list" type="list"
@ -453,7 +453,7 @@
COM_COMPONENTBUILDER_CONFIG_SSL</option> COM_COMPONENTBUILDER_CONFIG_SSL</option>
<option value="tls"> <option value="tls">
COM_COMPONENTBUILDER_CONFIG_TLS</option> COM_COMPONENTBUILDER_CONFIG_TLS</option>
</field> </field>
<!-- Smtpport Field. Type: Text. (joomla) --> <!-- Smtpport Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -468,7 +468,7 @@
message="Error! Please add the port number of your SMTP server here." message="Error! Please add the port number of your SMTP server here."
hint="COM_COMPONENTBUILDER_CONFIG_SMTPPORT_HINT" hint="COM_COMPONENTBUILDER_CONFIG_SMTPPORT_HINT"
showon="mailer:smtp" showon="mailer:smtp"
/> />
<!-- Smtpuser Field. Type: Text. (joomla) --> <!-- Smtpuser Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -482,7 +482,7 @@
message="Error! Please add the username for SMTP server here." message="Error! Please add the username for SMTP server here."
hint="COM_COMPONENTBUILDER_CONFIG_SMTPUSER_HINT" hint="COM_COMPONENTBUILDER_CONFIG_SMTPUSER_HINT"
showon="mailer:smtp" showon="mailer:smtp"
/> />
<!-- Smtppass Field. Type: Password. (joomla) --> <!-- Smtppass Field. Type: Password. (joomla) -->
<field <field
type="password" type="password"
@ -494,7 +494,7 @@
filter="raw" filter="raw"
message="Error! Please add the password for SMTP server here." message="Error! Please add the password for SMTP server here."
showon="mailer:smtp" showon="mailer:smtp"
/> />
<!-- Smtphost Field. Type: Text. (joomla) --> <!-- Smtphost Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -529,7 +529,7 @@
COM_COMPONENTBUILDER_CONFIG_YES</option> COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="0"> <option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option> COM_COMPONENTBUILDER_CONFIG_NO</option>
</field> </field>
<!-- Dkim_domain Field. Type: Text. (joomla) --> <!-- Dkim_domain Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -544,7 +544,7 @@
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_DOMAIN_HINT" hint="COM_COMPONENTBUILDER_CONFIG_DKIM_DOMAIN_HINT"
showon="dkim:1" showon="dkim:1"
onchange="vdm_dkim();" onchange="vdm_dkim();"
/> />
<!-- Dkim_selector Field. Type: Text. (joomla) --> <!-- Dkim_selector Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -560,7 +560,7 @@
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_SELECTOR_HINT" hint="COM_COMPONENTBUILDER_CONFIG_DKIM_SELECTOR_HINT"
showon="dkim:1" showon="dkim:1"
onchange="vdm_dkim();" onchange="vdm_dkim();"
/> />
<!-- Dkim_passphrase Field. Type: Password. (joomla) --> <!-- Dkim_passphrase Field. Type: Password. (joomla) -->
<field <field
type="password" type="password"
@ -572,7 +572,7 @@
filter="raw" filter="raw"
message="Error! Please add passphrase here." message="Error! Please add passphrase here."
showon="dkim:1" showon="dkim:1"
/> />
<!-- Dkim_identity Field. Type: Text. (joomla) --> <!-- Dkim_identity Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -586,7 +586,7 @@
message="Error! Please add DKIM Identity here." message="Error! Please add DKIM Identity here."
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_IDENTITY_HINT" hint="COM_COMPONENTBUILDER_CONFIG_DKIM_IDENTITY_HINT"
showon="dkim:1" showon="dkim:1"
/> />
<!-- Dkim_private_key Field. Type: Textarea. (joomla) --> <!-- Dkim_private_key Field. Type: Textarea. (joomla) -->
<field <field
type="textarea" type="textarea"
@ -597,7 +597,7 @@
description="COM_COMPONENTBUILDER_CONFIG_DKIM_PRIVATE_KEY_DESCRIPTION" description="COM_COMPONENTBUILDER_CONFIG_DKIM_PRIVATE_KEY_DESCRIPTION"
class="input-xxlarge span12" class="input-xxlarge span12"
showon="dkim:1" showon="dkim:1"
/> />
<!-- Dkim_public_key Field. Type: Textarea. (joomla) --> <!-- Dkim_public_key Field. Type: Textarea. (joomla) -->
<field <field
type="textarea" type="textarea"
@ -609,9 +609,9 @@
class="input-xxlarge span12" class="input-xxlarge span12"
showon="dkim:1" showon="dkim:1"
onchange="vdm_dkim();" onchange="vdm_dkim();"
/> />
<!-- Note_dkim_use Field. Type: Note. A None Database Field. (joomla) --> <!-- 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) --> <!-- Dkim_key Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
@ -625,7 +625,7 @@
message="Error! Please add KEY here." message="Error! Please add KEY here."
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_KEY_HINT" hint="COM_COMPONENTBUILDER_CONFIG_DKIM_KEY_HINT"
showon="dkim:1" showon="dkim:1"
/> />
<!-- Dkim_value Field. Type: Text. (joomla) --> <!-- Dkim_value Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -25,7 +25,6 @@ class Compiler extends Infusion
* *
* @var string * @var string
*/ */
private $tempPath; private $tempPath;
/* /*
@ -677,4 +676,5 @@ class Compiler extends Infusion
// any help to improve this is welcome... // any help to improve this is welcome...
} }
} }

View File

@ -655,7 +655,14 @@ class Get
*/ */
public $setTidyWarning = false; public $setTidyWarning = false;
/* * * /**
* Set tab/spacer
*
* @var string
*/
public $tabSpacer = "\t";
/**
* Constructor * Constructor
*/ */
@ -745,6 +752,19 @@ class Get
return false; return false;
} }
/**
* Set the tab/space
*
* @param int $nr The number of tag/space
*
* @return string
*
*/
public function _t($nr)
{
return str_repeat($this->tabSpacer, (int) $nr);
}
/** /**
* Set the line number in comments * Set the line number in comments
* *
@ -1670,12 +1690,17 @@ class Get
foreach ($view->addrelations as $nr => $relationsValue) foreach ($view->addrelations as $nr => $relationsValue)
{ {
// only add if list view field is selected and joind fields are set // only add if list view field is selected and joind fields are set
if (isset($relationsValue['listfield']) && if (isset($relationsValue['listfield']) &&
is_numeric($relationsValue['listfield']) && is_numeric($relationsValue['listfield']) &&
$relationsValue['listfield'] > 0 && $relationsValue['listfield'] > 0 &&
isset($relationsValue['joinfields']) && isset($relationsValue['joinfields']) &&
ComponentbuilderHelper::checkArray($relationsValue['joinfields'])) ComponentbuilderHelper::checkArray($relationsValue['joinfields']))
{ {
// do a dynamic update on the set values
if (isset($relationsValue['set']) && ComponentbuilderHelper::checkString($relationsValue['set']))
{
$relationsValue['set'] = $this->setDynamicValues($relationsValue['set']);
}
// load the field relations // load the field relations
$this->fieldRelations[$name_list][(int) $relationsValue['listfield']] = $relationsValue; $this->fieldRelations[$name_list][(int) $relationsValue['listfield']] = $relationsValue;
// load the list joints // load the list joints
@ -3876,7 +3901,7 @@ class Get
} }
if (ComponentbuilderHelper::checkArray($gets) && ComponentbuilderHelper::checkArray($keys)) 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) . ')'; $queryFrom = '$db->quoteName(' . $this->db->quote($table) . ', ' . $this->db->quote($as) . ')';
// return the select query // return the select query
return array('select' => $querySelect, 'from' => $queryFrom, 'name' => $queryName, 'table' => $table, 'type' => $type, 'select_gets' => $gets, 'select_keys' => $keys); return array('select' => $querySelect, 'from' => $queryFrom, 'name' => $queryName, 'table' => $table, 'type' => $type, 'select_gets' => $gets, 'select_keys' => $keys);
@ -4005,9 +4030,9 @@ class Get
$data = $this->db->loadObjectList(); $data = $this->db->loadObjectList();
// start building the MySql dump // start building the MySql dump
$dump = "--"; $dump = "--";
$dump .= PHP_EOL . "-- Dumping data for table `#__".$this->bbb."component".$this->ddd."_" . $view . "`"; $dump .= PHP_EOL . "-- Dumping data for table `#__" . $this->bbb . "component" . $this->ddd . "_" . $view . "`";
$dump .= PHP_EOL . "--"; $dump .= PHP_EOL . "--";
$dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__".$this->bbb."component".$this->ddd."_" . $view . "` ("; $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__" . $this->bbb . "component" . $this->ddd . "_" . $view . "` (";
foreach ($data as $line) foreach ($data as $line)
{ {
$comaSet = 0; $comaSet = 0;

View File

@ -494,7 +494,7 @@ class Structure extends Get
{ {
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = ''; $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = '';
} }
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= 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) // if config fields are found load into component config (avoiding dublicates)
@ -1285,7 +1285,7 @@ class Structure extends Get
} }
if (count($pathArray) == 1 && $firstFolder === 'media') if (count($pathArray) == 1 && $firstFolder === 'media')
{ {
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= 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 // check if we sould add it to the site xml list
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh])) if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh]))
@ -1294,7 +1294,7 @@ class Structure extends Get
} }
if (count($pathArray) == 1 && $firstFolder === 'site') if (count($pathArray) == 1 && $firstFolder === 'site')
{ {
$this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh] .= 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 // check if we sould add it to the admin xml list
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh])) if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh]))
@ -1303,7 +1303,7 @@ class Structure extends Get
} }
if (count($pathArray) == 1 && $firstFolder === 'admin') if (count($pathArray) == 1 && $firstFolder === 'admin')
{ {
$this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh] .= 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 // make we have not duplicates
$key_pointer = ComponentbuilderHelper::safeString($custom['folder']) . '_f' . $pointer_tracker; $key_pointer = ComponentbuilderHelper::safeString($custom['folder']) . '_f' . $pointer_tracker;

View File

@ -457,7 +457,7 @@ class Fields extends Structure
$readOnly = false; $readOnly = false;
if ($view['settings']->type == 2) if ($view['settings']->type == 2)
{ {
$readOnly = "\t\t\t" . 'readonly="true"' . PHP_EOL . "\t\t\t" . 'disabled="true"'; $readOnly = $this->_t(3) . 'readonly="true"' . PHP_EOL . $this->_t(3) . 'disabled="true"';
} }
// start adding dynamc fields // start adding dynamc fields
$dynamicFields = ''; $dynamicFields = '';
@ -471,157 +471,157 @@ class Fields extends Structure
// set the default fields // set the default fields
$fieldSet = array(); $fieldSet = array();
$fieldSet[] = '<fieldset name="details">'; $fieldSet[] = '<fieldset name="details">';
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Default Fields. -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Default Fields. -->";
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Id Field. Type: Text (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Id Field. Type: Text (joomla) -->";
// if id is not set // if id is not set
if (!isset($this->fieldsNames[$view_name_single]['id'])) if (!isset($this->fieldsNames[$view_name_single]['id']))
{ {
$fieldSet[] = "\t\t<field"; $fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = "\t\t\tname=" . '"id"'; $fieldSet[] = $this->_t(3) . "name=" . '"id"';
$fieldSet[] = "\t\t\t" . 'type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"'; $fieldSet[] = $this->_t(3) . 'type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"';
$fieldSet[] = "\t\t\t" . 'description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"'; $fieldSet[] = $this->_t(3) . 'description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"';
$fieldSet[] = "\t\t\t" . 'readonly="true"'; $fieldSet[] = $this->_t(3) . 'readonly="true"';
$fieldSet[] = "\t\t/>"; $fieldSet[] = $this->_t(2) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
} }
// if created is not set // if created is not set
if (!isset($this->fieldsNames[$view_name_single]['created'])) if (!isset($this->fieldsNames[$view_name_single]['created']))
{ {
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Date Created Field. Type: Calendar (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Date Created Field. Type: Calendar (joomla) -->";
$fieldSet[] = "\t\t<field"; $fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = "\t\t\tname=" . '"created"'; $fieldSet[] = $this->_t(3) . "name=" . '"created"';
$fieldSet[] = "\t\t\ttype=" . '"calendar"'; $fieldSet[] = $this->_t(3) . "type=" . '"calendar"';
$fieldSet[] = "\t\t\tlabel=" . '"' . $langView . '_CREATED_DATE_LABEL"'; $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView . '_CREATED_DATE_LABEL"';
$fieldSet[] = "\t\t\tdescription=" . '"' . $langView . '_CREATED_DATE_DESC"'; $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView . '_CREATED_DATE_DESC"';
$fieldSet[] = "\t\t\tsize=" . '"22"'; $fieldSet[] = $this->_t(3) . "size=" . '"22"';
if ($readOnly) if ($readOnly)
{ {
$fieldSet[] = $readOnly; $fieldSet[] = $readOnly;
} }
$fieldSet[] = "\t\t\tformat=" . '"%Y-%m-%d %H:%M:%S"'; $fieldSet[] = $this->_t(3) . "format=" . '"%Y-%m-%d %H:%M:%S"';
$fieldSet[] = "\t\t\tfilter=" . '"user_utc"'; $fieldSet[] = $this->_t(3) . "filter=" . '"user_utc"';
$fieldSet[] = "\t\t/>"; $fieldSet[] = $this->_t(2) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
} }
// if created_by is not set // if created_by is not set
if (!isset($this->fieldsNames[$view_name_single]['created_by'])) if (!isset($this->fieldsNames[$view_name_single]['created_by']))
{ {
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " User Created Field. Type: User (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " User Created Field. Type: User (joomla) -->";
$fieldSet[] = "\t\t<field"; $fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = "\t\t\tname=" . '"created_by"'; $fieldSet[] = $this->_t(3) . "name=" . '"created_by"';
$fieldSet[] = "\t\t\ttype=" . '"user"'; $fieldSet[] = $this->_t(3) . "type=" . '"user"';
$fieldSet[] = "\t\t\tlabel=" . '"' . $langView . '_CREATED_BY_LABEL"'; $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView . '_CREATED_BY_LABEL"';
if ($readOnly) if ($readOnly)
{ {
$fieldSet[] = $readOnly; $fieldSet[] = $readOnly;
} }
$fieldSet[] = "\t\t\tdescription=" . '"' . $langView . '_CREATED_BY_DESC"'; $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView . '_CREATED_BY_DESC"';
$fieldSet[] = "\t\t/>"; $fieldSet[] = $this->_t(2) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
} }
// if published is not set // if published is not set
if (!isset($this->fieldsNames[$view_name_single]['published'])) if (!isset($this->fieldsNames[$view_name_single]['published']))
{ {
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Published Field. Type: List (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Published Field. Type: List (joomla) -->";
$fieldSet[] = "\t\t<field name=" . '"published" type="list" label="JSTATUS"'; $fieldSet[] = $this->_t(2) . "<field name=" . '"published" type="list" label="JSTATUS"';
$fieldSet[] = "\t\t\tdescription=" . '"JFIELD_PUBLISHED_DESC" class="chzn-color-state"'; $fieldSet[] = $this->_t(3) . "description=" . '"JFIELD_PUBLISHED_DESC" class="chzn-color-state"';
if ($readOnly) if ($readOnly)
{ {
$fieldSet[] = $readOnly; $fieldSet[] = $readOnly;
} }
$fieldSet[] = "\t\t\tfilter=" . '"intval" size="1" default="1" >'; $fieldSet[] = $this->_t(3) . "filter=" . '"intval" size="1" default="1" >';
$fieldSet[] = "\t\t\t<option value=" . '"1">'; $fieldSet[] = $this->_t(3) . "<option value=" . '"1">';
$fieldSet[] = "\t\t\t\tJPUBLISHED</option>"; $fieldSet[] = $this->_t(4) . "JPUBLISHED</option>";
$fieldSet[] = "\t\t\t<option value=" . '"0">'; $fieldSet[] = $this->_t(3) . "<option value=" . '"0">';
$fieldSet[] = "\t\t\t\tJUNPUBLISHED</option>"; $fieldSet[] = $this->_t(4) . "JUNPUBLISHED</option>";
$fieldSet[] = "\t\t\t<option value=" . '"2">'; $fieldSet[] = $this->_t(3) . "<option value=" . '"2">';
$fieldSet[] = "\t\t\t\tJARCHIVED</option>"; $fieldSet[] = $this->_t(4) . "JARCHIVED</option>";
$fieldSet[] = "\t\t\t<option value=" . '"-2">'; $fieldSet[] = $this->_t(3) . "<option value=" . '"-2">';
$fieldSet[] = "\t\t\t\tJTRASHED</option>"; $fieldSet[] = $this->_t(4) . "JTRASHED</option>";
$fieldSet[] = "\t\t</field>"; $fieldSet[] = $this->_t(2) . "</field>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
} }
// if modified is not set // if modified is not set
if (!isset($this->fieldsNames[$view_name_single]['modified'])) if (!isset($this->fieldsNames[$view_name_single]['modified']))
{ {
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Date Modified Field. Type: Calendar (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Date Modified Field. Type: Calendar (joomla) -->";
$fieldSet[] = "\t\t" . '<field name="modified" type="calendar" class="readonly"'; $fieldSet[] = $this->_t(2) . '<field name="modified" type="calendar" class="readonly"';
$fieldSet[] = "\t\t\t" . 'label="' . $langView . '_MODIFIED_DATE_LABEL" description="' . $langView . '_MODIFIED_DATE_DESC"'; $fieldSet[] = $this->_t(3) . 'label="' . $langView . '_MODIFIED_DATE_LABEL" description="' . $langView . '_MODIFIED_DATE_DESC"';
$fieldSet[] = "\t\t\t" . 'size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />'; $fieldSet[] = $this->_t(3) . 'size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />';
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
} }
// if modified_by is not set // if modified_by is not set
if (!isset($this->fieldsNames[$view_name_single]['modified_by'])) if (!isset($this->fieldsNames[$view_name_single]['modified_by']))
{ {
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " User Modified Field. Type: User (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " User Modified Field. Type: User (joomla) -->";
$fieldSet[] = "\t\t" . '<field name="modified_by" type="user"'; $fieldSet[] = $this->_t(2) . '<field name="modified_by" type="user"';
$fieldSet[] = "\t\t\t" . 'label="' . $langView . '_MODIFIED_BY_LABEL"'; $fieldSet[] = $this->_t(3) . 'label="' . $langView . '_MODIFIED_BY_LABEL"';
$fieldSet[] = "\t\t\tdescription=" . '"' . $langView . '_MODIFIED_BY_DESC"'; $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView . '_MODIFIED_BY_DESC"';
$fieldSet[] = "\t\t\t" . 'class="readonly"'; $fieldSet[] = $this->_t(3) . 'class="readonly"';
$fieldSet[] = "\t\t\t" . 'readonly="true"'; $fieldSet[] = $this->_t(3) . 'readonly="true"';
$fieldSet[] = "\t\t\t" . 'filter="unset"'; $fieldSet[] = $this->_t(3) . 'filter="unset"';
$fieldSet[] = "\t\t/>"; $fieldSet[] = $this->_t(2) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
} }
// check if view has access // check if view has access
if (isset($this->accessBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view_name_single]) && !isset($this->fieldsNames[$view_name_single]['access'])) if (isset($this->accessBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view_name_single]) && !isset($this->fieldsNames[$view_name_single]['access']))
{ {
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Access Field. Type: Accesslevel (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Access Field. Type: Accesslevel (joomla) -->";
$fieldSet[] = "\t\t" . '<field name="access"'; $fieldSet[] = $this->_t(2) . '<field name="access"';
$fieldSet[] = "\t\t\t" . 'type="accesslevel"'; $fieldSet[] = $this->_t(3) . 'type="accesslevel"';
$fieldSet[] = "\t\t\t" . 'label="JFIELD_ACCESS_LABEL"'; $fieldSet[] = $this->_t(3) . 'label="JFIELD_ACCESS_LABEL"';
$fieldSet[] = "\t\t\t" . 'description="JFIELD_ACCESS_DESC"'; $fieldSet[] = $this->_t(3) . 'description="JFIELD_ACCESS_DESC"';
$fieldSet[] = "\t\t\t" . 'default="1"'; $fieldSet[] = $this->_t(3) . 'default="1"';
if ($readOnly) if ($readOnly)
{ {
$fieldSet[] = $readOnly; $fieldSet[] = $readOnly;
} }
$fieldSet[] = "\t\t\t" . 'required="false"'; $fieldSet[] = $this->_t(3) . 'required="false"';
$fieldSet[] = "\t\t/>"; $fieldSet[] = $this->_t(2) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
} }
// if ordering is not set // if ordering is not set
if (!isset($this->fieldsNames[$view_name_single]['ordering'])) if (!isset($this->fieldsNames[$view_name_single]['ordering']))
{ {
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Ordering Field. Type: Numbers (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Ordering Field. Type: Numbers (joomla) -->";
$fieldSet[] = "\t\t<field"; $fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = "\t\t\t" . 'name="ordering"'; $fieldSet[] = $this->_t(3) . 'name="ordering"';
$fieldSet[] = "\t\t\t" . 'type="number"'; $fieldSet[] = $this->_t(3) . 'type="number"';
$fieldSet[] = "\t\t\t" . 'class="inputbox validate-ordering"'; $fieldSet[] = $this->_t(3) . 'class="inputbox validate-ordering"';
$fieldSet[] = "\t\t\t" . 'label="' . $langView . '_ORDERING_LABEL' . '"'; $fieldSet[] = $this->_t(3) . 'label="' . $langView . '_ORDERING_LABEL' . '"';
$fieldSet[] = "\t\t\t" . 'description=""'; $fieldSet[] = $this->_t(3) . 'description=""';
$fieldSet[] = "\t\t\t" . 'default="0"'; $fieldSet[] = $this->_t(3) . 'default="0"';
$fieldSet[] = "\t\t\t" . 'size="6"'; $fieldSet[] = $this->_t(3) . 'size="6"';
if ($readOnly) if ($readOnly)
{ {
$fieldSet[] = $readOnly; $fieldSet[] = $readOnly;
} }
$fieldSet[] = "\t\t\t" . 'required="false"'; $fieldSet[] = $this->_t(3) . 'required="false"';
$fieldSet[] = "\t\t/>"; $fieldSet[] = $this->_t(2) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
} }
// if version is not set // if version is not set
if (!isset($this->fieldsNames[$view_name_single]['version'])) if (!isset($this->fieldsNames[$view_name_single]['version']))
{ {
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Version Field. Type: Text (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Version Field. Type: Text (joomla) -->";
$fieldSet[] = "\t\t<field"; $fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = "\t\t\t" . 'name="version"'; $fieldSet[] = $this->_t(3) . 'name="version"';
$fieldSet[] = "\t\t\t" . 'type="text"'; $fieldSet[] = $this->_t(3) . 'type="text"';
$fieldSet[] = "\t\t\t" . 'class="readonly"'; $fieldSet[] = $this->_t(3) . 'class="readonly"';
$fieldSet[] = "\t\t\t" . 'label="' . $langView . '_VERSION_LABEL"'; $fieldSet[] = $this->_t(3) . 'label="' . $langView . '_VERSION_LABEL"';
$fieldSet[] = "\t\t\t" . 'description="' . $langView . '_VERSION_DESC"'; $fieldSet[] = $this->_t(3) . 'description="' . $langView . '_VERSION_DESC"';
$fieldSet[] = "\t\t\t" . 'size="6"'; $fieldSet[] = $this->_t(3) . 'size="6"';
$fieldSet[] = "\t\t\t" . 'readonly="true"'; $fieldSet[] = $this->_t(3) . 'readonly="true"';
$fieldSet[] = "\t\t\t" . 'filter="unset"'; $fieldSet[] = $this->_t(3) . 'filter="unset"';
$fieldSet[] = "\t\t/>"; $fieldSet[] = $this->_t(2) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
} }
@ -629,77 +629,77 @@ class Fields extends Structure
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single])) if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
{ {
// metakey // metakey
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla) -->";
$fieldSet[] = "\t\t<field"; $fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = "\t\t\t" . 'name="metakey"'; $fieldSet[] = $this->_t(3) . 'name="metakey"';
$fieldSet[] = "\t\t\t" . 'type="textarea"'; $fieldSet[] = $this->_t(3) . 'type="textarea"';
$fieldSet[] = "\t\t\t" . 'label="JFIELD_META_KEYWORDS_LABEL"'; $fieldSet[] = $this->_t(3) . 'label="JFIELD_META_KEYWORDS_LABEL"';
$fieldSet[] = "\t\t\t" . 'description="JFIELD_META_KEYWORDS_DESC"'; $fieldSet[] = $this->_t(3) . 'description="JFIELD_META_KEYWORDS_DESC"';
$fieldSet[] = "\t\t\t" . 'rows="3"'; $fieldSet[] = $this->_t(3) . 'rows="3"';
$fieldSet[] = "\t\t\t" . 'cols="30"'; $fieldSet[] = $this->_t(3) . 'cols="30"';
$fieldSet[] = "\t\t/>"; $fieldSet[] = $this->_t(2) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
// metadesc // metadesc
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla) -->"; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla) -->";
$fieldSet[] = "\t\t<field"; $fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = "\t\t\t" . 'name="metadesc"'; $fieldSet[] = $this->_t(3) . 'name="metadesc"';
$fieldSet[] = "\t\t\t" . 'type="textarea"'; $fieldSet[] = $this->_t(3) . 'type="textarea"';
$fieldSet[] = "\t\t\t" . 'label="JFIELD_META_DESCRIPTION_LABEL"'; $fieldSet[] = $this->_t(3) . 'label="JFIELD_META_DESCRIPTION_LABEL"';
$fieldSet[] = "\t\t\t" . 'description="JFIELD_META_DESCRIPTION_DESC"'; $fieldSet[] = $this->_t(3) . 'description="JFIELD_META_DESCRIPTION_DESC"';
$fieldSet[] = "\t\t\t" . 'rows="3"'; $fieldSet[] = $this->_t(3) . 'rows="3"';
$fieldSet[] = "\t\t\t" . 'cols="30"'; $fieldSet[] = $this->_t(3) . 'cols="30"';
$fieldSet[] = "\t\t/>"; $fieldSet[] = $this->_t(2) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
} }
// load the dynamic fields now // load the dynamic fields now
if (ComponentbuilderHelper::checkString($dynamicFields)) if (ComponentbuilderHelper::checkString($dynamicFields))
{ {
$fieldSet[] = "\t\t<!--" . $this->setLine(__LINE__) . " Dynamic Fields. -->" . $dynamicFields; $fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Dynamic Fields. -->" . $dynamicFields;
} }
// close fieldset // close fieldset
$fieldSet[] = "\t</fieldset>"; $fieldSet[] = $this->_t(1) . "</fieldset>";
// check if metadata is added to this view // check if metadata is added to this view
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single])) if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
{ {
$fieldSet[] = PHP_EOL . "\t<!--" . $this->setLine(__LINE__) . " Metadata Fields. -->"; $fieldSet[] = PHP_EOL . $this->_t(1) . "<!--" . $this->setLine(__LINE__) . " Metadata Fields. -->";
$fieldSet[] = "\t<fields" . ' name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">'; $fieldSet[] = $this->_t(1) . "<fields" . ' name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">';
$fieldSet[] = "\t\t" . '<fieldset name="vdmmetadata"'; $fieldSet[] = $this->_t(2) . '<fieldset name="vdmmetadata"';
$fieldSet[] = "\t\t\t" . 'label="JGLOBAL_FIELDSET_METADATA_OPTIONS">'; $fieldSet[] = $this->_t(3) . 'label="JGLOBAL_FIELDSET_METADATA_OPTIONS">';
// robots // robots
$fieldSet[] = "\t\t\t<!--" . $this->setLine(__LINE__) . " Robots Field. Type: List (joomla) -->"; $fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Robots Field. Type: List (joomla) -->";
$fieldSet[] = "\t\t\t" . '<field name="robots"'; $fieldSet[] = $this->_t(3) . '<field name="robots"';
$fieldSet[] = "\t\t\t\t" . 'type="list"'; $fieldSet[] = $this->_t(4) . 'type="list"';
$fieldSet[] = "\t\t\t\t" . 'label="JFIELD_METADATA_ROBOTS_LABEL"'; $fieldSet[] = $this->_t(4) . 'label="JFIELD_METADATA_ROBOTS_LABEL"';
$fieldSet[] = "\t\t\t\t" . 'description="JFIELD_METADATA_ROBOTS_DESC" >'; $fieldSet[] = $this->_t(4) . 'description="JFIELD_METADATA_ROBOTS_DESC" >';
$fieldSet[] = "\t\t\t\t" . '<option value="">JGLOBAL_USE_GLOBAL</option>'; $fieldSet[] = $this->_t(4) . '<option value="">JGLOBAL_USE_GLOBAL</option>';
$fieldSet[] = "\t\t\t\t" . '<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>'; $fieldSet[] = $this->_t(4) . '<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>';
$fieldSet[] = "\t\t\t\t" . '<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>'; $fieldSet[] = $this->_t(4) . '<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>';
$fieldSet[] = "\t\t\t\t" . '<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>'; $fieldSet[] = $this->_t(4) . '<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>';
$fieldSet[] = "\t\t\t\t" . '<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>'; $fieldSet[] = $this->_t(4) . '<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>';
$fieldSet[] = "\t\t\t" . '</field>'; $fieldSet[] = $this->_t(3) . '</field>';
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
// author // author
$fieldSet[] = "\t\t\t<!--" . $this->setLine(__LINE__) . " Author Field. Type: Text (joomla) -->"; $fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Author Field. Type: Text (joomla) -->";
$fieldSet[] = "\t\t\t" . '<field name="author"'; $fieldSet[] = $this->_t(3) . '<field name="author"';
$fieldSet[] = "\t\t\t\t" . 'type="text"'; $fieldSet[] = $this->_t(4) . 'type="text"';
$fieldSet[] = "\t\t\t\t" . 'label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"'; $fieldSet[] = $this->_t(4) . 'label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"';
$fieldSet[] = "\t\t\t\t" . 'size="20"'; $fieldSet[] = $this->_t(4) . 'size="20"';
$fieldSet[] = "\t\t\t/>"; $fieldSet[] = $this->_t(3) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
// rights // rights
$fieldSet[] = "\t\t\t<!--" . $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla) -->"; $fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla) -->";
$fieldSet[] = "\t\t\t" . '<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"'; $fieldSet[] = $this->_t(3) . '<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"';
$fieldSet[] = "\t\t\t\t" . 'description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"'; $fieldSet[] = $this->_t(4) . 'description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"';
$fieldSet[] = "\t\t\t\t" . 'cols="30" rows="2"'; $fieldSet[] = $this->_t(4) . 'cols="30" rows="2"';
$fieldSet[] = "\t\t\t/>"; $fieldSet[] = $this->_t(3) . "/>";
// count the static field created // count the static field created
$this->fieldCount++; $this->fieldCount++;
$fieldSet[] = "\t\t</fieldset>"; $fieldSet[] = $this->_t(2) . "</fieldset>";
$fieldSet[] = "\t</fields>"; $fieldSet[] = $this->_t(1) . "</fields>";
} }
// retunr the set // retunr the set
return implode(PHP_EOL, $fieldSet); return implode(PHP_EOL, $fieldSet);
@ -1212,14 +1212,14 @@ class Fields extends Structure
if ($setType === 'option') if ($setType === 'option')
{ {
// now add to the field set // now add to the field set
$field .= PHP_EOL . "\t" . $taber . "\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->"; $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1) . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$field .= PHP_EOL . "\t" . $taber . "\t<field"; $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1) . "<field";
$optionSet = ''; $optionSet = '';
foreach ($fieldAttributes as $property => $value) foreach ($fieldAttributes as $property => $value)
{ {
if ($property != 'option') if ($property != 'option')
{ {
$field .= PHP_EOL . "\t\t" . $taber . "\t" . $property . '="' . $value . '"'; $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . $property . '="' . $value . '"';
} }
elseif ($property === 'option') elseif ($property === 'option')
{ {
@ -1238,7 +1238,7 @@ class Fields extends Structure
// add to lang array // add to lang array
$this->langContent[$this->lang][$langValue] = $t; $this->langContent[$this->lang][$langValue] = $t;
// no add to option set // no add to option set
$optionSet .= PHP_EOL . "\t" . $taber . "\t\t" . '<option value="' . $v . '">' . PHP_EOL . "\t" . $taber . "\t\t\t" . $langValue . '</option>'; $optionSet .= PHP_EOL . $this->_t(1) . $taber . $this->_t(2) . '<option value="' . $v . '">' . PHP_EOL . $this->_t(1) . $taber . $this->_t(3) . $langValue . '</option>';
$optionArray[$v] = $langValue; $optionArray[$v] = $langValue;
} }
else else
@ -1248,7 +1248,7 @@ class Fields extends Structure
// add to lang array // add to lang array
$this->langContent[$this->lang][$langValue] = $option; $this->langContent[$this->lang][$langValue] = $option;
// no add to option set // no add to option set
$optionSet .= PHP_EOL . "\t\t" . $taber . "\t" . '<option value="' . $option . '">' . PHP_EOL . "\t\t" . $taber . "\t\t" . $langValue . '</option>'; $optionSet .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . '<option value="' . $option . '">' . PHP_EOL . $this->_t(2) . $taber . $this->_t(2) . $langValue . '</option>';
$optionArray[$option] = $langValue; $optionArray[$option] = $langValue;
} }
} }
@ -1264,7 +1264,7 @@ class Fields extends Structure
// add to lang array // add to lang array
$this->langContent[$this->lang][$langValue] = $t; $this->langContent[$this->lang][$langValue] = $t;
// no add to option set // no add to option set
$optionSet .= PHP_EOL . "\t\t" . $taber . "\t" . '<option value="' . $v . '">' . PHP_EOL . "\t\t" . $taber . "\t\t" . $langValue . '</option>'; $optionSet .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . '<option value="' . $v . '">' . PHP_EOL . $this->_t(2) . $taber . $this->_t(2) . $langValue . '</option>';
$optionArray[$v] = $langValue; $optionArray[$v] = $langValue;
} }
else else
@ -1274,7 +1274,7 @@ class Fields extends Structure
// add to lang array // add to lang array
$this->langContent[$this->lang][$langValue] = $value; $this->langContent[$this->lang][$langValue] = $value;
// no add to option set // no add to option set
$optionSet .= PHP_EOL . "\t\t" . $taber . "\t" . '<option value="' . $value . '">' . PHP_EOL . "\t\t" . $taber . "\t\t" . $langValue . '</option>'; $optionSet .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . '<option value="' . $value . '">' . PHP_EOL . $this->_t(2) . $taber . $this->_t(2) . $langValue . '</option>';
$optionArray[$value] = $langValue; $optionArray[$value] = $langValue;
} }
} }
@ -1283,41 +1283,41 @@ class Fields extends Structure
if (ComponentbuilderHelper::checkString($optionSet)) if (ComponentbuilderHelper::checkString($optionSet))
{ {
$field .= '>'; $field .= '>';
$field .= PHP_EOL . "\t\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " Option Set. -->"; $field .= PHP_EOL . $this->_t(3) . $taber . "<!--" . $this->setLine(__LINE__) . " Option Set. -->";
$field .= $optionSet; $field .= $optionSet;
$field .= PHP_EOL . "\t\t" . $taber . "</field>"; $field .= PHP_EOL . $this->_t(2) . $taber . "</field>";
} }
elseif ($typeName === 'sql') elseif ($typeName === 'sql')
{ {
$optionArray = false; $optionArray = false;
$field .= PHP_EOL . "\t\t" . $taber . "/>"; $field .= PHP_EOL . $this->_t(2) . $taber . "/>";
} }
else else
{ {
$optionArray = false; $optionArray = false;
$field .= PHP_EOL . "\t\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " No Manual Options Were Added In Field Settings. -->"; $field .= PHP_EOL . $this->_t(3) . $taber . "<!--" . $this->setLine(__LINE__) . " No Manual Options Were Added In Field Settings. -->";
$field .= PHP_EOL . "\t\t" . $taber . "/>"; $field .= PHP_EOL . $this->_t(2) . $taber . "/>";
} }
} }
elseif ($setType === 'plain') elseif ($setType === 'plain')
{ {
// now add to the field set // now add to the field set
$field .= PHP_EOL . "\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->"; $field .= PHP_EOL . $this->_t(2) . $taber . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$field .= PHP_EOL . "\t\t" . $taber . "<field"; $field .= PHP_EOL . $this->_t(2) . $taber . "<field";
foreach ($fieldAttributes as $property => $value) foreach ($fieldAttributes as $property => $value)
{ {
if ($property != 'option') if ($property != 'option')
{ {
$field .= PHP_EOL . "\t\t" . $taber . "\t" . $property . '="' . $value . '"'; $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . $property . '="' . $value . '"';
} }
} }
$field .= PHP_EOL . "\t\t" . $taber . "/>"; $field .= PHP_EOL . $this->_t(2) . $taber . "/>";
} }
elseif ($setType === 'spacer') elseif ($setType === 'spacer')
{ {
// now add to the field set // now add to the field set
$field .= PHP_EOL . "\t\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". A None Database Field. (joomla) -->"; $field .= PHP_EOL . $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". A None Database Field. (joomla) -->";
$field .= PHP_EOL . "\t\t<field"; $field .= PHP_EOL . $this->_t(2) . "<field";
foreach ($fieldAttributes as $property => $value) foreach ($fieldAttributes as $property => $value)
{ {
if ($property != 'option') if ($property != 'option')
@ -1333,19 +1333,19 @@ class Fields extends Structure
if ($typeName === 'repeatable') if ($typeName === 'repeatable')
{ {
// now add to the field set // now add to the field set
$field .= PHP_EOL . "\t\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->"; $field .= PHP_EOL . $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$field .= PHP_EOL . "\t\t<field"; $field .= PHP_EOL . $this->_t(2) . "<field";
$fieldsSet = array(); $fieldsSet = array();
foreach ($fieldAttributes as $property => $value) foreach ($fieldAttributes as $property => $value)
{ {
if ($property != 'fields') if ($property != 'fields')
{ {
$field .= PHP_EOL . "\t\t\t" . $property . '="' . $value . '"'; $field .= PHP_EOL . $this->_t(3) . $property . '="' . $value . '"';
} }
} }
$field .= ">"; $field .= ">";
$field .= PHP_EOL . "\t\t\t" . '<fields name="' . $fieldAttributes['name'] . '_fields" label="">'; $field .= PHP_EOL . $this->_t(3) . '<fields name="' . $fieldAttributes['name'] . '_fields" label="">';
$field .= PHP_EOL . "\t\t\t\t" . '<fieldset hidden="true" name="' . $fieldAttributes['name'] . '_modal" repeat="true">'; $field .= PHP_EOL . $this->_t(4) . '<fieldset hidden="true" name="' . $fieldAttributes['name'] . '_modal" repeat="true">';
if (strpos($fieldAttributes['fields'], ',') !== false) if (strpos($fieldAttributes['fields'], ',') !== false)
{ {
// mulitpal fields // mulitpal fields
@ -1370,7 +1370,7 @@ class Fields extends Structure
$r_multiple = false; $r_multiple = false;
$r_langLabel = ''; $r_langLabel = '';
// add the tabs needed // add the tabs needed
$r_taber = "\t\t\t"; $r_taber = $this->_t(3);
// get field values // get field values
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $view_name_list, $view_name_single, $placeholders, true); $r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $view_name_list, $view_name_single, $placeholders, true);
// check if values were set // check if values were set
@ -1413,26 +1413,26 @@ class Fields extends Structure
} }
} }
} }
$field .= PHP_EOL . "\t\t\t\t</fieldset>"; $field .= PHP_EOL . $this->_t(4) . "</fieldset>";
$field .= PHP_EOL . "\t\t\t</fields>"; $field .= PHP_EOL . $this->_t(3) . "</fields>";
$field .= PHP_EOL . "\t\t</field>"; $field .= PHP_EOL . $this->_t(2) . "</field>";
} }
// set the subform fields (it is a repeatable without the modal) // set the subform fields (it is a repeatable without the modal)
elseif ($typeName === 'subform') elseif ($typeName === 'subform')
{ {
// now add to the field set // now add to the field set
$field .= PHP_EOL . "\t\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->"; $field .= PHP_EOL . $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$field .= PHP_EOL . "\t\t<field"; $field .= PHP_EOL . $this->_t(2) . "<field";
$fieldsSet = array(); $fieldsSet = array();
foreach ($fieldAttributes as $property => $value) foreach ($fieldAttributes as $property => $value)
{ {
if ($property != 'fields') if ($property != 'fields')
{ {
$field .= PHP_EOL . "\t\t\t" . $property . '="' . $value . '"'; $field .= PHP_EOL . $this->_t(3) . $property . '="' . $value . '"';
} }
} }
$field .= ">"; $field .= ">";
$field .= PHP_EOL . "\t\t\t" . '<form hidden="true" name="list_' . $fieldAttributes['name'] . '_modal" repeat="true">'; $field .= PHP_EOL . $this->_t(3) . '<form hidden="true" name="list_' . $fieldAttributes['name'] . '_modal" repeat="true">';
if (strpos($fieldAttributes['fields'], ',') !== false) if (strpos($fieldAttributes['fields'], ',') !== false)
{ {
// mulitpal fields // mulitpal fields
@ -1457,7 +1457,7 @@ class Fields extends Structure
$r_multiple = false; $r_multiple = false;
$r_langLabel = ''; $r_langLabel = '';
// add the tabs needed // add the tabs needed
$r_taber = "\t\t"; $r_taber = $this->_t(2);
// get field values // get field values
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $view_name_list, $view_name_single, $placeholders, true); $r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $view_name_list, $view_name_single, $placeholders, true);
// check if values were set // check if values were set
@ -1500,23 +1500,23 @@ class Fields extends Structure
} }
} }
} }
$field .= PHP_EOL . "\t\t\t</form>"; $field .= PHP_EOL . $this->_t(3) . "</form>";
$field .= PHP_EOL . "\t\t</field>"; $field .= PHP_EOL . $this->_t(2) . "</field>";
} }
} }
elseif ($setType === 'custom') elseif ($setType === 'custom')
{ {
// now add to the field set // now add to the field set
$field .= PHP_EOL . "\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (custom) -->"; $field .= PHP_EOL . $this->_t(2) . $taber . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (custom) -->";
$field .= PHP_EOL . "\t\t" . $taber . "<field"; $field .= PHP_EOL . $this->_t(2) . $taber . "<field";
foreach ($fieldAttributes as $property => $value) foreach ($fieldAttributes as $property => $value)
{ {
if ($property != 'option') if ($property != 'option')
{ {
$field .= PHP_EOL . "\t\t" . $taber . "\t" . $property . '="' . $value . '"'; $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . $property . '="' . $value . '"';
} }
} }
$field .= PHP_EOL . "\t\t" . $taber . "/>"; $field .= PHP_EOL . $this->_t(2) . $taber . "/>";
// incase the field is in the config and has not been set // incase the field is in the config and has not been set
if ('config' === $view_name_single && 'configs' === $view_name_list) if ('config' === $view_name_single && 'configs' === $view_name_list)
{ {
@ -2465,27 +2465,34 @@ class Fields extends Structure
'multiple' => $multiple, 'multiple' => $multiple,
'options' => $options); 'options' => $options);
} }
// load the list join builder
elseif ($listJoin)
{
$this->listJoinBuilder[$view_name_list][(int) $field['field']] = array(
'type' => $typeName,
'code' => $name,
'lang' => $listLangName,
'title' => (isset($field['title']) && $field['title']) ? true : false,
'alias' => (isset($field['alias']) && $field['alias']) ? true : false,
'link' => (isset($field['link']) && $field['link']) ? true : false,
'sort' => (isset($field['sort']) && $field['sort']) ? true : false,
'custom' => $custom,
'multiple' => $multiple,
'options' => $options);
}
// build custom builder list // build custom builder list
if ($listSwitch || $listJoin) if ($listSwitch || $listJoin)
{ {
$this->customBuilderList[$view_name_list][] = $name; $this->customBuilderList[$view_name_list][] = $name;
} }
} }
// load the list join builder
if ($listJoin)
{
$this->listJoinBuilder[$view_name_list][(int) $field['field']] = array(
'type' => $typeName,
'code' => $name,
'lang' => $listLangName,
'title' => (isset($field['title']) && $field['title']) ? true : false,
'alias' => (isset($field['alias']) && $field['alias']) ? true : false,
'link' => (isset($field['link']) && $field['link']) ? true : false,
'sort' => (isset($field['sort']) && $field['sort']) ? true : false,
'custom' => $custom,
'multiple' => $multiple,
'options' => $options);
}
// update the field relations
if (isset($this->fieldRelations[$view_name_list]) && isset($this->fieldRelations[$view_name_list][(int) $field['field']]))
{
$this->fieldRelations[$view_name_list][(int) $field['field']]['type'] = $typeName;
$this->fieldRelations[$view_name_list][(int) $field['field']]['code'] = $name;
$this->fieldRelations[$view_name_list][(int) $field['field']]['custom'] = $custom;
}
// set the hidden field of this view // set the hidden field of this view
if ($typeName === 'hidden') if ($typeName === 'hidden')
{ {
@ -2717,7 +2724,7 @@ class Fields extends Structure
$this->buildDynamique($target, 'field' . $data['custom']['extends'], $data['custom']['type']); $this->buildDynamique($target, 'field' . $data['custom']['extends'], $data['custom']['type']);
// set tab and break replacements // set tab and break replacements
$tabBreak = array( $tabBreak = array(
'\t' => "\t", '\t' => $this->_t(1),
'\n' => PHP_EOL '\n' => PHP_EOL
); );
// make field dynamic // make field dynamic
@ -2749,7 +2756,7 @@ class Fields extends Structure
} }
else else
{ {
$phpCode .= PHP_EOL . "\t\t" . $this->setPlaceholders($code, $tabBreak); $phpCode .= PHP_EOL . $this->_t(2) . $this->setPlaceholders($code, $tabBreak);
} }
} }
} }
@ -2783,7 +2790,7 @@ class Fields extends Structure
} }
else else
{ {
$phpxCode .= PHP_EOL . "\t\t" . $this->setPlaceholders($code, $tabBreak); $phpxCode .= PHP_EOL . $this->_t(2) . $this->setPlaceholders($code, $tabBreak);
} }
} }
} }
@ -2882,137 +2889,137 @@ class Fields extends Structure
} }
// start building the add buttons/s // start building the add buttons/s
$addButton = array(); $addButton = array();
$addButton[] = PHP_EOL . PHP_EOL . "\t/**"; $addButton[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
$addButton[] = "\t * Override to add new button"; $addButton[] = $this->_t(1) . " * Override to add new button";
$addButton[] = "\t *"; $addButton[] = $this->_t(1) . " *";
$addButton[] = "\t * @return string The field input markup."; $addButton[] = $this->_t(1) . " * @return string The field input markup.";
$addButton[] = "\t *"; $addButton[] = $this->_t(1) . " *";
$addButton[] = "\t * @since 3.2"; $addButton[] = $this->_t(1) . " * @since 3.2";
$addButton[] = "\t */"; $addButton[] = $this->_t(1) . " */";
$addButton[] = "\tprotected function getInput()"; $addButton[] = $this->_t(1) . "protected function getInput()";
$addButton[] = "\t{"; $addButton[] = $this->_t(1) . "{";
$addButton[] = "\t\t//" . $this->setLine(__LINE__) . " see if we should add buttons"; $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " see if we should add buttons";
$addButton[] = "\t\t\$setButton = \$this->getAttribute('button');"; $addButton[] = $this->_t(2) . "\$setButton = \$this->getAttribute('button');";
$addButton[] = "\t\t//" . $this->setLine(__LINE__) . " get html"; $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get html";
$addButton[] = "\t\t\$html = parent::getInput();"; $addButton[] = $this->_t(2) . "\$html = parent::getInput();";
$addButton[] = "\t\t//" . $this->setLine(__LINE__) . " if true set button"; $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " if true set button";
$addButton[] = "\t\tif (\$setButton === 'true')"; $addButton[] = $this->_t(2) . "if (\$setButton === 'true')";
$addButton[] = "\t\t{"; $addButton[] = $this->_t(2) . "{";
$addButton[] = "\t\t\t\$button = array();"; $addButton[] = $this->_t(3) . "\$button = array();";
$addButton[] = "\t\t\t\$script = array();"; $addButton[] = $this->_t(3) . "\$script = array();";
$addButton[] = "\t\t\t\$buttonName = \$this->getAttribute('name');"; $addButton[] = $this->_t(3) . "\$buttonName = \$this->getAttribute('name');";
$addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the input from url"; $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the input from url";
$addButton[] = "\t\t\t\$app = JFactory::getApplication();"; $addButton[] = $this->_t(3) . "\$app = JFactory::getApplication();";
$addButton[] = "\t\t\t\$jinput = \$app->input;"; $addButton[] = $this->_t(3) . "\$jinput = \$app->input;";
$addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the view name & id"; $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the view name & id";
$addButton[] = "\t\t\t\$values = \$jinput->getArray(array("; $addButton[] = $this->_t(3) . "\$values = \$jinput->getArray(array(";
$addButton[] = "\t\t\t\t'id' => 'int',"; $addButton[] = $this->_t(4) . "'id' => 'int',";
$addButton[] = "\t\t\t\t'view' => 'word'"; $addButton[] = $this->_t(4) . "'view' => 'word'";
$addButton[] = "\t\t\t));"; $addButton[] = $this->_t(3) . "));";
$addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " check if new item"; $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " check if new item";
$addButton[] = "\t\t\t\$ref = '';"; $addButton[] = $this->_t(3) . "\$ref = '';";
$addButton[] = "\t\t\t\$refJ = '';"; $addButton[] = $this->_t(3) . "\$refJ = '';";
if ($refLoad) if ($refLoad)
{ {
$addButton[] = "\t\t\tif (!is_null(\$values['id']) && strlen(\$values['view']))"; $addButton[] = $this->_t(3) . "if (!is_null(\$values['id']) && strlen(\$values['view']))";
$addButton[] = "\t\t\t{"; $addButton[] = $this->_t(3) . "{";
$addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " only load referal if not new item."; $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " only load referal if not new item.";
$addButton[] = "\t\t\t\t\$ref = '&amp;ref=' . \$values['view'] . '&amp;refid=' . \$values['id'];"; $addButton[] = $this->_t(4) . "\$ref = '&amp;ref=' . \$values['view'] . '&amp;refid=' . \$values['id'];";
$addButton[] = "\t\t\t\t\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; $addButton[] = $this->_t(4) . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];";
$addButton[] = "\t\t\t}"; $addButton[] = $this->_t(3) . "}";
} }
else else
{ {
$addButton[] = "\t\t\tif (!is_null(\$values['id']) && strlen(\$values['view']))"; $addButton[] = $this->_t(3) . "if (!is_null(\$values['id']) && strlen(\$values['view']))";
$addButton[] = "\t\t\t{"; $addButton[] = $this->_t(3) . "{";
$addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " get the return value."; $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " get the return value.";
$addButton[] = "\t\t\t\t\$_uri = (string) JUri::getInstance();"; $addButton[] = $this->_t(4) . "\$_uri = (string) JUri::getInstance();";
$addButton[] = "\t\t\t\t\$_return = urlencode(base64_encode(\$_uri));"; $addButton[] = $this->_t(4) . "\$_return = urlencode(base64_encode(\$_uri));";
$addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " load return value."; $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " load return value.";
$addButton[] = "\t\t\t\t\$ref = '&amp;return=' . \$_return;"; $addButton[] = $this->_t(4) . "\$ref = '&amp;return=' . \$_return;";
$addButton[] = "\t\t\t\t\$refJ = '&return=' . \$_return;"; $addButton[] = $this->_t(4) . "\$refJ = '&return=' . \$_return;";
$addButton[] = "\t\t\t}"; $addButton[] = $this->_t(3) . "}";
} }
$addButton[] = "\t\t\t\$user = JFactory::getUser();"; $addButton[] = $this->_t(3) . "\$user = JFactory::getUser();";
$addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " only add if user allowed to create " . $fieldData['view']; $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " only add if user allowed to create " . $fieldData['view'];
// check if the item has permissions. // check if the item has permissions.
if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($fieldData['view'], $this->permissionBuilder['global'][$core['core.create']])) if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($fieldData['view'], $this->permissionBuilder['global'][$core['core.create']]))
{ {
$addButton[] = "\t\t\tif (\$user->authorise('" . $core['core.create'] . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; $addButton[] = $this->_t(3) . "if (\$user->authorise('" . $core['core.create'] . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area.";
} }
else else
{ {
$addButton[] = "\t\t\tif (\$user->authorise('core.create', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; $addButton[] = $this->_t(3) . "if (\$user->authorise('core.create', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area.";
} }
$addButton[] = "\t\t\t{"; $addButton[] = $this->_t(3) . "{";
$addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " build Create button"; $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " build Create button";
$addButton[] = "\t\t\t\t\$buttonNamee = trim(\$buttonName);"; $addButton[] = $this->_t(4) . "\$buttonNamee = trim(\$buttonName);";
$addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);"; $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);";
$addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);"; $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);";
$addButton[] = "\t\t\t\t\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);"; $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);";
$addButton[] = "\t\t\t\t\$buttonNamee = ucfirst(strtolower(\$buttonNamee));"; $addButton[] = $this->_t(4) . "\$buttonNamee = ucfirst(strtolower(\$buttonNamee));";
$addButton[] = "\t\t\t\t\$button[] = '<a id=\"'.\$buttonName.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.JText:" . ":sprintf('" . $this->langPrefix . "_CREATE_NEW_S', \$buttonNamee).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; $addButton[] = $this->_t(4) . "\$button[] = '<a id=\"'.\$buttonName.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.JText:" . ":sprintf('" . $this->langPrefix . "_CREATE_NEW_S', \$buttonNamee).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\"";
$addButton[] = "\t\t\t\t\thref=\"index.php?option=" . $fieldData['component'] . "&amp;view=" . $fieldData['view'] . "&amp;layout=edit'.\$ref.'\" >"; $addButton[] = $this->_t(5) . "href=\"index.php?option=" . $fieldData['component'] . "&amp;view=" . $fieldData['view'] . "&amp;layout=edit'.\$ref.'\" >";
$addButton[] = "\t\t\t\t\t<span class=\"icon-new icon-white\"></span></a>';"; $addButton[] = $this->_t(5) . "<span class=\"icon-new icon-white\"></span></a>';";
$addButton[] = "\t\t\t}"; $addButton[] = $this->_t(3) . "}";
$addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " only add if user allowed to edit " . $fieldData['view']; $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " only add if user allowed to edit " . $fieldData['view'];
// check if the item has permissions. // check if the item has permissions.
if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($fieldData['view'], $this->permissionBuilder['global'][$core['core.edit']])) if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($fieldData['view'], $this->permissionBuilder['global'][$core['core.edit']]))
{ {
$addButton[] = "\t\t\tif ((\$buttonName === '" . $fieldData['view'] . "' || \$buttonName === '" . $fieldData['views'] . "') && \$user->authorise('" . $core['core.edit'] . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; $addButton[] = $this->_t(3) . "if ((\$buttonName === '" . $fieldData['view'] . "' || \$buttonName === '" . $fieldData['views'] . "') && \$user->authorise('" . $core['core.edit'] . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area.";
} }
else else
{ {
$addButton[] = "\t\t\tif ((\$buttonName === '" . $fieldData['view'] . "' || \$buttonName === '" . $fieldData['views'] . "') && \$user->authorise('core.edit', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; $addButton[] = $this->_t(3) . "if ((\$buttonName === '" . $fieldData['view'] . "' || \$buttonName === '" . $fieldData['views'] . "') && \$user->authorise('core.edit', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area.";
} }
$addButton[] = "\t\t\t{"; $addButton[] = $this->_t(3) . "{";
$addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " build edit button"; $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " build edit button";
$addButton[] = "\t\t\t\t\$buttonNamee = trim(\$buttonName);"; $addButton[] = $this->_t(4) . "\$buttonNamee = trim(\$buttonName);";
$addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);"; $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);";
$addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);"; $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);";
$addButton[] = "\t\t\t\t\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);"; $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);";
$addButton[] = "\t\t\t\t\$buttonNamee = ucfirst(strtolower(\$buttonNamee));"; $addButton[] = $this->_t(4) . "\$buttonNamee = ucfirst(strtolower(\$buttonNamee));";
$addButton[] = "\t\t\t\t\$button[] = '<a id=\"'.\$buttonName.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.JText:" . ":sprintf('" . $this->langPrefix . "_EDIT_S', \$buttonNamee).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; $addButton[] = $this->_t(4) . "\$button[] = '<a id=\"'.\$buttonName.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.JText:" . ":sprintf('" . $this->langPrefix . "_EDIT_S', \$buttonNamee).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >";
$addButton[] = "\t\t\t\t\t<span class=\"icon-edit\"></span></a>';"; $addButton[] = $this->_t(5) . "<span class=\"icon-edit\"></span></a>';";
$addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " build script"; $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " build script";
$addButton[] = "\t\t\t\t\$script[] = \""; $addButton[] = $this->_t(4) . "\$script[] = \"";
$addButton[] = "\t\t\t\t\tjQuery(document).ready(function() {"; $addButton[] = $this->_t(5) . "jQuery(document).ready(function() {";
$addButton[] = "\t\t\t\t\t\tjQuery('#adminForm').on('change', '#jform_\".\$buttonName.\"',function (e) {"; $addButton[] = $this->_t(6) . "jQuery('#adminForm').on('change', '#jform_\".\$buttonName.\"',function (e) {";
$addButton[] = "\t\t\t\t\t\t\te.preventDefault();"; $addButton[] = $this->_t(7) . "e.preventDefault();";
$addButton[] = "\t\t\t\t\t\t\tvar \".\$buttonName.\"Value = jQuery('#jform_\".\$buttonName.\"').val();"; $addButton[] = $this->_t(7) . "var \".\$buttonName.\"Value = jQuery('#jform_\".\$buttonName.\"').val();";
$addButton[] = "\t\t\t\t\t\t\t\".\$buttonName.\"Button(\".\$buttonName.\"Value);"; $addButton[] = $this->_t(7) . "\".\$buttonName.\"Button(\".\$buttonName.\"Value);";
$addButton[] = "\t\t\t\t\t\t});"; $addButton[] = $this->_t(6) . "});";
$addButton[] = "\t\t\t\t\t\tvar \".\$buttonName.\"Value = jQuery('#jform_\".\$buttonName.\"').val();"; $addButton[] = $this->_t(6) . "var \".\$buttonName.\"Value = jQuery('#jform_\".\$buttonName.\"').val();";
$addButton[] = "\t\t\t\t\t\t\".\$buttonName.\"Button(\".\$buttonName.\"Value);"; $addButton[] = $this->_t(6) . "\".\$buttonName.\"Button(\".\$buttonName.\"Value);";
$addButton[] = "\t\t\t\t\t});"; $addButton[] = $this->_t(5) . "});";
$addButton[] = "\t\t\t\t\tfunction \".\$buttonName.\"Button(value) {"; $addButton[] = $this->_t(5) . "function \".\$buttonName.\"Button(value) {";
$addButton[] = "\t\t\t\t\t\tif (value > 0) {"; // TODO not ideal since value may not be an (int) $addButton[] = $this->_t(6) . "if (value > 0) {"; // TODO not ideal since value may not be an (int)
$addButton[] = "\t\t\t\t\t\t\t// hide the create button"; $addButton[] = $this->_t(7) . "// hide the create button";
$addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Create').hide();"; $addButton[] = $this->_t(7) . "jQuery('#\".\$buttonName.\"Create').hide();";
$addButton[] = "\t\t\t\t\t\t\t// show edit button"; $addButton[] = $this->_t(7) . "// show edit button";
$addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Edit').show();"; $addButton[] = $this->_t(7) . "jQuery('#\".\$buttonName.\"Edit').show();";
$addButton[] = "\t\t\t\t\t\t\tvar url = 'index.php?option=" . $fieldData['component'] . "&view=" . $fieldData['views'] . "&task=" . $fieldData['view'] . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID $addButton[] = $this->_t(7) . "var url = 'index.php?option=" . $fieldData['component'] . "&view=" . $fieldData['views'] . "&task=" . $fieldData['view'] . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID
$addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Edit').attr('href', url);"; $addButton[] = $this->_t(7) . "jQuery('#\".\$buttonName.\"Edit').attr('href', url);";
$addButton[] = "\t\t\t\t\t\t} else {"; $addButton[] = $this->_t(6) . "} else {";
$addButton[] = "\t\t\t\t\t\t\t// show the create button"; $addButton[] = $this->_t(7) . "// show the create button";
$addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Create').show();"; $addButton[] = $this->_t(7) . "jQuery('#\".\$buttonName.\"Create').show();";
$addButton[] = "\t\t\t\t\t\t\t// hide edit button"; $addButton[] = $this->_t(7) . "// hide edit button";
$addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Edit').hide();"; $addButton[] = $this->_t(7) . "jQuery('#\".\$buttonName.\"Edit').hide();";
$addButton[] = "\t\t\t\t\t\t}"; $addButton[] = $this->_t(6) . "}";
$addButton[] = "\t\t\t\t\t}\";"; $addButton[] = $this->_t(5) . "}\";";
$addButton[] = "\t\t\t}"; $addButton[] = $this->_t(3) . "}";
$addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " check if button was created for " . $fieldData['view'] . " field."; $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " check if button was created for " . $fieldData['view'] . " field.";
$addButton[] = "\t\t\tif (is_array(\$button) && count(\$button) > 0)"; $addButton[] = $this->_t(3) . "if (is_array(\$button) && count(\$button) > 0)";
$addButton[] = "\t\t\t{"; $addButton[] = $this->_t(3) . "{";
$addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Load the needed script."; $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Load the needed script.";
$addButton[] = "\t\t\t\t\$document = JFactory::getDocument();"; $addButton[] = $this->_t(4) . "\$document = JFactory::getDocument();";
$addButton[] = "\t\t\t\t\$document->addScriptDeclaration(implode(' ',\$script));"; $addButton[] = $this->_t(4) . "\$document->addScriptDeclaration(implode(' ',\$script));";
$addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " return the button attached to input field."; $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " return the button attached to input field.";
$addButton[] = "\t\t\t\treturn '<div class=\"input-append\">' .\$html . implode('',\$button).'</div>';"; $addButton[] = $this->_t(4) . "return '<div class=\"input-append\">' .\$html . implode('',\$button).'</div>';";
$addButton[] = "\t\t\t}"; $addButton[] = $this->_t(3) . "}";
$addButton[] = "\t\t}"; $addButton[] = $this->_t(2) . "}";
$addButton[] = "\t\treturn \$html;"; $addButton[] = $this->_t(2) . "return \$html;";
$addButton[] = "\t}"; $addButton[] = $this->_t(1) . "}";
return implode(PHP_EOL, $addButton); return implode(PHP_EOL, $addButton);
} }

File diff suppressed because it is too large Load Diff

View File

@ -184,19 +184,19 @@ class Infusion extends Interpretation
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] = PHP_EOL . PHP_EOL . '// Triger the Global Admin Event'; $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] = PHP_EOL . PHP_EOL . '// Triger the Global Admin Event';
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] .= PHP_EOL . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::globalEvent($document);'; $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] .= PHP_EOL . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::globalEvent($document);';
// ADMIN_GLOBAL_EVENT_HELPER // ADMIN_GLOBAL_EVENT_HELPER
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] = PHP_EOL . PHP_EOL . "\t" . '/**'; $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] = PHP_EOL . PHP_EOL . $this->_t(1) . '/**';
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '* The Global Admin Event Method.'; $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '* The Global Admin Event Method.';
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '**/'; $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '**/';
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . 'public static function globalEvent($document)'; $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . 'public static function globalEvent($document)';
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '{'; $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '{';
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders); $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders);
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '}'; $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '}';
} }
// now load the readme file if needed // now load the readme file if needed
if ($this->componentData->addreadme == 1) if ($this->componentData->addreadme == 1)
{ {
$this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' . $this->hhh] .= PHP_EOL . "\t\t\t<filename>README.txt</filename>"; $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' . $this->hhh] .= PHP_EOL . $this->_t(3) . "<filename>README.txt</filename>";
} }
// HELPER_CREATEUSER // HELPER_CREATEUSER
@ -243,7 +243,7 @@ class Infusion extends Interpretation
// set site edit view array // set site edit view array
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
{ {
$site_edit_view_array[] = "\t\t\t\t'" . $viewName_single . "'"; $site_edit_view_array[] = $this->_t(4) . "'" . $viewName_single . "'";
$this->lang = 'both'; $this->lang = 'both';
} }
// check if help is being loaded // check if help is being loaded
@ -252,7 +252,7 @@ class Infusion extends Interpretation
$this->setCustomAdminViewListLink($view, $viewName_list); $this->setCustomAdminViewListLink($view, $viewName_list);
// set view array // set view array
$viewarray[] = "\t\t\t\t'" . $viewName_single . "' => '" . $viewName_list . "'"; $viewarray[] = $this->_t(4) . "'" . $viewName_single . "' => '" . $viewName_list . "'";
// set the view names // set the view names
if (isset($view['settings']->name_single) && $view['settings']->name_single != 'null') if (isset($view['settings']->name_single) && $view['settings']->name_single != 'null')
{ {
@ -342,7 +342,7 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_single][$this->hhh . 'METHOD_ITEM_SAVE' . $this->hhh] = $this->setMethodItemSave($viewName_single); $this->fileContentDynamic[$viewName_single][$this->hhh . 'METHOD_ITEM_SAVE' . $this->hhh] = $this->setMethodItemSave($viewName_single);
// POSTSAVEHOOK <<<DYNAMIC>>> // POSTSAVEHOOK <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single][$this->hhh . 'POSTSAVEHOOK' . $this->hhh] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL . "\t\treturn;", PHP_EOL . PHP_EOL . "\t\treturn;"); $this->fileContentDynamic[$viewName_single][$this->hhh . 'POSTSAVEHOOK' . $this->hhh] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL . $this->_t(2) . "return;", PHP_EOL . PHP_EOL . $this->_t(2) . "return;");
// VIEWCSS <<<DYNAMIC>>> // VIEWCSS <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh] = $this->getCustomScriptBuilder('css_view', $viewName_single, '', null, true); $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh] = $this->getCustomScriptBuilder('css_view', $viewName_single, '', null, true);
@ -393,11 +393,11 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CHECKINCALL' . $this->hhh] = ''; $this->fileContentDynamic[$viewName_list][$this->hhh . 'CHECKINCALL' . $this->hhh] = '';
} }
// ADMIN_CUSTOM_BUTTONS_LIST // ADMIN_CUSTOM_BUTTONS_LIST
$this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_CUSTOM_BUTTONS_LIST' . $this->hhh] = $this->setCustomButtons($view, 3, "\t"); $this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_CUSTOM_BUTTONS_LIST' . $this->hhh] = $this->setCustomButtons($view, 3, $this->_t(1));
$this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST' . $this->hhh] = $this->setFunctionOnlyButtons($viewName_list); $this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST' . $this->hhh] = $this->setFunctionOnlyButtons($viewName_list);
// GET_ITEMS_METHOD_STRING_FIX <<<DYNAMIC>>> // GET_ITEMS_METHOD_STRING_FIX <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list][$this->hhh . 'GET_ITEMS_METHOD_STRING_FIX' . $this->hhh] = $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); $this->fileContentDynamic[$viewName_list][$this->hhh . 'GET_ITEMS_METHOD_STRING_FIX' . $this->hhh] = $this->setGetItemsMethodStringFix($viewName_single, $viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]);
// GET_ITEMS_METHOD_AFTER_ALL <<<DYNAMIC>>> // GET_ITEMS_METHOD_AFTER_ALL <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list][$this->hhh . 'GET_ITEMS_METHOD_AFTER_ALL' . $this->hhh] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL); $this->fileContentDynamic[$viewName_list][$this->hhh . 'GET_ITEMS_METHOD_AFTER_ALL' . $this->hhh] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL);
@ -611,7 +611,7 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BEFORE_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true); $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BEFORE_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true);
// CUSTOM_ADMIN_GET_ITEM <<<DYNAMIC>>> // CUSTOM_ADMIN_GET_ITEM <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_ITEM' . $this->hhh] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t"); $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_ITEM' . $this->hhh] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, $this->_t(2));
// CUSTOM_ADMIN_AFTER_GET_ITEM <<<DYNAMIC>>> // CUSTOM_ADMIN_AFTER_GET_ITEM <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_AFTER_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true); $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_AFTER_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true);
@ -848,7 +848,7 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BEFORE_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true); $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BEFORE_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true);
// SITE_GET_ITEM <<<DYNAMIC>>> // SITE_GET_ITEM <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_ITEM' . $this->hhh] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t"); $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_ITEM' . $this->hhh] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, $this->_t(2));
// SITE_AFTER_GET_ITEM <<<DYNAMIC>>> // SITE_AFTER_GET_ITEM <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_AFTER_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true); $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_AFTER_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true);
@ -913,13 +913,13 @@ class Infusion extends Interpretation
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] = PHP_EOL . PHP_EOL . '// Triger the Global Site Event'; $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] = PHP_EOL . PHP_EOL . '// Triger the Global Site Event';
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] .= PHP_EOL . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::globalEvent($document);'; $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] .= PHP_EOL . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::globalEvent($document);';
// SITE_GLOBAL_EVENT_HELPER // SITE_GLOBAL_EVENT_HELPER
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] = PHP_EOL . PHP_EOL . "\t" . '/**'; $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] = PHP_EOL . PHP_EOL . $this->_t(1) . '/**';
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '* The Global Site Event Method.'; $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '* The Global Site Event Method.';
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '**/'; $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '**/';
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . 'public static function globalEvent($document)'; $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . 'public static function globalEvent($document)';
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '{'; $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '{';
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders); $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders);
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '}'; $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '}';
} }
// setup the layouts // setup the layouts
$this->setCustomViewLayouts(); $this->setCustomViewLayouts();
@ -1179,11 +1179,11 @@ class Infusion extends Interpretation
$replace = array(); $replace = array();
if (isset($langXML['admin']) && ComponentbuilderHelper::checkArray($langXML['admin'])) if (isset($langXML['admin']) && ComponentbuilderHelper::checkArray($langXML['admin']))
{ {
$replace[$this->hhh . 'ADMIN_LANGUAGES' . $this->hhh] = implode(PHP_EOL . "\t\t\t", $langXML['admin']); $replace[$this->hhh . 'ADMIN_LANGUAGES' . $this->hhh] = implode(PHP_EOL . $this->_t(3), $langXML['admin']);
} }
if (!$this->removeSiteFolder && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site'])) if (!$this->removeSiteFolder && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site']))
{ {
$replace[$this->hhh . 'SITE_LANGUAGES' . $this->hhh] = implode(PHP_EOL . "\t\t", $langXML['site']); $replace[$this->hhh . 'SITE_LANGUAGES' . $this->hhh] = implode(PHP_EOL . $this->_t(2), $langXML['site']);
} }
// build xml path // build xml path
$xmlPath = $this->componentPath . '/' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.xml'; $xmlPath = $this->componentPath . '/' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.xml';

View File

@ -3646,8 +3646,8 @@ abstract class ComponentbuilderHelper
} }
/** /**
* Load the Component Help URLs. * Load the Component Help URLs.
**/ **/
public static function getHelpUrl($view) public static function getHelpUrl($view)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
@ -3684,15 +3684,15 @@ abstract class ComponentbuilderHelper
// set joomla article // set joomla article
case 1: case 1:
return self::loadArticleLink($help->article); return self::loadArticleLink($help->article);
break; break;
// set help text // set help text
case 2: case 2:
return self::loadHelpTextLink($help->id); return self::loadHelpTextLink($help->id);
break; break;
// set Link // set Link
case 3: case 3:
return $help->url; return $help->url;
break; break;
} }
} }
} }
@ -3701,16 +3701,16 @@ abstract class ComponentbuilderHelper
} }
/** /**
* Get the Article Link. * Get the Article Link.
**/ **/
protected static function loadArticleLink($id) protected static function loadArticleLink($id)
{ {
return JURI::root().'index.php?option=com_content&view=article&id='.$id.'&tmpl=component&layout=modal'; 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) protected static function loadHelpTextLink($id)
{ {
$token = JSession::getFormToken(); $token = JSession::getFormToken();
@ -3809,8 +3809,8 @@ abstract class ComponentbuilderHelper
} }
/** /**
* UIKIT Component Classes * UIKIT Component Classes
**/ **/
public static $uk_components = array( public static $uk_components = array(
'data-uk-grid' => array( 'data-uk-grid' => array(
'grid' ), 'grid' ),
@ -3864,15 +3864,15 @@ abstract class ComponentbuilderHelper
'upload-drop' => array( 'upload-drop' => array(
'upload', 'form-file' ) 'upload', 'form-file' )
); );
/** /**
* Add UIKIT Components * Add UIKIT Components
**/ **/
public static $uikit = false; public static $uikit = false;
/** /**
* Get UIKIT Components * Get UIKIT Components
**/ **/
public static function getUikitComp($content,$classes = array()) public static function getUikitComp($content,$classes = array())
{ {
if (strpos($content,'class="uk-') !== false) if (strpos($content,'class="uk-') !== false)
@ -3902,7 +3902,7 @@ abstract class ComponentbuilderHelper
} }
return $temp; return $temp;
} }
} }
if (self::checkArray($classes)) if (self::checkArray($classes))
{ {
return $classes; return $classes;
@ -3938,19 +3938,19 @@ abstract class ComponentbuilderHelper
{ {
$subjectTab = 'Sheet1'; $subjectTab = 'Sheet1';
} }
// make sure the file is loaded // make sure the file is loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
// Create new PHPExcel object // Create new PHPExcel object
$objPHPExcel = new PHPExcel(); $objPHPExcel = new PHPExcel();
// Set document properties // Set document properties
$objPHPExcel->getProperties()->setCreator($creator) $objPHPExcel->getProperties()->setCreator($creator)
->setCompany('Joomla Component Builder') ->setCompany('Joomla Component Builder')
->setLastModifiedBy($modified) ->setLastModifiedBy($modified)
->setTitle($title) ->setTitle($title)
->setSubject($subjectTab); ->setSubject($subjectTab);
if (!$description) if (!$description)
{ {
$objPHPExcel->getProperties()->setDescription($description); $objPHPExcel->getProperties()->setDescription($description);
@ -3963,7 +3963,7 @@ abstract class ComponentbuilderHelper
{ {
$objPHPExcel->getProperties()->setCategory($category); $objPHPExcel->getProperties()->setCategory($category);
} }
// Some styles // Some styles
$headerStyles = array( $headerStyles = array(
'font' => array( 'font' => array(
@ -3985,7 +3985,7 @@ abstract class ComponentbuilderHelper
'size' => 11, 'size' => 11,
'name' => 'Verdana' 'name' => 'Verdana'
)); ));
// Add some data // Add some data
if (self::checkArray($rows)) if (self::checkArray($rows))
{ {
@ -4012,43 +4012,43 @@ abstract class ComponentbuilderHelper
{ {
return false; return false;
} }
// Rename worksheet // Rename worksheet
$objPHPExcel->getActiveSheet()->setTitle($subjectTab); $objPHPExcel->getActiveSheet()->setTitle($subjectTab);
// Set active sheet index to the first sheet, so Excel opens this as the first sheet // Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->setActiveSheetIndex(0);
// Redirect output to a client's web browser (Excel5) // Redirect output to a client's web browser (Excel5)
header('Content-Type: application/vnd.ms-excel'); header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$fileName.'.xls"'); header('Content-Disposition: attachment;filename="'.$fileName.'.xls"');
header('Cache-Control: max-age=0'); header('Cache-Control: max-age=0');
// If you're serving to IE 9, then the following may be needed // If you're serving to IE 9, then the following may be needed
header('Cache-Control: max-age=1'); header('Cache-Control: max-age=1');
// If you're serving to IE over SSL, then the following may be needed // 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 ('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 ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified
header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
header ('Pragma: public'); // HTTP/1.0 header ('Pragma: public'); // HTTP/1.0
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output'); $objWriter->save('php://output');
jexit(); jexit();
} }
/** /**
* Get CSV Headers * Get CSV Headers
*/ */
public static function getFileHeaders($dataType) 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('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
JLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader'); JLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader');
// get session object // get session object
$session = JFactory::getSession(); $session = JFactory::getSession();
$package = $session->get('package', null); $package = $session->get('package', null);
$package = json_decode($package, true); $package = json_decode($package, true);
// set the headers // set the headers
if(isset($package['dir'])) if(isset($package['dir']))
{ {

View File

@ -271,7 +271,8 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOIN_TYPE_LABEL="Join Type"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD="Listfield" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD="Listfield"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_DESCRIPTION="Select the target list field." COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_DESCRIPTION="Select the target list field."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_LABEL="List Field" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_LABEL="List Field"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL="Model" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL_AFTER_MODELLING="Model (after modelling)"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL_BEFORE_MODELLING="Model (before modelling)"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_DESC="The last user that modified this Admin Fields Relations." COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_DESC="The last user that modified this Admin Fields Relations."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_LABEL="Modified By" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_LABEL="Modified By"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_DATE_DESC="The date this Admin Fields Relations was modified." COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_DATE_DESC="The date this Admin Fields Relations was modified."

View File

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

View File

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

View File

@ -236,7 +236,7 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -502,7 +502,7 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -600,7 +600,7 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -645,7 +645,7 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -835,13 +835,13 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

View File

@ -550,7 +550,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -661,18 +661,18 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
} }
/** /**
* Method to validate the form data. * Method to validate the form data.
* *
* @param JForm $form The form to validate against. * @param JForm $form The form to validate against.
* @param array $data The data to validate. * @param array $data The data to validate.
* @param string $group The name of the field group to validate. * @param string $group The name of the field group to validate.
* *
* @return mixed Array of filtered data if valid, false otherwise. * @return mixed Array of filtered data if valid, false otherwise.
* *
* @see JFormRule * @see JFormRule
* @see JFilterInput * @see JFilterInput
* @since 12.2 * @since 12.2
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// check if the not_required field is set // check if the not_required field is set
@ -894,7 +894,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -986,7 +986,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -1051,7 +1051,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {

View File

@ -104,11 +104,9 @@ class ComponentbuilderModelAdmin_views extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) 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) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -194,10 +192,10 @@ class ComponentbuilderModelAdmin_views extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -237,11 +235,9 @@ class ComponentbuilderModelAdmin_views extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) 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) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -385,16 +381,16 @@ class ComponentbuilderModelAdmin_views extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

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

View File

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

View File

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

View File

@ -2092,6 +2092,13 @@ class ComponentbuilderModelAjax extends JModelList
$targets['admin_view']['not_base64'] = array(); $targets['admin_view']['not_base64'] = array();
$targets['admin_view']['name'] = 'system_name'; $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 // #__componentbuilder_custom_admin_view
$targets['custom_admin_view'] = array(); $targets['custom_admin_view'] = array();
$targets['custom_admin_view']['search'] = array('id', 'system_name', 'default','php_view','php_jview','php_jview_display','php_document', $targets['custom_admin_view']['search'] = array('id', 'system_name', 'default','php_view','php_jview','php_jview_display','php_document',
@ -2139,7 +2146,6 @@ class ComponentbuilderModelAjax extends JModelList
// #__componentbuilder_library // #__componentbuilder_library
$targets['library'] = array(); $targets['library'] = array();
$targets['library']['view'] = 'libraries';
$targets['library']['search'] = array('id', 'name', 'php_setdocument'); $targets['library']['search'] = array('id', 'name', 'php_setdocument');
$targets['library']['view'] = 'libraries'; $targets['library']['view'] = 'libraries';
$targets['library']['not_base64'] = array(); $targets['library']['not_base64'] = array();
@ -2597,17 +2603,19 @@ class ComponentbuilderModelAjax extends JModelList
$names = array_map( function ($id) { $names = array_map( function ($id) {
return '[' . $id . ']=> ' . ComponentbuilderHelper::getVar('field', $id, 'id', 'name'); return '[' . $id . ']=> ' . ComponentbuilderHelper::getVar('field', $id, 'id', 'name');
}, $fields); }, $fields);
// create note
$note = "// ". implode('; ', $names);
// MODEL // MODEL
if ($area == 1) if ($area == 1 || $area == 3)
{ {
return $note . PHP_EOL . PHP_EOL . '$item->[' . implode("] . ', ' . \$item->[", $fields) . '];'; // create note
$note = "// ". implode('; ', $names);
return $note . PHP_EOL . '$item->{'.(int)$listfield.'} = $item->{' . implode("} . ', ' . \$item->{", $fields) . '};';
} }
// VIEW // VIEW
elseif ($area == 2) elseif ($area == 2)
{ {
return '$this->escape($item->[' . implode("]) . '<br />' . \$this->escape(\$item->[", $fields). ']);' . PHP_EOL . PHP_EOL . $note; // create note
$note = "<!-- " . implode('; ', $names) . " -->";
return '[field=' . implode("]<br />[field=", $fields). ']' . PHP_EOL . PHP_EOL . $note;
} }
} }
return false; return false;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -377,7 +377,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -488,18 +488,18 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
} }
/** /**
* Method to validate the form data. * Method to validate the form data.
* *
* @param JForm $form The form to validate against. * @param JForm $form The form to validate against.
* @param array $data The data to validate. * @param array $data The data to validate.
* @param string $group The name of the field group to validate. * @param string $group The name of the field group to validate.
* *
* @return mixed Array of filtered data if valid, false otherwise. * @return mixed Array of filtered data if valid, false otherwise.
* *
* @see JFormRule * @see JFormRule
* @see JFilterInput * @see JFilterInput
* @since 12.2 * @since 12.2
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// check if the not_required field is set // check if the not_required field is set
@ -679,7 +679,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -777,7 +777,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -822,7 +822,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -1126,13 +1126,13 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

View File

@ -104,11 +104,9 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && $user->authorise('custom_admin_view.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -198,10 +196,10 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -241,11 +239,9 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && $user->authorise('custom_admin_view.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -345,16 +341,16 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

@ -234,7 +234,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -345,18 +345,18 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
} }
/** /**
* Method to validate the form data. * Method to validate the form data.
* *
* @param JForm $form The form to validate against. * @param JForm $form The form to validate against.
* @param array $data The data to validate. * @param array $data The data to validate.
* @param string $group The name of the field group to validate. * @param string $group The name of the field group to validate.
* *
* @return mixed Array of filtered data if valid, false otherwise. * @return mixed Array of filtered data if valid, false otherwise.
* *
* @see JFormRule * @see JFormRule
* @see JFilterInput * @see JFilterInput
* @since 12.2 * @since 12.2
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// check if the not_required field is set // check if the not_required field is set
@ -536,7 +536,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -634,7 +634,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -679,7 +679,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -862,13 +862,13 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

View File

@ -108,11 +108,9 @@ class ComponentbuilderModelCustom_codes extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && $user->authorise('custom_code.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -159,10 +157,10 @@ class ComponentbuilderModelCustom_codes extends JModelList
} }
/** /**
* Method to convert selection values to translatable string. * Method to convert selection values to translatable string.
* *
* @return translatable string * @return translatable string
*/ */
public function selectionTranslation($value,$name) public function selectionTranslation($value,$name)
{ {
// Array of target language strings // Array of target language strings
@ -303,10 +301,10 @@ class ComponentbuilderModelCustom_codes extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -346,11 +344,9 @@ class ComponentbuilderModelCustom_codes extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && $user->authorise('custom_code.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -446,16 +442,16 @@ class ComponentbuilderModelCustom_codes extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

@ -384,7 +384,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -495,18 +495,18 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
} }
/** /**
* Method to validate the form data. * Method to validate the form data.
* *
* @param JForm $form The form to validate against. * @param JForm $form The form to validate against.
* @param array $data The data to validate. * @param array $data The data to validate.
* @param string $group The name of the field group to validate. * @param string $group The name of the field group to validate.
* *
* @return mixed Array of filtered data if valid, false otherwise. * @return mixed Array of filtered data if valid, false otherwise.
* *
* @see JFormRule * @see JFormRule
* @see JFilterInput * @see JFilterInput
* @since 12.2 * @since 12.2
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// check if the not_required field is set // check if the not_required field is set
@ -686,7 +686,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -784,7 +784,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -829,7 +829,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -1132,13 +1132,13 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

View File

@ -100,11 +100,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && $user->authorise('dynamic_get.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -123,8 +121,6 @@ class ComponentbuilderModelDynamic_gets extends JModelList
$item->main_source = $this->selectionTranslation($item->main_source, 'main_source'); $item->main_source = $this->selectionTranslation($item->main_source, 'main_source');
// convert gettype // convert gettype
$item->gettype = $this->selectionTranslation($item->gettype, 'gettype'); $item->gettype = $this->selectionTranslation($item->gettype, 'gettype');
// convert addcalculation
$item->addcalculation = $this->selectionTranslation($item->addcalculation, 'addcalculation');
} }
} }
@ -134,10 +130,10 @@ class ComponentbuilderModelDynamic_gets extends JModelList
} }
/** /**
* Method to convert selection values to translatable string. * Method to convert selection values to translatable string.
* *
* @return translatable string * @return translatable string
*/ */
public function selectionTranslation($value,$name) public function selectionTranslation($value,$name)
{ {
// Array of main_source language strings // Array of main_source language strings
@ -170,19 +166,6 @@ class ComponentbuilderModelDynamic_gets extends JModelList
return $gettypeArray[$value]; return $gettypeArray[$value];
} }
} }
// Array of addcalculation language strings
if ($name === 'addcalculation')
{
$addcalculationArray = array(
1 => 'COM_COMPONENTBUILDER_DYNAMIC_GET_YES',
0 => 'COM_COMPONENTBUILDER_DYNAMIC_GET_NO'
);
// Now check if value is found in this array
if (isset($addcalculationArray[$value]) && ComponentbuilderHelper::checkString($addcalculationArray[$value]))
{
return $addcalculationArray[$value];
}
}
return $value; return $value;
} }
@ -205,10 +188,6 @@ class ComponentbuilderModelDynamic_gets extends JModelList
// From the componentbuilder_item table // From the componentbuilder_item table
$query->from($db->quoteName('#__componentbuilder_dynamic_get', 'a')); $query->from($db->quoteName('#__componentbuilder_dynamic_get', 'a'));
// From the componentbuilder_admin_view table.
$query->select($db->quoteName('h.system_name','view_table_main_system_name'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_admin_view', 'h') . ' ON (' . $db->quoteName('a.view_table_main') . ' = ' . $db->quoteName('h.id') . ')');
// Filter by published state // Filter by published state
$published = $this->getState('filter.published'); $published = $this->getState('filter.published');
if (is_numeric($published)) if (is_numeric($published))
@ -272,10 +251,10 @@ class ComponentbuilderModelDynamic_gets extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -315,11 +294,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && $user->authorise('dynamic_get.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -410,16 +387,16 @@ class ComponentbuilderModelDynamic_gets extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

@ -282,7 +282,7 @@ class ComponentbuilderModelField extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -393,18 +393,18 @@ class ComponentbuilderModelField extends JModelAdmin
} }
/** /**
* Method to validate the form data. * Method to validate the form data.
* *
* @param JForm $form The form to validate against. * @param JForm $form The form to validate against.
* @param array $data The data to validate. * @param array $data The data to validate.
* @param string $group The name of the field group to validate. * @param string $group The name of the field group to validate.
* *
* @return mixed Array of filtered data if valid, false otherwise. * @return mixed Array of filtered data if valid, false otherwise.
* *
* @see JFormRule * @see JFormRule
* @see JFilterInput * @see JFilterInput
* @since 12.2 * @since 12.2
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// check if the not_required field is set // check if the not_required field is set
@ -584,7 +584,7 @@ class ComponentbuilderModelField extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -691,7 +691,7 @@ class ComponentbuilderModelField extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -736,7 +736,7 @@ class ComponentbuilderModelField extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -1024,13 +1024,13 @@ class ComponentbuilderModelField extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

View File

@ -124,11 +124,9 @@ class ComponentbuilderModelFields extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && JFactory::getUser()->authorise('field.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -160,10 +158,10 @@ class ComponentbuilderModelFields extends JModelList
} }
/** /**
* Method to convert selection values to translatable string. * Method to convert selection values to translatable string.
* *
* @return translatable string * @return translatable string
*/ */
public function selectionTranslation($value,$name) public function selectionTranslation($value,$name)
{ {
// Array of datatype language strings // Array of datatype language strings
@ -364,10 +362,10 @@ class ComponentbuilderModelFields extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -407,11 +405,9 @@ class ComponentbuilderModelFields extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && JFactory::getUser()->authorise('field.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -500,16 +496,16 @@ class ComponentbuilderModelFields extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

@ -121,10 +121,10 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
} }
/** /**
* Method to get list data. * Method to get list data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getWadfields() public function getWadfields()
{ {
// Get the user object. // Get the user object.
@ -189,11 +189,9 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && JFactory::getUser()->authorise('field.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -225,10 +223,10 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
} }
/** /**
* Method to convert selection values to translatable string. * Method to convert selection values to translatable string.
* *
* @return translatable string * @return translatable string
*/ */
public function selectionTranslationWadfields($value,$name) public function selectionTranslationWadfields($value,$name)
{ {
// Array of datatype language strings // Array of datatype language strings
@ -503,7 +501,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -769,7 +767,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -876,7 +874,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -921,7 +919,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -1127,13 +1125,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

View File

@ -108,11 +108,9 @@ class ComponentbuilderModelFieldtypes extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && $user->authorise('fieldtype.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -222,10 +220,10 @@ class ComponentbuilderModelFieldtypes extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -265,11 +263,9 @@ class ComponentbuilderModelFieldtypes extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && $user->authorise('fieldtype.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -346,16 +342,16 @@ class ComponentbuilderModelFieldtypes extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

@ -144,7 +144,9 @@
onchange="getCodeGlueOptions(this)"> onchange="getCodeGlueOptions(this)">
<!-- Option Set. --> <!-- Option Set. -->
<option value="1"> <option value="1">
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL</option> COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL_BEFORE_MODELLING</option>
<option value="3">
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL_AFTER_MODELLING</option>
<option value="2"> <option value="2">
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VIEW</option> COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VIEW</option>
</field> </field>

View File

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

View File

@ -232,7 +232,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -343,18 +343,18 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
} }
/** /**
* Method to validate the form data. * Method to validate the form data.
* *
* @param JForm $form The form to validate against. * @param JForm $form The form to validate against.
* @param array $data The data to validate. * @param array $data The data to validate.
* @param string $group The name of the field group to validate. * @param string $group The name of the field group to validate.
* *
* @return mixed Array of filtered data if valid, false otherwise. * @return mixed Array of filtered data if valid, false otherwise.
* *
* @see JFormRule * @see JFormRule
* @see JFilterInput * @see JFilterInput
* @since 12.2 * @since 12.2
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// check if the not_required field is set // check if the not_required field is set
@ -534,7 +534,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -627,7 +627,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -672,7 +672,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -908,14 +908,14 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
} }
/** /**
* Method to change the title/s & alias. * Method to change the title/s & alias.
* *
* @param string $alias The alias. * @param string $alias The alias.
* @param string/array $title The title. * @param string/array $title The title.
* *
* @return array/string Contains the modified title/s and/or alias. * @return array/string Contains the modified title/s and/or alias.
* *
*/ */
protected function _generateNewTitle($alias, $title = null) protected function _generateNewTitle($alias, $title = null)
{ {

View File

@ -108,11 +108,9 @@ class ComponentbuilderModelHelp_documents extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && $user->authorise('help_document.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -160,10 +158,10 @@ class ComponentbuilderModelHelp_documents extends JModelList
} }
/** /**
* Method to convert selection values to translatable string. * Method to convert selection values to translatable string.
* *
* @return translatable string * @return translatable string
*/ */
public function selectionTranslation($value,$name) public function selectionTranslation($value,$name)
{ {
// Array of type language strings // Array of type language strings
@ -289,10 +287,10 @@ class ComponentbuilderModelHelp_documents extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -332,11 +330,9 @@ class ComponentbuilderModelHelp_documents extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && $user->authorise('help_document.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -413,16 +409,16 @@ class ComponentbuilderModelHelp_documents extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

@ -698,7 +698,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
$tables = array( $tables = array(
'validation_rule', 'fieldtype', 'field', 'admin_view', 'snippet', 'dynamic_get', 'custom_admin_view', 'site_view', 'validation_rule', 'fieldtype', 'field', 'admin_view', 'snippet', 'dynamic_get', 'custom_admin_view', 'site_view',
'template', 'layout', 'joomla_component', 'language', 'language_translation', 'custom_code', 'template', 'layout', 'joomla_component', 'language', 'language_translation', 'custom_code',
'admin_fields', 'admin_fields_conditions', 'component_admin_views', 'component_site_views', 'admin_fields', 'admin_fields_conditions', 'admin_fields_relations', 'component_admin_views', 'component_site_views',
'component_custom_admin_views', 'component_updates', 'component_mysql_tweaks', 'component_custom_admin_views', 'component_updates', 'component_mysql_tweaks',
'component_custom_admin_menus', 'component_config', 'component_dashboard', 'component_files_folders' 'component_custom_admin_menus', 'component_config', 'component_dashboard', 'component_files_folders'
); );
@ -2009,12 +2009,14 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
break; break;
case 'admin_fields': case 'admin_fields':
case 'admin_fields_conditions': case 'admin_fields_conditions':
case 'admin_fields_relations':
// diverged id already updated // diverged id already updated
if (!$diverged) if (!$diverged)
{ {
// update the admin_view ID where needed // update the admin_view ID where needed
$item = $this->setNewID($item, 'admin_view', 'admin_view', $type); $item = $this->setNewID($item, 'admin_view', 'admin_view', $type);
} }
$updaterR = array();
// set the updater // set the updater
if ('admin_fields' === $type) if ('admin_fields' === $type)
{ {
@ -2034,7 +2036,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
unset($item->addconditions); unset($item->addconditions);
} }
} }
else elseif ('admin_fields_conditions' === $type)
{ {
// repeatable fields to update // repeatable fields to update
$updaterR = array( $updaterR = array(
@ -2047,10 +2049,20 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
'addconditions' => array('target_field' => 'field', 'match_field' => 'field') 'addconditions' => array('target_field' => 'field', 'match_field' => 'field')
); );
} }
elseif ('admin_fields_relations' === $type)
{
// subform fields to target
$updaterT = array(
// subformfield => field => type_value
'addrelations' => array('listfield' => 'field', 'joinfields' => 'field')
);
}
// update the repeatable fields // update the repeatable fields
$item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR); if (isset($updaterR) && ComponentbuilderHelper::checkArray($updaterR))
{
$item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR);
}
// update the subform ids // update the subform ids
$this->updateSubformsIDs($item, $type, $updaterT); $this->updateSubformsIDs($item, $type, $updaterT);
} }
@ -2390,6 +2402,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
{ {
case 'admin_fields': case 'admin_fields':
case 'admin_fields_conditions': case 'admin_fields_conditions':
case 'admin_fields_relations':
// get by admin_view (since there should only be one of each name) // get by admin_view (since there should only be one of each name)
$getter = array('admin_view'); $getter = array('admin_view');
$this->specialValue = array(); $this->specialValue = array();

View File

@ -412,7 +412,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -523,18 +523,18 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
} }
/** /**
* Method to validate the form data. * Method to validate the form data.
* *
* @param JForm $form The form to validate against. * @param JForm $form The form to validate against.
* @param array $data The data to validate. * @param array $data The data to validate.
* @param string $group The name of the field group to validate. * @param string $group The name of the field group to validate.
* *
* @return mixed Array of filtered data if valid, false otherwise. * @return mixed Array of filtered data if valid, false otherwise.
* *
* @see JFormRule * @see JFormRule
* @see JFilterInput * @see JFilterInput
* @since 12.2 * @since 12.2
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// check if the not_required field is set // check if the not_required field is set
@ -770,7 +770,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -868,7 +868,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -913,7 +913,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -1231,13 +1231,13 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

View File

@ -307,11 +307,12 @@ class ComponentbuilderModelJoomla_components extends JModelList
{ {
$this->setData($table, $pks, $field); $this->setData($table, $pks, $field);
} }
// add fields and conditions // add fields conditions and relations
if (isset($this->smartIDs['admin_view']) && ComponentbuilderHelper::checkArray($this->smartIDs['admin_view'])) if (isset($this->smartIDs['admin_view']) && ComponentbuilderHelper::checkArray($this->smartIDs['admin_view']))
{ {
$this->setData('admin_fields', array_values($this->smartIDs['admin_view']), 'admin_view'); $this->setData('admin_fields', array_values($this->smartIDs['admin_view']), 'admin_view');
$this->setData('admin_fields_conditions', array_values($this->smartIDs['admin_view']), 'admin_view'); $this->setData('admin_fields_conditions', array_values($this->smartIDs['admin_view']), 'admin_view');
$this->setData('admin_fields_relations', array_values($this->smartIDs['admin_view']), 'admin_view');
} }
// add validation rules // add validation rules
if (isset($this->smartIDs['validation_rule']) && ComponentbuilderHelper::checkArray($this->smartIDs['validation_rule'])) if (isset($this->smartIDs['validation_rule']) && ComponentbuilderHelper::checkArray($this->smartIDs['validation_rule']))
@ -715,10 +716,17 @@ class ComponentbuilderModelJoomla_components extends JModelList
// actions to take if table is admin_fields_conditions // actions to take if table is admin_fields_conditions
if ('admin_fields_conditions' === $table) if ('admin_fields_conditions' === $table)
{ {
// add fields // add fields (all should already be added)
$this->setData('field', $this->getValues($item->addconditions, 'subform', 'target_field'), 'id'); $this->setData('field', $this->getValues($item->addconditions, 'subform', 'target_field'), 'id');
$this->setData('field', $this->getValues($item->addconditions, 'subform', 'match_field'), 'id'); $this->setData('field', $this->getValues($item->addconditions, 'subform', 'match_field'), 'id');
} }
// actions to take if table is admin_fields_relations
if ('admin_fields_relations' === $table)
{
// add fields (all should already be added)
$this->setData('field', $this->getValues($item->addrelations, 'subform', 'listfield'), 'id');
$this->setData('field', $this->getValues($item->addrelations, 'subform', 'joinfields'), 'id');
}
// actions to take if table is field // actions to take if table is field
if ('field' === $table) if ('field' === $table)
{ {
@ -847,7 +855,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
$tables = array( $tables = array(
'fieldtype', 'field', 'admin_view', 'snippet', 'dynamic_get', 'custom_admin_view', 'site_view', 'fieldtype', 'field', 'admin_view', 'snippet', 'dynamic_get', 'custom_admin_view', 'site_view',
'template', 'layout', 'joomla_component', 'language', 'language_translation', 'custom_code', 'template', 'layout', 'joomla_component', 'language', 'language_translation', 'custom_code',
'admin_fields', 'admin_fields_conditions', 'component_admin_views', 'component_site_views', 'admin_fields', 'admin_fields_conditions', 'admin_fields_relations', 'component_admin_views', 'component_site_views',
'component_custom_admin_views', 'component_updates', 'component_mysql_tweaks', 'component_custom_admin_views', 'component_updates', 'component_mysql_tweaks',
'component_custom_admin_menus', 'component_config', 'component_dashboard', 'component_files_folders' 'component_custom_admin_menus', 'component_config', 'component_dashboard', 'component_files_folders'
); );
@ -1604,6 +1612,13 @@ class ComponentbuilderModelJoomla_components extends JModelList
$targets['admin_view']['not_base64'] = array(); $targets['admin_view']['not_base64'] = array();
$targets['admin_view']['name'] = 'system_name'; $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 // #__componentbuilder_custom_admin_view
$targets['custom_admin_view'] = array(); $targets['custom_admin_view'] = array();
$targets['custom_admin_view']['search'] = array('id', 'system_name', 'default','php_view','php_jview','php_jview_display','php_document', $targets['custom_admin_view']['search'] = array('id', 'system_name', 'default','php_view','php_jview','php_jview_display','php_document',
@ -1651,7 +1666,6 @@ class ComponentbuilderModelJoomla_components extends JModelList
// #__componentbuilder_library // #__componentbuilder_library
$targets['library'] = array(); $targets['library'] = array();
$targets['library']['view'] = 'libraries';
$targets['library']['search'] = array('id', 'name', 'php_setdocument'); $targets['library']['search'] = array('id', 'name', 'php_setdocument');
$targets['library']['view'] = 'libraries'; $targets['library']['view'] = 'libraries';
$targets['library']['not_base64'] = array(); $targets['library']['not_base64'] = array();
@ -1748,11 +1762,9 @@ class ComponentbuilderModelJoomla_components extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -1848,10 +1860,10 @@ class ComponentbuilderModelJoomla_components extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -1896,11 +1908,9 @@ class ComponentbuilderModelJoomla_components extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -2022,16 +2032,16 @@ class ComponentbuilderModelJoomla_components extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

@ -226,7 +226,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -492,7 +492,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -590,7 +590,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -635,7 +635,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -812,13 +812,13 @@ class ComponentbuilderModelLanguage extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

View File

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

View File

@ -92,11 +92,9 @@ class ComponentbuilderModelLanguage_translations extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && $user->authorise('language_translation.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -271,10 +269,10 @@ class ComponentbuilderModelLanguage_translations extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -314,11 +312,9 @@ class ComponentbuilderModelLanguage_translations extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && $user->authorise('language_translation.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -477,16 +473,16 @@ class ComponentbuilderModelLanguage_translations extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

@ -219,11 +219,9 @@ class ComponentbuilderModelLanguages extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && $user->authorise('language.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && JFactory::getUser()->authorise('language.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -309,10 +307,10 @@ class ComponentbuilderModelLanguages extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -352,11 +350,9 @@ class ComponentbuilderModelLanguages extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && $user->authorise('language.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && JFactory::getUser()->authorise('language.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -430,16 +426,16 @@ class ComponentbuilderModelLanguages extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

@ -272,7 +272,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -383,18 +383,18 @@ class ComponentbuilderModelLayout extends JModelAdmin
} }
/** /**
* Method to validate the form data. * Method to validate the form data.
* *
* @param JForm $form The form to validate against. * @param JForm $form The form to validate against.
* @param array $data The data to validate. * @param array $data The data to validate.
* @param string $group The name of the field group to validate. * @param string $group The name of the field group to validate.
* *
* @return mixed Array of filtered data if valid, false otherwise. * @return mixed Array of filtered data if valid, false otherwise.
* *
* @see JFormRule * @see JFormRule
* @see JFilterInput * @see JFilterInput
* @since 12.2 * @since 12.2
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// check if the not_required field is set // check if the not_required field is set
@ -574,7 +574,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -667,7 +667,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -712,7 +712,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -970,14 +970,14 @@ class ComponentbuilderModelLayout extends JModelAdmin
} }
/** /**
* Method to change the title/s & alias. * Method to change the title/s & alias.
* *
* @param string $alias The alias. * @param string $alias The alias.
* @param string/array $title The title. * @param string/array $title The title.
* *
* @return array/string Contains the modified title/s and/or alias. * @return array/string Contains the modified title/s and/or alias.
* *
*/ */
protected function _generateNewTitle($alias, $title = null) protected function _generateNewTitle($alias, $title = null)
{ {

View File

@ -104,11 +104,9 @@ class ComponentbuilderModelLayouts extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && $user->authorise('layout.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && JFactory::getUser()->authorise('layout.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -203,10 +201,10 @@ class ComponentbuilderModelLayouts extends JModelList
} }
/** /**
* Method to get list export data. * Method to get list export data.
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// setup the query // setup the query
@ -246,11 +244,9 @@ class ComponentbuilderModelLayouts extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && $user->authorise('layout.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && JFactory::getUser()->authorise('layout.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
@ -330,16 +326,16 @@ class ComponentbuilderModelLayouts extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

@ -104,17 +104,19 @@ class ComponentbuilderModelLibraries extends JModelList
// set values to display correctly. // set values to display correctly.
if (ComponentbuilderHelper::checkArray($items)) if (ComponentbuilderHelper::checkArray($items))
{ {
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
$access = ($user->authorise('library.access', 'com_componentbuilder.library.' . (int) $item->id) && $user->authorise('library.access', 'com_componentbuilder')); $access = (JFactory::getUser()->authorise('library.access', 'com_componentbuilder.library.' . (int) $item->id) && JFactory::getUser()->authorise('library.access', 'com_componentbuilder'));
if (!$access) if (!$access)
{ {
unset($items[$nr]); unset($items[$nr]);
continue; continue;
} }
// convert how
$item->how = $this->selectionTranslation($item->how, 'how');
} }
} }
@ -125,10 +127,6 @@ class ComponentbuilderModelLibraries extends JModelList
{ {
// convert type // convert type
$item->type = $this->selectionTranslation($item->type, 'type'); $item->type = $this->selectionTranslation($item->type, 'type');
// convert how
$item->how = $this->selectionTranslation($item->how, 'how');
} }
} }
@ -138,10 +136,10 @@ class ComponentbuilderModelLibraries extends JModelList
} }
/** /**
* Method to convert selection values to translatable string. * Method to convert selection values to translatable string.
* *
* @return translatable string * @return translatable string
*/ */
public function selectionTranslation($value,$name) public function selectionTranslation($value,$name)
{ {
// Array of type language strings // Array of type language strings
@ -158,22 +156,22 @@ class ComponentbuilderModelLibraries extends JModelList
} }
} }
// Array of how language strings // Array of how language strings
if ($name === 'how') if ($name === 'how')
{ {
$howArray = array( $howArray = array(
1 => 'COM_COMPONENTBUILDER_ALWAYS_ADD', 1 => 'COM_COMPONENTBUILDER_ALWAYS_ADD',
2 => 'COM_COMPONENTBUILDER_CONDITIONS', 2 => 'COM_COMPONENTBUILDER_CONDITIONS',
3 => 'COM_COMPONENTBUILDER_CUSTOM_SCRIPT', 3 => 'COM_COMPONENTBUILDER_CUSTOM_SCRIPT',
4 => 'COM_COMPONENTBUILDER_BUILDIN', 4 => 'COM_COMPONENTBUILDER_BUILDIN',
0 => 'COM_COMPONENTBUILDER_DO_NOT_ADD' 0 => 'COM_COMPONENTBUILDER_DO_NOT_ADD'
); );
// Now check if value is found in this array // Now check if value is found in this array
if (isset($howArray[$value]) && ComponentbuilderHelper::checkString($howArray[$value])) if (isset($howArray[$value]) && ComponentbuilderHelper::checkString($howArray[$value]))
{ {
return JText::_($howArray[$value]); return JText::_($howArray[$value]);
} }
} }
return $value; return $value;
} }
@ -283,16 +281,16 @@ class ComponentbuilderModelLibraries extends JModelList
} }
/** /**
* Build an SQL query to checkin all items left checked out longer then a set time. * Build an SQL query to checkin all items left checked out longer then a set time.
* *
* @return a bool * @return a bool
* *
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// Get set check in time // Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time) if ($time)
{ {

View File

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

View File

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

View File

@ -274,7 +274,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -385,18 +385,18 @@ class ComponentbuilderModelLibrary extends JModelAdmin
} }
/** /**
* Method to validate the form data. * Method to validate the form data.
* *
* @param JForm $form The form to validate against. * @param JForm $form The form to validate against.
* @param array $data The data to validate. * @param array $data The data to validate.
* @param string $group The name of the field group to validate. * @param string $group The name of the field group to validate.
* *
* @return mixed Array of filtered data if valid, false otherwise. * @return mixed Array of filtered data if valid, false otherwise.
* *
* @see JFormRule * @see JFormRule
* @see JFilterInput * @see JFilterInput
* @since 12.2 * @since 12.2
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// check if the not_required field is set // check if the not_required field is set
@ -638,7 +638,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -736,7 +736,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -781,7 +781,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -1012,13 +1012,13 @@ class ComponentbuilderModelLibrary extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

View File

@ -236,7 +236,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -502,7 +502,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -600,7 +600,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -645,7 +645,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -835,13 +835,13 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

View File

@ -268,7 +268,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
protected function canEditState($record) protected function canEditState($record)
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0; $recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId) if ($recordId)
{ {
@ -534,7 +534,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
* *
* @return mixed An array of new IDs on success, boolean false on failure. * @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) protected function batchCopy($values, $pks, $contexts)
{ {
@ -632,7 +632,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
$this->table->id = 0; $this->table->id = 0;
// TODO: Deal with ordering? // TODO: Deal with ordering?
// $this->table->ordering = 1; // $this->table->ordering = 1;
// Check the row. // Check the row.
if (!$this->table->check()) if (!$this->table->check())
@ -677,7 +677,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
* *
* @return boolean True if successful, false otherwise and internal error is set. * @return boolean True if successful, false otherwise and internal error is set.
* *
* @since 12.2 * @since 12.2
*/ */
protected function batchMove($values, $pks, $contexts) protected function batchMove($values, $pks, $contexts)
{ {
@ -919,13 +919,13 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
} }
/** /**
* Method to change the title * Method to change the title
* *
* @param string $title The title. * @param string $title The title.
* *
* @return array Contains the modified title and alias. * @return array Contains the modified title and alias.
* *
*/ */
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {

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