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
227 changed files with 12401 additions and 8275 deletions

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.10) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.8.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)
@ -125,14 +125,14 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 18th May, 2018
+ *Version*: 2.7.10
+ *Last Build*: 30th May, 2018
+ *Version*: 2.8.0
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **181594**
+ *Field count*: **1036**
+ *File count*: **1203**
+ *Folder count*: **193**
+ *Line count*: **185584**
+ *Field count*: **1054**
+ *File count*: **1236**
+ *Folder count*: **197**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.10) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.8.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)
@ -125,14 +125,14 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 18th May, 2018
+ *Version*: 2.7.10
+ *Last Build*: 30th May, 2018
+ *Version*: 2.8.0
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **181594**
+ *Field count*: **1036**
+ *File count*: **1203**
+ *Folder count*: **193**
+ *Line count*: **185584**
+ *Field count*: **1054**
+ *File count*: **1236**
+ *Folder count*: **197**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -50,6 +50,16 @@
<action name="admin_fields.edit.own" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_OWN" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_OWN_DESC" />
<action name="admin_fields.edit.state" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE_DESC" />
<action name="admin_fields.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION_DESC" />
<action name="admin_fields_relations.access" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC" />
<action name="admin_fields_relations.batch" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE_DESC" />
<action name="admin_fields_relations.create" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC" />
<action name="admin_fields_relations.delete" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC" />
<action name="admin_fields_relations.edit" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC" />
<action name="admin_fields_relations.edit.created_by" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC" />
<action name="admin_fields_relations.edit.created" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC" />
<action name="admin_fields_relations.edit.own" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC" />
<action name="admin_fields_relations.edit.state" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC" />
<action name="admin_fields_relations.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC" />
<action name="compiler.access" title="COM_COMPONENTBUILDER_COMPILER_ACCESS" description="COM_COMPONENTBUILDER_COMPILER_ACCESS_DESC" />
<action name="compiler.clear_tmp" title="COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS_DESC" />
<action name="compiler.dashboard_list" title="COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST_DESC" />
@ -561,6 +571,17 @@
<action name="admin_fields_conditions.access" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_ACCESS" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_ACCESS_DESC" />
<action name="admin_fields_conditions.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_EDIT_VERSION_DESC" />
</section>
<section name="admin_fields_relations">
<action name="admin_fields_relations.edit" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC" />
<action name="admin_fields_relations.edit.own" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC" />
<action name="admin_fields_relations.edit.state" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC" />
<action name="admin_fields_relations.edit.created_by" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC" />
<action name="admin_fields_relations.edit.created" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC" />
<action name="admin_fields_relations.create" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC" />
<action name="admin_fields_relations.delete" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC" />
<action name="admin_fields_relations.access" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC" />
<action name="admin_fields_relations.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC" />
</section>
<section name="component_admin_views">
<action name="component_admin_views.edit" title="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT" description="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_DESC" />
<action name="component_admin_views.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_OWN_DESC" />

View File

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

View File

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

View File

