2016-03-01 18:44:13 +00:00
|
|
|
<?php
|
2018-05-18 06:28:27 +00:00
|
|
|
/**
|
|
|
|
* @package Joomla.Component.Builder
|
|
|
|
*
|
|
|
|
* @created 30th April, 2015
|
2021-12-21 14:44:50 +00:00
|
|
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
|
|
|
* @gitea Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
2018-05-18 06:28:27 +00:00
|
|
|
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
2021-01-03 16:49:35 +00:00
|
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
2018-05-18 06:28:27 +00:00
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
*/
|
2016-03-01 18:44:13 +00:00
|
|
|
|
|
|
|
// No direct access to this file
|
|
|
|
defined('_JEXEC') or die('Restricted access');
|
|
|
|
|
2022-03-09 23:46:45 +00:00
|
|
|
use VDM\Joomla\Utilities\StringHelper;
|
|
|
|
use VDM\Joomla\Utilities\ArrayHelper;
|
2022-08-30 15:28:41 +00:00
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
2022-03-09 23:46:45 +00:00
|
|
|
|
2016-03-01 18:44:13 +00:00
|
|
|
/**
|
|
|
|
* Compiler class
|
2023-01-22 00:38:21 +00:00
|
|
|
* @deprecated 3.3
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
class Fields extends Structure
|
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Metadate Switch
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Meta.Data')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $metadataBuilder = array();
|
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* View access Switch
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Access.Switch')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $accessBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* edit view tabs counter
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Tab.Counter')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $tabCounter = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* layout builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Layout')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $layoutBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2020-12-24 16:28:07 +00:00
|
|
|
/**
|
|
|
|
* permissions builder
|
|
|
|
*
|
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Has.Permissions')->get($key);
|
2020-12-24 16:28:07 +00:00
|
|
|
*/
|
|
|
|
public $hasPermissions = array();
|
|
|
|
|
2017-08-12 11:47:25 +00:00
|
|
|
/**
|
|
|
|
* used to fix the zero order
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2017-08-12 11:47:25 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Order.Zero')->get($key);
|
2017-08-12 11:47:25 +00:00
|
|
|
*/
|
|
|
|
private $zeroOrderFix = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Site field data
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Site.Field.Data')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $siteFieldData = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* list of fields that are not being escaped
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Do.Not.Escape')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $doNotEscape = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-02-27 12:17:38 +00:00
|
|
|
/**
|
|
|
|
* list of classes used in the list view for the fields
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2018-02-27 12:17:38 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.List.Field.Class')->set($key, true);
|
2018-02-27 12:17:38 +00:00
|
|
|
*/
|
|
|
|
public $listFieldClass = array();
|
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* tags builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Tags')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $tagsBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* query builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Database.Tables')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $queryBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* unique keys for database field
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Database.Unique.Keys')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $dbUniqueKeys = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2020-05-25 00:38:16 +00:00
|
|
|
/**
|
|
|
|
* unique guid swtich
|
|
|
|
*
|
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Database.Unique.Guid')->get($key);
|
2020-05-25 00:38:16 +00:00
|
|
|
*/
|
|
|
|
public $dbUniqueGuid = array();
|
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* keys for database field
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Database.Keys')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $dbKeys = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* history builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.History')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $historyBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* alias builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 CFactory::_('Compiler.Builder.Alias')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $aliasBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* title builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 CFactory::_('Compiler.Builder.Title')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $titleBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* list builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Lists')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $listBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* custom Builder List
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Custom.List')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $customBuilderList = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Hidden Fields Builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Hidden.Fields')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $hiddenFieldsBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* INT Field Builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Integer.Fields')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $intFieldsBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Dynamic Fields Builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Dynamic.Fields')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $dynamicfieldsBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Main text Builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Main.Text.Field')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $maintextBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Custom Builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Custom.Field')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $customBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Custom Field Links Builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Custom.Field.Links')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $customFieldLinksBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Set Script for User Switch
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Script.User.Switch')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $setScriptUserSwitch = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Set Script for Media Switch
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Script.Media.Switch')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $setScriptMediaSwitch = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Category builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Category')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $categoryBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Category Code builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Category.Code')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $catCodeBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Check Box builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Check.Box')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $checkboxBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Json String Builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Json.String')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $jsonStringBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2017-06-18 07:37:48 +00:00
|
|
|
/**
|
|
|
|
* Json String Builder for return values to array
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2017-06-18 07:37:48 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Json.Item.Array')->get($key);
|
2017-06-18 07:37:48 +00:00
|
|
|
*/
|
|
|
|
public $jsonItemBuilderArray = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Json Item Builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Json.Item')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $jsonItemBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Base 64 Builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Base.Six.Four')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $base64Builder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2019-10-16 20:34:36 +00:00
|
|
|
* Basic Encryption Field Modeling
|
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Model.Basic.Field')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
2019-10-16 20:34:36 +00:00
|
|
|
public $basicFieldModeling = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2019-10-16 20:34:36 +00:00
|
|
|
* WHMCS Encryption Field Modeling
|
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Model.Whmcs.Field')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
2019-10-16 20:34:36 +00:00
|
|
|
public $whmcsFieldModeling = array();
|
2018-03-06 02:28:44 +00:00
|
|
|
|
|
|
|
/**
|
2019-10-16 20:34:36 +00:00
|
|
|
* Medium Encryption Field Modeling
|
|
|
|
*
|
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Model.Medium.Field')->get($key);
|
2019-10-16 20:34:36 +00:00
|
|
|
*/
|
|
|
|
public $mediumFieldModeling = array();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Expert Field Modeling
|
|
|
|
*
|
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Model.Expert.Field')->get($key);
|
2019-10-16 20:34:36 +00:00
|
|
|
*/
|
|
|
|
public $expertFieldModeling = array();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Expert Mode Initiator
|
|
|
|
*
|
2018-03-06 02:28:44 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Model.Expert.Field.Initiator')->get($key);
|
2018-03-06 02:28:44 +00:00
|
|
|
*/
|
2019-10-16 20:34:36 +00:00
|
|
|
public $expertFieldModelInitiator = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Get Items Method List String Fix Builder
|
2019-10-16 20:34:36 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Items.Method.List.String')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $getItemsMethodListStringFixBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Get Items Method Eximport String Fix Builder
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Items.Method.Eximport.String')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $getItemsMethodEximportStringFixBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Selection Translation Fix Builder
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Selection.Translation')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
2017-12-14 23:10:47 +00:00
|
|
|
public $selectionTranslationFixBuilder = array();
|
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Sort Builder
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Sort')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $sortBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Search Builder
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Search')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $searchBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Filter Builder
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Filter')->get($key);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
|
|
|
public $filterBuilder = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Set Group Control
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Field.Group.Control')->get($key);
|
2016-03-04 00:01:43 +00:00
|
|
|
*/
|
|
|
|
public $setGroupControl = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-06-02 16:18:49 +00:00
|
|
|
/**
|
|
|
|
* Set Field Names
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-06-02 16:18:49 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Field.Names')->get($key);
|
2016-06-02 16:18:49 +00:00
|
|
|
*/
|
2017-12-14 23:10:47 +00:00
|
|
|
public $fieldsNames = array();
|
|
|
|
|
2016-06-02 16:18:49 +00:00
|
|
|
/**
|
|
|
|
* Default Fields set to publishing
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-06-02 16:18:49 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.New.Publishing.Fields')->set($key);
|
2016-06-02 16:18:49 +00:00
|
|
|
*/
|
|
|
|
public $newPublishingFields = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-06-02 16:18:49 +00:00
|
|
|
/**
|
|
|
|
* Default Fields set to publishing
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-06-02 16:18:49 +00:00
|
|
|
* @var array
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Moved.Publishing.Fields')->set($key);
|
2016-06-02 16:18:49 +00:00
|
|
|
*/
|
|
|
|
public $movedPublishingFields = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* set the Field set of a view
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2020-11-26 17:33:39 +00:00
|
|
|
* @param array $view The view data
|
|
|
|
* @param string $component The component name
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
2016-03-01 18:44:13 +00:00
|
|
|
*
|
|
|
|
* @return string The fields set in xml
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Fieldset')->get(...);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
2023-10-18 07:26:30 +00:00
|
|
|
public function setFieldSet(array $view, string $component, string $nameSingleCode, string $nameListCode)
|
|
|
|
{
|
|
|
|
return CFactory::_('Compiler.Creator.Fieldset')->
|
|
|
|
get($view, $component, $nameSingleCode, $nameListCode);
|
2016-03-01 18:44:13 +00:00
|
|
|
}
|
2017-12-03 17:08:01 +00:00
|
|
|
|
2018-03-18 04:28:54 +00:00
|
|
|
/**
|
|
|
|
* build field set using string manipulation
|
|
|
|
*
|
2020-11-26 17:33:39 +00:00
|
|
|
* @param array $view The view data
|
|
|
|
* @param string $component The component name
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
* @param string $langView The language string of the view
|
|
|
|
* @param string $langViews The language string of the views
|
2018-03-18 04:28:54 +00:00
|
|
|
*
|
|
|
|
* @return string The fields set in xml
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Fieldset.String')->get(...);
|
2018-03-18 04:28:54 +00:00
|
|
|
*/
|
2023-10-18 07:26:30 +00:00
|
|
|
protected function stringFieldSet(array $view, string $component, string $nameSingleCode, string $nameListCode,
|
|
|
|
string $langView, string $langViews): string
|
|
|
|
{
|
|
|
|
return CFactory::_('Compiler.Creator.Fieldset.String')->get(
|
|
|
|
$view,
|
|
|
|
$component,
|
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode,
|
|
|
|
$langView,
|
|
|
|
$langViews
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2018-03-18 04:28:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* build field set with simpleXMLElement class
|
|
|
|
*
|
2020-11-26 17:33:39 +00:00
|
|
|
* @param array $view The view data
|
|
|
|
* @param string $component The component name
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
* @param string $langView The language string of the view
|
|
|
|
* @param string $langViews The language string of the views
|
2018-03-18 04:28:54 +00:00
|
|
|
*
|
2023-10-18 07:26:30 +00:00
|
|
|
* @return string The fields set in string xml
|
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Fieldset.XML')->get(...);
|
2018-03-18 04:28:54 +00:00
|
|
|
*/
|
2023-10-18 07:26:30 +00:00
|
|
|
protected function simpleXMLFieldSet(array $view, string $component, string $nameSingleCode,
|
|
|
|
string $nameListCode, string $langView, string $langViews): string
|
|
|
|
{
|
|
|
|
return CFactory::_('Compiler.Creator.Fieldset.XML')->get(
|
|
|
|
$view,
|
|
|
|
$component,
|
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode,
|
|
|
|
$langView,
|
|
|
|
$langViews
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2018-03-18 04:28:54 +00:00
|
|
|
}
|
|
|
|
|
2020-12-24 16:28:07 +00:00
|
|
|
/**
|
|
|
|
* Check to see if a view has permissions
|
|
|
|
*
|
|
|
|
* @param array $view View details
|
|
|
|
* @param string $nameSingleCode View Single Code Name
|
|
|
|
*
|
|
|
|
* @return boolean true if it has permisssions
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Adminview.Permission')->check($view, $nameSingleCode);
|
2020-12-24 16:28:07 +00:00
|
|
|
*/
|
|
|
|
protected function hasPermissionsSet(&$view, &$nameSingleCode)
|
|
|
|
{
|
2023-10-18 07:26:30 +00:00
|
|
|
return CFactory::_('Adminview.Permission')->check($view, $nameSingleCode);
|
|
|
|
}
|
2020-12-24 16:28:07 +00:00
|
|
|
|
2016-06-02 16:18:49 +00:00
|
|
|
/**
|
|
|
|
* set Field Names
|
2017-12-03 17:08:01 +00:00
|
|
|
*
|
2020-03-28 13:34:14 +00:00
|
|
|
* @param string $view View the field belongs to
|
|
|
|
* @param string $name The name of the field
|
2016-06-02 16:18:49 +00:00
|
|
|
*
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Field.Names')->set($view . '.' . $name, $name);
|
2016-06-02 16:18:49 +00:00
|
|
|
*/
|
|
|
|
public function setFieldsNames(&$view, &$name)
|
|
|
|
{
|
2023-10-18 07:26:30 +00:00
|
|
|
CFactory::_('Compiler.Builder.Field.Names')->set($view . '.' . $name, $name);
|
2016-06-02 16:18:49 +00:00
|
|
|
}
|
2016-03-01 18:44:13 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* set Dynamic field
|
2017-12-03 17:08:01 +00:00
|
|
|
*
|
2020-11-26 17:33:39 +00:00
|
|
|
* @param array $field The field data
|
|
|
|
* @param array $view The view data
|
|
|
|
* @param int $viewType The view type
|
|
|
|
* @param string $langView The language string of the view
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
* @param array $placeholders The place holder and replace values
|
|
|
|
* @param string $dbkey The the custom table key
|
|
|
|
* @param boolean $build The switch to set the build option
|
2016-03-01 18:44:13 +00:00
|
|
|
*
|
2023-10-18 07:26:30 +00:00
|
|
|
* @return mixed The complete field
|
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Field.Names')->get(...);
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
2020-03-28 13:34:14 +00:00
|
|
|
public function setDynamicField(&$field, &$view, &$viewType, &$langView,
|
2023-10-18 07:26:30 +00:00
|
|
|
&$nameSingleCode, &$nameListCode, &$placeholders, &$dbkey, $build)
|
|
|
|
{
|
|
|
|
CFactory::_('Compiler.Creator.Field.Dynamic')->get($field, $view, $viewType, $langView,
|
|
|
|
$nameSingleCode, $nameListCode, $placeholders, $dbkey, $build);
|
2016-03-01 18:44:13 +00:00
|
|
|
}
|
|
|
|
|
2020-11-26 17:33:39 +00:00
|
|
|
/**
|
|
|
|
* build field set
|
|
|
|
*
|
|
|
|
* @param array $fields The fields data
|
|
|
|
* @param string $langView The language string of the view
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
* @param array $placeholders The place holder and replace values
|
|
|
|
* @param string $dbkey The the custom table key
|
|
|
|
* @param boolean $build The switch to set the build option
|
|
|
|
* @param int $return_type The return type 1 = string, 2 = array
|
|
|
|
*
|
2023-10-18 07:26:30 +00:00
|
|
|
* @return mixed The complete field in string or array
|
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Builder.Fieldset.Dynamic')->get(...);
|
2020-11-26 17:33:39 +00:00
|
|
|
*/
|
2023-10-18 07:26:30 +00:00
|
|
|
public function getFieldsetXML(array &$fields, string &$langView, string &$nameSingleCode,
|
|
|
|
string &$nameListCode, array &$placeholders, string &$dbkey, bool $build = false,
|
|
|
|
int $returnType = 1)
|
|
|
|
{
|
|
|
|
return CFactory::_('Compiler.Creator.Fieldset.Dynamic')->get(
|
|
|
|
$fields, $langView, $nameSingleCode,
|
|
|
|
$nameListCode, $placeholders, $dbkey, $build, $returnType
|
|
|
|
);
|
2020-11-26 17:33:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* build field string
|
|
|
|
*
|
|
|
|
* @param array $field The field data
|
|
|
|
* @param array $view The view data
|
|
|
|
* @param int $viewType The view type
|
|
|
|
* @param string $langView The language string of the view
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
* @param array $placeholders The place holder and replace values
|
|
|
|
* @param string $dbkey The the custom table key
|
|
|
|
* @param boolean $build The switch to set the build option
|
|
|
|
*
|
|
|
|
* @return string The complete field in xml-string
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Field.As.String')->get(...);
|
2020-11-26 17:33:39 +00:00
|
|
|
*/
|
2023-10-18 07:26:30 +00:00
|
|
|
public function getFieldXMLString(array &$field, array &$view, int &$viewType, string &$langView,
|
|
|
|
string &$nameSingleCode, string &$nameListCode, array &$placeholders, string &$dbkey,
|
|
|
|
bool $build = false): string
|
|
|
|
{
|
|
|
|
// get field
|
|
|
|
return CFactory::_('Compiler.Creator.Field.As.String')->get(
|
|
|
|
$field, $view, $viewType, $langView,
|
|
|
|
$nameSingleCode, $nameListCode, $placeholders, $dbkey, $build
|
|
|
|
);
|
2020-11-26 17:33:39 +00:00
|
|
|
}
|
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* set a field
|
|
|
|
*
|
2020-11-26 17:33:39 +00:00
|
|
|
* @param string $setType The set of fields type
|
|
|
|
* @param array $fieldAttributes The field values
|
|
|
|
* @param string $name The field name
|
|
|
|
* @param string $typeName The field type
|
|
|
|
* @param string $langView The language string of the view
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
* @param array $placeholders The place holder and replace values
|
2023-10-18 07:26:30 +00:00
|
|
|
* @param array|null $optionArray The option bucket array used to set the field options if needed.
|
2020-11-26 17:33:39 +00:00
|
|
|
* @param array $custom Used when field is from config
|
|
|
|
* @param string $taber The tabs to add in layout (only in string manipulation)
|
2018-03-18 04:28:54 +00:00
|
|
|
*
|
|
|
|
* @return SimpleXMLElement The field in xml
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Field.Type')->get(...);
|
2018-03-18 04:28:54 +00:00
|
|
|
*/
|
2020-03-28 13:34:14 +00:00
|
|
|
private function setField($setType, &$fieldAttributes, &$name, &$typeName,
|
2023-05-02 00:10:55 +00:00
|
|
|
&$langView, &$nameSingleCode, &$nameListCode, $placeholders,
|
|
|
|
&$optionArray, $custom = null, $taber = ''
|
2020-03-28 13:34:14 +00:00
|
|
|
) {
|
2023-10-18 07:26:30 +00:00
|
|
|
return CFactory::_('Compiler.Creator.Field.Type')->get(
|
|
|
|
$setType, $fieldAttributes, $name, $typeName,
|
|
|
|
$langView, $nameSingleCode, $nameListCode, $placeholders,
|
|
|
|
$optionArray, $custom, $taber
|
|
|
|
);
|
2018-03-18 04:28:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set a field using string manipulation
|
|
|
|
*
|
2020-11-26 17:33:39 +00:00
|
|
|
* @param string $setType The set of fields type
|
|
|
|
* @param array $fieldAttributes The field values
|
|
|
|
* @param string $name The field name
|
|
|
|
* @param string $typeName The field type
|
|
|
|
* @param string $langView The language string of the view
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
* @param array $placeholders The place holder and replace values
|
2023-10-18 07:26:30 +00:00
|
|
|
* @param array|null $optionArray The option bucket array used to set the field options if needed.
|
2020-11-26 17:33:39 +00:00
|
|
|
* @param array $custom Used when field is from config
|
|
|
|
* @param string $taber The tabs to add in layout
|
2018-03-18 04:28:54 +00:00
|
|
|
*
|
|
|
|
* @return SimpleXMLElement The field in xml
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Field.String')->get(...);
|
2018-03-18 04:28:54 +00:00
|
|
|
*/
|
2020-03-28 13:34:14 +00:00
|
|
|
protected function stringSetField($setType, &$fieldAttributes, &$name,
|
2023-10-18 07:26:30 +00:00
|
|
|
&$typeName, &$langView, &$nameSingleCode, &$nameListCode,
|
|
|
|
$placeholders, &$optionArray, $custom = null, $taber = '')
|
|
|
|
{
|
|
|
|
return CFactory::_('Compiler.Creator.Field.String')->get(
|
|
|
|
$setType, $fieldAttributes, $name,
|
|
|
|
$typeName, $langView, $nameSingleCode, $nameListCode,
|
|
|
|
$placeholders, $optionArray, $custom, $taber
|
|
|
|
);
|
2020-07-07 15:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set a field with simpleXMLElement class
|
|
|
|
*
|
2023-10-18 07:26:30 +00:00
|
|
|
* @param string $setType The set of fields type
|
|
|
|
* @param array $fieldAttributes The field values
|
|
|
|
* @param string $name The field name
|
|
|
|
* @param string $typeName The field type
|
|
|
|
* @param string $langView The language string of the view
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
* @param array $placeholders The place holder and replace values
|
|
|
|
* @param string $optionArray The option bucket array used to set the field options if needed.
|
|
|
|
* @param array $custom Used when field is from config
|
|
|
|
*
|
|
|
|
* @return SimpleXMLElement The field in xml
|
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Field.XML')->get(...);
|
|
|
|
*/
|
|
|
|
protected function simpleXMLSetField($setType, &$fieldAttributes, &$name,
|
|
|
|
&$typeName, &$langView, &$nameSingleCode, &$nameListCode,
|
|
|
|
$placeholders, &$optionArray, $custom = null)
|
|
|
|
{
|
|
|
|
return CFactory::_('Compiler.Creator.Field.XML')->get(
|
|
|
|
$setType, $fieldAttributes, $name,
|
|
|
|
$typeName, $langView, $nameSingleCode, $nameListCode,
|
|
|
|
$placeholders, $optionArray, $custom
|
|
|
|
);
|
|
|
|
}
|
2016-03-01 18:44:13 +00:00
|
|
|
|
2023-10-18 07:26:30 +00:00
|
|
|
/**
|
|
|
|
* set the layout builder
|
|
|
|
*
|
|
|
|
* @param string $nameSingleCode The single edit view code name
|
|
|
|
* @param string $tabName The tab code name
|
|
|
|
* @param string $name The field code name
|
|
|
|
* @param array $field The field details
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Layout')->set(...);
|
|
|
|
*/
|
|
|
|
public function setLayoutBuilder($nameSingleCode, $tabName, $name, &$field)
|
|
|
|
{
|
|
|
|
CFactory::_('Compiler.Creator.Layout')->set($nameSingleCode, $tabName, $name, $field);
|
|
|
|
}
|
2017-12-03 17:08:01 +00:00
|
|
|
|
2023-10-18 07:26:30 +00:00
|
|
|
/**
|
|
|
|
* build the site field data needed
|
|
|
|
*
|
|
|
|
* @param string $view The single edit view code name
|
|
|
|
* @param string $field The field name
|
|
|
|
* @param string $set The decoding set this field belongs to
|
|
|
|
* @param string $type The field type
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Site.Field.Data')->set(...);
|
|
|
|
*/
|
|
|
|
public function buildSiteFieldData($view, $field, $set, $type)
|
|
|
|
{
|
|
|
|
CFactory::_('Compiler.Creator.Site.Field.Data')->set($view, $field, $set, $type);
|
|
|
|
}
|
2020-11-30 03:59:45 +00:00
|
|
|
|
2023-10-18 07:26:30 +00:00
|
|
|
/**
|
|
|
|
* set field attributes
|
|
|
|
*
|
|
|
|
* @param array $field The field data
|
|
|
|
* @param int $viewType The view type
|
|
|
|
* @param string $name The field name
|
|
|
|
* @param string $typeName The field type
|
|
|
|
* @param boolean $multiple The switch to set multiple selection option
|
|
|
|
* @param string $langLabel The language string for field label
|
|
|
|
* @param string $langView The language string of the view
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param array $placeholders The place holder and replace values
|
|
|
|
* @param boolean $repeatable The repeatable field switch
|
|
|
|
*
|
|
|
|
* @return array The field attributes
|
|
|
|
* @deprecated 3.3 Use CFactory::_('Field.Attributes')->set(...);
|
|
|
|
*/
|
|
|
|
private function setFieldAttributes(&$field, &$viewType, &$name, &$typeName,
|
|
|
|
&$multiple, &$langLabel, $langView, $nameListCode, $nameSingleCode,
|
|
|
|
$placeholders, $repeatable = false
|
|
|
|
)
|
|
|
|
{
|
|
|
|
// set notice that we could not get a valid string from the target
|
|
|
|
$this->app->enqueueMessage(
|
|
|
|
JText::sprintf('<hr /><h3>%s Warning</h3>', __CLASS__), 'Error'
|
|
|
|
);
|
|
|
|
$this->app->enqueueMessage(
|
|
|
|
JText::sprintf(
|
|
|
|
'Use of a deprecated method (%s)!', __METHOD__
|
|
|
|
), 'Error'
|
|
|
|
);
|
2016-03-01 18:44:13 +00:00
|
|
|
|
2023-10-18 07:26:30 +00:00
|
|
|
return false;
|
|
|
|
}
|
2022-09-14 15:40:02 +00:00
|
|
|
|
2023-10-18 07:26:30 +00:00
|
|
|
/**
|
|
|
|
* set Builders
|
|
|
|
*
|
|
|
|
* @param string $langLabel The language string for field label
|
|
|
|
* @param string $langView The language string of the view
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
* @param string $name The field name
|
|
|
|
* @param array $view The view data
|
|
|
|
* @param array $field The field data
|
|
|
|
* @param string $typeName The field type
|
|
|
|
* @param bool $multiple The switch to set multiple selection option
|
|
|
|
* @param array|null $custom The custom field switch
|
|
|
|
* @param array|null $options The options switch
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Builders')->set(...);
|
|
|
|
*/
|
|
|
|
public function setBuilders($langLabel, $langView, $nameSingleCode,
|
|
|
|
$nameListCode, $name, $view, $field, $typeName, $multiple,
|
|
|
|
$custom = null, $options = null
|
|
|
|
): void
|
|
|
|
{
|
|
|
|
CFactory::_('Compiler.Creator.Builders')->set($langLabel, $langView, $nameSingleCode,
|
|
|
|
$nameListCode, $name, $view, $field, $typeName, $multiple, $custom, $options);
|
2016-03-01 18:44:13 +00:00
|
|
|
}
|
2017-12-03 08:02:11 +00:00
|
|
|
|
2018-03-30 04:41:33 +00:00
|
|
|
/**
|
|
|
|
* set Custom Field Type File
|
|
|
|
*
|
2020-11-26 17:33:39 +00:00
|
|
|
* @param array $data The field complete data set
|
|
|
|
* @param string $nameListCode The list view code name
|
|
|
|
* @param string $nameSingleCode The single view code name
|
2018-03-30 04:41:33 +00:00
|
|
|
*
|
|
|
|
* @return void
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Compiler.Creator.Custom.Field.Type.File')->set(...);
|
2018-03-30 04:41:33 +00:00
|
|
|
*/
|
2023-10-18 07:26:30 +00:00
|
|
|
public function setCustomFieldTypeFile($data, $nameListCode,$nameSingleCode)
|
|
|
|
{
|
|
|
|
CFactory::_('Compiler.Creator.Custom.Field.Type.File')->set($data, $nameListCode,$nameSingleCode);
|
2018-03-30 04:41:33 +00:00
|
|
|
}
|
|
|
|
|
2020-11-29 00:00:20 +00:00
|
|
|
/**
|
|
|
|
* This is just to get the code.
|
|
|
|
* Don't use this to build the field
|
|
|
|
*
|
|
|
|
* @param array $custom The field complete data set
|
|
|
|
*
|
|
|
|
* @return array with the code
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function getCustomFieldCode($custom)
|
|
|
|
{
|
|
|
|
// the code bucket
|
|
|
|
$code_bucket = array(
|
|
|
|
'JFORM_TYPE_HEADER' => '',
|
|
|
|
'JFORM_TYPE_PHP' => ''
|
|
|
|
);
|
|
|
|
// set tab and break replacements
|
|
|
|
$tabBreak = array(
|
2022-08-30 15:28:41 +00:00
|
|
|
'\t' => Indent::_(1),
|
2020-11-29 00:00:20 +00:00
|
|
|
'\n' => PHP_EOL
|
|
|
|
);
|
|
|
|
// load the other PHP options
|
|
|
|
foreach (ComponentbuilderHelper::$phpFieldArray as $x)
|
|
|
|
{
|
|
|
|
// reset the php bucket
|
|
|
|
$phpBucket = '';
|
|
|
|
// only set if available
|
|
|
|
if (isset($custom['php' . $x])
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check(
|
2020-11-29 00:00:20 +00:00
|
|
|
$custom['php' . $x]
|
|
|
|
))
|
|
|
|
{
|
|
|
|
foreach ($custom['php' . $x] as $line => $code)
|
|
|
|
{
|
2022-03-09 23:46:45 +00:00
|
|
|
if (StringHelper::check($code))
|
2020-11-29 00:00:20 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$phpBucket .= PHP_EOL . CFactory::_('Placeholder')->update(
|
2020-11-29 00:00:20 +00:00
|
|
|
$code, $tabBreak
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// check if this is header text
|
|
|
|
if ('HEADER' === $x)
|
|
|
|
{
|
|
|
|
$code_bucket['JFORM_TYPE_HEADER']
|
|
|
|
.= PHP_EOL . $phpBucket;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// JFORM_TYPE_PHP <<<DYNAMIC>>>
|
|
|
|
$code_bucket['JFORM_TYPE_PHP']
|
|
|
|
.= PHP_EOL . $phpBucket;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $code_bucket;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set the Filter Field set of a view
|
|
|
|
*
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
*
|
|
|
|
* @return string The fields set in xml
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function setFieldFilterSet(&$nameSingleCode, &$nameListCode)
|
|
|
|
{
|
|
|
|
// check if this is the above/new filter option
|
2023-10-18 07:26:30 +00:00
|
|
|
if (CFactory::_('Compiler.Builder.Admin.Filter.Type')->get($nameListCode, 1) == 2)
|
2020-11-29 00:00:20 +00:00
|
|
|
{
|
|
|
|
// we first create the file
|
|
|
|
$target = array('admin' => 'filter_' . $nameListCode);
|
2023-02-12 19:15:41 +00:00
|
|
|
CFactory::_('Utilities.Structure')->build(
|
2020-11-29 00:00:20 +00:00
|
|
|
$target, 'filter'
|
|
|
|
);
|
2020-11-30 03:59:45 +00:00
|
|
|
// the search language string
|
2022-08-30 15:28:41 +00:00
|
|
|
$lang_search = CFactory::_('Config')->lang_prefix . '_FILTER_SEARCH';
|
2020-11-30 03:59:45 +00:00
|
|
|
// and to translation
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Language')->set(
|
|
|
|
CFactory::_('Config')->lang_target, $lang_search, 'Search'
|
2022-03-09 23:46:45 +00:00
|
|
|
. StringHelper::safe($nameListCode, 'w')
|
2020-11-30 03:59:45 +00:00
|
|
|
);
|
|
|
|
// the search description language string
|
2022-08-30 15:28:41 +00:00
|
|
|
$lang_search_desc = CFactory::_('Config')->lang_prefix . '_FILTER_SEARCH_'
|
2020-11-30 03:59:45 +00:00
|
|
|
. strtoupper($nameListCode);
|
|
|
|
// and to translation
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Language')->set(
|
|
|
|
CFactory::_('Config')->lang_target, $lang_search_desc, 'Search the '
|
2022-03-09 23:46:45 +00:00
|
|
|
. StringHelper::safe($nameSingleCode, 'w')
|
2020-11-30 03:59:45 +00:00
|
|
|
. ' items. Prefix with ID: to search for an item by ID.'
|
|
|
|
);
|
2020-11-29 00:00:20 +00:00
|
|
|
// now build the XML
|
|
|
|
$field_filter_sets = array();
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(1) . '<fields name="filter">';
|
2020-11-29 00:00:20 +00:00
|
|
|
// we first add the search
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(2) . '<field';
|
|
|
|
$field_filter_sets[] = Indent::_(3) . 'type="text"';
|
|
|
|
$field_filter_sets[] = Indent::_(3) . 'name="search"';
|
|
|
|
$field_filter_sets[] = Indent::_(3) . 'inputmode="search"';
|
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. 'label="' . $lang_search . '"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. 'description="' . $lang_search_desc . '"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'hint="JSEARCH_FILTER"';
|
|
|
|
$field_filter_sets[] = Indent::_(2) . '/>';
|
2020-11-29 00:00:20 +00:00
|
|
|
// add the published filter if published is not set
|
2023-10-18 07:26:30 +00:00
|
|
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($nameSingleCode . '.published'))
|
2020-11-29 00:00:20 +00:00
|
|
|
{
|
2020-11-30 03:59:45 +00:00
|
|
|
// the published language string
|
2022-08-30 15:28:41 +00:00
|
|
|
$lang_published = CFactory::_('Config')->lang_prefix . '_FILTER_PUBLISHED';
|
2020-11-30 03:59:45 +00:00
|
|
|
// and to translation
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Language')->set(
|
|
|
|
CFactory::_('Config')->lang_target, $lang_published, 'Status'
|
2020-11-30 03:59:45 +00:00
|
|
|
);
|
|
|
|
// the published description language string
|
2022-08-30 15:28:41 +00:00
|
|
|
$lang_published_desc = CFactory::_('Config')->lang_prefix . '_FILTER_PUBLISHED_'
|
2020-11-30 03:59:45 +00:00
|
|
|
. strtoupper($nameListCode);
|
|
|
|
// and to translation
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Language')->set(
|
|
|
|
CFactory::_('Config')->lang_target, $lang_published_desc, 'Status options for '
|
2022-03-09 23:46:45 +00:00
|
|
|
. StringHelper::safe($nameListCode, 'w')
|
2020-11-30 03:59:45 +00:00
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(2) . '<field';
|
|
|
|
$field_filter_sets[] = Indent::_(3) . 'type="status"';
|
|
|
|
$field_filter_sets[] = Indent::_(3) . 'name="published"';
|
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. 'label="' . $lang_published . '"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. 'description="' . $lang_published_desc . '"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-29 00:00:20 +00:00
|
|
|
. 'onchange="this.form.submit();"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(2) . '>';
|
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-29 00:00:20 +00:00
|
|
|
. '<option value="">JOPTION_SELECT_PUBLISHED</option>';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(2) . '</field>';
|
2020-11-29 00:00:20 +00:00
|
|
|
}
|
2020-11-30 15:30:10 +00:00
|
|
|
// add the category if found
|
2023-10-18 07:26:30 +00:00
|
|
|
if (CFactory::_('Compiler.Builder.Category')->exists("{$nameListCode}.extension")
|
|
|
|
&& CFactory::_('Compiler.Builder.Category')->get("{$nameListCode}.filter", 0) >= 1)
|
2020-11-30 15:30:10 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(2) . '<field';
|
|
|
|
$field_filter_sets[] = Indent::_(3) . 'type="category"';
|
|
|
|
$field_filter_sets[] = Indent::_(3) . 'name="category_id"';
|
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2023-10-18 07:26:30 +00:00
|
|
|
. 'label="' . CFactory::_('Compiler.Builder.Category')->get("{$nameListCode}.name", 'error')
|
2020-12-05 06:17:54 +00:00
|
|
|
. '"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-30 15:30:10 +00:00
|
|
|
. 'description="JOPTION_FILTER_CATEGORY_DESC"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'multiple="true"';
|
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-30 15:30:10 +00:00
|
|
|
. 'class="multipleCategories"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'extension="'
|
2023-10-18 07:26:30 +00:00
|
|
|
. CFactory::_('Compiler.Builder.Category')->get("{$nameListCode}.extension") . '"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-30 15:30:10 +00:00
|
|
|
. 'onchange="this.form.submit();"';
|
|
|
|
// TODO NOT SURE IF THIS SHOULD BE STATIC
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'published="0,1,2"';
|
|
|
|
$field_filter_sets[] = Indent::_(2) . '/>';
|
2020-11-30 15:30:10 +00:00
|
|
|
}
|
2020-11-29 00:00:20 +00:00
|
|
|
// add the access filter if this view has access
|
|
|
|
// and if access manually is not set
|
2023-10-18 07:26:30 +00:00
|
|
|
if (CFactory::_('Compiler.Builder.Access.Switch')->exists($nameSingleCode)
|
|
|
|
&& !CFactory::_('Compiler.Builder.Field.Names')->isString($nameSingleCode . '.access'))
|
2020-11-29 00:00:20 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(2) . '<field';
|
|
|
|
$field_filter_sets[] = Indent::_(3) . 'type="accesslevel"';
|
|
|
|
$field_filter_sets[] = Indent::_(3) . 'name="access"';
|
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-12-03 00:13:49 +00:00
|
|
|
. 'label="JFIELD_ACCESS_LABEL"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-12-03 00:13:49 +00:00
|
|
|
. 'description="JFIELD_ACCESS_DESC"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'multiple="true"';
|
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-29 00:00:20 +00:00
|
|
|
. 'class="multipleAccessLevels"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-29 00:00:20 +00:00
|
|
|
. 'onchange="this.form.submit();"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(2) . '/>';
|
2020-11-29 00:00:20 +00:00
|
|
|
}
|
|
|
|
// now add the dynamic fields
|
2023-10-18 07:26:30 +00:00
|
|
|
if (CFactory::_('Compiler.Builder.Filter')->exists($nameListCode))
|
2020-11-29 00:00:20 +00:00
|
|
|
{
|
2023-10-18 07:26:30 +00:00
|
|
|
foreach (CFactory::_('Compiler.Builder.Filter')->get($nameListCode) as $n => $filter)
|
2020-11-29 00:00:20 +00:00
|
|
|
{
|
2020-11-30 03:59:45 +00:00
|
|
|
if ($filter['type'] != 'category')
|
2020-11-29 00:00:20 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(2) . '<field';
|
2020-11-30 03:59:45 +00:00
|
|
|
// if this is a custom field
|
2023-10-18 07:26:30 +00:00
|
|
|
if (ArrayHelper::check($filter['custom']))
|
2020-11-30 03:59:45 +00:00
|
|
|
{
|
|
|
|
// we use the field type from the custom field
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'type="'
|
2020-11-30 03:59:45 +00:00
|
|
|
. $filter['type'] . '"';
|
|
|
|
// set css classname of this field
|
2023-10-18 07:26:30 +00:00
|
|
|
$filter_class = ucfirst((string) $filter['type']);
|
2020-11-30 03:59:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// we use the filter field type that was build
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'type="'
|
2020-11-30 03:59:45 +00:00
|
|
|
. $filter['filter_type'] . '"';
|
|
|
|
// set css classname of this field
|
2023-10-18 07:26:30 +00:00
|
|
|
$filter_class = ucfirst((string) $filter['filter_type']);
|
2020-11-30 03:59:45 +00:00
|
|
|
}
|
2023-10-18 07:26:30 +00:00
|
|
|
// update global data set
|
|
|
|
CFactory::_('Compiler.Builder.Filter')->set("{$nameListCode}.{$n}.class", $filter_class);
|
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'name="'
|
2020-11-30 03:59:45 +00:00
|
|
|
. $filter['code'] . '"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'label="'
|
2020-11-30 03:59:45 +00:00
|
|
|
. $filter['label'] . '"';
|
2023-10-18 07:26:30 +00:00
|
|
|
|
2020-11-30 03:59:45 +00:00
|
|
|
// if this is a multi field
|
|
|
|
if ($filter['multi'] == 2)
|
|
|
|
{
|
2023-10-18 07:26:30 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'class="multiple' . $filter_class . '"';
|
|
|
|
$field_filter_sets[] = Indent::_(3) . 'multiple="true"';
|
2020-11-30 03:59:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-10-18 07:26:30 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3) . 'multiple="false"';
|
2020-11-30 03:59:45 +00:00
|
|
|
}
|
2023-10-18 07:26:30 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. 'onchange="this.form.submit();"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(2) . '/>';
|
2020-11-29 00:00:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(2)
|
2020-11-29 00:00:20 +00:00
|
|
|
. '<input type="hidden" name="form_submited" value="1"/>';
|
2022-08-30 15:28:41 +00:00
|
|
|
$field_filter_sets[] = Indent::_(1) . '</fields>';
|
2020-11-29 00:00:20 +00:00
|
|
|
|
|
|
|
// now update the file
|
|
|
|
return implode(PHP_EOL, $field_filter_sets);
|
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set the Filter List set of a view
|
|
|
|
*
|
|
|
|
* @param string $nameSingleCode The single view name
|
|
|
|
* @param string $nameListCode The list view name
|
|
|
|
*
|
|
|
|
* @return string The fields set in xml
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function setFieldFilterListSet(&$nameSingleCode, &$nameListCode)
|
|
|
|
{
|
2020-11-30 03:59:45 +00:00
|
|
|
// check if this is the above/new filter option
|
2023-10-18 07:26:30 +00:00
|
|
|
if (CFactory::_('Compiler.Builder.Admin.Filter.Type')->get($nameListCode, 1) == 2)
|
2020-11-30 03:59:45 +00:00
|
|
|
{
|
|
|
|
// keep track of all fields already added
|
|
|
|
$donelist = array('ordering' => true, 'id' => true);
|
|
|
|
// now build the XML
|
|
|
|
$list_sets = array();
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(1) . '<fields name="list">';
|
|
|
|
$list_sets[] = Indent::_(2) . '<field';
|
|
|
|
$list_sets[] = Indent::_(3) . 'name="fullordering"';
|
|
|
|
$list_sets[] = Indent::_(3) . 'type="list"';
|
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. 'label="COM_CONTENT_LIST_FULL_ORDERING"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. 'description="COM_CONTENT_LIST_FULL_ORDERING_DESC"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3) . 'onchange="this.form.submit();"';
|
2020-11-30 03:59:45 +00:00
|
|
|
// add dynamic ordering (Admin view)
|
|
|
|
$default_ordering = $this->getListViewDefaultOrdering(
|
|
|
|
$nameListCode
|
|
|
|
);
|
|
|
|
// set the default ordering
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3) . 'default="'
|
2020-11-30 03:59:45 +00:00
|
|
|
. $default_ordering['name'] . ' '
|
|
|
|
. $default_ordering['direction'] . '"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3) . 'validate="options"';
|
|
|
|
$list_sets[] = Indent::_(2) . '>';
|
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. '<option value="">JGLOBAL_SORT_BY</option>';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. '<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. '<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>';
|
|
|
|
// add the published filter if published is not set
|
2023-10-18 07:26:30 +00:00
|
|
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($nameSingleCode . '.published'))
|
2020-11-30 03:59:45 +00:00
|
|
|
{
|
|
|
|
// add to done list
|
|
|
|
$donelist['published'] = true;
|
|
|
|
// add to xml :)
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. '<option value="a.published ASC">JSTATUS_ASC</option>';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. '<option value="a.published DESC">JSTATUS_DESC</option>';
|
|
|
|
}
|
|
|
|
|
|
|
|
// add the rest of the set filters
|
2023-10-18 07:26:30 +00:00
|
|
|
if (CFactory::_('Compiler.Builder.Sort')->exists($nameListCode))
|
2020-11-30 03:59:45 +00:00
|
|
|
{
|
2023-10-18 07:26:30 +00:00
|
|
|
foreach (CFactory::_('Compiler.Builder.Sort')->get($nameListCode) as $filter)
|
2020-11-30 03:59:45 +00:00
|
|
|
{
|
|
|
|
if (!isset($donelist[$filter['code']]))
|
|
|
|
{
|
|
|
|
if ($filter['type'] === 'category')
|
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. '<option value="category_title ASC">'
|
|
|
|
. $filter['lang_asc'] . '</option>';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. '<option value="category_title DESC">'
|
|
|
|
. $filter['lang_desc'] . '</option>';
|
|
|
|
}
|
2022-03-09 23:46:45 +00:00
|
|
|
elseif (ArrayHelper::check(
|
2020-11-30 03:59:45 +00:00
|
|
|
$filter['custom']
|
|
|
|
))
|
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3) . '<option value="'
|
2020-11-30 03:59:45 +00:00
|
|
|
. $filter['custom']['db'] . '.'
|
|
|
|
. $filter['custom']['text'] . ' ASC">'
|
|
|
|
. $filter['lang_asc'] . '</option>';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3) . '<option value="'
|
2020-11-30 03:59:45 +00:00
|
|
|
. $filter['custom']['db'] . '.'
|
|
|
|
. $filter['custom']['text'] . ' DESC">'
|
|
|
|
. $filter['lang_desc'] . '</option>';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3) . '<option value="a.'
|
2020-11-30 03:59:45 +00:00
|
|
|
. $filter['code'] . ' ASC">'
|
|
|
|
. $filter['lang_asc'] . '</option>';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3) . '<option value="a.'
|
2020-11-30 03:59:45 +00:00
|
|
|
. $filter['code'] . ' DESC">'
|
|
|
|
. $filter['lang_desc'] . '</option>';
|
|
|
|
}
|
|
|
|
// do not add again
|
|
|
|
$donelist[$filter['code']] = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. '<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. '<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(2) . '</field>' . PHP_EOL;
|
2020-11-30 03:59:45 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(2) . '<field';
|
|
|
|
$list_sets[] = Indent::_(3) . 'name="limit"';
|
|
|
|
$list_sets[] = Indent::_(3) . 'type="limitbox"';
|
|
|
|
$list_sets[] = Indent::_(3) . 'label="COM_CONTENT_LIST_LIMIT"';
|
|
|
|
$list_sets[] = Indent::_(3)
|
2020-11-30 03:59:45 +00:00
|
|
|
. 'description="COM_CONTENT_LIST_LIMIT_DESC"';
|
2022-08-30 15:28:41 +00:00
|
|
|
$list_sets[] = Indent::_(3) . 'class="input-mini"';
|
|
|
|
$list_sets[] = Indent::_(3) . 'default="25"';
|
|
|
|
$list_sets[] = Indent::_(3) . 'onchange="this.form.submit();"';
|
|
|
|
$list_sets[] = Indent::_(2) . '/>';
|
|
|
|
$list_sets[] = Indent::_(1) . '</fields>';
|
2020-11-30 03:59:45 +00:00
|
|
|
|
|
|
|
return implode(PHP_EOL, $list_sets);
|
|
|
|
}
|
|
|
|
|
2020-11-29 00:00:20 +00:00
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set Custom Field for Filter
|
|
|
|
*
|
|
|
|
* @param string $getOptions The get options php string/code
|
|
|
|
* @param array $filter The filter details
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function setFilterFieldFile($getOptions, $filter)
|
|
|
|
{
|
|
|
|
// make sure it is not already been build
|
2023-10-18 07:26:30 +00:00
|
|
|
if (!CFactory::_('Compiler.Builder.Content.Multi')->
|
|
|
|
isArray('customfilterfield_' . $filter['filter_type']))
|
2020-11-29 00:00:20 +00:00
|
|
|
{
|
|
|
|
// start loading the field type
|
2022-12-11 15:06:13 +00:00
|
|
|
// $this->fileContentDynamic['customfilterfield_'
|
|
|
|
// . $filter['filter_type']]
|
|
|
|
// = array();
|
2020-11-29 00:00:20 +00:00
|
|
|
// JPREFIX <<DYNAMIC>>>
|
2023-10-18 07:26:30 +00:00
|
|
|
CFactory::_('Compiler.Builder.Content.Multi')->set('customfilterfield_' . $filter['filter_type'] . '|JPREFIX', 'J');
|
2020-11-29 00:00:20 +00:00
|
|
|
// Type <<<DYNAMIC>>>
|
2023-10-18 07:26:30 +00:00
|
|
|
CFactory::_('Compiler.Builder.Content.Multi')->set('customfilterfield_' . $filter['filter_type'] . '|Type',
|
2022-12-11 15:06:13 +00:00
|
|
|
StringHelper::safe(
|
|
|
|
$filter['filter_type'], 'F'
|
|
|
|
)
|
2020-11-29 00:00:20 +00:00
|
|
|
);
|
|
|
|
// type <<<DYNAMIC>>>
|
2023-10-18 07:26:30 +00:00
|
|
|
CFactory::_('Compiler.Builder.Content.Multi')->set('customfilterfield_' . $filter['filter_type'] . '|type',
|
2022-12-11 15:06:13 +00:00
|
|
|
StringHelper::safe($filter['filter_type'])
|
|
|
|
);
|
2020-11-29 00:00:20 +00:00
|
|
|
// JFORM_GETOPTIONS_PHP <<<DYNAMIC>>>
|
2023-10-18 07:26:30 +00:00
|
|
|
CFactory::_('Compiler.Builder.Content.Multi')->set('customfilterfield_' . $filter['filter_type'] . '|JFORM_GETOPTIONS_PHP',
|
2022-12-11 15:06:13 +00:00
|
|
|
$getOptions
|
|
|
|
);
|
2020-11-29 00:00:20 +00:00
|
|
|
// ADD_BUTTON <<<DYNAMIC>>>
|
2023-10-18 07:26:30 +00:00
|
|
|
CFactory::_('Compiler.Builder.Content.Multi')->set('customfilterfield_' . $filter['filter_type'] . '|ADD_BUTTON', '');
|
2020-11-29 00:00:20 +00:00
|
|
|
// now build the custom filter field type file
|
|
|
|
$target = array('admin' => 'customfilterfield');
|
2023-02-12 19:15:41 +00:00
|
|
|
CFactory::_('Utilities.Structure')->build(
|
2020-11-29 00:00:20 +00:00
|
|
|
$target, 'fieldlist',
|
|
|
|
$filter['filter_type']
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-30 04:41:33 +00:00
|
|
|
/**
|
|
|
|
* set Add Button To List Field (getInput tweak)
|
|
|
|
*
|
2020-03-28 13:34:14 +00:00
|
|
|
* @param array $fieldData The field custom data
|
2018-03-30 04:41:33 +00:00
|
|
|
*
|
|
|
|
* @return string of getInput class on success empty string otherwise
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Field.Input.Button')->get($fieldData);
|
2018-03-30 04:41:33 +00:00
|
|
|
*/
|
|
|
|
protected function setAddButtonToListField($fieldData)
|
|
|
|
{
|
2023-10-18 07:26:30 +00:00
|
|
|
return CFactory::_('Field.Input.Button')->get($fieldData);
|
2016-03-01 18:44:13 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 19:12:56 +00:00
|
|
|
/**
|
|
|
|
* xmlPrettyPrint
|
|
|
|
*
|
2020-03-28 13:34:14 +00:00
|
|
|
* @param SimpleXMLElement $xml The XML element containing a node to be output
|
|
|
|
* @param string $nodename node name of the input xml element to print out. this is done to omit the <?xml... tag
|
2017-12-03 19:12:56 +00:00
|
|
|
*
|
|
|
|
* @return string XML output
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Utilities.Xml')->pretty($xml, $nodename);
|
2017-12-03 19:12:56 +00:00
|
|
|
*/
|
2017-12-03 17:08:01 +00:00
|
|
|
public function xmlPrettyPrint($xml, $nodename)
|
|
|
|
{
|
2023-10-18 07:26:30 +00:00
|
|
|
return CFactory::_('Utilities.Xml')->pretty($xml, $nodename);
|
2017-12-03 19:12:56 +00:00
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2017-12-03 19:12:56 +00:00
|
|
|
/**
|
|
|
|
* xmlIndent
|
|
|
|
*
|
2020-03-28 13:34:14 +00:00
|
|
|
* @param string $string The XML input
|
|
|
|
* @param string $char Character or characters to use as the repeated indent
|
|
|
|
* @param integer $depth number of times to repeat the indent character
|
|
|
|
* @param boolean $skipfirst Skip the first line of the input.
|
|
|
|
* @param boolean $skiplast Skip the last line of the input;
|
2017-12-03 19:12:56 +00:00
|
|
|
*
|
|
|
|
* @return string XML output
|
2023-10-18 07:26:30 +00:00
|
|
|
* @deprecated 3.3 Use CFactory::_('Utilities.Xml')->indent(...);
|
2017-12-03 19:12:56 +00:00
|
|
|
*/
|
2020-03-28 13:34:14 +00:00
|
|
|
public function xmlIndent($string, $char = ' ', $depth = 0,
|
2023-05-02 00:10:55 +00:00
|
|
|
$skipfirst = false, $skiplast = false
|
2020-03-28 13:34:14 +00:00
|
|
|
) {
|
2023-10-18 07:26:30 +00:00
|
|
|
return CFactory::_('Utilities.Xml')->indent($string, $char, $depth, $skipfirst, $skiplast);
|
2017-12-03 17:08:01 +00:00
|
|
|
}
|
2016-03-01 18:44:13 +00:00
|
|
|
}
|