@ -647,7 +647,7 @@ abstract class ###Component###Helper
}
}
// check if there are any view values remaining
if (count($_result))
if (count((array)$_result))
{
$_result = json_encode($_result);
$_result = array($_result);
@ -841,7 +841,7 @@ abstract class ###Component###Helper
**/
public static function checkArray($array, $removeEmptyString = false)
{
if (isset($array) && is_array($array) && count($array) > 0)
if (isset($array) && is_array($array) && count((array)$array) > 0)
{
// also make sure the empty strings are removed
if ($removeEmptyString)
@ -944,7 +944,7 @@ abstract class ###Component###Helper
{
$initial = strlen($string);
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count($words);
$words_count = count((array)$words);
$word_length = 0;
$last_word = 0;

View File

@ -232,7 +232,7 @@ abstract class ###Component###Email
if (is_array($mailreply))
{
$mail->ClearReplyTos();
$numReplyTo = count($mailreply);
$numReplyTo = count((array)$mailreply);
for ($i=0; $i < $numReplyTo; $i++)
{
$mail->addReplyTo($mailreply[$i], $replyname[$i]);

View File

@ -293,7 +293,7 @@ abstract class ###Component###Helper
}
}
// check if there are any view values remaining
if (count($_result))
if (count((array)$_result))
{
$_result = json_encode($_result);
$_result = array($_result);
@ -833,7 +833,7 @@ abstract class ###Component###Helper
**/
public static function checkArray($array, $removeEmptyString = false)
{
if (isset($array) && is_array($array) && count($array) > 0)
if (isset($array) && is_array($array) && count((array)$array) > 0)
{
// also make sure the empty strings are removed
if ($removeEmptyString)
@ -936,7 +936,7 @@ abstract class ###Component###Helper
{
$initial = strlen($string);
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count($words);
$words_count = count((array)$words);
$word_length = 0;
$last_word = 0;

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,312 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Admin_fields_relations Controller
*/
class ComponentbuilderControllerAdmin_fields_relations extends JControllerForm
{
/**
* Current or most recently performed task.
*
* @var string
* @since 12.2
* @note Replaces _task.
*/
protected $task;
public function __construct($config = array())
{
$this->view_list = 'Admins_fields_relations'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 1.6
*/
protected function allowAdd($data = array())
{
// Access check.
$access = JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('admin_fields_relations.create', $this->option);
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.
$access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder'));
if (!$access)
{
return false;
}
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('admin_fields_relations.edit', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('admin_fields_relations.edit.own', 'com_componentbuilder.admin_fields_relations.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_by;
}
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('admin_fields_relations.edit.own', 'com_componentbuilder'))
{
return true;
}
}
}
return false;
}
}
// Since there is no permission, revert to the component permissions.
return $user->authorise('admin_fields_relations.edit', $this->option);
}
/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
*
* @return string The arguments to append to the redirect URL.
*
* @since 12.2
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$tmpl = $this->input->get('tmpl');
$layout = $this->input->get('layout', 'edit', 'string');
$ref = $this->input->get('ref', 0, 'string');
$refid = $this->input->get('refid', 0, 'int');
// Setup redirect info.
$append = '';
if ($refid)
{
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
}
elseif ($ref)
{
$append .= '&ref='.(string)$ref;
}
if ($tmpl)
{
$append .= '&tmpl=' . $tmpl;
}
if ($layout)
{
$append .= '&layout=' . $layout;
}
if ($recordId)
{
$append .= '&' . $urlVar . '=' . $recordId;
}
return $append;
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 2.5
*/
public function batch($model = null)
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Admin_fields_relations', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_relations' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
/**
* Method to cancel an edit.
*
* @param string $key The name of the primary key of the URL variable.
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since 12.2
*/
public function cancel($key = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
$cancel = parent::cancel($key);
if ($cancel)
{
if ($this->refid)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
}
else
{
// Redirect to the items screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
)
);
}
return $cancel;
}
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 12.2
*/
public function save($key = null, $urlVar = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid)
{
// to make sure the item is checkedin on redirect
$this->task = 'save';
}
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
return $saved;
}
/**
* Function that allows child controller access to model data
* after the data has been saved.
*
* @param JModel &$model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 11.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
return;
}
}

View File

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

View File

@ -0,0 +1,34 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Admins_fields_relations Controller
*/
class ComponentbuilderControllerAdmins_fields_relations extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Admin_fields_relations', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,6 +18,27 @@ defined('_JEXEC') or die('Restricted access');
class Get
{
/**
* The hash placeholder
*
* @var string
*/
public $hhh = '#' . '#' . '#';
/**
* The open bracket placeholder
*
* @var string
*/
public $bbb = '[' . '[' . '[';
/**
* The close bracket placeholder
*
* @var string
*/
public $ddd = ']' . ']' . ']';
/**
* The app
*
@ -466,6 +487,27 @@ class Get
*/
public $catOtherName = array();
/**
* The field relations values
*
* @var array
*/
public $fieldRelations = array();
/**
* The list join fields
*
* @var array
*/
public $listJoinBuilder = array();
/**
* The list head over ride
*
* @var array
*/
public $listHeadOverRide = array();
/**
* The linked admin view tabs
*
@ -620,7 +662,21 @@ class Get
*/
public $setTidyWarning = false;
/* * *
/**
* Tab/spacer bucket (to speed-up the build)
*
* @var array
*/
public $tabSpacerBucket = array();
/**
* Set tab/spacer
*
* @var string
*/
public $tabSpacer = "\t";
/**
* Constructor
*/
@ -710,6 +766,26 @@ class Get
return false;
}
/**
* Set the tab/space
*
* @param int $nr The number of tag/space
*
* @return string
*
*/
public function _t($nr)
{
// check if we already have the string
if (!isset($this->tabSpacerBucket[$nr]))
{
// get the string
$this->tabSpacerBucket[$nr] = str_repeat($this->tabSpacer, (int) $nr);
}
// return stored string
return $this->tabSpacerBucket[$nr];
}
/**
* Set the line number in comments
*
@ -834,12 +910,12 @@ class Get
$component = ComponentbuilderHelper::convertRepeatableFields($component, $searchRepeatables, $updater);
// set component place holders
$this->placeholders['###component###'] = ComponentbuilderHelper::safeString($component->name_code);
$this->placeholders['###Component###'] = ComponentbuilderHelper::safeString($component->name_code, 'F');
$this->placeholders['###COMPONENT###'] = ComponentbuilderHelper::safeString($component->name_code, 'U');
$this->placeholders['[[[component]]]'] = $this->placeholders['###component###'];
$this->placeholders['[[[Component]]]'] = $this->placeholders['###Component###'];
$this->placeholders['[[[COMPONENT]]]'] = $this->placeholders['###COMPONENT###'];
$this->placeholders[$this->hhh . 'component' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code);
$this->placeholders[$this->hhh . 'Component' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code, 'F');
$this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code, 'U');
$this->placeholders[$this->bbb . 'component' . $this->ddd] = $this->placeholders[$this->hhh . 'component' . $this->hhh];
$this->placeholders[$this->bbb . 'Component' . $this->ddd] = $this->placeholders[$this->hhh . 'Component' . $this->hhh];
$this->placeholders[$this->bbb . 'COMPONENT' . $this->ddd] = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh];
// set component sales name
$component->sales_name = ComponentbuilderHelper::safeString($component->system_name);
@ -1319,18 +1395,21 @@ class Get
'b.addfields',
'b.id',
'c.addconditions',
'c.id'
'c.id',
'r.addrelations'
), array(
'addfields',
'addfields_id',
'addconditions',
'addconditions_id'
'addconditions_id',
'addrelations'
)
)
);
$query->from('#__componentbuilder_admin_view AS a');
$query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields', 'b') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('b.admin_view') . ')');
$query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_conditions', 'c') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('c.admin_view') . ')');
$query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_relations', 'r') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('r.admin_view') . ')');
$query->where($this->db->quoteName('a.id') . ' = ' . (int) $id);
// Reset the query using our newly populated query object.
@ -1376,18 +1455,18 @@ class Get
$this->customScriptBuilder['token'][$name_single] = false;
$this->customScriptBuilder['token'][$name_list] = false;
// set some placeholders
$this->placeholders['###view###'] = ComponentbuilderHelper::safeString($name_single);
$this->placeholders['###views###'] = ComponentbuilderHelper::safeString($name_list);
$this->placeholders['###View###'] = ComponentbuilderHelper::safeString($name_single, 'F');
$this->placeholders['###Views###'] = ComponentbuilderHelper::safeString($name_list, 'F');
$this->placeholders['###VIEW###'] = ComponentbuilderHelper::safeString($name_single, 'U');
$this->placeholders['###VIEWS###'] = ComponentbuilderHelper::safeString($name_list, 'U');
$this->placeholders['[[[view]]]'] = $this->placeholders['###view###'];
$this->placeholders['[[[views]]]'] = $this->placeholders['###views###'];
$this->placeholders['[[[View]]]'] = $this->placeholders['###View###'];
$this->placeholders['[[[Views]]]'] = $this->placeholders['###Views###'];
$this->placeholders['[[[VIEW]]]'] = $this->placeholders['###VIEW###'];
$this->placeholders['[[[VIEWS]]]'] = $this->placeholders['###VIEWS###'];
$this->placeholders[$this->hhh . 'view' . $this->hhh] = ComponentbuilderHelper::safeString($name_single);
$this->placeholders[$this->hhh . 'views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list);
$this->placeholders[$this->hhh . 'View' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'F');
$this->placeholders[$this->hhh . 'Views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'F');
$this->placeholders[$this->hhh . 'VIEW' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'U');
$this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'U');
$this->placeholders[$this->bbb . 'view' . $this->ddd] = $this->placeholders[$this->hhh . 'view' . $this->hhh];
$this->placeholders[$this->bbb . 'views' . $this->ddd] = $this->placeholders[$this->hhh . 'views' . $this->hhh];
$this->placeholders[$this->bbb . 'View' . $this->ddd] = $this->placeholders[$this->hhh . 'View' . $this->hhh];
$this->placeholders[$this->bbb . 'Views' . $this->ddd] = $this->placeholders[$this->hhh . 'Views' . $this->hhh];
$this->placeholders[$this->bbb . 'VIEW' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEW' . $this->hhh];
$this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh];
// add the tables
$view->addtables = (isset($view->addtables) && ComponentbuilderHelper::checkJson($view->addtables)) ? json_decode($view->addtables, true) : null;
if (ComponentbuilderHelper::checkArray($view->addtables))
@ -1603,7 +1682,7 @@ class Get
$conditionValue['match_type'] = $type;
$conditionValue['match_xml'] = $fieldValue['settings']->xml;
// if custom field load field being extended
if (!ComponentbuilderHelper::typeField($type))
if (!ComponentbuilderHelper::fieldCheck($type))
{
$conditionValue['match_extends'] = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml, 'extends="', '"');
}
@ -1621,6 +1700,53 @@ class Get
}
}
unset($view->addconditions);
// prep the buckets
$this->fieldRelations[$name_list] = array();
$this->listJoinBuilder[$name_list] = array();
$this->listHeadOverRide[$name_list] = array();
// set the relations
$view->addrelations = (isset($view->addrelations) && ComponentbuilderHelper::checkJson($view->addrelations)) ? json_decode($view->addrelations, true) : null;
if (ComponentbuilderHelper::checkArray($view->addrelations))
{
foreach ($view->addrelations as $nr => $relationsValue)
{
// only add if list view field is selected and joind fields are set
if (isset($relationsValue['listfield']) &&
is_numeric($relationsValue['listfield']) &&
$relationsValue['listfield'] > 0 &&
isset($relationsValue['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
$this->fieldRelations[$name_list][(int) $relationsValue['listfield']] = $relationsValue;
// load the list joints
foreach ($relationsValue['joinfields'] as $join)
{
$this->listJoinBuilder[$name_list][(int) $join] = (int) $join;
}
// set header over-ride
if (isset($relationsValue['column_name']) && ComponentbuilderHelper::checkString($relationsValue['column_name']))
{
$check_column_name = trim(strtolower($relationsValue['column_name']));
// confirm it should really make the over ride
if ('default' !== $check_column_name)
{
$column_name_lang = ComponentbuilderHelper::safeString($name_list, 'U') . '_' . ComponentbuilderHelper::safeString($relationsValue['column_name'], 'U');
$this->langContent['admin'][$column_name_lang] = trim($relationsValue['column_name']);
$this->listHeadOverRide[$name_list][(int) $relationsValue['listfield']] = $column_name_lang;
}
}
}
}
}
unset($view->addrelations);
// set linked views
$this->linkedAdminViews[$name_single] = null;
$view->addlinked_views = (isset($view->addlinked_views) && ComponentbuilderHelper::checkJson($view->addlinked_views)) ? json_decode($view->addlinked_views, true) : null;
@ -1819,18 +1945,18 @@ class Get
}
}
// clear placeholders
unset($this->placeholders['###view###']);
unset($this->placeholders['###views###']);
unset($this->placeholders['###View###']);
unset($this->placeholders['###Views###']);
unset($this->placeholders['###VIEW###']);
unset($this->placeholders['###VIEWS###']);
unset($this->placeholders['[[[view]]]']);
unset($this->placeholders['[[[views]]]']);
unset($this->placeholders['[[[View]]]']);
unset($this->placeholders['[[[Views]]]']);
unset($this->placeholders['[[[VIEW]]]']);
unset($this->placeholders['[[[VIEWS]]]']);
unset($this->placeholders[$this->hhh . 'view' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'views' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'View' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'Views' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'VIEW' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]);
unset($this->placeholders[$this->bbb . 'view' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'views' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'View' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'Views' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'VIEW' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'VIEWS' . $this->ddd]);
// store this view to class object
$this->_adminViewData[$id] = $view;
@ -3605,7 +3731,7 @@ class Get
if (ComponentbuilderHelper::checkArray($langStringTargets))
{
// insure string is not broken
$content = str_replace('COM_###COMPONENT###', $this->langPrefix, $content);
$content = str_replace('COM_' . $this->hhh . 'COMPONENT' . $this->hhh, $this->langPrefix, $content);
// reset some buckets
$langHolders = array();
$langCheck = array();
@ -3809,7 +3935,7 @@ class Get
}
if (ComponentbuilderHelper::checkArray($gets) && ComponentbuilderHelper::checkArray($keys))
{
$querySelect = '$query->select($db->quoteName(' . PHP_EOL . "\t\t\t" . 'array(' . implode(',', $gets) . '),' . PHP_EOL . "\t\t\t" . 'array(' . implode(',', $keys) . ')));';
$querySelect = '$query->select($db->quoteName(' . PHP_EOL . $this->_t(3) . 'array(' . implode(',', $gets) . '),' . PHP_EOL . $this->_t(3) . 'array(' . implode(',', $keys) . ')));';
$queryFrom = '$db->quoteName(' . $this->db->quote($table) . ', ' . $this->db->quote($as) . ')';
// return the select query
return array('select' => $querySelect, 'from' => $queryFrom, 'name' => $queryName, 'table' => $table, 'type' => $type, 'select_gets' => $gets, 'select_keys' => $keys);
@ -3938,9 +4064,9 @@ class Get
$data = $this->db->loadObjectList();
// start building the MySql dump
$dump = "--";
$dump .= PHP_EOL . "-- Dumping data for table `#__[[[component]]]_" . $view . "`";
$dump .= PHP_EOL . "-- Dumping data for table `#__" . $this->bbb . "component" . $this->ddd . "_" . $view . "`";
$dump .= PHP_EOL . "--";
$dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__[[[component]]]_" . $view . "` (";
$dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__" . $this->bbb . "component" . $this->ddd . "_" . $view . "` (";
foreach ($data as $line)
{
$comaSet = 0;
@ -4442,7 +4568,7 @@ class Get
}
// check what type of place holders we should load here
$placeholderType = (int) $item['comment_type'] . '2';
if (stripos($item['code'], '[[[view') !== false || stripos($item['code'], '[[[sview') !== false || stripos($item['code'], '[[[arg') !== false)
if (stripos($item['code'], $this->bbb . 'view') !== false || stripos($item['code'], $this->bbb . 'sview') !== false || stripos($item['code'], $this->bbb . 'arg') !== false)
{
// if view is being set dynamicly then we can't update this code via IDE (TODO)
$placeholderType = 3;
@ -4472,7 +4598,7 @@ class Get
$number = 0;
foreach ($values as $value)
{
$this->placeholders['[[[' . $key . $number . ']]]'] = $value;
$this->placeholders[$this->bbb . $key . $number . $this->ddd] = $value;
$number++;
}
}
@ -5043,9 +5169,9 @@ class Get
$fileTypes = array('\.php', '\.js');
// set some local placeholders
$placeholders = array();
$placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = '[[[Component]]]Helper::';
$placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_[[[COMPONENT]]]';
$placeholders['com_' . $this->componentCodeName] = 'com_[[[component]]]';
$placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = $this->bbb . 'Component' . $this->ddd . 'Helper::';
$placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_' . $this->bbb . 'COMPONENT' . $this->ddd;
$placeholders['com_' . $this->componentCodeName] = 'com_' . $this->bbb . 'component' . $this->ddd;
foreach ($paths as $target => $path)
{
// we are changing the working directory to the componet path
@ -5760,7 +5886,7 @@ class Get
return round($val1 + $val2);
break;
// Subtract one number from the other
case 'add':
case 'sub':
return round($val1 - $val2);
break;
}

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -215,7 +215,7 @@ abstract class ComponentbuilderEmail
if (is_array($mailreply))
{
$mail->ClearReplyTos();
$numReplyTo = count($mailreply);
$numReplyTo = count((array)$mailreply);
for ($i=0; $i < $numReplyTo; $i++)
{
$mail->addReplyTo($mailreply[$i], $replyname[$i]);

View File

@ -11,6 +11,7 @@ COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_T
COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS="Add Custom Code Placeholders"
COM_COMPONENTBUILDER_ADD_KEY_HERE="add key here"
COM_COMPONENTBUILDER_ADD_MENU="Add Menu"
COM_COMPONENTBUILDER_ADD_MORE_FIELDS_TO_THIS_ADMIN_VIEW="Add more fields to this admin view"
COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_SMALLIF_SETSMALL="Add to Backup Folder &amp; Sales Server <small>(if set)</small>"
COM_COMPONENTBUILDER_ADD_TO_REPOSITORY_FOLDER="Add to Repository Folder"
COM_COMPONENTBUILDER_ADD_YOUR_OWN_JCB_PACKAGES_TO_THE_COMMUNITY_A_S_GITHUBA_REPOSITORYBR_WATCH_THIS_A_S_TUTORIALA_TO_SEE_HOW="Add your own JCB packages to the community <a %s >gitHub</a> repository.<br />Watch this <a %s >tutorial</a> to see how!"
@ -94,6 +95,46 @@ COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNFEATURED="%s Admins Fields unfeatur
COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNFEATURED_1="%s Admin Fields unfeatured."
COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNPUBLISHED="%s Admins Fields unpublished."
COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNPUBLISHED_1="%s Admin Fields unpublished."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS="Admins Fields Relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS="Admins Fields Relations Access"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC="Allows the users in this group to access access admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS="Batch process the selected Admins Fields Relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_TIP="All changes will be applied to all selected Admins Fields Relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE="Admins Fields Relations Batch Use"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE="Admins Fields Relations Create"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC="Allows the users in this group to create create admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE="Admins Fields Relations Delete"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC="Allows the users in this group to delete delete admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT="Admins Fields Relations Edit"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY="Admins Fields Relations Edit Created By"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE="Admins Fields Relations Edit Created Date"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC="Allows the users in this group to edit the admin fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN="Admins Fields Relations Edit Own"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC="Allows the users in this group to edit edit own admins fields relations created by them"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE="Admins Fields Relations Edit State"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION="Admins Fields Relations Edit Version"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_ARCHIVED="%s Admins Fields Relations archived."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_ARCHIVED_1="%s Admin Fields Relations archived."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_CHECKED_IN_0="No Admin Fields Relations successfully checked in."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_CHECKED_IN_1="%d Admin Fields Relations successfully checked in."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_CHECKED_IN_MORE="%d Admins Fields Relations successfully checked in."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_DELETED="%s Admins Fields Relations deleted."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_DELETED_1="%s Admin Fields Relations deleted."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_FEATURED="%s Admins Fields Relations featured."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_FEATURED_1="%s Admin Fields Relations featured."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_PUBLISHED="%s Admins Fields Relations published."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_PUBLISHED_1="%s Admin Fields Relations published."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_TRASHED="%s Admins Fields Relations trashed."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_TRASHED_1="%s Admin Fields Relations trashed."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNFEATURED="%s Admins Fields Relations unfeatured."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNFEATURED_1="%s Admin Fields Relations unfeatured."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNPUBLISHED="%s Admins Fields Relations unpublished."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNPUBLISHED_1="%s Admin Fields Relations unpublished."
COM_COMPONENTBUILDER_ADMIN_BEHAVIOUR="Admin Behaviour"
COM_COMPONENTBUILDER_ADMIN_FIELDS="Admin Fields"
COM_COMPONENTBUILDER_ADMIN_FIELDS_ABOVE_TABS="Above Tabs"
@ -110,7 +151,7 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_ALIGNMENT_LABEL="Alignment"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS="Admin Fields Conditions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ACTIVE_ONLY_FOUR_TEXT_FIELD="Active (only 4 text_field)"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS="Addconditions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_DESCRIPTION="Conditional setup for the above fields."
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_DESCRIPTION="Conditional setup for the fields behaviour."
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_LABEL="Conditions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW="Admin View"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW_DESCRIPTION="Select an admin view"
@ -148,7 +189,7 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_BY_LABEL="Modified By"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_DATE_DESC="The date this Admin Fields Conditions was modified."
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_DATE_LABEL="Modified Date"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NEW="A New Admin Fields Conditions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_DESCRIPTION="Here you can add conditional field settings"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_DESCRIPTION="Here you can add conditional settings"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_LABEL="Condition Implementation"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ORDERING_LABEL="Ordering"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_PERMISSION="Permissions"
@ -206,6 +247,55 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION="Permissions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_DESCRIPTION="What permission to use."
COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_LABEL="Permissions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS="Admin Fields Relations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS="Addrelations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_DESCRIPTION="Relations setup for the the field combination."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_LABEL="Relations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW="Admin View"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_DESCRIPTION="Select an admin view"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_LABEL="View"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_AREA_LABEL="Area"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_COLUMN_NAME_HINT="Default"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_COLUMN_NAME_LABEL="Table Column Name"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_COLUMN_NAME_MESSAGE="Error! Please add some text here."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CONCATENATE_RAQUO_GLUE="Concatenate &raquo; Glue"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_BY_DESC="The user that created this Admin Fields Relations."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_BY_LABEL="Created By"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_DESC="The date this Admin Fields Relations was created."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_LABEL="Created Date"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CUSTOM_RAQUO_CODE="Custom &raquo; Code"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT="Editing the Admin Fields Relations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ERROR_UNIQUE_ALIAS="Another Admin Fields Relations has the same alias."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ID="Id"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS="Joinfields"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS_DESCRIPTION="Select the target join fields."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS_LABEL="Join Field"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOIN_TYPE_LABEL="Join Type"
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_LABEL="List Field"
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_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_LABEL="Modified Date"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW="A New Admin Fields Relations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_DESCRIPTION="<p>Here you are able to combine/join multiple fields into one for display in the list view of the admin area.</p>
<p>You are able to add calculations, or even model the values into one result.</p>"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_LABEL="Relations Implementation"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ORDERING_LABEL="Ordering"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PERMISSION="Permissions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_RELATIONS="Relations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Admin Fields Relations to customise the alias."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_DESCRIPTION="Glue/Code"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_HINT="Glue/Code"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_LABEL="Set"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_STATUS="Status"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VERSION_DESC="A count of the number of times this Admin Fields Relations has been revised."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VERSION_LABEL="Revision"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VIEW="View"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RIGHT_IN_TAB="Right in Tab"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RIGHT_OF_TABS="Right of Tabs"
COM_COMPONENTBUILDER_ADMIN_FIELDS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Admin Fields to customise the alias."
@ -472,7 +562,7 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_EYE_CLOSE="Eye Close"
COM_COMPONENTBUILDER_ADMIN_VIEW_EYE_OPEN="Eye Open"
COM_COMPONENTBUILDER_ADMIN_VIEW_FEATURED="Featured"
COM_COMPONENTBUILDER_ADMIN_VIEW_FEED="Feed"
COM_COMPONENTBUILDER_ADMIN_VIEW_FIELDS_CONDITIONS="Fields & Conditions"
COM_COMPONENTBUILDER_ADMIN_VIEW_FIELDS="Fields"
COM_COMPONENTBUILDER_ADMIN_VIEW_FILE="File"
COM_COMPONENTBUILDER_ADMIN_VIEW_FILE_ADD="File Add"
COM_COMPONENTBUILDER_ADMIN_VIEW_FILE_CHECK="File Check"
@ -615,7 +705,15 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ALIAS_BUILDER_DEFAULT_LABEL="Default Alias
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_DESCRIPTION="<p>Please do not change this area unless you would like to add special import to this view that goes beyond the default import concept that Component Builder already does automatic if this view is set to have import & export in the component area where this view is linked to the component.</p>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_LABEL="Beginners notice."
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_BUTTONS_DESCRIPTION="Some Shortcut Buttons<hr /><div id='jform_create_edit_buttons'></div>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_DISPLAY_DESCRIPTION="<hr /><h4>Linked Fields <span id='header_admin_fields_buttons'></span></h4><div id='display_admin_fields'>Display of the fields will load here!</div><hr /><h4>Field Conditions <span id='header_admin_fields_conditions_buttons'></span></h4><div id='display_admin_fields_conditions'>Display of the fields conditions will load here!</div>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_DISPLAY_DESCRIPTION="<hr />
<h4>Linked Fields <span id='header_admin_fields_buttons'></span></h4>
<div id='display_admin_fields'>Display of the fields will load here!</div>
<hr />
<h4>Field Relations <span id='header_admin_fields_relations_buttons'></span></h4>
<div id='display_admin_fields_relations'>Display of the fields relations will load here!</div>
<hr />
<h4>Field Conditions <span id='header_admin_fields_conditions_buttons'></span></h4>
<div id='display_admin_fields_conditions'>Display of the fields conditions will load here!</div>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_NOTICE_DESCRIPTION="<h5>Welcome to the new improved fields and conditions layout.</h5><div class='note_create_edit_notice_p'><p>We had to remove the repeatable fields layouts since Joomla has depreciated it. With this new improved layout we trust your experience will be better then ever before.</p><p>You can still <a href='https://youtu.be/CdSKSCTzmRA?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=32m28s' target='_blank'>watch the tutorials</a>, and though it was made during the time repeatable fields were still being used, the various concepts and layouts still look mostly the same.</p></div>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_NOTICE_LABEL="Fields &amp; Conditions"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_LINKED_TO_NOTICE_DESCRIPTION="<div id='display_linked_to'>Searching the database.<span class='loading-dots'></span></div>"
@ -2210,6 +2308,7 @@ COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_MESSAGE="Error! Please add some t
COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE="Version Update"
COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE_DESCRIPTION="Add Version Updates Here!"
COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE_LABEL="Version Updates"
COM_COMPONENTBUILDER_CONCATENATE="Concatenate"
COM_COMPONENTBUILDER_CONDITIONS="Conditions"
COM_COMPONENTBUILDER_CONFIG_ACTIVE="Active"
COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_DESCRIPTION="Would you like to add a prefix to the Joomla menu name of your components"
@ -3640,6 +3739,7 @@ COM_COMPONENTBUILDER_EDIT_S="Edit %s"
COM_COMPONENTBUILDER_EDIT_S_FOR_THIS_S="Edit %s for this %s"
COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS="Edit the admin fields"
COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_CONDITIONS="Edit the admin fields conditions"
COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_RELATIONS="Edit the admin fields relations"
COM_COMPONENTBUILDER_EDIT_VERSIONS="Edit Version"
COM_COMPONENTBUILDER_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions."
COM_COMPONENTBUILDER_EMAIL="Email"
@ -4090,6 +4190,7 @@ COM_COMPONENTBUILDER_GET_SNIPPETS_TEMPLATES_BUTTON_ACCESS_DESC=" Allows the user
COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY="Get the snippet from gitHub and install it locally"
COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION="Get the snippet from gitHub and update the local version"
COM_COMPONENTBUILDER_GLOBAL="Global"
COM_COMPONENTBUILDER_GLUECODE="Glue/Code"
COM_COMPONENTBUILDER_GREAT_THIS_FUNCTION_NAME_WILL_WORK="Great, this function name will work!"
COM_COMPONENTBUILDER_GREAT_THIS_VALIDATION_RULE_NAME_S_WILL_WORK="Great, this validation rule name (%s) will work!"
COM_COMPONENTBUILDER_HAS_METADATA="Has Metadata"
@ -4279,6 +4380,8 @@ COM_COMPONENTBUILDER_JCB_COMMUNITY_PACKAGES="JCB Community Packages"
COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS="JCB Community Snippets"
COM_COMPONENTBUILDER_JCB_PACKAGE_IMPORT="JCB Package Import"
COM_COMPONENTBUILDER_JCB_PACKAGE_INFO_PATH_DOES_NOT_WORK_WE_ADVICE_YOU_BNOT_TO_CONTINUEB_WITH_THE_IMPORT_OF_THE_SELECTED_PACKAGE="JCB Package info path does not work, we advice you <b>not to continue</b> with the import of the selected package!"
COM_COMPONENTBUILDER_JOIN_FIELDS="Join Fields"
COM_COMPONENTBUILDER_JOIN_TYPE="Join Type"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT="Joomla Component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS="Joomla Components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS="Joomla Components Access"
@ -5412,6 +5515,7 @@ COM_COMPONENTBUILDER_LICENSE_S="License: %s"
COM_COMPONENTBUILDER_LINK="Link"
COM_COMPONENTBUILDER_LINK_LOCAL_DYNAMIC="Link & Local (dynamic)"
COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR="Link to the contributor"
COM_COMPONENTBUILDER_LIST_FIELD="List Field"
COM_COMPONENTBUILDER_LOADING="loading"
COM_COMPONENTBUILDER_LOCAL="Local"
COM_COMPONENTBUILDER_LOCAL_GET="Local (get)"
@ -5424,6 +5528,8 @@ COM_COMPONENTBUILDER_MAX_LENGTH_ONLY_FOUR_TEXT_FIELD="Max Length (only 4 text_fi
COM_COMPONENTBUILDER_MERGE="Merge"
COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT="Minify JavaScript"
COM_COMPONENTBUILDER_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD="Min Length (only 4 text_field)"
COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)"
COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)"
COM_COMPONENTBUILDER_NAME="Name"
COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)"
COM_COMPONENTBUILDER_NAME_DESC="Name (Desc)"

View File

@ -39,6 +39,26 @@ COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE="Admins Fields Edit State"
COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields"
COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION="Admins Fields Edit Version"
COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS="Admins Fields Relations Access"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC="Allows the users in this group to access access admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE="Admins Fields Relations Batch Use"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE="Admins Fields Relations Create"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC="Allows the users in this group to create create admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE="Admins Fields Relations Delete"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC="Allows the users in this group to delete delete admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT="Admins Fields Relations Edit"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY="Admins Fields Relations Edit Created By"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE="Admins Fields Relations Edit Created Date"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC="Allows the users in this group to edit the admin fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN="Admins Fields Relations Edit Own"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC="Allows the users in this group to edit edit own admins fields relations created by them"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE="Admins Fields Relations Edit State"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION="Admins Fields Relations Edit Version"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields relations"
COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS="Admin Views Access"
COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS_DESC="Allows the users in this group to access access admin views"
COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE="Admin Views Batch Use"

View File

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

View File

@ -0,0 +1,44 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$app = JFactory::getApplication();
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'created',
'created_by',
'modified',
'modified_by'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
foreach ($fields as $field)
{
$field = is_array($field) ? $field : array($field);
foreach ($field as $f)
{
if ($form->getField($f))
{
if (in_array($f, $hiddenFields))
{
$form->setFieldAttribute($f, 'type', 'hidden');
}
echo $form->renderField($f);
break;
}
}
}

View File

@ -0,0 +1,46 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$app = JFactory::getApplication();
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'published',
'ordering',
'access',
'version',
'hits',
'id'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
foreach ($fields as $field)
{
$field = is_array($field) ? $field : array($field);
foreach ($field as $f)
{
if ($form->getField($f))
{
if (in_array($f, $hiddenFields))
{
$form->setFieldAttribute($f, 'type', 'hidden');
}
echo $form->renderField($f);
break;
}
}
}

View File

@ -0,0 +1,27 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = array(
'admin_view'
);
?>
<div class="form-inline form-inline-header">
<?php foreach($fields as $field){
echo $form->renderField($field);
} ?>
</div>

View File

@ -0,0 +1,35 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'note_on_relations',
'addrelations'
);
?>
<div class="form-vertical">
<?php foreach($fields as $field): ?>
<div class="control-group">
<div class="control-label">
<?php echo $form->getLabel($field); ?>
</div>
<div class="controls">
<?php echo $form->getInput($field); ?>
</div>
</div>
<?php endforeach; ?>
</div>

View File

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

View File

@ -59,14 +59,14 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
$canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components');
?>
<tr>
<td class="nowrap">
<td>
<?php if ($canDo->get('joomla_component.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>&ref=server&refid=<?php echo $id; ?>"><?php echo $displayData->escape($item->system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?>
<?php endif; ?>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<div class="name"><?php echo $displayData->escape($item->system_name); ?></div>
<?php echo $displayData->escape($item->system_name); ?>
<?php endif; ?>
</td>
<td>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -238,6 +238,7 @@ class ComponentbuilderModelAjax extends JModelList
'library_files_folders_urls' => 'libraries_files_folders_urls',
'admin_fields' => 'admins_fields',
'admin_fields_conditions' => 'admins_fields_conditions',
'admin_fields_relations' => 'admins_fields_relations',
'validation_rule' => 'validation_rules',
'field' => 'fields',
'component_admin_views' => 'components_admin_views' ,
@ -410,6 +411,11 @@ class ComponentbuilderModelAjax extends JModelList
'type' => 'setURLType',
// Admin View
'field' => 'setItemNames',
'listfield' => 'setItemNames',
'joinfields' => 'setItemNames',
'area' => 'setAreaName',
'set' => 'setCode',
'join_type' => 'setJoinType',
'list' => 'setAdminBehaviour',
'title' => 'setYesNo',
'alias' => 'setYesNo',
@ -456,6 +462,10 @@ class ComponentbuilderModelAjax extends JModelList
'update' => JText::_('COM_COMPONENTBUILDER_UPDATE'),
// Admin View (fields)
'field' => JText::_('COM_COMPONENTBUILDER_FIELD'),
'listfield' => JText::_('COM_COMPONENTBUILDER_LIST_FIELD'),
'joinfields' => JText::_('COM_COMPONENTBUILDER_JOIN_FIELDS'),
'set' => JText::_('COM_COMPONENTBUILDER_GLUECODE'),
'join_type' => JText::_('COM_COMPONENTBUILDER_JOIN_TYPE'),
'list' => JText::_('COM_COMPONENTBUILDER_ADMIN_BEHAVIOUR'),
'order_list' => JText::_('COM_COMPONENTBUILDER_ORDER_IN_LIST_VIEWS'),
'title' => JText::_('COM_COMPONENTBUILDER_TITLE'),
@ -625,6 +635,7 @@ class ComponentbuilderModelAjax extends JModelList
'library_files_folders_urls' => array('addurls','addfiles','addfolders'),
'admin_fields' => 'addfields',
'admin_fields_conditions' => 'addconditions',
'admin_fields_relations' => 'addrelations',
'component_admin_views' => 'addadmin_views',
'component_site_views' => 'addsite_views',
'component_custom_admin_views' => 'addcustom_admin_views');
@ -755,6 +766,8 @@ class ComponentbuilderModelAjax extends JModelList
'field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'target_field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'match_field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'listfield' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'joinfields' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
// joomla component view
'siteview' => array('table' => 'site_view', 'tables' => 'site_views', 'id' => 'id', 'name' => 'name', 'text' => 'Site View'),
'customadminview' => array('table' => 'custom_admin_view', 'tables' => 'custom_admin_views', 'id' => 'id', 'name' => 'system_name', 'text' => 'Custom Admin View'),
@ -832,6 +845,20 @@ class ComponentbuilderModelAjax extends JModelList
return JText::_('COM_COMPONENTBUILDER_NO_ITEM_FOUND');
}
protected function setJoinType($header, $value)
{
switch ($value)
{
case 1:
return JText::_('COM_COMPONENTBUILDER_CONCATENATE');
break;
case 2:
return JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE');
break;
}
return JText::_('COM_COMPONENTBUILDER_NOT_SET');
}
protected function setURLType($header, $value)
{
switch ($value)
@ -969,6 +996,28 @@ class ComponentbuilderModelAjax extends JModelList
return JText::_('COM_COMPONENTBUILDER_DETAILS');
}
protected function setAreaName($header, $value)
{
switch ($value)
{
case 1:
return JText::_('COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING');
break;
case 2:
return JText::_('COM_COMPONENTBUILDER_VIEW');
break;
case 3:
return JText::_('COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING');
break;
}
return JText::_('COM_COMPONENTBUILDER_NOT_SET');
}
protected function setCode($header, $value)
{
return nl2br(htmlspecialchars($value));
}
protected function setYesNo($header, $value)
{
if (1 == $value)
@ -1067,7 +1116,7 @@ class ComponentbuilderModelAjax extends JModelList
{
$result = $this->_db->loadObject();
$result->name = strtolower($result->name);
if (ComponentbuilderHelper::typeField($result->name,'list'))
if (ComponentbuilderHelper::fieldCheck($result->name,'list'))
{
// load the values form params
$xml = json_decode($result->xml);
@ -1111,15 +1160,15 @@ class ComponentbuilderModelAjax extends JModelList
// return found field options
return $optionSet;
}
elseif (ComponentbuilderHelper::typeField($result->name,'text'))
elseif (ComponentbuilderHelper::fieldCheck($result->name,'text'))
{
return "keywords=\"\"\nlength=\"\"";
}
elseif (ComponentbuilderHelper::typeField($result->name,'dynamic'))
elseif (ComponentbuilderHelper::fieldCheck($result->name,'dynamic'))
{
return 'dynamic_list';
}
elseif (ComponentbuilderHelper::typeField($result->name))
elseif (ComponentbuilderHelper::fieldCheck($result->name))
{
return 'match field type not supported. Select another!';
}
@ -2067,6 +2116,13 @@ class ComponentbuilderModelAjax extends JModelList
$targets['admin_view']['not_base64'] = array();
$targets['admin_view']['name'] = 'system_name';
// #__componentbuilder_admin_fields_relations
$targets['library'] = array();
$targets['library']['search'] = array('id', 'admin_view', 'addrelations');
$targets['library']['view'] = 'admin_fields_relations';
$targets['library']['not_base64'] = array('addrelations' => 'json');
$targets['library']['name'] = 'admin_view->id:admin_view.system_name';
// #__componentbuilder_custom_admin_view
$targets['custom_admin_view'] = array();
$targets['custom_admin_view']['search'] = array('id', 'system_name', 'default','php_view','php_jview','php_jview_display','php_document',
@ -2114,7 +2170,6 @@ class ComponentbuilderModelAjax extends JModelList
// #__componentbuilder_library
$targets['library'] = array();
$targets['library']['view'] = 'libraries';
$targets['library']['search'] = array('id', 'name', 'php_setdocument');
$targets['library']['view'] = 'libraries';
$targets['library']['not_base64'] = array();
@ -2542,6 +2597,54 @@ class ComponentbuilderModelAjax extends JModelList
return $xml;
}
// Used in admin_fields_relations
public function getCodeGlueOptions($listfield, $joinfields, $type, $area)
{
// CONCATENATE GLUE
if ($type == 1)
{
// MODEL
if ($area == 1 || $area == 3)
{
return ', ';
}
// VIEW
elseif ($area == 2)
{
return '<br />';
}
}
// CUSTOM CODE
elseif ($type == 2)
{
// build fields array
$fields = array_map( function ($id) {
return (int) $id;
}, (array) explode(',', $joinfields));
// add the list field to array
array_unshift($fields, (int) $listfield);
// get field names
$names = array_map( function ($id) {
return '[' . $id . ']=> ' . ComponentbuilderHelper::getVar('field', $id, 'id', 'name');
}, $fields);
// MODEL
if ($area == 1 || $area == 3)
{
// create note
$note = "// ". implode('; ', $names);
return $note . PHP_EOL . '$item->{'.(int)$listfield.'} = $item->{' . implode("} . ', ' . \$item->{", $fields) . '};';
}
// VIEW
elseif ($area == 2)
{
// create note
$note = "<!-- " . implode('; ', $names) . " -->";
return '[field=' . implode("]<br />[field=", $fields). ']' . PHP_EOL . PHP_EOL . $note;
}
}
return false;
}
// Used in get_snippets
public function getSnippets($libraries)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -100,11 +100,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('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)
{
unset($items[$nr]);
@ -132,10 +130,10 @@ class ComponentbuilderModelDynamic_gets extends JModelList
}
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
public function selectionTranslation($value,$name)
{
// Array of main_source language strings
@ -253,10 +251,10 @@ class ComponentbuilderModelDynamic_gets extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -296,11 +294,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('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)
{
unset($items[$nr]);
@ -391,16 +387,16 @@ class ComponentbuilderModelDynamic_gets extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

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

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