Improved the export feature for all views, and much more... #581

Merged
Llewellyn merged 14 commits from staging into master 2020-08-08 13:38:06 +00:00
195 changed files with 4209 additions and 2190 deletions

View File

@ -12,7 +12,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.11.2) 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.11.3) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -144,13 +144,13 @@ TODO
+ *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*: 25th May, 2020
+ *Version*: 2.11.2
+ *Last Build*: 29th July, 2020
+ *Version*: 2.11.3
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **282168**
+ *Field count*: **1522**
+ *File count*: **1783**
+ *Line count*: **283076**
+ *Field count*: **1527**
+ *File count*: **1785**
+ *Folder count*: **295**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).

7
SECURITY.md Normal file
View File

@ -0,0 +1,7 @@
# Security Policy
## Reporting a Vulnerability
Report all security issues on the JCB website, and not on GitHub.
### [joomlacomponentbuilder.com/report-security-issues](http://joomlacomponentbuilder.com/report-security-issues)

View File

@ -12,7 +12,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.11.2) 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.11.3) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -144,13 +144,13 @@ TODO
+ *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*: 25th May, 2020
+ *Version*: 2.11.2
+ *Last Build*: 29th July, 2020
+ *Version*: 2.11.3
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **282168**
+ *Field count*: **1522**
+ *File count*: **1783**
+ *Line count*: **283076**
+ *Field count*: **1527**
+ *File count*: **1785**
+ *Folder count*: **295**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).

View File

@ -18,6 +18,7 @@ defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Language;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;###ADMIN_HELPER_CLASS_HEADER###

View File

@ -20,7 +20,7 @@ defined('_JEXEC') or die('Restricted access');
/**
* ###Component### ###View### Component Category Tree
*/
class ###Component######Views###Categories extends JCategories
class ###Component######View###Categories extends JCategories
{
/**
* Class constructor
@ -31,7 +31,7 @@ class ###Component######Views###Categories extends JCategories
public function __construct($options = array())
{
$options['table'] = '#__###component###_###view###';
$options['extension'] = 'com_###component###.###views###';
$options['extension'] = 'com_###component###.###view###';
parent::__construct($options);
}

View File

@ -18,6 +18,7 @@ defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Language;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;###SITE_HELPER_CLASS_HEADER###

View File

@ -17,9 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the ###JFORM_extends### field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('###JFORM_extends###');
###JFORM_TYPE_HEADER###
/**
* ###Type### Form Field class for the ###Component### component

View File

@ -24,9 +24,10 @@ JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tabstate');
JHtml::_('behavior.calendar');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<div class="###component###-###view###">
<?php echo $this->toolbar->render(); ?>
<form action="<?php echo JRoute::_('index.php?option=com_###component###&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
###EDITBODY###
</form>###EDITBODYSCRIPT###
</form>
</div>###EDITBODYSCRIPT###

View File

@ -0,0 +1,20 @@
<?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');
?>
###BOM###
// No direct access to this file
defined('JPATH_BASE') or die('Restricted access');###ADMIN_LAYOUT_CODE###
?>###ADMIN_LAYOUT_BODY###

View File

@ -376,6 +376,11 @@
"rename": "JFormRule",
"type": "rule"
},
"layout_admin.php": {
"path": "c0mp0n3nt/admin/layouts",
"rename": "layout_admin",
"type": "layout"
},
"layoutitems.php": {
"path": "c0mp0n3nt/admin/layouts/VIEW",
"rename": "layoutitems",

View File

@ -47,6 +47,71 @@
/>
<field type="spacer" name="spacerHistory" hr="true" />
<!-- Subform_layouts Field. Type: Subform. (joomla) -->
<field
type="subform"
name="subform_layouts"
label="COM_COMPONENTBUILDER_CONFIG_SUBFORM_LAYOUTS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
buttons="add,remove,move"
description="COM_COMPONENTBUILDER_CONFIG_SUBFORM_LAYOUTS_DESCRIPTION"
icon="list"
max="9"
min="1">
<form hidden="true" name="list_subform_layouts_modal" repeat="true">
<!-- View_field Field. Type: List. (joomla) -->
<field
type="list"
name="view_field"
label="COM_COMPONENTBUILDER_CONFIG_VIEW_FIELD_LABEL"
class="list_class"
multiple="false"
filter="CMD"
required="true"
default="default">
<!-- Option Set. -->
<option value="default">
COM_COMPONENTBUILDER_CONFIG_DEFAULT</option>
<option value="admin_custom_tabs.tabs">
COM_COMPONENTBUILDER_CONFIG_ADMIN_CUSTOM_TABS_TABS</option>
<option value="admin_fields.addfields">
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_ADDFIELDS</option>
<option value="admin_fields_conditions.addconditions">
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS</option>
<option value="admin_fields_relations.addrelations">
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_RELATIONS_ADDRELATIONS</option>
<option value="component_admin_views.addadmin_views">
COM_COMPONENTBUILDER_CONFIG_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS</option>
<option value="component_custom_admin_views.addcustom_admin_views">
COM_COMPONENTBUILDER_CONFIG_COMPONENT_CUSTOM_ADMIN_VIEWS_ADDCUSTOM_ADMIN_VIEWS</option>
<option value="component_site_views.addsite_views">
COM_COMPONENTBUILDER_CONFIG_COMPONENT_SITE_VIEWS_ADDSITE_VIEWS</option>
<option value="dynamic_get.join_db_table">
COM_COMPONENTBUILDER_CONFIG_DYNAMIC_GET_JOIN_DB_TABLE</option>
<option value="dynamic_get.join_view_table">
COM_COMPONENTBUILDER_CONFIG_DYNAMIC_GET_JOIN_VIEW_TABLE</option>
</field>
<!-- Layout Field. Type: List. (joomla) -->
<field
type="list"
name="layout"
label="COM_COMPONENTBUILDER_CONFIG_LAYOUT_LABEL"
class="list_class"
multiple="false"
filter="CMD"
required="true"
default="joomla.form.field.subform.repeatable-table">
<!-- Option Set. -->
<option value="joomla.form.field.subform.repeatable-table">
COM_COMPONENTBUILDER_CONFIG_REPEATABLETABLE_JOOMLA</option>
<option value="joomla.form.field.subform.repeatable">
COM_COMPONENTBUILDER_CONFIG_REPEATABLE_JOOMLA</option>
<option value="repeatablejcb">
COM_COMPONENTBUILDER_CONFIG_REPEATABLE_UIKIT</option>
</field>
</form>
</field>
<!-- Editor Field. Type: Plugins. (joomla) -->
<field
type="plugins"
@ -246,6 +311,20 @@
max="100"
step="10"
/>
<!-- Export_language_strings Field. Type: Radio. (joomla) -->
<field
type="radio"
name="export_language_strings"
label="COM_COMPONENTBUILDER_CONFIG_EXPORT_LANGUAGE_STRINGS_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_EXPORT_LANGUAGE_STRINGS_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option>
</field>
<!-- Spacer_hr_six Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_six" hr="true" class="spacer_hr_six" />
<!-- Compiler_field_builder_type Field. Type: List. (joomla) -->

View File

@ -111,7 +111,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeUpdateFiles
$this->triggerEvent(
'jcb_ce_onBeforeUpdateFiles',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// now update the files
if (!$this->updateFiles())
@ -121,7 +121,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeGetCustomCode
$this->triggerEvent(
'jcb_ce_onBeforeGetCustomCode',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// now insert into the new files
if ($this->getCustomCode())
@ -129,7 +129,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeAddCustomCode
$this->triggerEvent(
'jcb_ce_onBeforeAddCustomCode',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
$this->addCustomCode();
@ -137,7 +137,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeSetLangFileData
$this->triggerEvent(
'jcb_ce_onBeforeSetLangFileData',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// set the lang data now
$this->setLangFileData();

View File

@ -322,8 +322,8 @@ class Get
= array(
'Joomla' . '.JText._(',
'JText:' . ':script(',
'JText:' . ':_(',
'JText:' . ':sprintf(',
'Text:' . ':_(', // namespace and J version will be found
'Text:' . ':sprintf(', // namespace and J version will be found
'JustTEXT:' . ':_('
);
@ -835,7 +835,7 @@ class Get
}
}
// Trigger Event: jcb_ce_onBeforeGet
$this->triggerEvent('jcb_ce_onBeforeGet', array(&$config, $this));
$this->triggerEvent('jcb_ce_onBeforeGet', array(&$config, &$this));
// set the Joomla version
$this->joomlaVersion = $config['version'];
// set the minfy switch of the JavaScript
@ -923,14 +923,14 @@ class Get
// Trigger Event: jcb_ce_onBeforeGetComponentData
$this->triggerEvent(
'jcb_ce_onBeforeGetComponentData',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// get the component data
$this->componentData = $this->getComponentData();
// Trigger Event: jcb_ce_onAfterGetComponentData
$this->triggerEvent(
'jcb_ce_onAfterGetComponentData',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// make sure we have a version
if (strpos($this->componentData->component_version, '.')
@ -969,7 +969,7 @@ class Get
// Trigger Event: jcb_ce_onBeforeGet
$this->triggerEvent(
'jcb_ce_onAfterGet', array(&$this->componentContext, $this)
'jcb_ce_onAfterGet', array(&$this->componentContext, &$this)
);
return true;
@ -1201,7 +1201,7 @@ class Get
array(&$this->componentContext, &$component)
);
// set upater
// set updater
$updater = array(
'unique' => array(
'addadmin_views' => array('table' => 'component_admin_views',
@ -1281,7 +1281,8 @@ class Get
);
// set the add targets
$addArrayF = array('files' => 'files', 'folders' => 'folders',
$addArrayF = array('files' => 'files',
'folders' => 'folders',
'filesfullpath' => 'files',
'foldersfullpath' => 'folders');
foreach ($addArrayF as $addTarget => $targetHere)
@ -1413,6 +1414,8 @@ class Get
? json_decode($component->addadmin_views, true) : null;
if (ComponentbuilderHelper::checkArray($component->addadmin_views))
{
$this->lang = 'admin';
$this->target = 'admin';
// sort the views according to order
usort(
$component->addadmin_views, function ($a, $b) {
@ -2923,6 +2926,10 @@ class Get
false,
$guiMapper
);
// check if we have template or layouts to load
$this->setTemplateAndLayoutData($view->{$scripter}, $name_single);
unset($view->{$scripter});
}
}
@ -2953,6 +2960,9 @@ class Get
),
$guiMapper
);
// check if we have template or layouts to load
$this->setTemplateAndLayoutData($view->{$button_code_field}, $name_single);
}
}
// set the button array
@ -3045,6 +3055,7 @@ class Get
$name_single,
$guiMapper
);
if ($addAjaxSite)
{
$this->setCustomScriptBuilder(
@ -4988,6 +4999,8 @@ class Get
{
$script = $this->setGuiCodePlaceholder($script, $config);
}
// add base64 locking option of a string
$script = $this->setBase64LOCK($script);
// load the script
if ($first && $second && $third)
{
@ -8716,6 +8729,8 @@ class Get
'php_method');
$addScriptTypes = array('install', 'update',
'uninstall');
// the next are php placeholders
$guiMapper['type'] = 'php';
foreach ($addScriptMethods as $scriptMethod)
{
foreach ($addScriptTypes as $scriptType)
@ -9851,7 +9866,7 @@ class Get
*/
protected function customCodeFactory(&$paths, &$today)
{
// we must first store the current woking directory
// we must first store the current working directory
$joomla = getcwd();
$counter = array(1 => 0, 2 => 0);
// file types to get
@ -10337,6 +10352,35 @@ class Get
}
}
/**
* Lock a string with bsae64 (basic)
*
* @param string $string The code string
*
* @return string
*
*/
protected function setBase64LOCK($script)
{
if (strpos($script, 'LOCKBASE64((((') !== false)
{
// get the strings
$values = ComponentbuilderHelper::getAllBetween($script, 'LOCKBASE64((((', '))))');
$locker = array();
// convert them
foreach($values as $value)
{
$locker['LOCKBASE64((((' . $value . '))))'] = "base64_decode( preg_replace('/\s+/', ''," .
PHP_EOL . $this->_t(2) . "'" .
wordwrap(base64_encode($value), 64, PHP_EOL . $this->_t(2), true) .
"'))";
}
// update the script
return $this->setPlaceholders($script, $locker);
}
return $script;
}
/**
* Set the JCB GUI code placeholder
*

View File

@ -2556,7 +2556,8 @@ class Structure extends Get
public function moveFieldsRules($field, $path)
{
// check if we have a subform or repeatable field
if ($field['type_name'] === 'subform' || $field['type_name'] === 'repeatable')
if ($field['type_name'] === 'subform'
|| $field['type_name'] === 'repeatable')
{
// since we could have a custom field or rule inside
$this->moveMultiFieldsRules($field, $path);
@ -2624,7 +2625,7 @@ class Structure extends Get
* move the fields and Rules of multi fields
*
* @param array $multi_field The field data
* @param string $path The path to move to
* @param string $path The path to move to
*
* @return void
*
@ -2632,13 +2633,19 @@ class Structure extends Get
protected function moveMultiFieldsRules($multi_field, $path)
{
// get the fields ids
$ids = array_map( 'trim', explode(',', ComponentbuilderHelper::getBetween($multi_field['settings']->xml, 'fields="', '"')));
$ids = array_map(
'trim', explode(
',', ComponentbuilderHelper::getBetween(
$multi_field['settings']->xml, 'fields="', '"'
)
)
);
if (ComponentbuilderHelper::checkArray($ids))
{
foreach ($ids as $id)
{
// setup the field
$field = array();
$field = array();
$field['field'] = $id;
$this->setFieldDetails($field);
// move field and rules if needed
@ -2835,10 +2842,24 @@ class Structure extends Get
{
$path = $details->path;
}
$zipPath = str_replace('c0mp0n3nt/', '', $path);
$path = str_replace(
'c0mp0n3nt/', $this->componentPath . '/', $path
);
// make sure we have component to replace
if (strpos($path, 'c0mp0n3nt') !== false)
{
$zipPath = str_replace('c0mp0n3nt/', '', $path);
$path = str_replace(
'c0mp0n3nt/', $this->componentPath . '/', $path
);
}
else
{
$this->app->enqueueMessage(
JText::sprintf(
'<hr /><h3>c0mp0n3nt issue found</h3><p>The path (%s) could not be used.</p>',
$path
), 'Error'
);
continue;
}
// setup the folder
if (!JFolder::exists($path))
@ -2878,7 +2899,7 @@ class Structure extends Get
// move the file to its place
JFile::copy(
$this->templatePath . '/' . $item,
$path . '/' . $new, '', true
$path . '/' . $new
);
// count the file created
$this->fileCount++;
@ -2934,9 +2955,10 @@ class Structure extends Get
'rename' => 1);
$this->componentData->folders[] = $importView;
// move the phpspreadsheet Folder (TODO we must move this to a library package)
$PHPExcel = array('folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor',
'path' => '/libraries/phpspreadsheet/',
'rename' => 0);
$PHPExcel
= array('folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor',
'path' => '/libraries/phpspreadsheet/',
'rename' => 0);
$this->componentData->folders[] = $PHPExcel;
}
if (2 == $this->uikit || 1 == $this->uikit)

View File

@ -2328,6 +2328,7 @@ class Fields extends Structure
. ComponentbuilderHelper::safeString($typeName, 'F')
. ". (custom) -->";
$field .= PHP_EOL . $this->_t(2) . $taber . "<field";
$optionSet = '';
foreach ($fieldAttributes as $property => $value)
{
if ($property != 'option')
@ -2335,8 +2336,274 @@ class Fields extends Structure
$field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1)
. $property . '="' . $value . '"';
}
elseif ($property === 'option')
{
$optionSet = '';
if (strtolower($typeName) === 'groupedlist'
&& strpos(
$value, ','
) !== false
&& strpos($value, '@@') !== false)
{
// reset the group temp arrays
$groups_ = array();
$grouped_ = array('group' => array(),
'option' => array());
$order_ = array();
// mulitpal options
$options = explode(',', $value);
foreach ($options as $option)
{
if (strpos($option, '@@') !== false)
{
// set the group label
$valueKeyArray = explode('@@', $option);
if (count((array) $valueKeyArray) == 2)
{
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$valueKeyArray[0], true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue,
$valueKeyArray[0]
);
// now add group label
$groups_[$valueKeyArray[1]] = PHP_EOL
. $this->_t(1) . $taber . $this->_t(2)
. '<group label="' . $langValue . '">';
// set order
$order_['group' . $valueKeyArray[1]]
= $valueKeyArray[1];
}
}
elseif (strpos($option, '|') !== false)
{
// has other value then text
$valueKeyArray = explode('|', $option);
if (count((array) $valueKeyArray) == 3)
{
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$valueKeyArray[1], true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue,
$valueKeyArray[1]
);
// now add to option set
$grouped_['group'][$valueKeyArray[2]][]
= PHP_EOL . $this->_t(1) . $taber
. $this->_t(3) . '<option value="'
. $valueKeyArray[0] . '">' . PHP_EOL
. $this->_t(1) . $taber . $this->_t(4)
. $langValue . '</option>';
$optionArray[$valueKeyArray[0]]
= $langValue;
// set order
$order_['group' . $valueKeyArray[2]]
= $valueKeyArray[2];
}
else
{
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$valueKeyArray[1], true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue,
$valueKeyArray[1]
);
// now add to option set
$grouped_['option'][$valueKeyArray[0]]
= PHP_EOL . $this->_t(1) . $taber
. $this->_t(2) . '<option value="'
. $valueKeyArray[0] . '">' . PHP_EOL
. $this->_t(1) . $taber . $this->_t(3)
. $langValue . '</option>';
$optionArray[$valueKeyArray[0]]
= $langValue;
// set order
$order_['option' . $valueKeyArray[0]]
= $valueKeyArray[0];
}
}
else
{
// text is also the value
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$option, true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue, $option
);
// now add to option set
$grouped_['option'][$option] = PHP_EOL
. $this->_t(1) . $taber . $this->_t(2)
. '<option value="' . $option . '">'
. PHP_EOL . $this->_t(1) . $taber
. $this->_t(3) . $langValue . '</option>';
$optionArray[$option] = $langValue;
// set order
$order_['option' . $option] = $option;
}
}
// now build the groups
foreach ($order_ as $pointer_ => $_id)
{
// load the default key
$key_ = 'group';
if (strpos($pointer_, 'option') !== false)
{
// load the option field
$key_ = 'option';
}
// check if this is a group loader
if ('group' === $key_ && isset($groups_[$_id])
&& isset($grouped_[$key_][$_id])
&& ComponentbuilderHelper::checkArray(
$grouped_[$key_][$_id]
))
{
// set group label
$optionSet .= $groups_[$_id];
foreach ($grouped_[$key_][$_id] as $option_)
{
$optionSet .= $option_;
}
unset($groups_[$_id]);
unset($grouped_[$key_][$_id]);
// close the group
$optionSet .= PHP_EOL . $this->_t(1) . $taber
. $this->_t(2) . '</group>';
}
elseif (isset($grouped_[$key_][$_id])
&& ComponentbuilderHelper::checkString(
$grouped_[$key_][$_id]
))
{
$optionSet .= $grouped_[$key_][$_id];
}
}
}
elseif (strpos($value, ',') !== false)
{
// mulitpal options
$options = explode(',', $value);
foreach ($options as $option)
{
if (strpos($option, '|') !== false)
{
// has other value then text
list($v, $t) = explode('|', $option);
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$t, true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue, $t
);
// now add to option set
$optionSet .= PHP_EOL . $this->_t(1)
. $taber . $this->_t(2) . '<option value="'
. $v . '">' . PHP_EOL . $this->_t(1)
. $taber . $this->_t(3) . $langValue
. '</option>';
$optionArray[$v] = $langValue;
}
else
{
// text is also the value
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$option, true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue, $option
);
// now add to option set
$optionSet .= PHP_EOL . $this->_t(2)
. $taber . $this->_t(1) . '<option value="'
. $option . '">' . PHP_EOL . $this->_t(2)
. $taber . $this->_t(2) . $langValue
. '</option>';
$optionArray[$option] = $langValue;
}
}
}
else
{
// one option
if (strpos($value, '|') !== false)
{
// has other value then text
list($v, $t) = explode('|', $value);
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$t, true
);
// add to lang array
$this->setLangContent($this->lang, $langValue, $t);
// now add to option set
$optionSet .= PHP_EOL . $this->_t(2) . $taber
. $this->_t(1) . '<option value="' . $v . '">'
. PHP_EOL . $this->_t(2) . $taber . $this->_t(2)
. $langValue . '</option>';
$optionArray[$v] = $langValue;
}
else
{
// text is also the value
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$value, true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue, $value
);
// now add to option set
$optionSet .= PHP_EOL . $this->_t(2)
. $taber . $this->_t(1) . '<option value="'
. $value . '">' . PHP_EOL . $this->_t(2)
. $taber . $this->_t(2) . $langValue
. '</option>';
$optionArray[$value] = $langValue;
}
}
}
}
// if options were found
if (ComponentbuilderHelper::checkString($optionSet))
{
$field .= '>';
$field .= PHP_EOL . $this->_t(3) . $taber . "<!--"
. $this->setLine(__LINE__) . " Option Set. -->";
$field .= $optionSet;
$field .= PHP_EOL . $this->_t(2) . $taber . "</field>";
}
// if no options found and must have a list of options
elseif (ComponentbuilderHelper::fieldCheck($typeName, 'list'))
{
$optionArray = false;
$field .= PHP_EOL . $this->_t(2) . $taber . "/>";
$field .= PHP_EOL . $this->_t(2) . $taber . "<!--"
. $this->setLine(__LINE__)
. " No Manual Options Were Added In Field Settings. -->"
. PHP_EOL;
}
else
{
$optionArray = false;
$field .= PHP_EOL . $this->_t(2) . $taber . "/>";
}
$field .= PHP_EOL . $this->_t(2) . $taber . "/>";
// incase the field is in the config and has not been set
if ('config' === $view_name_single && 'configs' === $view_name_list
|| (strpos($view_name_single, 'P|uG!n') !== false
@ -3083,6 +3350,244 @@ class Fields extends Structure
{
$field->fieldXML->addAttribute($property, $value);
}
elseif ($property === 'option')
{
ComponentbuilderHelper::xmlComment(
$field->fieldXML,
$this->setLine(__LINE__) . " Option Set."
);
if (strtolower($typeName) === 'groupedlist'
&& strpos(
$value, ','
) !== false
&& strpos($value, '@@') !== false)
{
// reset the group temp arrays
$groups_ = array();
$grouped_ = array('group' => array(),
'option' => array());
$order_ = array();
// mulitpal options
$options = explode(',', $value);
foreach ($options as $option)
{
if (strpos($option, '@@') !== false)
{
// set the group label
$valueKeyArray = explode('@@', $option);
if (count((array) $valueKeyArray) == 2)
{
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$valueKeyArray[0], true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue,
$valueKeyArray[0]
);
// now add group label
$groups_[$valueKeyArray[1]] = $langValue;
// set order
$order_['group' . $valueKeyArray[1]]
= $valueKeyArray[1];
}
}
elseif (strpos($option, '|') !== false)
{
// has other value then text
$valueKeyArray = explode('|', $option);
if (count((array) $valueKeyArray) == 3)
{
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$valueKeyArray[1], true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue,
$valueKeyArray[1]
);
// now add to option set
$grouped_['group'][$valueKeyArray[2]][]
= array('value' => $valueKeyArray[0],
'text' => $langValue);
$optionArray[$valueKeyArray[0]]
= $langValue;
// set order
$order_['group' . $valueKeyArray[2]]
= $valueKeyArray[2];
}
else
{
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$valueKeyArray[1], true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue,
$valueKeyArray[1]
);
// now add to option set
$grouped_['option'][$valueKeyArray[0]]
= array('value' => $valueKeyArray[0],
'text' => $langValue);
$optionArray[$valueKeyArray[0]]
= $langValue;
// set order
$order_['option' . $valueKeyArray[0]]
= $valueKeyArray[0];
}
}
else
{
// text is also the value
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$option, true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue, $option
);
// now add to option set
$grouped_['option'][$option]
= array('value' => $option,
'text' => $langValue);
$optionArray[$option] = $langValue;
// set order
$order_['option' . $option] = $option;
}
}
// now build the groups
foreach ($order_ as $pointer_ => $_id)
{
// load the default key
$key_ = 'group';
if (strpos($pointer_, 'option') !== false)
{
// load the option field
$key_ = 'option';
}
// check if this is a group loader
if ('group' === $key_ && isset($groups_[$_id])
&& isset($grouped_[$key_][$_id])
&& ComponentbuilderHelper::checkArray(
$grouped_[$key_][$_id]
))
{
// set group label
$groupXML = $field->fieldXML->addChild('group');
$groupXML->addAttribute(
'label', $groups_[$_id]
);
foreach ($grouped_[$key_][$_id] as $option_)
{
$groupOptionXML = $groupXML->addChild(
'option'
);
$groupOptionXML->addAttribute(
'value', $option_['value']
);
$groupOptionXML[] = $option_['text'];
}
unset($groups_[$_id]);
unset($grouped_[$key_][$_id]);
}
elseif (isset($grouped_[$key_][$_id])
&& ComponentbuilderHelper::checkString(
$grouped_[$key_][$_id]
))
{
$optionXML = $field->fieldXML->addChild(
'option'
);
$optionXML->addAttribute(
'value', $grouped_[$key_][$_id]['value']
);
$optionXML[] = $grouped_[$key_][$_id]['text'];
}
}
}
elseif (strpos($value, ',') !== false)
{
// mulitpal options
$options = explode(',', $value);
foreach ($options as $option)
{
$optionXML = $field->fieldXML->addChild('option');
if (strpos($option, '|') !== false)
{
// has other value then text
list($v, $t) = explode('|', $option);
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$t, true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue, $t
);
// now add to option set
$optionXML->addAttribute('value', $v);
$optionArray[$v] = $langValue;
}
else
{
// text is also the value
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$option, true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue, $option
);
// now add to option set
$optionXML->addAttribute('value', $option);
$optionArray[$option] = $langValue;
}
$optionXML[] = $langValue;
}
}
else
{
// one option
$optionXML = $field->fieldXML->addChild('option');
if (strpos($value, '|') !== false)
{
// has other value then text
list($v, $t) = explode('|', $value);
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$t, true
);
// add to lang array
$this->setLangContent($this->lang, $langValue, $t);
// now add to option set
$optionXML->addAttribute('value', $v);
$optionArray[$v] = $langValue;
}
else
{
// text is also the value
$langValue = $langView . '_'
. ComponentbuilderHelper::safeFieldName(
$value, true
);
// add to lang array
$this->setLangContent(
$this->lang, $langValue, $value
);
// now add to option set
$optionXML->addAttribute('value', $value);
$optionArray[$value] = $langValue;
}
$optionXML[] = $langValue;
}
}
}
// incase the field is in the config and has not been set (or is part of a plugin or module)
if (('config' === $view_name_single
@ -3636,10 +4141,6 @@ class Fields extends Structure
{
$xmlValue = 'JGLOBAL_TITLE';
}
elseif ($property['name'] === 'description')
{
$xmlValue = 'JFIELD_TITLE_DESC';
}
}
// only load value if found or is mandatory
if (ComponentbuilderHelper::checkString($xmlValue)
@ -3689,7 +4190,7 @@ class Fields extends Structure
= '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB';
foreach ($phpTracker as $searchKey => $phpKey)
{
// we must search for more code in the xml just incase
// we must search for more code in the xml just encase
foreach (range(2, 30) as $phpLine)
{
$get_ = $searchKey . '_' . $phpLine;
@ -4112,7 +4613,7 @@ class Fields extends Structure
{
$this->setScriptMediaSwitch[$typeName] = $typeName;
}
// setup gategory for this view
// setup category for this view
if ($dbSwitch && $typeName === 'category')
{
if (isset($this->catOtherName[$view_name_list])
@ -4134,13 +4635,41 @@ class Fields extends Structure
$field['settings']->xml, 'extension="', '"'
), $this->placeholders
);
// if they left out the extention for some reason
// if they left out the extension for some reason
if (!ComponentbuilderHelper::checkString($_extension))
{
$_extension = 'com_' . $this->componentCodeName . '.'
. $otherView;
}
// load the category builder
// check the context (does our target match)
if (strpos($_extension, '.') !== false)
{
$target_view = trim(explode('.', $_extension)[1]);
// from my understanding the target extension view and the otherView must align
// so I will here check that it does, and if not raise an error message to fix this
if ($target_view !== $otherView)
{
$target_extension = trim(explode('.', $_extension)[0]);
$correction = $target_extension . '.' . $otherView;
$this->app->enqueueMessage(
JText::sprintf(
'<hr /><h3>Category targeting view mismatch</h3>
<a>The <a href="index.php?option=com_componentbuilder&view=fields&task=field.edit&id=%s" target="_blank" title="open field">
category field</a> in <b>(%s) admin view</b> has a mismatching target view.
<br />To correct the mismatch, the <b>extension</b> value <code>%s</code> in the <a href="index.php?option=com_componentbuilder&view=fields&task=field.edit&id=%s" target="_blank" title="open category field">
field</a> must be changed to <code>%s</code>
for <a href="https://github.com/vdm-io/Joomla-Component-Builder/issues/561" target="_blank" title="view issue on gitHub">
best category integration with Joomla</a>.
<br /><b>Please watch <a href="https://youtu.be/R4WQgcu6Xns" target="_blank" title="very important info on the topic">
this tutorial</a> before proceeding!!!</b>,
<a href="https://gist.github.com/Llewellynvdm/e053dc39ae3b2bf769c76a3e62c75b95" target="_blank" title="first watch the tutorial to understand how to use this code">code fix</a></p>',
$field['field'], $view_name_single, $_extension,
$field['field'], $correction
), 'Error'
);
}
}
// load the category builder - TODO must move all to single view
$this->categoryBuilder[$view_name_list] = array('code' => $name,
'name' => $listLangName,
'extension' => $_extension);
@ -4345,15 +4874,15 @@ class Fields extends Structure
&& $typeName != 'repeatable'
&& $typeName != 'subform'))
{
$this->filterBuilder[$view_name_list][] = array('type' => $typeName,
'code' => $name,
'lang' => $listLangName,
'database' => $view_name_single,
'function' => ComponentbuilderHelper::safeString(
$this->filterBuilder[$view_name_list][] = array('type' => $typeName,
'code' => $name,
'lang' => $listLangName,
'database' => $view_name_single,
'function' => ComponentbuilderHelper::safeString(
$name, 'F'
),
'custom' => $custom,
'options' => $options);
'custom' => $custom,
'options' => $options);
}
// build the layout
@ -4418,21 +4947,20 @@ class Fields extends Structure
);
// set the [[[PLACEHOLDER]]] options
$replace = array(
$this->bbb . 'JPREFIX' . $this->ddd => $jprefix,
$this->bbb . 'JPREFIX' . $this->ddd => $jprefix,
$this->bbb . 'TABLE'
. $this->ddd => $data['custom']['table'],
. $this->ddd => (isset($data['custom']['table'])) ? $data['custom']['table'] :'',
$this->bbb . 'ID'
. $this->ddd => $data['custom']['id'],
. $this->ddd => (isset($data['custom']['id'])) ? $data['custom']['id'] :'',
$this->bbb . 'TEXT'
. $this->ddd => $data['custom']['text'],
$this->bbb . 'CODE_TEXT' . $this->ddd => $data['code'] . '_'
. $data['custom']['text'],
$this->bbb . 'CODE' . $this->ddd => $data['code'],
$this->bbb . 'view_type' . $this->ddd => $view_name_single
. $this->ddd => (isset($data['custom']['text'])) ? $data['custom']['text'] :'',
$this->bbb . 'CODE_TEXT' . $this->ddd => (isset($data['code'], $data['custom']['text'])) ? $data['code'] . '_' . $data['custom']['text'] :'',
$this->bbb . 'CODE' . $this->ddd => (isset($data['code'])) ? $data['code'] :'',
$this->bbb . 'view_type' . $this->ddd => $view_name_single
. '_' . $data['type'],
$this->bbb . 'type' . $this->ddd => $data['type'],
$this->bbb . 'type' . $this->ddd => (isset($data['type'])) ? $data['type'] :'',
$this->bbb . 'com_component'
. $this->ddd => (isset($data['custom']['component'])
. $this->ddd => (isset($data['custom']['component'])
&& ComponentbuilderHelper::checkString(
$data['custom']['component']
)) ? ComponentbuilderHelper::safeString(
@ -4440,19 +4968,19 @@ class Fields extends Structure
) : 'com_' . $this->componentCodeName,
// set the generic values
$this->bbb . 'component'
. $this->ddd => $this->componentCodeName,
. $this->ddd => $this->componentCodeName,
$this->bbb . 'Component'
. $this->ddd => $this->fileContentStatic[$this->hhh
. $this->ddd => $this->fileContentStatic[$this->hhh
. 'Component' . $this->hhh],
$this->bbb . 'view'
. $this->ddd => (isset($data['custom']['view'])
. $this->ddd => (isset($data['custom']['view'])
&& ComponentbuilderHelper::checkString(
$data['custom']['view']
)) ? ComponentbuilderHelper::safeString(
$data['custom']['view']
) : $view_name_single,
$this->bbb . 'views'
. $this->ddd => (isset($data['custom']['views'])
. $this->ddd => (isset($data['custom']['views'])
&& ComponentbuilderHelper::checkString(
$data['custom']['views']
)) ? ComponentbuilderHelper::safeString(
@ -4520,12 +5048,21 @@ class Fields extends Structure
$this->buildDynamique(
$target, 'fieldcustom', $data['custom']['type']
);
// get the extends name
$JFORM_extends = ComponentbuilderHelper::safeString(
$data['custom']['extends']
);
// JFORM_TYPE_HEADER <<<DYNAMIC>>>
$add_default_header = true;
$this->fileContentDynamic['customfield_'
. $data['type']][$this->hhh . 'JFORM_TYPE_HEADER' . $this->hhh]
= "//" . $this->setLine(
__LINE__
) . " Import the " . $JFORM_extends . " field type classes needed";
// JFORM_extens <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_'
. $data['type']][$this->hhh . 'JFORM_extends' . $this->hhh]
= ComponentbuilderHelper::safeString(
$data['custom']['extends']
);
= $JFORM_extends;
// JFORM_EXTENDS <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_'
. $data['type']][$this->hhh . 'JFORM_EXTENDS' . $this->hhh]
@ -4558,15 +5095,56 @@ class Fields extends Structure
);
}
}
// JFORM_TYPE_PHP <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_'
. $data['type']][$this->hhh . 'JFORM_TYPE_PHP'
. $this->hhh]
.= PHP_EOL . $this->setPlaceholders(
$phpBucket, $replace
);
// check if this is header text
if('HEADER' === $x)
{
$this->fileContentDynamic['customfield_'
. $data['type']][$this->hhh . 'JFORM_TYPE_HEADER'
. $this->hhh]
.= PHP_EOL . $this->setPlaceholders(
$phpBucket, $replace
);
// stop default headers from loading
$add_default_header = false;
}
else
{
// JFORM_TYPE_PHP <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_'
. $data['type']][$this->hhh . 'JFORM_TYPE_PHP'
. $this->hhh]
.= PHP_EOL . $this->setPlaceholders(
$phpBucket, $replace
);
}
}
}
// check if we should add default header
if ($add_default_header)
{
$this->fileContentDynamic['customfield_'
. $data['type']][$this->hhh . 'JFORM_TYPE_HEADER'
. $this->hhh]
.= PHP_EOL . "jimport('joomla.form.helper');";
$this->fileContentDynamic['customfield_'
. $data['type']][$this->hhh . 'JFORM_TYPE_HEADER'
. $this->hhh]
.= PHP_EOL . "JFormHelper::loadFieldClass('"
. $JFORM_extends . "');";
}
// check the the JFormHelper::loadFieldClass(..) was set
elseif (strpos(
$this->fileContentDynamic['customfield_'
. $data['type']][$this->hhh . 'JFORM_TYPE_HEADER'
. $this->hhh], 'JFormHelper::loadFieldClass('
) === false)
{
$this->fileContentDynamic['customfield_'
. $data['type']][$this->hhh . 'JFORM_TYPE_HEADER'
. $this->hhh]
.= PHP_EOL . "JFormHelper::loadFieldClass('"
. $JFORM_extends . "');";
}
}
else
{

View File

@ -1637,6 +1637,9 @@ class Interpretation extends Fields
$exel[] = $this->_t(3) . "->setLastModifiedBy(\$modified)";
$exel[] = $this->_t(3) . "->setTitle(\$title)";
$exel[] = $this->_t(3) . "->setSubject(\$subjectTab);";
$exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " The file type";
$exel[] = $this->_t(2) . "\$file_type = 'Xls';";
$exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " set description";
$exel[] = $this->_t(2) . "if (\$description)";
@ -1682,27 +1685,52 @@ class Interpretation extends Fields
$exel[] = $this->_t(2) . "));";
$exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Add some data";
$exel[] = $this->_t(2) . "if (self::checkArray(\$rows))";
$exel[] = $this->_t(2) . "if ((\$size = self::checkArray(\$rows)) !== false)";
$exel[] = $this->_t(2) . "{";
$exel[] = $this->_t(3) . "\$i = 1;";
$exel[] = $this->_t(3) . "foreach (\$rows as \$array){";
$exel[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Based on data size we adapt the behaviour.";
$exel[] = $this->_t(3) . "\$xls_mode = 1;";
$exel[] = $this->_t(3) . "if (\$size > 3000)";
$exel[] = $this->_t(3) . "{";
$exel[] = $this->_t(4) . "\$xls_mode = 3;";
$exel[] = $this->_t(4) . "\$file_type = 'Csv';";
$exel[] = $this->_t(3) . "}";
$exel[] = $this->_t(3) . "elseif (\$size > 2000)";
$exel[] = $this->_t(3) . "{";
$exel[] = $this->_t(4) . "\$xls_mode = 2;";
$exel[] = $this->_t(3) . "}";
$exel[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Set active sheet and get it.";
$exel[] = $this->_t(3) . "\$active_sheet = \$spreadsheet->setActiveSheetIndex(0);";
$exel[] = $this->_t(3) . "foreach (\$rows as \$array)";
$exel[] = $this->_t(3) . "{";
$exel[] = $this->_t(4) . "\$a = 'A';";
$exel[] = $this->_t(4) . "foreach (\$array as \$value){";
$exel[] = $this->_t(4) . "foreach (\$array as \$value)";
$exel[] = $this->_t(4) . "{";
$exel[] = $this->_t(5)
. "\$spreadsheet->setActiveSheetIndex(0)->setCellValue(\$a.\$i, \$value);";
$exel[] = $this->_t(5) . "if (\$i == 1){";
$exel[] = $this->_t(6)
. "\$spreadsheet->getActiveSheet()->getColumnDimension(\$a)->setAutoSize(true);";
$exel[] = $this->_t(6)
. "\$spreadsheet->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$headerStyles);";
$exel[] = $this->_t(6)
. "\$spreadsheet->getActiveSheet()->getStyle(\$a.\$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);";
$exel[] = $this->_t(5) . "} elseif (\$a === 'A'){";
$exel[] = $this->_t(6)
. "\$spreadsheet->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$sideStyles);";
$exel[] = $this->_t(5) . "} else {";
$exel[] = $this->_t(6)
. "\$spreadsheet->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$normalStyles);";
. "\$active_sheet->setCellValue(\$a.\$i, \$value);";
$exel[] = $this->_t(5) . "if (\$xls_mode != 3)";
$exel[] = $this->_t(5) . "{";
$exel[] = $this->_t(6) . "if (\$i == 1)";
$exel[] = $this->_t(6) . "{";
$exel[] = $this->_t(7)
. "\$active_sheet->getColumnDimension(\$a)->setAutoSize(true);";
$exel[] = $this->_t(7)
. "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$headerStyles);";
$exel[] = $this->_t(7)
. "\$active_sheet->getStyle(\$a.\$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);";
$exel[] = $this->_t(6) . "}";
$exel[] = $this->_t(6) . "elseif (\$a === 'A')";
$exel[] = $this->_t(6) . "{";
$exel[] = $this->_t(7)
. "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$sideStyles);";
$exel[] = $this->_t(6) . "}";
$exel[] = $this->_t(6) . "elseif (\$xls_mode == 1)";
$exel[] = $this->_t(6) . "{";
$exel[] = $this->_t(7)
. "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$normalStyles);";
$exel[] = $this->_t(6) . "}";
$exel[] = $this->_t(5) . "}";
$exel[] = $this->_t(5) . "\$a++;";
$exel[] = $this->_t(4) . "}";
@ -1725,7 +1753,7 @@ class Interpretation extends Fields
$exel[] = $this->_t(2)
. "header('Content-Type: application/vnd.ms-excel');";
$exel[] = $this->_t(2)
. "header('Content-Disposition: attachment;filename=\"'.\$fileName.'.xls\"');";
. "header('Content-Disposition: attachment;filename=\"' . \$fileName . '.' . strtolower(\$file_type) .'\"');";
$exel[] = $this->_t(2) . "header('Cache-Control: max-age=0');";
$exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " If you're serving to IE 9, then the following may be needed";
@ -1744,7 +1772,7 @@ class Interpretation extends Fields
$exel[] = $this->_t(2) . "header ('Pragma: public'); //"
. $this->setLine(__LINE__) . " HTTP/1.0";
$exel[] = PHP_EOL . $this->_t(2)
. "\$writer = IOFactory::createWriter(\$spreadsheet, 'Xls');";
. "\$writer = IOFactory::createWriter(\$spreadsheet, \$file_type);";
$exel[] = $this->_t(2) . "\$writer->save('php://output');";
$exel[] = $this->_t(2) . "jexit();";
$exel[] = $this->_t(1) . "}";
@ -1849,10 +1877,38 @@ class Interpretation extends Fields
$method = array();
$method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
$method[] = $this->_t(1) . " * Greate user and update given table";
$method[] = $this->_t(1) . " *";
$method[] = $this->_t(1) . " * @param array \$credentials Array('name' => string, 'username' => string, 'email' => string, 'password' => string, 'password2' => string)";
$method[] = $this->_t(1) . " * @param int \$autologin";
$method[] = $this->_t(1) . " * @param array \$params Array('useractivation' => int, 'sendpassword' => int, 'allowUserRegistration' => int)";
$method[] = $this->_t(1) . " * @param array \$mode 1 = Site Registrations; 0 = Admin Registration; 2 = Custom Helper Method Called registerUser";
$method[] = $this->_t(1) . " *";
$method[] = $this->_t(1) . " * @return int|Error User ID on success, or an error.";
$method[] = $this->_t(1) . " */";
$method[] = $this->_t(1)
. "public static function createUser(\$new)";
. "public static function createUser(\$credentials, \$autologin = 0,";
$method[] = $this->_t(2) . "\$params = array(";
$method[] = $this->_t(3) . "'useractivation' => 0, 'sendpassword' => 1";
$method[] = $this->_t(2) . "), \$mode = 1";
$method[] = $this->_t(1) . ")";
$method[] = $this->_t(1) . "{";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Override mode";
$method[] = $this->_t(2) . "if (\$mode == 2 && method_exists(__CLASS__, 'registerUser'))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Update params";
$method[] = $this->_t(3) . "\$params['autologin'] = \$autologin;";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Now Register User";
$method[] = $this->_t(3) . "return self::registerUser(\$credentials, \$params);";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "elseif (\$mode == 2)";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Fallback to Site Registrations";
$method[] = $this->_t(3) . "\$mode = 1;";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " load the user component language files if there is an error.";
$method[] = $this->_t(2) . "\$lang = JFactory::getLanguage();";
@ -1864,75 +1920,159 @@ class Interpretation extends Fields
$method[] = $this->_t(2)
. "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " load the user regestration model";
$method[] = $this->_t(2)
. "\$model = self::getModel('registration', JPATH_ROOT. '/components/com_users', 'Users');";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " make sure no activation is needed";
$method[] = $this->_t(2)
. "\$useractivation = self::setParams('com_users','useractivation',0);";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " make sure password is send";
$method[] = $this->_t(2)
. "\$sendpassword = self::setParams('com_users','sendpassword',1);";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Check if password was set";
$method[] = $this->_t(2)
. "if (isset(\$new['password']) && isset(\$new['password2']) && self::checkString(\$new['password']) && self::checkString(\$new['password2']))";
. " Load the correct user model.";
$method[] = $this->_t(2) . "if (\$mode == 1) //" . $this->setLine(__LINE__)
. " 1 = Site Registrations";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Use the users passwords";
$method[] = $this->_t(3) . "\$password = \$new['password'];";
$method[] = $this->_t(3) . "\$password2 = \$new['password2'];";
. " Load the user site-registration model";
$method[] = $this->_t(3)
. "\$model = self::getModel('registration', \$base_dir . '/components/' . \$extension, 'Users');";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "else";
$method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__)
. " 0 = Admin Registration";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Set random password";
$method[] = $this->_t(3) . "\$password = self::randomkey(8);";
$method[] = $this->_t(3) . "\$password2 = \$password;";
. " Load the backend-user model";
$method[] = $this->_t(3)
. "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/' . \$extension, 'Users');";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " set username if not set";
. " Check if we have params/config";
$method[] = $this->_t(2) . "if (self::checkArray(\$params))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Make changes to user config";
$method[] = $this->_t(3)
. "foreach (\$params as \$param => \$set)";
$method[] = $this->_t(3) . "{";
$method[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
. " If you know of a better path, let me know";
$method[] = $this->_t(4)
."\$params[\$param] = self::setParams(\$extension, \$param, \$set);";
$method[] = $this->_t(3) . "}";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Set username to email if not set";
$method[] = $this->_t(2)
. "if (!isset(\$new['username']) || !self::checkString(\$new['username']))";
. "if (!isset(\$credentials['username']) || !self::checkString(\$credentials['username']))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3)
. "\$new['username'] = self::safeString(\$new['name']);";
. "\$credentials['username'] = \$credentials['email'];";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " linup new user data";
. " Lineup new user data array";
$method[] = $this->_t(2) . "\$data = array(";
$method[] = $this->_t(3) . "'username' => \$new['username'],";
$method[] = $this->_t(3) . "'name' => \$new['name'],";
$method[] = $this->_t(3) . "'email1' => \$new['email'],";
$method[] = $this->_t(3)
. "'password1' => \$password, // First password field";
$method[] = $this->_t(3)
. "'password2' => \$password2, // Confirm password field";
$method[] = $this->_t(3) . "'username' => \$credentials['username'],";
$method[] = $this->_t(3) . "'name' => \$credentials['name'],";
$method[] = $this->_t(3) . "'block' => 0 );";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " register the new user";
$method[] = $this->_t(2) . "\$userId = \$model->register(\$data);";
. " Added details based on mode";
$method[] = $this->_t(2) . "if (\$mode == 1) //". $this->setLine(__LINE__)
. " 1 = Site-registration mode";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "\$data['email1'] = \$credentials['email'];";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__)
. " 0 = Admin-registration mode";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "\$data['email'] = \$credentials['email'];";
$method[] = $this->_t(3) . "\$data['registerDate'] = JFactory::getDate()->toSql();";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " set activation back to default";
. " Check if password was set";
$method[] = $this->_t(2)
. "self::setParams('com_users','useractivation',\$useractivation);";
. "if (\$mode == 1 && (!isset(\$credentials['password']) || !isset(\$credentials['password2']) || !self::checkString(\$credentials['password']) || !self::checkString(\$credentials['password2'])))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Set random password when empty password was submitted,";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " when using the 1 = site-registration mode";
$method[] = $this->_t(3) . "\$credentials['password'] = self::randomkey(8);";
$method[] = $this->_t(3) . "\$credentials['password2'] = \$credentials['password'];";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " set send password back to default";
. " Now Add password if set";
$method[] = $this->_t(2)
. "self::setParams('com_users','sendpassword',\$sendpassword);";
. "if (isset(\$credentials['password']) && isset(\$credentials['password2']) && self::checkString(\$credentials['password']) && self::checkString(\$credentials['password2']))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "if (\$mode == 1) //". $this->setLine(__LINE__)
. " 1 = Site-registration mode";
$method[] = $this->_t(3) . "{";
$method[] = $this->_t(4) . "\$data['password1'] = \$credentials['password'];";
$method[] = $this->_t(3) . "}";
$method[] = $this->_t(3) . "else //" . $this->setLine(__LINE__)
. " 0 = Admin-registration mode";
$method[] = $this->_t(3) . "{";
$method[] = $this->_t(4) . "\$data['password'] = \$credentials['password'];";
$method[] = $this->_t(3) . "}";
$method[] = $this->_t(3) . "\$data['password2'] = \$credentials['password2'];";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Load the group/s value if set, only for Admin Registration (\$mode == 0)";
$method[] = $this->_t(2)
. "if (\$mode == 0 && isset(\$credentials['groups']) && self::checkArray(\$credentials['groups']))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3)
. "\$data['groups'] = \$credentials['groups'];";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Create the new user";
$method[] = $this->_t(2) . "if (\$mode == 1) //". $this->setLine(__LINE__)
. " 1 = Site-registration mode";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "\$userId = \$model->register(\$data);";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__)
. " 0 = Admin-registration mode";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "\$model->save(\$data);";
$method[] = $this->_t(3) . "\$userId = \$model->getState('user.id', 0);";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Check if we have params";
$method[] = $this->_t(2) . "if (self::checkArray(\$params))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Change user params/config back";
$method[] = $this->_t(3)
. "foreach (\$params as \$param => \$set)";
$method[] = $this->_t(3) . "{";
$method[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
. " If you know of a better path, let me know";
$method[] = $this->_t(4)
."self::setParams(\$extension, \$param, \$set);";
$method[] = $this->_t(3) . "}";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " if user is created";
$method[] = $this->_t(2) . "if (\$userId > 0)";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Auto Login if Needed";
$method[] = $this->_t(3) . "if (\$autologin && isset(\$credentials['password']))";
$method[] = $this->_t(3) . "{";
$method[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
. " Try to login";
$method[] = $this->_t(4) . "try{";
$method[] = $this->_t(5) . "JFactory::getApplication()->login(\$credentials);";
$method[] = $this->_t(4) . "} catch (Exception \$exception){";
$method[] = $this->_t(5) . "//" . $this->setLine(__LINE__)
. " Do noting for now, may want to set redirect.";
$method[] = $this->_t(4) . "}";
$method[] = $this->_t(3) . "}";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Return ID";
$method[] = $this->_t(3) . "return \$userId;";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "return \$model->getError();";
$method[] = $this->_t(1) . "}";
$method[] = PHP_EOL . $this->_t(1)
. "protected static function setParams(\$component,\$target,\$value)";
. "public static function setParams(\$component,\$target,\$value)";
$method[] = $this->_t(1) . "{";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Get the params and set the new values";
@ -1957,7 +2097,7 @@ class Interpretation extends Fields
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Execute the query";
$method[] = $this->_t(3) . "\$db->setQuery(\$query);";
$method[] = $this->_t(3) . "\$db->query();";
$method[] = $this->_t(3) . "\$db->execute();";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "return \$was;";
$method[] = $this->_t(1) . "}";
@ -1991,17 +2131,12 @@ class Interpretation extends Fields
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "// set username";
$method[] = $this->_t(2)
. "if (isset(\$new['username']) && self::checkString(\$new['username']))";
. "if (!isset(\$new['username']) || !self::checkString(\$new['username']))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3)
. "\$new['username'] = self::safeString(\$new['username']);";
. "\$new['username'] = \$new['email'];";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "else";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3)
. "\$new['username'] = self::safeString(\$new['name']);";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "// linup update user data";
$method[] = $this->_t(2) . "// lineup update user data";
$method[] = $this->_t(2) . "\$data = array(";
$method[] = $this->_t(3) . "'id' => \$new['id'],";
$method[] = $this->_t(3) . "'username' => \$new['username'],";
@ -3025,11 +3160,16 @@ class Interpretation extends Fields
. $ter['table_key'] . " " . $ter['operator']
. " (' . implode(',', \$array) . ')');";
$string .= PHP_EOL . $this->_t(2) . $tab . "}";
$string .= PHP_EOL . $this->_t(2) . $tab . "else";
$string .= PHP_EOL . $this->_t(2) . $tab . "{";
$string .= PHP_EOL . $this->_t(2) . $tab
. $this->_t(1) . "return false;";
$string .= PHP_EOL . $this->_t(2) . $tab . "}";
// check if empty is allowed
if (!isset($ter['empty']) || !$ter['empty'])
{
$string .= PHP_EOL . $this->_t(2) . $tab
. "else";
$string .= PHP_EOL . $this->_t(2) . $tab . "{";
$string .= PHP_EOL . $this->_t(2) . $tab
. $this->_t(1) . "return false;";
$string .= PHP_EOL . $this->_t(2) . $tab . "}";
}
}
else
{
@ -3058,11 +3198,16 @@ class Interpretation extends Fields
. $ter['table_key'] . " " . $ter['operator']
. " ' . \$checkValue);";
$string .= PHP_EOL . $this->_t(2) . $tab . "}";
$string .= PHP_EOL . $this->_t(2) . $tab . "else";
$string .= PHP_EOL . $this->_t(2) . $tab . "{";
$string .= PHP_EOL . $this->_t(2) . $tab
. $this->_t(1) . "return false;";
$string .= PHP_EOL . $this->_t(2) . $tab . "}";
// check if empty is allowed
if (!isset($ter['empty']) || !$ter['empty'])
{
$string .= PHP_EOL . $this->_t(2) . $tab
. "else";
$string .= PHP_EOL . $this->_t(2) . $tab . "{";
$string .= PHP_EOL . $this->_t(2) . $tab
. $this->_t(1) . "return false;";
$string .= PHP_EOL . $this->_t(2) . $tab . "}";
}
}
break;
case 9:
@ -5260,7 +5405,10 @@ class Interpretation extends Fields
. " this is where you want to load your module position";
$addModule[] = $this->_t(3)
. "\$modules = JModuleHelper::getModules(\$position);";
$addModule[] = $this->_t(3) . "if (\$modules)";
$addModule[] = $this->_t(3) . "if ("
. $this->fileContentStatic[$this->hhh . 'Component'
. $this->hhh]
. "Helper::checkArray(\$modules, true))";
$addModule[] = $this->_t(3) . "{";
$addModule[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
. " set the place holder";
@ -5521,7 +5669,8 @@ class Interpretation extends Fields
$buttons[] = $this->_t(1) . $tab . $this->_t(2)
. "JToolBarHelper::custom('" . $viewName . "."
. $custom_button['method'] . "', '"
. $custom_button['icomoon'] . "', '', '" . $keyLang
. $custom_button['icomoon'] . " custom-button-"
. strtolower($custom_button['method']) . "', '', '" . $keyLang
. "', false);";
$buttons[] = $this->_t(1) . $tab . $this->_t(1) . "}";
}
@ -5555,7 +5704,8 @@ class Interpretation extends Fields
) . $tab . $this->_t(1)
. "JToolBarHelper::custom('" . $viewsName . "."
. $custom_button['method'] . "', '"
. $custom_button['icomoon'] . "', '', '"
. $custom_button['icomoon'] . " custom-button-"
. strtolower($custom_button['method']) . "', '', '"
. $keyLang . "', false);";
$this->onlyFunctionButton[$viewsName][] = $this->_t(
1
@ -5575,7 +5725,8 @@ class Interpretation extends Fields
$buttons[] = $this->_t(1) . $tab . $this->_t(2)
. "JToolBarHelper::custom('" . $viewsName . "."
. $custom_button['method'] . "', '"
. $custom_button['icomoon'] . "', '', '"
. $custom_button['icomoon'] . " custom-button-"
. strtolower($custom_button['method']) . "', '', '"
. $keyLang . "', '" . $validateSelection
. "');";
$buttons[] = $this->_t(1) . $tab . $this->_t(1)
@ -5660,10 +5811,16 @@ class Interpretation extends Fields
// return buttons if they were build
if (ComponentbuilderHelper::checkArray($buttons))
{
// set the custom get form method JAVASCRIPT_FOR_BUTTONS
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. $TARGET . '_JAVASCRIPT_FOR_BUTTONS' . $this->hhh]
= $this->setJavaScriptForButtons();
// just to check if the submission script is manually added
if (!isset($view['settings']->php_document) ||
strpos(implode(' ', $view['settings']->php_document),
'/submitbutton.js') === false)
{
// set the custom get form method JAVASCRIPT_FOR_BUTTONS
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. $TARGET . '_JAVASCRIPT_FOR_BUTTONS' . $this->hhh]
= $this->setJavaScriptForButtons();
}
// insure the form is added (only if no form exist)
if (isset($view['settings']->default)
&& strpos(
@ -8476,19 +8633,21 @@ class Interpretation extends Fields
public function getCategoryContentType($view, $views, $component)
{
// get the other view
$otherView = $this->catCodeBuilder[$view]['view'];
$category = $this->catCodeBuilder[$view]['code'];
$Component = ComponentbuilderHelper::safeString($component, 'F');
$View = ComponentbuilderHelper::safeString($view, 'F');
// build uninstall script for content types
$this->uninstallScriptBuilder[$View . ' ' . $category] = 'com_'
. $component . '.' . $views . '.category';
. $component . '.' . $otherView . '.category';
$this->uninstallScriptContent[$View . ' ' . $category] = $View . ' '
. $category;
// set the title
$array['type_title'] = $Component . ' ' . $View . ' '
. ComponentbuilderHelper::safeString($category, 'F');
// set the alias
$array['type_alias'] = 'com_' . $component . '.' . $views . '.category';
$array['type_alias'] = 'com_' . $component . '.' . $otherView . '.category';
// set the table
$array['table']
= '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}';
@ -11450,13 +11609,10 @@ class Interpretation extends Fields
// if to be linked
if ($item['type'] === 'category' && !$item['title'])
{
// get the other view
$otherViews = $this->catCodeBuilder[$viewName_single]['views'];
// return the link to category
return 'index.php?option=com_categories&task=category.edit&id=<?php echo (int)$item->'
. $item['code'] . '; ?>&extension=com_'
. $this->componentCodeName . '.' . $otherViews;
. $item['code'] . '; ?>&extension='
. $this->categoryBuilder[$viewName_list]['extension'];
}
elseif ($item['type'] === 'user' && !$item['title'])
{
@ -11517,11 +11673,10 @@ class Interpretation extends Fields
if ($item['type'] === 'category' && !$item['title'])
{
// get the other view
$otherViews = $this->catCodeBuilder[$viewName_single]['views'];
$otherView = $this->catCodeBuilder[$viewName_single]['view'];
// return the authority to category
return $user . "->authorise('core.edit', 'com_"
. $this->componentCodeName . "." . $otherViews
. $this->componentCodeName . "." . $otherView
. ".category.' . (int)\$item->" . $item['code'] . ")";
}
elseif ($item['type'] === 'user' && !$item['title'])
@ -12624,10 +12779,11 @@ class Interpretation extends Fields
if ($items_one || $items_two)
{
// check if the item has permissions.
$publishingPer = array();
$allToBeChekced = array('core.delete', 'core.edit.created_by',
'core.edit.state', 'core.edit.created');
foreach ($allToBeChekced as $core_permission)
$publishingPerOR = array();
$allToBeChekcedOR = array('core.edit.created_by',
'core.edit.created',
'core.edit.state');
foreach ($allToBeChekcedOR as $core_permission)
{
if ($coreLoad && isset($core[$core_permission])
&& isset($this->permissionBuilder['global'][$core[$core_permission]])
@ -12640,13 +12796,38 @@ class Interpretation extends Fields
))
{
// set permissions.
$publishingPer[] = "\$this->canDo->get('"
$publishingPerOR[] = "\$this->canDo->get('"
. $core[$core_permission] . "')";
}
else
{
// set permissions.
$publishingPer[] = "\$this->canDo->get('" . $core_permission
$publishingPerOR[] = "\$this->canDo->get('" . $core_permission
. "')";
}
}
$publishingPerAND = array();
$allToBeChekcedAND = array('core.delete', 'core.edit.state');
foreach ($allToBeChekcedAND as $core_permission)
{
if ($coreLoad && isset($core[$core_permission])
&& isset($this->permissionBuilder['global'][$core[$core_permission]])
&& ComponentbuilderHelper::checkArray(
$this->permissionBuilder['global'][$core[$core_permission]]
)
&& in_array(
$view_name_single,
$this->permissionBuilder['global'][$core[$core_permission]]
))
{
// set permissions.
$publishingPerAND[] = "\$this->canDo->get('"
. $core[$core_permission] . "')";
}
else
{
// set permissions.
$publishingPerAND[] = "\$this->canDo->get('" . $core_permission
. "')";
}
}
@ -12657,8 +12838,11 @@ class Interpretation extends Fields
{
$tabs .= $_customTabHTML;
}
// add the AND values to OR
$publishingPerOR[] = '(' . implode(' && ', $publishingPerAND) . ')';
// now build the complete showhide behaviour for the publishing area
$tabs .= PHP_EOL . PHP_EOL . $this->_t(1) . "<?php if (" . implode(
' || ', $publishingPer
' || ', $publishingPerOR
) . ") : ?>";
// set the default publishing tab
$tabs .= PHP_EOL . $this->_t(1)
@ -14222,9 +14406,9 @@ class Interpretation extends Fields
$query .= PHP_EOL . $this->_t(1) . "{";
$query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
. " setup the query";
$query .= PHP_EOL . $this->_t(2) . "if ("
$query .= PHP_EOL . $this->_t(2) . "if ((\$pks_size = "
. $this->fileContentStatic[$this->hhh . 'Component'
. $this->hhh] . "Helper::checkArray(\$pks))";
. $this->hhh] . "Helper::checkArray(\$pks)) !== false || 'bulk' === \$pks)";
$query .= PHP_EOL . $this->_t(2) . "{";
$query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Set a value to know this is " . $config['type']
@ -14256,8 +14440,39 @@ class Interpretation extends Fields
. "\$query->from(\$db->quoteName('#__"
. $this->componentCodeName . "_" . $viewName_single
. "', 'a'));";
$query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
. " The bulk export path";
$query .= PHP_EOL . $this->_t(3) . "if ('bulk' === \$pks)";
$query .= PHP_EOL . $this->_t(3)
. "{";
$query .= PHP_EOL . $this->_t(4)
. "\$query->where('a.id > 0');";
$query .= PHP_EOL . $this->_t(3)
. "}";
$query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
. " A large array of ID's will not work out well";
$query .= PHP_EOL . $this->_t(3) . "elseif (\$pks_size > 500)";
$query .= PHP_EOL . $this->_t(3)
. "{";
$query .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__)
. " Use lowest ID";
$query .= PHP_EOL . $this->_t(4)
. "\$query->where('a.id >= ' . (int) min(\$pks));";
$query .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__)
. " Use highest ID";
$query .= PHP_EOL . $this->_t(4)
. "\$query->where('a.id <= ' . (int) max(\$pks));";
$query .= PHP_EOL . $this->_t(3)
. "}";
$query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
. " The normal default path";
$query .= PHP_EOL . $this->_t(3) . "else";
$query .= PHP_EOL . $this->_t(3)
. "{";
$query .= PHP_EOL . $this->_t(4)
. "\$query->where('a.id IN (' . implode(',',\$pks) . ')');";
$query .= PHP_EOL . $this->_t(3)
. "}";
// add custom filtering php
$query .= $this->getCustomScriptBuilder(
'php_getlistquery', $viewName_single,
@ -16625,7 +16840,7 @@ class Interpretation extends Fields
$fix .= PHP_EOL . $this->_t(1) . "{";
$fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
. " check if the not_required field is set";
$fix .= PHP_EOL . $this->_t(2) . "if (" . $Component
$fix .= PHP_EOL . $this->_t(2) . "if (isset(\$data['not_required']) && " . $Component
. "Helper::checkString(\$data['not_required']))";
$fix .= PHP_EOL . $this->_t(2) . "{";
$fix .= PHP_EOL . $this->_t(3)
@ -17459,26 +17674,30 @@ class Interpretation extends Fields
$otherViews = $viewName_list;
$otherView = $viewName_single;
}
// set the OtherView value
$this->fileContentDynamic['category' . $otherView][$this->hhh
. 'otherview' . $this->hhh]
= $otherView;
// load the category helper details in not already loaded
if (!isset(
$this->fileContentDynamic['category' . $otherViews][$this->hhh
$this->fileContentDynamic['category' . $otherView][$this->hhh
. 'view' . $this->hhh]
))
{
// lets also set the category helper for this view
$target = array('site' => 'category' . $viewName_list);
$target = array('site' => 'category' . $otherView);
$this->buildDynamique($target, 'category');
// insure the file gets updated
$this->fileContentDynamic['category' . $otherViews][$this->hhh
$this->fileContentDynamic['category' . $otherView][$this->hhh
. 'view' . $this->hhh]
= $otherView;
$this->fileContentDynamic['category' . $otherViews][$this->hhh
$this->fileContentDynamic['category' . $otherView][$this->hhh
. 'View' . $this->hhh]
= ucfirst($otherView);
$this->fileContentDynamic['category' . $otherViews][$this->hhh
$this->fileContentDynamic['category' . $otherView][$this->hhh
. 'views' . $this->hhh]
= $otherViews;
$this->fileContentDynamic['category' . $otherViews][$this->hhh
$this->fileContentDynamic['category' . $otherView][$this->hhh
. 'Views' . $this->hhh]
= ucfirst($otherViews);
// set script to global helper file
@ -17486,12 +17705,12 @@ class Interpretation extends Fields
$includeHelper[] = "\n//" . $this->setLine(__LINE__)
. "Insure this view category file is loaded.";
$includeHelper[] = "\$classname = '" . ucfirst($component)
. ucfirst($viewName_list) . "Categories';";
. ucfirst($otherView) . "Categories';";
$includeHelper[] = "if (!class_exists(\$classname))";
$includeHelper[] = "{";
$includeHelper[] = $this->_t(1)
. "\$path = JPATH_SITE . '/components/com_" . $component
. "/helpers/category" . $viewName_list . ".php';";
. "/helpers/category" . $otherView . ".php';";
$includeHelper[] = $this->_t(1) . "if (is_file(\$path))";
$includeHelper[] = $this->_t(1) . "{";
$includeHelper[] = $this->_t(2) . "include_once \$path;";
@ -17593,7 +17812,7 @@ class Interpretation extends Fields
. " If the category has been passed in the URL check it.";
$allow[] = $this->_t(3)
. "\$allow = \$user->authorise('core.create', \$this->option . '."
. $otherViews . ".category.' . \$categoryId);";
. $otherView . ".category.' . \$categoryId);";
$allow[] = $this->_t(2) . "}";
$allow[] = PHP_EOL . $this->_t(2) . "if (\$allow === null)";
$allow[] = $this->_t(2) . "{";
@ -18168,6 +18387,8 @@ class Interpretation extends Fields
) . " Check for existing item.";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Modify the form based on Edit State access controls.";
// get the other view
$otherView = $this->catCodeBuilder[$viewName_single]['view'];
// check if the item has permissions.
if ($coreLoad && isset($core['core.edit.state'])
&& isset($this->permissionBuilder[$core['core.edit.state']])
@ -18185,7 +18406,7 @@ class Interpretation extends Fields
. $viewName_single . ".' . (int) \$id))";
$getForm[] = $this->_t(3)
. "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_"
. $component . "." . $viewName_list
. $component . "." . $otherView
. ".category.' . (int) \$catid))";
$getForm[] = $this->_t(3)
. "|| (\$id == 0 && !\$user->authorise('"
@ -18199,7 +18420,7 @@ class Interpretation extends Fields
. $component . "." . $viewName_single . ".' . (int) \$id))";
$getForm[] = $this->_t(3)
. "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_"
. $component . "." . $viewName_list
. $component . "." . $otherView
. ".category.' . (int) \$catid))";
$getForm[] = $this->_t(3)
. "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_"
@ -18728,7 +18949,7 @@ class Interpretation extends Fields
$allow[] = PHP_EOL . $this->_t(3) . "\$user = JFactory::getUser();";
$allow[] = $this->_t(3)
. "\$allow = \$user->authorise('core.delete', 'com_"
. $component . "." . $otherViews
. $component . "." . $otherView
. ".category.' . (int) \$record->catid);";
// check if the item has permissions.
if ($coreLoad
@ -18882,7 +19103,7 @@ class Interpretation extends Fields
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3)
. "\$catpermission = \$user->authorise('core.edit.state', 'com_"
. $component . "." . $otherViews
. $component . "." . $otherView
. ".category.' . (int) \$record->catid);";
$allow[] = $this->_t(3)
. "if (!\$catpermission && !is_null(\$catpermission))";
@ -20817,7 +21038,7 @@ class Interpretation extends Fields
// move the image to its place
JFile::copy(
JPATH_SITE . '/' . $path,
$imagePath . '/vdm-component.' . $type, '', true
$imagePath . '/vdm-component.' . $type
);
// now set the type to global for re-use
$this->componentImageType = $type;
@ -21056,8 +21277,7 @@ class Interpretation extends Fields
}
// move the image to its place
JFile::copy(
JPATH_SITE . '/' . $path, $imagePath . '/' . $imageName,
'', true
JPATH_SITE . '/' . $path, $imagePath . '/' . $imageName
);
}
}
@ -25057,7 +25277,7 @@ function vdm_dkim() {
// Trigger Event: jcb_ce_onBeforeBuildAccessSections
$this->triggerEvent(
'jcb_ce_onBeforeBuildAccessSections',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
$this->componentHead[] = '<section name="component">';
@ -25484,7 +25704,7 @@ function vdm_dkim() {
// Trigger Event: jcb_ce_onAfterBuildAccessSections
$this->triggerEvent(
'jcb_ce_onAfterBuildAccessSections',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// set the views permissions now
@ -26361,10 +26581,10 @@ function vdm_dkim() {
$xml .= PHP_EOL . $this->_t(1) . '<config';
$xml .= PHP_EOL . $this->_t(2)
. 'addrulepath="/administrator/components/com_'
. $this->componentCodeName . '/modules/rules"';
. $this->componentCodeName . '/models/rules"';
$xml .= PHP_EOL . $this->_t(2)
. 'addfieldpath="/administrator/components/com_'
. $this->componentCodeName . '/modules/fields"';
. $this->componentCodeName . '/models/fields"';
$xml .= PHP_EOL . $this->_t(1) . '>';
}
else
@ -26397,12 +26617,24 @@ function vdm_dkim() {
. $fieldset . ' fieldset points to the module -->';
$xml .= PHP_EOL . $this->_t(1) . '<fieldset name="'
. $fieldset . '" label="' . $label . '"';
$xml .= PHP_EOL . $this->_t(2)
. 'addrulepath="/modules/' . $module->file_name
. '/rules"';
$xml .= PHP_EOL . $this->_t(2)
. 'addfieldpath="/modules/' . $module->file_name
. '/fields"';
if ($module->target == 2)
{
$xml .= PHP_EOL . $this->_t(2)
. 'addrulepath="/administrator/modules/' . $module->file_name
. '/rules"';
$xml .= PHP_EOL . $this->_t(2)
. 'addfieldpath="/administrator/modules/' . $module->file_name
. '/fields"';
}
else
{
$xml .= PHP_EOL . $this->_t(2)
. 'addrulepath="/modules/' . $module->file_name
. '/rules"';
$xml .= PHP_EOL . $this->_t(2)
. 'addfieldpath="/modules/' . $module->file_name
. '/fields"';
}
$xml .= PHP_EOL . $this->_t(1) . '>';
}
else

View File

@ -1077,6 +1077,9 @@ class Infusion extends Interpretation
);
}
// setup the layouts
$this->setCustomViewLayouts();
// ADMIN_HELPER_CLASS_HEADER
$this->fileContentStatic[$this->hhh . 'ADMIN_HELPER_CLASS_HEADER'
. $this->hhh]
@ -1760,6 +1763,7 @@ class Infusion extends Interpretation
&$this->placeholders, &$this->hhh)
);
}
// setup the layouts
$this->setCustomViewLayouts();
}
@ -1930,7 +1934,7 @@ class Infusion extends Interpretation
// Trigger Event: jcb_ce_onBeforeInfuseModuleData
$this->triggerEvent(
'jcb_ce_onBeforeInfuseModuleData',
array(&$this->componentContext, &$module, $this)
array(&$this->componentContext, &$module, &$this)
);
$this->target = $module->key;
$this->lang = $module->key;
@ -1994,7 +1998,7 @@ class Infusion extends Interpretation
// Trigger Event: jcb_ce_onAfterInfuseModuleData
$this->triggerEvent(
'jcb_ce_onAfterInfuseModuleData',
array(&$this->componentContext, &$module, $this)
array(&$this->componentContext, &$module, &$this)
);
}
}
@ -2009,7 +2013,7 @@ class Infusion extends Interpretation
// Trigger Event: jcb_ce_onBeforeInfusePluginData
$this->triggerEvent(
'jcb_ce_onBeforeInfusePluginData',
array(&$this->componentContext, &$plugin, $this)
array(&$this->componentContext, &$plugin, &$this)
);
$this->target = $plugin->key;
$this->lang = $plugin->key;
@ -2056,7 +2060,7 @@ class Infusion extends Interpretation
// Trigger Event: jcb_ce_onAfterInfusePluginData
$this->triggerEvent(
'jcb_ce_onAfterInfusePluginData',
array(&$this->componentContext, &$plugin, $this)
array(&$this->componentContext, &$plugin, &$this)
);
}
}

View File

@ -13,6 +13,7 @@
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Language;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
@ -56,7 +57,7 @@ abstract class ComponentbuilderHelper
/**
* Array of php fields Allowed (16)
**/
public static $phpFieldArray = array('', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'x');
public static $phpFieldArray = array('', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'x', 'HEADER');
/**
* The global params
@ -2964,7 +2965,15 @@ abstract class ComponentbuilderHelper
$script['setdata'][] = self::_t(3) . "\$jinput = JFactory::getApplication()->input;";
$script['setdata'][] = self::_t(3) . "foreach(\$target_headers as \$header)";
$script['setdata'][] = self::_t(3) . "{";
$script['setdata'][] = self::_t(4) . "\$data['target_headers'][\$header] = \$jinput->getString(\$header, null);";
$script['setdata'][] = self::_t(4) . "if ((\$column = \$jinput->getString(\$header, false)) !== false ||";
$script['setdata'][] = self::_t(5) . "(\$column = \$jinput->getString(strtolower(\$header), false)) !== false)";
$script['setdata'][] = self::_t(4) . "{";
$script['setdata'][] = self::_t(5) . "\$data['target_headers'][\$header] = \$column;";
$script['setdata'][] = self::_t(4) . "}";
$script['setdata'][] = self::_t(4) . "else";
$script['setdata'][] = self::_t(4) . "{";
$script['setdata'][] = self::_t(5) . "\$data['target_headers'][\$header] = null;";
$script['setdata'][] = self::_t(4) . "}";
$script['setdata'][] = self::_t(3) . "}";
$script['setdata'][] = self::_t(3) . "// set the data";
$script['setdata'][] = self::_t(3) . "if(isset(\$package['dir']))";
@ -5534,14 +5543,61 @@ abstract class ComponentbuilderHelper
*
*/
public static function getEditURL(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder', $jRoute = true)
{
// build record
$record = new stdClass();
// check if user can edit
if (self::canEditItem($record, $item, $view, $views, $component))
{
// set the edit link
if ($jRoute)
{
return JRoute::_("index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $record->id . $ref);
}
return "index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $record->id . $ref;
}
return false;
}
/**
* Can Edit (either any, or own)
*
* @param int $item The item to edit
* @param string $view The type of item to edit
* @param string $views The list view controller name
* @param string $component The component these views belong to
*
* @return bool if user can edit returns true els
*
*/
public static function allowEdit(&$item, $view, $views, $component = 'com_componentbuilder')
{
// build record
$record = new stdClass();
return self::canEditItem($record, $item, $view, $views, $component);
}
/**
* Can Edit (either any, or own)
*
* @param int $item The item to edit
* @param string $view The type of item to edit
* @param string $views The list view controller name
* @param string $component The component these views belong to
*
* @return bool if user can edit returns true els
*
*/
protected static function canEditItem(&$record, &$item, $view, $views, $component = 'com_componentbuilder')
{
// make sure the user has access to view
if (!JFactory::getUser()->authorise($view. '.access', $component))
{
return false;
}
// build record
$record = new stdClass();
// we start with false.
$can_edit = false;
// check that we have the ID
if (self::checkObject($item) && isset($item->id))
{
@ -5571,25 +5627,14 @@ abstract class ComponentbuilderHelper
// get user action permission to edit
$action = self::getActions($view, $record, $views, 'edit', str_replace('com_', '', $component));
// check if the view permission is set
if (($edit = $action->get($view . '.edit', 'none-set')) === 'none-set')
if (($can_edit = $action->get($view . '.edit', 'none-set')) === 'none-set')
{
// fall back on the core permission then
$edit = $action->get('core.edit', 'none-set');
}
// can edit
if ($edit)
{
// set the edit link
if ($jRoute)
{
return JRoute::_("index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $record->id . $ref);
}
return "index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $record->id . $ref;
// fall back on the core permission then (this can be an issue)
$can_edit = ($action->get('core.edit', false) || $action->get('core.edit.own', false));
}
}
return false;
return $can_edit;
}
/**
* set subform type table
@ -5632,9 +5677,9 @@ abstract class ComponentbuilderHelper
/**
* Change to nice fancy date
*/
public static function fancyDate($date)
public static function fancyDate($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -5644,9 +5689,9 @@ abstract class ComponentbuilderHelper
/**
* get date based in period past
*/
public static function fancyDynamicDate($date)
public static function fancyDynamicDate($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -5670,9 +5715,9 @@ abstract class ComponentbuilderHelper
/**
* Change to nice fancy day time and date
*/
public static function fancyDayTimeDate($time)
public static function fancyDayTimeDate($time, $check_stamp = true)
{
if (!self::isValidTimeStamp($time))
if ($check_stamp && !self::isValidTimeStamp($time))
{
$time = strtotime($time);
}
@ -5682,9 +5727,9 @@ abstract class ComponentbuilderHelper
/**
* Change to nice fancy time and date
*/
public static function fancyDateTime($time)
public static function fancyDateTime($time, $check_stamp = true)
{
if (!self::isValidTimeStamp($time))
if ($check_stamp && !self::isValidTimeStamp($time))
{
$time = strtotime($time);
}
@ -5694,9 +5739,9 @@ abstract class ComponentbuilderHelper
/**
* Change to nice hour:minutes time
*/
public static function fancyTime($time)
public static function fancyTime($time, $check_stamp = true)
{
if (!self::isValidTimeStamp($time))
if ($check_stamp && !self::isValidTimeStamp($time))
{
$time = strtotime($time);
}
@ -5706,9 +5751,9 @@ abstract class ComponentbuilderHelper
/**
* set the date day as Sunday through Saturday
*/
public static function setDayName($date)
public static function setDayName($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -5718,9 +5763,9 @@ abstract class ComponentbuilderHelper
/**
* set the date month as January through December
*/
public static function setMonthName($date)
public static function setMonthName($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -5730,9 +5775,9 @@ abstract class ComponentbuilderHelper
/**
* set the date day as 1st
*/
public static function setDay($date)
public static function setDay($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -5742,9 +5787,9 @@ abstract class ComponentbuilderHelper
/**
* set the date month as 5
*/
public static function setMonth($date)
public static function setMonth($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -5754,9 +5799,9 @@ abstract class ComponentbuilderHelper
/**
* set the date year as 2004 (for charts)
*/
public static function setYear($date)
public static function setYear($date, $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -5766,9 +5811,9 @@ abstract class ComponentbuilderHelper
/**
* set the date as 2004/05 (for charts)
*/
public static function setYearMonth($date, $spacer = '/')
public static function setYearMonth($date, $spacer = '/', $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
@ -5778,15 +5823,27 @@ abstract class ComponentbuilderHelper
/**
* set the date as 2004/05/03 (for charts)
*/
public static function setYearMonthDay($date, $spacer = '/')
public static function setYearMonthDay($date, $spacer = '/', $check_stamp = true)
{
if (!self::isValidTimeStamp($date))
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
return date('Y' . $spacer . 'm' . $spacer . 'd', $date);
}
/**
* set the date as 03/05/2004
*/
public static function setDayMonthYear($date, $spacer = '/', $check_stamp = true)
{
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
return date('d' . $spacer . 'm' . $spacer . 'Y', $date);
}
/**
* Check if string is a valid time stamp
*/
@ -5797,6 +5854,57 @@ abstract class ComponentbuilderHelper
&& ($timestamp >= ~PHP_INT_MAX);
}
/**
* Check if string is a valid date
* https://www.php.net/manual/en/function.checkdate.php#113205
*/
public static function isValidateDate($date, $format = 'Y-m-d H:i:s')
{
$d = DateTime::createFromFormat($format, $date);
return $d && $d->format($format) == $date;
}
/**
* The subform layouts
**/
protected static $subformLayouts = false;
/**
* get the subform layout
*
* @input string The view name
* @input string The string name
*
* @returns string on success
**/
public static function getSubformLayout($view, $field, $default = 'repeatablejcb')
{
// get global values
if (self::$subformLayouts === false)
{
self::$subformLayouts = JComponentHelper::getParams('com_componentbuilder')->get('subform_layouts', false);
}
// check what we found (else) return default
if (self::checkObject(self::$subformLayouts))
{
// looking for
$target = $view . '.' . $field;
foreach (self::$subformLayouts as $subform)
{
if ($target === $subform->view_field)
{
return $subform->layout;
}
elseif ('default' === $subform->view_field)
{
$default = $subform->layout;
}
}
}
return $default;
}
/**
* Load the Composer Vendors
@ -6033,12 +6141,12 @@ abstract class ComponentbuilderHelper
if ($user->authorise('field.access', 'com_componentbuilder') && $user->authorise('field.submenu', 'com_componentbuilder'))
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_FIELDS'), 'index.php?option=com_componentbuilder&view=fields', $submenu === 'fields');
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.fields', $submenu === 'categories.fields');
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.field', $submenu === 'categories.field');
}
if ($user->authorise('fieldtype.access', 'com_componentbuilder') && $user->authorise('fieldtype.submenu', 'com_componentbuilder'))
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_FIELDTYPES'), 'index.php?option=com_componentbuilder&view=fieldtypes', $submenu === 'fieldtypes');
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.fieldtypes', $submenu === 'categories.fieldtypes');
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.fieldtype', $submenu === 'categories.fieldtype');
}
if ($user->authorise('language_translation.access', 'com_componentbuilder') && $user->authorise('language_translation.submenu', 'com_componentbuilder'))
{
@ -6201,6 +6309,8 @@ abstract class ComponentbuilderHelper
->setLastModifiedBy($modified)
->setTitle($title)
->setSubject($subjectTab);
// The file type
$file_type = 'Xls';
// set description
if ($description)
{
@ -6240,21 +6350,46 @@ abstract class ComponentbuilderHelper
));
// Add some data
if (self::checkArray($rows))
if (($size = self::checkArray($rows)) !== false)
{
$i = 1;
foreach ($rows as $array){
// Based on data size we adapt the behaviour.
$xls_mode = 1;
if ($size > 3000)
{
$xls_mode = 3;
$file_type = 'Csv';
}
elseif ($size > 2000)
{
$xls_mode = 2;
}
// Set active sheet and get it.
$active_sheet = $spreadsheet->setActiveSheetIndex(0);
foreach ($rows as $array)
{
$a = 'A';
foreach ($array as $value){
$spreadsheet->setActiveSheetIndex(0)->setCellValue($a.$i, $value);
if ($i == 1){
$spreadsheet->getActiveSheet()->getColumnDimension($a)->setAutoSize(true);
$spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($headerStyles);
$spreadsheet->getActiveSheet()->getStyle($a.$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
} elseif ($a === 'A'){
$spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($sideStyles);
} else {
$spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($normalStyles);
foreach ($array as $value)
{
$active_sheet->setCellValue($a.$i, $value);
if ($xls_mode != 3)
{
if ($i == 1)
{
$active_sheet->getColumnDimension($a)->setAutoSize(true);
$active_sheet->getStyle($a.$i)->applyFromArray($headerStyles);
$active_sheet->getStyle($a.$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
}
elseif ($a === 'A')
{
$active_sheet->getStyle($a.$i)->applyFromArray($sideStyles);
}
elseif ($xls_mode == 1)
{
$active_sheet->getStyle($a.$i)->applyFromArray($normalStyles);
}
}
$a++;
}
@ -6274,7 +6409,7 @@ abstract class ComponentbuilderHelper
// Redirect output to a client's web browser (Excel5)
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$fileName.'.xls"');
header('Content-Disposition: attachment;filename="' . $fileName . '.' . strtolower($file_type) .'"');
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');
@ -6285,7 +6420,7 @@ abstract class ComponentbuilderHelper
header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
header ('Pragma: public'); // HTTP/1.0
$writer = IOFactory::createWriter($spreadsheet, 'Xls');
$writer = IOFactory::createWriter($spreadsheet, $file_type);
$writer->save('php://output');
jexit();
}

View File

@ -7,6 +7,7 @@ COM_COMPONENTBUILDER_ACCESS="Access"
COM_COMPONENTBUILDER_ACCESS_BULK_TOOLS="Access Bulk Tools"
COM_COMPONENTBUILDER_ACCESS_DENIED="Access denied!"
COM_COMPONENTBUILDER_ACTIVE_ONLY_FOUR_TEXT_FIELD="Active (only 4 text_field)"
COM_COMPONENTBUILDER_ADD="Add"
COM_COMPONENTBUILDER_ADD_ACCESS="Add Access"
COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_TO_SEE_WHERE_IN_THE_COMPILER_THE_LINES_OF_CODE_WAS_BUILD_THIS_WILL_HELP_IF_YOU_NEED_TO_GET_MORE_TECHNICAL_WITH_AN_ISSUE_ON_GITHUB_OR_EVEN_FOR_YOUR_OWN_DEBUGGING="Add corresponding line numbers to the dynamic comments, so to see where in the compiler the lines of code was build. This will help if you need to get more technical with an issue on github, or even for your own debugging."
COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS="Add Custom Code Placeholders"
@ -3234,6 +3235,10 @@ 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"
COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_LABEL="Add Menu Prefix"
COM_COMPONENTBUILDER_CONFIG_ADMIN_CUSTOM_TABS_TABS="Admin Custom Tabs (tabs)"
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_ADDFIELDS="Admin Fields (addfields)"
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS="Admin Fields Conditions (addconditions)"
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_RELATIONS_ADDRELATIONS="Admin Fields Relations (addrelations)"
COM_COMPONENTBUILDER_CONFIG_ALMOST_FLAT_LOAD="Almost Flat"
COM_COMPONENTBUILDER_CONFIG_ALPHANUMERIC="Alphanumeric"
COM_COMPONENTBUILDER_CONFIG_ALPHANUMERICDOT="Alphanumeric+dot"
@ -3335,7 +3340,10 @@ COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_MESSAGE="Error! Please add some
COM_COMPONENTBUILDER_CONFIG_COMPILER_PLUGIN_DESCRIPTION="Select the plugin you would like to use in JCB's compiler"
COM_COMPONENTBUILDER_CONFIG_COMPILER_PLUGIN_LABEL="Activate Compiler Plugins"
COM_COMPONENTBUILDER_CONFIG_COMPONENT="Component"
COM_COMPONENTBUILDER_CONFIG_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS="Component Admin Views (addadmin_views)"
COM_COMPONENTBUILDER_CONFIG_COMPONENT_CUSTOM_ADMIN_VIEWS_ADDCUSTOM_ADMIN_VIEWS="Component Custom Admin Views (addcustom_admin_views)"
COM_COMPONENTBUILDER_CONFIG_COMPONENT_LABEL="Component"
COM_COMPONENTBUILDER_CONFIG_COMPONENT_SITE_VIEWS_ADDSITE_VIEWS="Component Site Views (addsite_views)"
COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_DESCRIPTION="Here you can set the path to where all components are backed up to."
COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_HINT="/home/user/fullbackup"
COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_LABEL="Cronjob Backup Folder Path"
@ -3378,6 +3386,8 @@ COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_DESCRIPTION="This is the TXT value to use
COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_HINT="v=DKIM1;k=rsa;g=*;s=email;h=sha1;t=s;p=PUBLICKEY"
COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_LABEL="Value"
COM_COMPONENTBUILDER_CONFIG_DONT_LOAD="Not"
COM_COMPONENTBUILDER_CONFIG_DYNAMIC_GET_JOIN_DB_TABLE="Dynamic Get (join_db_table)"
COM_COMPONENTBUILDER_CONFIG_DYNAMIC_GET_JOIN_VIEW_TABLE="Dynamic Get (join_view_table)"
COM_COMPONENTBUILDER_CONFIG_EDITOR_DESCRIPTION="Select the editor you would like to use as the JCB global editor for all custom coding areas."
COM_COMPONENTBUILDER_CONFIG_EDITOR_LABEL="Select an editor"
COM_COMPONENTBUILDER_CONFIG_EMAILFROM_DESCRIPTION="The global email address that will be used to send system email."
@ -3446,6 +3456,8 @@ COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_DESCRIPTION="Enter Email"
COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_HINT="Email Here"
COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_LABEL="Email"
COM_COMPONENTBUILDER_CONFIG_EXPORT_EMAIL_MESSAGE="Error! Please email address here."
COM_COMPONENTBUILDER_CONFIG_EXPORT_LANGUAGE_STRINGS_DESCRIPTION="All the export of language strings during JCB package export."
COM_COMPONENTBUILDER_CONFIG_EXPORT_LANGUAGE_STRINGS_LABEL="Export Language Strings"
COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_DESCRIPTION="Add License Here"
COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_HINT="Add License Here"
COM_COMPONENTBUILDER_CONFIG_EXPORT_LICENSE_LABEL="License"
@ -3485,6 +3497,7 @@ COM_COMPONENTBUILDER_CONFIG_JCB_COMMUNITY_PACKAGES="JCB Community Packages"
COM_COMPONENTBUILDER_CONFIG_JCB_PACKAGE_DIRECTORIES_DESCRIPTION="Here you can manage what package directories show in the JCB package import area."
COM_COMPONENTBUILDER_CONFIG_JCB_PACKAGE_DIRECTORIES_LABEL="Directories"
COM_COMPONENTBUILDER_CONFIG_LANGUAGE_LABEL="Language"
COM_COMPONENTBUILDER_CONFIG_LAYOUT_LABEL="Layout"
COM_COMPONENTBUILDER_CONFIG_LOCAL_FOLDER="Local Folder"
COM_COMPONENTBUILDER_CONFIG_MAILER_DESCRIPTION="Select what mailer you would like to use to send emails."
COM_COMPONENTBUILDER_CONFIG_MAILER_LABEL="Mailer"
@ -3567,6 +3580,9 @@ COM_COMPONENTBUILDER_CONFIG_PHP_MAIL="PHP Mail"
COM_COMPONENTBUILDER_CONFIG_PLACEHOLDERS_DESCRIPTION="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code."
COM_COMPONENTBUILDER_CONFIG_PLACEHOLDERS_LABEL="Add Custom Code Placeholders"
COM_COMPONENTBUILDER_CONFIG_REMOTE_SERVER="Remote Server"
COM_COMPONENTBUILDER_CONFIG_REPEATABLETABLE_JOOMLA="Repeatable-table (joomla)"
COM_COMPONENTBUILDER_CONFIG_REPEATABLE_JOOMLA="Repeatable (Joomla)"
COM_COMPONENTBUILDER_CONFIG_REPEATABLE_UIKIT="Repeatable (UIkit)"
COM_COMPONENTBUILDER_CONFIG_REPLYNAME_DESCRIPTION="Text displayed in the header &quot;Reply To:&quot; field when replying to the site email. Usually the the person that receives the response. (leave blank for none)"
COM_COMPONENTBUILDER_CONFIG_REPLYNAME_HINT="Reply Name Here"
COM_COMPONENTBUILDER_CONFIG_REPLYNAME_LABEL="Reply to Name"
@ -3602,6 +3618,8 @@ COM_COMPONENTBUILDER_CONFIG_SSL="SSL"
COM_COMPONENTBUILDER_CONFIG_STORAGE_TIME_TO_LIVE_DESCRIPTION="How long should the data that is stored in the browser memory remain unchanged before it is removed and updated."
COM_COMPONENTBUILDER_CONFIG_STORAGE_TIME_TO_LIVE_LABEL="Update Cycle"
COM_COMPONENTBUILDER_CONFIG_STRING_MANIPULATION="String Manipulation"
COM_COMPONENTBUILDER_CONFIG_SUBFORM_LAYOUTS_DESCRIPTION="Select the sub-form layouts you would like to use."
COM_COMPONENTBUILDER_CONFIG_SUBFORM_LAYOUTS_LABEL="Sub-form Layouts"
COM_COMPONENTBUILDER_CONFIG_TLS="TLS"
COM_COMPONENTBUILDER_CONFIG_TRUE="True"
COM_COMPONENTBUILDER_CONFIG_TYPE_NAME_BUILDER_DESCRIPTION="The default option only uses alphabetical characters and converts all numbers in field names to the English equivalent like <em>1</em> becomes <b>one</b>.<br />Alphanumeric+dot keeps the numbers unconverted unless it is at the beginning of the field name, and allows for a dot (.) to be used in the type name for namespacing."
@ -3616,6 +3634,7 @@ COM_COMPONENTBUILDER_CONFIG_UIKIT_MIN_LABEL="Load Minified"
COM_COMPONENTBUILDER_CONFIG_UIKIT_STYLE_DESC="Set the css style that should be used."
COM_COMPONENTBUILDER_CONFIG_UIKIT_STYLE_LABEL="css Style"
COM_COMPONENTBUILDER_CONFIG_VDM_PACKAGES="VDM Packages"
COM_COMPONENTBUILDER_CONFIG_VIEW_FIELD_LABEL="View & Field"
COM_COMPONENTBUILDER_CONFIG_YES="Yes"
COM_COMPONENTBUILDER_CONFIRMATION_STEP_BEFORE_IMPORTING="Confirmation Step Before Importing!"
COM_COMPONENTBUILDER_CONTEXT="Context"
@ -4495,6 +4514,8 @@ COM_COMPONENTBUILDER_DYNAMIC_GET_DIRECTION_LABEL="Ordering Direction"
COM_COMPONENTBUILDER_DYNAMIC_GET_E="e"
COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT="Editing the Dynamic Get"
COM_COMPONENTBUILDER_DYNAMIC_GET_EE="ee"
COM_COMPONENTBUILDER_DYNAMIC_GET_EMPTY_DESCRIPTION="Empty"
COM_COMPONENTBUILDER_DYNAMIC_GET_EMPTY_LABEL="Allow"
COM_COMPONENTBUILDER_DYNAMIC_GET_EQUAL="equal"
COM_COMPONENTBUILDER_DYNAMIC_GET_EQUAL_OR_NOT="equal or not"
COM_COMPONENTBUILDER_DYNAMIC_GET_ERROR_UNIQUE_ALIAS="Another Dynamic Get has the same alias."
@ -5871,7 +5892,7 @@ Project duration: **###projectWeekTime### weeks** or **###projectMonthTime### mo
## Donations<br />
<br />
If you want to support this project, please consider donating:<br />
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) (Asseblief = Please) in Afrikaans<br />
* PayPal: [paypal.me/donationgeek](https://www.paypal.me/donationgeek)<br />
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf<br />
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218
</code></div>"
@ -7717,6 +7738,7 @@ COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)"
COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)"
COM_COMPONENTBUILDER_MODULE="Module"
COM_COMPONENTBUILDER_MODULES="Modules"
COM_COMPONENTBUILDER_MOVE="Move"
COM_COMPONENTBUILDER_NAME="Name"
COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)"
COM_COMPONENTBUILDER_NAME_DESC="Name (Desc)"
@ -7913,6 +7935,7 @@ COM_COMPONENTBUILDER_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT="Ready to compile a component"
COM_COMPONENTBUILDER_REFRESH="Refresh"
COM_COMPONENTBUILDER_RELEASED_THIS="released this"
COM_COMPONENTBUILDER_REMOVE="Remove"
COM_COMPONENTBUILDER_RENAME="Rename"
COM_COMPONENTBUILDER_REPORT_AN_ISSUE_BSB="Report an issue: <b>%s</b>"
COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_ENTERED_BE_ONE_OF_THE_OPTIONS_IN_AN_ELEMENT_OF_TYPEQUOTLISTQUOT_THAT_IS_THAT_THE_ELEMENT_IS_A_SELECT_LIST="Requires the value entered be one of the options in an element of type=&quot;list&quot;: that is, that the element is a select list."

View File

@ -13,7 +13,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
$items = $displayData->vyffields;
$items = $displayData->vycfields;
$user = JFactory::getUser();
$id = $displayData->item->id;
// set the edit URL
@ -118,8 +118,8 @@ $can = ComponentbuilderHelper::getActions('field');
<?php echo JText::_($item->store); ?>
</td>
<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 if ($user->authorise('core.edit', 'com_componentbuilder.field.category.' . (int)$item->catid)): ?>
<a href="index.php?option=com_categories&task=category.edit&id=<?php echo (int)$item->catid; ?>&extension=com_componentbuilder.field"><?php echo $displayData->escape($item->category_title); ?></a>
<?php else: ?>
<?php echo $displayData->escape($item->category_title); ?>
<?php endif; ?>

View File

@ -0,0 +1,95 @@
<?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 - 2020 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('JPATH_BASE') or die('Restricted access');
/**
* Make thing clear
*
* @var JForm $tmpl The Empty form for template
* @var array $forms Array of JForm instances for render the rows
* @var bool $multiple The multiple state for the form field
* @var int $min Count of minimum repeating in multiple mode
* @var int $max Count of maximum repeating in multiple mode
* @var string $fieldname The field name
* @var string $control The forms control
* @var string $label The field label
* @var string $description The field description
* @var array $buttons Array of the buttons that will be rendered
* @var bool $groupByFieldset Whether group the subform fields by it`s fieldset
*/
extract($displayData);
// Add script
JHtml::_('jquery.ui', array('core', 'sortable'));
JHtml::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true));
$sublayout = 'sectionjcb';
?>
<div class="row-fluid">
<div class="subform-repeatable-wrapper subform-layout">
<div class="subform-repeatable"
data-bt-add="a.group-add-<?php echo $unique_subform_id; ?>"
data-bt-remove="a.group-remove-<?php echo $unique_subform_id; ?>"
data-bt-move="a.group-move-<?php echo $unique_subform_id; ?>"
data-repeatable-element="div.subform-repeatable-jcb-group-<?php echo $unique_subform_id; ?>"
data-minimum="<?php echo $min; ?>" data-maximum="<?php echo $max; ?>"
>
<?php if (!empty($buttons['add'])) : ?>
<div class="btn-toolbar">
<div class="btn-group">
<a class="btn btn-mini button btn-success group-add group-add-<?php echo $unique_subform_id; ?>" aria-label="<?php echo JText::_('COM_COMPONENTBUILDER_ADD'); ?>">
<span class="icon-plus" aria-hidden="true"></span>
</a>
</div>
</div>
<?php endif; ?>
<?php
foreach ($forms as $k => $form) :
echo JLayoutHelper::render(
$sublayout,
array(
'form' => $form,
'basegroup' => $fieldname,
'group' => $fieldname . $k,
'buttons' => $buttons,
'unique_subform_id' => $unique_subform_id
)
);
endforeach;
?>
<?php if ($multiple) : ?>
<template class="subform-repeatable-template-section" style="display: none;"><?php
// Use str_replace to escape HTML in a simple way, it need for IE compatibility, and should be removed later
echo str_replace(
array('<', '>'),
array('SUBFORMLT', 'SUBFORMGT'),
trim(
JLayoutHelper::render(
$sublayout,
array(
'form' => $tmpl,
'basegroup' => $fieldname,
'group' => $fieldname . 'X',
'buttons' => $buttons,
'unique_subform_id' => $unique_subform_id
)
)
)
);
?></template>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -0,0 +1,62 @@
<?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 - 2020 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('JPATH_BASE') or die('Restricted access');
/**
* Make thing clear
*
* @var JForm $form The form instance for render the section
* @var string $basegroup The base group name
* @var string $group Current group name
* @var array $buttons Array of the buttons that will be rendered
*/
extract($displayData);
?>
<div
class="subform-repeatable-group subform-repeatable-jcb-group-<?php echo $unique_subform_id; ?>"
data-base-name="<?php echo $basegroup; ?>"
data-group="<?php echo $group; ?>"
>
<?php if (!empty($buttons)) : ?>
<div class="btn-toolbar text-right">
<div class="btn-group">
<?php if (!empty($buttons['add'])) : ?>
<a class="btn btn-mini button btn-success group-add group-add-<?php echo $unique_subform_id; ?>" aria-label="<?php echo JText::_('COM_COMPONENTBUILDER_ADD'); ?>">
<span class="icon-plus" aria-hidden="true"></span>
</a>
<?php endif; ?>
<?php if (!empty($buttons['remove'])) : ?>
<a class="btn btn-mini button btn-danger group-remove group-remove-<?php echo $unique_subform_id; ?>" aria-label="<?php echo JText::_('COM_COMPONENTBUILDER_REMOVE'); ?>">
<span class="icon-minus" aria-hidden="true"></span>
</a>
<?php endif; ?>
<?php if (!empty($buttons['move'])) : ?>
<a class="btn btn-mini button btn-primary group-move group-move-<?php echo $unique_subform_id; ?>" aria-label="<?php echo JText::_('COM_COMPONENTBUILDER_MOVE'); ?>">
<span class="icon-move" aria-hidden="true"></span>
</a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<div data-uk-grid-margin="" class="uk-grid">
<?php foreach ($form->getGroup('') as $field) : ?>
<div class="uk-width-medium-1-4 uk-width-large-1-5">
<div class="uk-panel">
<?php echo $field->renderField(); ?>
</div>
</div>
<?php endforeach; ?>
</div>
</div>

View File

@ -13,7 +13,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
$items = $displayData->vyplinked_components;
$items = $displayData->vymlinked_components;
$user = JFactory::getUser();
$id = $displayData->item->id;
// set the edit URL

View File

@ -225,6 +225,9 @@ class ComponentbuilderModelAdmin_custom_tabs extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the tabs (sub form) layout
$form->setFieldAttribute('tabs', 'layout', ComponentbuilderHelper::getSubformLayout('admin_custom_tabs', 'tabs'));
return $form;
}

View File

@ -246,6 +246,9 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addfields (sub form) layout
$form->setFieldAttribute('addfields', 'layout', ComponentbuilderHelper::getSubformLayout('admin_fields', 'addfields'));
return $form;
}

View File

@ -246,6 +246,9 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addconditions (sub form) layout
$form->setFieldAttribute('addconditions', 'layout', ComponentbuilderHelper::getSubformLayout('admin_fields_conditions', 'addconditions'));
return $form;
}

View File

@ -308,6 +308,9 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addrelations (sub form) layout
$form->setFieldAttribute('addrelations', 'layout', ComponentbuilderHelper::getSubformLayout('admin_fields_relations', 'addrelations'));
return $form;
}

View File

@ -800,8 +800,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -984,7 +984,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
@ -1491,8 +1491,15 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "admin_view", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('admin_view', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "admin_view", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -342,7 +342,7 @@ class ComponentbuilderModelAdmin_views extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -360,7 +360,24 @@ class ComponentbuilderModelAdmin_views extends JModelList
// From the componentbuilder_admin_view table
$query->from($db->quoteName('#__componentbuilder_admin_view', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -342,8 +342,8 @@ class ComponentbuilderModelClass_method extends JModelAdmin
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -526,7 +526,7 @@ class ComponentbuilderModelClass_method extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
@ -972,8 +972,15 @@ class ComponentbuilderModelClass_method extends JModelAdmin
$data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']);
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "class_method", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('class_method', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "class_method", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -269,7 +269,7 @@ class ComponentbuilderModelClass_methods extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -287,7 +287,24 @@ class ComponentbuilderModelClass_methods extends JModelList
// From the componentbuilder_class_method table
$query->from($db->quoteName('#__componentbuilder_class_method', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -269,7 +269,7 @@ class ComponentbuilderModelClass_properties extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -287,7 +287,24 @@ class ComponentbuilderModelClass_properties extends JModelList
// From the componentbuilder_class_property table
$query->from($db->quoteName('#__componentbuilder_class_property', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -333,8 +333,8 @@ class ComponentbuilderModelClass_property extends JModelAdmin
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -517,7 +517,7 @@ class ComponentbuilderModelClass_property extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
@ -963,8 +963,15 @@ class ComponentbuilderModelClass_property extends JModelAdmin
$data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']);
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "class_property", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('class_property', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "class_property", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -257,6 +257,9 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addadmin_views (sub form) layout
$form->setFieldAttribute('addadmin_views', 'layout', ComponentbuilderHelper::getSubformLayout('component_admin_views', 'addadmin_views'));
return $form;
}

View File

@ -257,6 +257,9 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addcustom_admin_views (sub form) layout
$form->setFieldAttribute('addcustom_admin_views', 'layout', ComponentbuilderHelper::getSubformLayout('component_custom_admin_views', 'addcustom_admin_views'));
return $form;
}

View File

@ -257,6 +257,9 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addsite_views (sub form) layout
$form->setFieldAttribute('addsite_views', 'layout', ComponentbuilderHelper::getSubformLayout('component_site_views', 'addsite_views'));
return $form;
}

View File

@ -506,8 +506,8 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -1125,8 +1125,15 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "custom_admin_view", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('custom_admin_view', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "custom_admin_view", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -283,7 +283,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -301,7 +301,24 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
// From the componentbuilder_custom_admin_view table
$query->from($db->quoteName('#__componentbuilder_custom_admin_view', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -519,7 +519,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);

View File

@ -316,7 +316,7 @@ class ComponentbuilderModelCustom_codes extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -334,7 +334,24 @@ class ComponentbuilderModelCustom_codes extends JModelList
// From the componentbuilder_custom_code table
$query->from($db->quoteName('#__componentbuilder_custom_code', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -520,12 +520,18 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
// update the join_view_table (sub form) layout
$form->setFieldAttribute('join_view_table', 'layout', ComponentbuilderHelper::getSubformLayout('dynamic_get', 'join_view_table'));
// update the join_db_table (sub form) layout
$form->setFieldAttribute('join_db_table', 'layout', ComponentbuilderHelper::getSubformLayout('dynamic_get', 'join_db_table'));
return $form;
}
@ -704,7 +710,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
@ -1148,8 +1154,15 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "dynamic_get", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('dynamic_get', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "dynamic_get", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -266,7 +266,7 @@ class ComponentbuilderModelDynamic_gets extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -284,7 +284,24 @@ class ComponentbuilderModelDynamic_gets extends JModelList
// From the componentbuilder_dynamic_get table
$query->from($db->quoteName('#__componentbuilder_dynamic_get', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -419,8 +419,8 @@ class ComponentbuilderModelField extends JModelAdmin
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -603,7 +603,7 @@ class ComponentbuilderModelField extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
@ -1144,8 +1144,15 @@ class ComponentbuilderModelField extends JModelAdmin
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "field", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('field', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "field", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -382,7 +382,7 @@ class ComponentbuilderModelFields extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -400,7 +400,24 @@ class ComponentbuilderModelFields extends JModelList
// From the componentbuilder_field table
$query->from($db->quoteName('#__componentbuilder_field', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -0,0 +1,99 @@
<?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 - 2020 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 list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Adminlistvieworderfields Form Field class for the Componentbuilder component
*/
class JFormFieldAdminlistvieworderfields extends JFormFieldList
{
/**
* The adminlistvieworderfields field type.
*
* @var string
*/
public $type = 'adminlistvieworderfields';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
protected function getOptions()
{
// load the db object
$db = JFactory::getDBO();
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the id
$adminView = $jinput->getInt('id', 0);
// check if we have an admin view
if (is_numeric($adminView) && $adminView >= 1)
{
// get all the fields linked to the admin view
if ($addFields = ComponentbuilderHelper::getVar('admin_fields', (int) $adminView, 'admin_view', 'addfields'))
{
if (ComponentbuilderHelper::checkJson($addFields))
{
$addFields = json_decode($addFields, true);
if (ComponentbuilderHelper::checkArray($addFields))
{
foreach($addFields as $addField)
{
// admin list view and ordering
if (isset($addField['field']) && isset($addField['list']) && ($addField['list'] == 1 || $addField['list'] == 3)
&& isset($addField['sort']) && $addField['sort'])
{
$fieldIds[] = (int) $addField['field'];
}
}
}
}
}
// filter by fields linked
if (ComponentbuilderHelper::checkArray($fieldIds))
{
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.name', 'a.xml', 'b.name'),array('id','name', 'xml', 'type')));
$query->from($db->quoteName('#__componentbuilder_field', 'a'));
$query->join('LEFT', '#__componentbuilder_fieldtype AS b ON b.id = a.fieldtype');
$query->where($db->quoteName('a.published') . ' >= 1');
// only load these fields
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')');
$query->order('a.name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
$options[] = JHtml::_('select.option', '', JText::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_SELECT_AN_OPTION'));
$options[] = JHtml::_('select.option', -1, JText::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_ID'). ' [ id - text ]');
$options[] = JHtml::_('select.option', -2, JText::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_ORDERING'). ' [ ordering - number ]');
$options[] = JHtml::_('select.option', -3, JText::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_STATUS'). ' [ published - list ]');
foreach($items as $item)
{
// get the field name (TODO this could slow down the system so we will need to improve on this)
$field_name = ComponentbuilderHelper::safeFieldName(ComponentbuilderHelper::getBetween(json_decode($item->xml),'name="','"'));
$options[] = JHtml::_('select.option', $item->id, $item->name . ' [ ' . $field_name . ' - ' . $item->type . ' ]');
}
}
return $options;
}
}
return false;
}
}

View File

@ -0,0 +1,99 @@
<?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 - 2020 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 list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Linkedviewsorderfields Form Field class for the Componentbuilder component
*/
class JFormFieldLinkedviewsorderfields extends JFormFieldList
{
/**
* The linkedviewsorderfields field type.
*
* @var string
*/
public $type = 'linkedviewsorderfields';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
protected function getOptions()
{
// load the db object
$db = JFactory::getDBO();
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the id
$adminView = $jinput->getInt('id', 0);
// check if we have an admin view
if (is_numeric($adminView) && $adminView >= 1)
{
// get all the fields linked to the admin view
if ($addFields = ComponentbuilderHelper::getVar('admin_fields', (int) $adminView, 'admin_view', 'addfields'))
{
if (ComponentbuilderHelper::checkJson($addFields))
{
$addFields = json_decode($addFields, true);
if (ComponentbuilderHelper::checkArray($addFields))
{
foreach($addFields as $addField)
{
// linked list views and ordering
if (isset($addField['field']) && isset($addField['list']) && ($addField['list'] == 1 || $addField['list'] == 4)
&& isset($addField['sort']) && $addField['sort'])
{
$fieldIds[] = (int) $addField['field'];
}
}
}
}
}
// filter by fields linked
if (ComponentbuilderHelper::checkArray($fieldIds))
{
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.name', 'a.xml', 'b.name'),array('id','name', 'xml', 'type')));
$query->from($db->quoteName('#__componentbuilder_field', 'a'));
$query->join('LEFT', '#__componentbuilder_fieldtype AS b ON b.id = a.fieldtype');
$query->where($db->quoteName('a.published') . ' >= 1');
// only load these fields
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')');
$query->order('a.name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
$options[] = JHtml::_('select.option', '', JText::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_SELECT_AN_OPTION'));
$options[] = JHtml::_('select.option', -1, JText::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_ID'). ' [ id - text ]');
$options[] = JHtml::_('select.option', -2, JText::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_ORDERING'). ' [ ordering - number ]');
$options[] = JHtml::_('select.option', -3, JText::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_STATUS'). ' [ published - list ]');
foreach($items as $item)
{
// get the field name (TODO this could slow down the system so we will need to improve on this)
$field_name = ComponentbuilderHelper::safeFieldName(ComponentbuilderHelper::getBetween(json_decode($item->xml),'name="','"'));
$options[] = JHtml::_('select.option', $item->id, $item->name . ' [ ' . $field_name . ' - ' . $item->type . ' ]');
}
}
return $options;
}
}
return false;
}
}

View File

@ -249,7 +249,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getVyffields()
public function getVycfields()
{
// Get the user object.
$user = JFactory::getUser();
@ -337,13 +337,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
foreach ($items as $nr => &$item)
{
// convert datatype
$item->datatype = $this->selectionTranslationVyffields($item->datatype, 'datatype');
$item->datatype = $this->selectionTranslationVycfields($item->datatype, 'datatype');
// convert indexes
$item->indexes = $this->selectionTranslationVyffields($item->indexes, 'indexes');
$item->indexes = $this->selectionTranslationVycfields($item->indexes, 'indexes');
// convert null_switch
$item->null_switch = $this->selectionTranslationVyffields($item->null_switch, 'null_switch');
$item->null_switch = $this->selectionTranslationVycfields($item->null_switch, 'null_switch');
// convert store
$item->store = $this->selectionTranslationVyffields($item->store, 'store');
$item->store = $this->selectionTranslationVycfields($item->store, 'store');
}
}
@ -357,7 +357,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*
* @return translatable string
*/
public function selectionTranslationVyffields($value,$name)
public function selectionTranslationVycfields($value,$name)
{
// Array of datatype language strings
if ($name === 'datatype')
@ -544,8 +544,8 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
}
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -728,7 +728,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
@ -1197,8 +1197,15 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "fieldtype", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('fieldtype', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "fieldtype", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -235,7 +235,7 @@ class ComponentbuilderModelFieldtypes extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -253,7 +253,24 @@ class ComponentbuilderModelFieldtypes extends JModelList
// From the componentbuilder_fieldtype table
$query->from($db->quoteName('#__componentbuilder_fieldtype', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -103,7 +103,7 @@
type="subform"
name="tabs"
label="COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_TABS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
layout="joomla.form.field.subform.repeatable"
multiple="true"
buttons="add,remove,move"
description="COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_TABS_DESCRIPTION"

View File

@ -103,7 +103,7 @@
type="subform"
name="addfields"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_ADDFIELDS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
layout="repeatablejcb"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_ADDFIELDS_DESCRIPTION"
default=""

View File

@ -103,7 +103,7 @@
type="subform"
name="addconditions"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_LABEL"
layout="joomla.form.field.subform.repeatable"
layout="repeatablejcb"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_DESCRIPTION"
default=""

View File

@ -103,7 +103,7 @@
type="subform"
name="addrelations"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_LABEL"
layout="joomla.form.field.subform.repeatable"
layout="repeatablejcb"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_DESCRIPTION"
default=""

View File

@ -103,7 +103,7 @@
type="subform"
name="addadmin_views"
label="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
layout="repeatablejcb"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS_DESCRIPTION"
default="[{&quot;submenu&quot;:&quot;1&quot;,&quot;checkin&quot;:&quot;1&quot;,&quot;history&quot;:&quot;1&quot;,&quot;access&quot;:&quot;1&quot;,&quot;port&quot;:&quot;1&quot;}]"

View File

@ -103,7 +103,7 @@
type="subform"
name="addcustom_admin_views"
label="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_ADDCUSTOM_ADMIN_VIEWS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
layout="repeatablejcb"
multiple="true"
default=""
icon="list">

View File

@ -103,7 +103,7 @@
type="subform"
name="addsite_views"
label="COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ADDSITE_VIEWS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
layout="repeatablejcb"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ADDSITE_VIEWS_DESCRIPTION"
default=""

View File

@ -90,7 +90,6 @@
type="component"
name="component"
label="COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL"
description="JFIELD_TITLE_DESC"
class="list_class"
multiple="false"
default="0"

View File

@ -227,7 +227,7 @@
type="subform"
name="join_db_table"
label="COM_COMPONENTBUILDER_DYNAMIC_GET_JOIN_DB_TABLE_LABEL"
layout="joomla.form.field.subform.repeatable-table"
layout="repeatablejcb"
multiple="true"
description="COM_COMPONENTBUILDER_DYNAMIC_GET_JOIN_DB_TABLE_DESCRIPTION"
icon="list">
@ -810,6 +810,16 @@
message="COM_COMPONENTBUILDER_DYNAMIC_GET_TABLE_KEY_MESSAGE"
hint="COM_COMPONENTBUILDER_DYNAMIC_GET_TABLE_KEY_HINT"
/>
<!-- Empty Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="empty"
label="COM_COMPONENTBUILDER_DYNAMIC_GET_EMPTY_LABEL"
value="1"
default="0"
description="COM_COMPONENTBUILDER_DYNAMIC_GET_EMPTY_DESCRIPTION"
class="inputbox"
/>
</form>
</field>
<!-- Add_php_after_getitems Field. Type: Radio. (joomla) -->
@ -1202,7 +1212,7 @@
type="subform"
name="join_view_table"
label="COM_COMPONENTBUILDER_DYNAMIC_GET_JOIN_VIEW_TABLE_LABEL"
layout="joomla.form.field.subform.repeatable-table"
layout="repeatablejcb"
multiple="true"
description="COM_COMPONENTBUILDER_DYNAMIC_GET_JOIN_VIEW_TABLE_DESCRIPTION"
icon="list">

View File

@ -13,11 +13,8 @@ jform_vvvvwczvxo_required = false;
jform_vvvvwdavxp_required = false;
jform_vvvvwdbvxq_required = false;
jform_vvvvwdcvxr_required = false;
jform_vvvvwddvxs_required = false;
jform_vvvvwdgvxt_required = false;
jform_vvvvwdgvxu_required = false;
jform_vvvvwdhvxv_required = false;
jform_vvvvwdhvxw_required = false;
jform_vvvvwdfvxs_required = false;
jform_vvvvwdfvxt_required = false;
// Initial Script
jQuery(document).ready(function()
@ -34,32 +31,24 @@ jQuery(document).ready(function()
var datatype_vvvvwdc = jQuery("#jform_datatype").val();
vvvvwdc(datatype_vvvvwdc);
var store_vvvvwdd = jQuery("#jform_store").val();
var datatype_vvvvwdd = jQuery("#jform_datatype").val();
vvvvwdd(datatype_vvvvwdd);
vvvvwdd(store_vvvvwdd,datatype_vvvvwdd);
var store_vvvvwde = jQuery("#jform_store").val();
var datatype_vvvvwde = jQuery("#jform_datatype").val();
vvvvwde(store_vvvvwde,datatype_vvvvwde);
var store_vvvvwdf = jQuery("#jform_store").val();
vvvvwdf(store_vvvvwdf);
var store_vvvvwdg = jQuery("#jform_store").val();
var datatype_vvvvwdg = jQuery("#jform_datatype").val();
vvvvwdg(store_vvvvwdg,datatype_vvvvwdg);
var add_css_view_vvvvwdg = jQuery("#jform_add_css_view input[type='radio']:checked").val();
vvvvwdg(add_css_view_vvvvwdg);
var datatype_vvvvwdh = jQuery("#jform_datatype").val();
var store_vvvvwdh = jQuery("#jform_store").val();
vvvvwdh(datatype_vvvvwdh,store_vvvvwdh);
var add_css_views_vvvvwdh = jQuery("#jform_add_css_views input[type='radio']:checked").val();
vvvvwdh(add_css_views_vvvvwdh);
var add_css_view_vvvvwdi = jQuery("#jform_add_css_view input[type='radio']:checked").val();
vvvvwdi(add_css_view_vvvvwdi);
var add_javascript_view_footer_vvvvwdi = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
vvvvwdi(add_javascript_view_footer_vvvvwdi);
var add_css_views_vvvvwdj = jQuery("#jform_add_css_views input[type='radio']:checked").val();
vvvvwdj(add_css_views_vvvvwdj);
var add_javascript_view_footer_vvvvwdk = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
vvvvwdk(add_javascript_view_footer_vvvvwdk);
var add_javascript_views_footer_vvvvwdl = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
vvvvwdl(add_javascript_views_footer_vvvvwdl);
var add_javascript_views_footer_vvvvwdj = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
vvvvwdj(add_javascript_views_footer_vvvvwdj);
});
// the vvvvwcz function
@ -289,8 +278,20 @@ function datatype_vvvvwdc_SomeFunc(datatype_vvvvwdc)
}
// the vvvvwdd function
function vvvvwdd(datatype_vvvvwdd)
function vvvvwdd(store_vvvvwdd,datatype_vvvvwdd)
{
if (isSet(store_vvvvwdd) && store_vvvvwdd.constructor !== Array)
{
var temp_vvvvwdd = store_vvvvwdd;
var store_vvvvwdd = [];
store_vvvvwdd.push(temp_vvvvwdd);
}
else if (!isSet(store_vvvvwdd))
{
var store_vvvvwdd = [];
}
var store = store_vvvvwdd.some(store_vvvvwdd_SomeFunc);
if (isSet(datatype_vvvvwdd) && datatype_vvvvwdd.constructor !== Array)
{
var temp_vvvvwdd = datatype_vvvvwdd;
@ -305,34 +306,27 @@ function vvvvwdd(datatype_vvvvwdd)
// set this function logic
if (datatype)
if (store && datatype)
{
jQuery('#jform_store').closest('.control-group').show();
// add required attribute to store field
if (jform_vvvvwddvxs_required)
{
updateFieldRequired('store',0);
jQuery('#jform_store').prop('required','required');
jQuery('#jform_store').attr('aria-required',true);
jQuery('#jform_store').addClass('required');
jform_vvvvwddvxs_required = false;
}
jQuery('.note_whmcs_encryption').closest('.control-group').show();
}
else
{
jQuery('#jform_store').closest('.control-group').hide();
// remove required attribute from store field
if (!jform_vvvvwddvxs_required)
{
updateFieldRequired('store',1);
jQuery('#jform_store').removeAttr('required');
jQuery('#jform_store').removeAttr('aria-required');
jQuery('#jform_store').removeClass('required');
jform_vvvvwddvxs_required = true;
}
jQuery('.note_whmcs_encryption').closest('.control-group').hide();
}
}
// the vvvvwdd Some function
function store_vvvvwdd_SomeFunc(store_vvvvwdd)
{
// set the function logic
if (store_vvvvwdd == 4)
{
return true;
}
return false;
}
// the vvvvwdd Some function
function datatype_vvvvwdd_SomeFunc(datatype_vvvvwdd)
{
@ -344,61 +338,82 @@ function datatype_vvvvwdd_SomeFunc(datatype_vvvvwdd)
return false;
}
// the vvvvwde function
function vvvvwde(store_vvvvwde,datatype_vvvvwde)
// the vvvvwdf function
function vvvvwdf(store_vvvvwdf)
{
if (isSet(store_vvvvwde) && store_vvvvwde.constructor !== Array)
if (isSet(store_vvvvwdf) && store_vvvvwdf.constructor !== Array)
{
var temp_vvvvwde = store_vvvvwde;
var store_vvvvwde = [];
store_vvvvwde.push(temp_vvvvwde);
var temp_vvvvwdf = store_vvvvwdf;
var store_vvvvwdf = [];
store_vvvvwdf.push(temp_vvvvwdf);
}
else if (!isSet(store_vvvvwde))
else if (!isSet(store_vvvvwdf))
{
var store_vvvvwde = [];
var store_vvvvwdf = [];
}
var store = store_vvvvwde.some(store_vvvvwde_SomeFunc);
if (isSet(datatype_vvvvwde) && datatype_vvvvwde.constructor !== Array)
{
var temp_vvvvwde = datatype_vvvvwde;
var datatype_vvvvwde = [];
datatype_vvvvwde.push(temp_vvvvwde);
}
else if (!isSet(datatype_vvvvwde))
{
var datatype_vvvvwde = [];
}
var datatype = datatype_vvvvwde.some(datatype_vvvvwde_SomeFunc);
var store = store_vvvvwdf.some(store_vvvvwdf_SomeFunc);
// set this function logic
if (store && datatype)
if (store)
{
jQuery('.note_whmcs_encryption').closest('.control-group').show();
jQuery('#jform_initiator_on_get_model').closest('.control-group').show();
jQuery('#jform_initiator_on_save_model').closest('.control-group').show();
jQuery('.note_expert_field_save_mode').closest('.control-group').show();
jQuery('#jform_on_get_model_field').closest('.control-group').show();
// add required attribute to on_get_model_field field
if (jform_vvvvwdfvxs_required)
{
updateFieldRequired('on_get_model_field',0);
jQuery('#jform_on_get_model_field').prop('required','required');
jQuery('#jform_on_get_model_field').attr('aria-required',true);
jQuery('#jform_on_get_model_field').addClass('required');
jform_vvvvwdfvxs_required = false;
}
jQuery('#jform_on_save_model_field').closest('.control-group').show();
// add required attribute to on_save_model_field field
if (jform_vvvvwdfvxt_required)
{
updateFieldRequired('on_save_model_field',0);
jQuery('#jform_on_save_model_field').prop('required','required');
jQuery('#jform_on_save_model_field').attr('aria-required',true);
jQuery('#jform_on_save_model_field').addClass('required');
jform_vvvvwdfvxt_required = false;
}
}
else
{
jQuery('.note_whmcs_encryption').closest('.control-group').hide();
jQuery('#jform_initiator_on_get_model').closest('.control-group').hide();
jQuery('#jform_initiator_on_save_model').closest('.control-group').hide();
jQuery('.note_expert_field_save_mode').closest('.control-group').hide();
jQuery('#jform_on_get_model_field').closest('.control-group').hide();
// remove required attribute from on_get_model_field field
if (!jform_vvvvwdfvxs_required)
{
updateFieldRequired('on_get_model_field',1);
jQuery('#jform_on_get_model_field').removeAttr('required');
jQuery('#jform_on_get_model_field').removeAttr('aria-required');
jQuery('#jform_on_get_model_field').removeClass('required');
jform_vvvvwdfvxs_required = true;
}
jQuery('#jform_on_save_model_field').closest('.control-group').hide();
// remove required attribute from on_save_model_field field
if (!jform_vvvvwdfvxt_required)
{
updateFieldRequired('on_save_model_field',1);
jQuery('#jform_on_save_model_field').removeAttr('required');
jQuery('#jform_on_save_model_field').removeAttr('aria-required');
jQuery('#jform_on_save_model_field').removeClass('required');
jform_vvvvwdfvxt_required = true;
}
}
}
// the vvvvwde Some function
function store_vvvvwde_SomeFunc(store_vvvvwde)
// the vvvvwdf Some function
function store_vvvvwdf_SomeFunc(store_vvvvwdf)
{
// set the function logic
if (store_vvvvwde == 4)
{
return true;
}
return false;
}
// the vvvvwde Some function
function datatype_vvvvwde_SomeFunc(datatype_vvvvwde)
{
// set the function logic
if (datatype_vvvvwde == 'CHAR' || datatype_vvvvwde == 'VARCHAR' || datatype_vvvvwde == 'TEXT' || datatype_vvvvwde == 'MEDIUMTEXT' || datatype_vvvvwde == 'LONGTEXT' || datatype_vvvvwde == 'BLOB' || datatype_vvvvwde == 'TINYBLOB' || datatype_vvvvwde == 'MEDIUMBLOB' || datatype_vvvvwde == 'LONGBLOB')
if (store_vvvvwdf == 6)
{
return true;
}
@ -406,220 +421,10 @@ function datatype_vvvvwde_SomeFunc(datatype_vvvvwde)
}
// the vvvvwdg function
function vvvvwdg(store_vvvvwdg,datatype_vvvvwdg)
{
if (isSet(store_vvvvwdg) && store_vvvvwdg.constructor !== Array)
{
var temp_vvvvwdg = store_vvvvwdg;
var store_vvvvwdg = [];
store_vvvvwdg.push(temp_vvvvwdg);
}
else if (!isSet(store_vvvvwdg))
{
var store_vvvvwdg = [];
}
var store = store_vvvvwdg.some(store_vvvvwdg_SomeFunc);
if (isSet(datatype_vvvvwdg) && datatype_vvvvwdg.constructor !== Array)
{
var temp_vvvvwdg = datatype_vvvvwdg;
var datatype_vvvvwdg = [];
datatype_vvvvwdg.push(temp_vvvvwdg);
}
else if (!isSet(datatype_vvvvwdg))
{
var datatype_vvvvwdg = [];
}
var datatype = datatype_vvvvwdg.some(datatype_vvvvwdg_SomeFunc);
// set this function logic
if (store && datatype)
{
jQuery('#jform_initiator_on_get_model').closest('.control-group').show();
jQuery('#jform_initiator_on_save_model').closest('.control-group').show();
jQuery('#jform_on_save_model_field').closest('.control-group').show();
// add required attribute to on_save_model_field field
if (jform_vvvvwdgvxt_required)
{
updateFieldRequired('on_save_model_field',0);
jQuery('#jform_on_save_model_field').prop('required','required');
jQuery('#jform_on_save_model_field').attr('aria-required',true);
jQuery('#jform_on_save_model_field').addClass('required');
jform_vvvvwdgvxt_required = false;
}
jQuery('.note_expert_field_save_mode').closest('.control-group').show();
jQuery('#jform_on_get_model_field').closest('.control-group').show();
// add required attribute to on_get_model_field field
if (jform_vvvvwdgvxu_required)
{
updateFieldRequired('on_get_model_field',0);
jQuery('#jform_on_get_model_field').prop('required','required');
jQuery('#jform_on_get_model_field').attr('aria-required',true);
jQuery('#jform_on_get_model_field').addClass('required');
jform_vvvvwdgvxu_required = false;
}
}
else
{
jQuery('#jform_initiator_on_get_model').closest('.control-group').hide();
jQuery('#jform_initiator_on_save_model').closest('.control-group').hide();
jQuery('#jform_on_save_model_field').closest('.control-group').hide();
// remove required attribute from on_save_model_field field
if (!jform_vvvvwdgvxt_required)
{
updateFieldRequired('on_save_model_field',1);
jQuery('#jform_on_save_model_field').removeAttr('required');
jQuery('#jform_on_save_model_field').removeAttr('aria-required');
jQuery('#jform_on_save_model_field').removeClass('required');
jform_vvvvwdgvxt_required = true;
}
jQuery('.note_expert_field_save_mode').closest('.control-group').hide();
jQuery('#jform_on_get_model_field').closest('.control-group').hide();
// remove required attribute from on_get_model_field field
if (!jform_vvvvwdgvxu_required)
{
updateFieldRequired('on_get_model_field',1);
jQuery('#jform_on_get_model_field').removeAttr('required');
jQuery('#jform_on_get_model_field').removeAttr('aria-required');
jQuery('#jform_on_get_model_field').removeClass('required');
jform_vvvvwdgvxu_required = true;
}
}
}
// the vvvvwdg Some function
function store_vvvvwdg_SomeFunc(store_vvvvwdg)
function vvvvwdg(add_css_view_vvvvwdg)
{
// set the function logic
if (store_vvvvwdg == 6)
{
return true;
}
return false;
}
// the vvvvwdg Some function
function datatype_vvvvwdg_SomeFunc(datatype_vvvvwdg)
{
// set the function logic
if (datatype_vvvvwdg == 'CHAR' || datatype_vvvvwdg == 'VARCHAR' || datatype_vvvvwdg == 'TEXT' || datatype_vvvvwdg == 'MEDIUMTEXT' || datatype_vvvvwdg == 'LONGTEXT' || datatype_vvvvwdg == 'BLOB' || datatype_vvvvwdg == 'TINYBLOB' || datatype_vvvvwdg == 'MEDIUMBLOB' || datatype_vvvvwdg == 'LONGBLOB')
{
return true;
}
return false;
}
// the vvvvwdh function
function vvvvwdh(datatype_vvvvwdh,store_vvvvwdh)
{
if (isSet(datatype_vvvvwdh) && datatype_vvvvwdh.constructor !== Array)
{
var temp_vvvvwdh = datatype_vvvvwdh;
var datatype_vvvvwdh = [];
datatype_vvvvwdh.push(temp_vvvvwdh);
}
else if (!isSet(datatype_vvvvwdh))
{
var datatype_vvvvwdh = [];
}
var datatype = datatype_vvvvwdh.some(datatype_vvvvwdh_SomeFunc);
if (isSet(store_vvvvwdh) && store_vvvvwdh.constructor !== Array)
{
var temp_vvvvwdh = store_vvvvwdh;
var store_vvvvwdh = [];
store_vvvvwdh.push(temp_vvvvwdh);
}
else if (!isSet(store_vvvvwdh))
{
var store_vvvvwdh = [];
}
var store = store_vvvvwdh.some(store_vvvvwdh_SomeFunc);
// set this function logic
if (datatype && store)
{
jQuery('#jform_initiator_on_get_model').closest('.control-group').show();
jQuery('#jform_initiator_on_save_model').closest('.control-group').show();
jQuery('#jform_on_save_model_field').closest('.control-group').show();
// add required attribute to on_save_model_field field
if (jform_vvvvwdhvxv_required)
{
updateFieldRequired('on_save_model_field',0);
jQuery('#jform_on_save_model_field').prop('required','required');
jQuery('#jform_on_save_model_field').attr('aria-required',true);
jQuery('#jform_on_save_model_field').addClass('required');
jform_vvvvwdhvxv_required = false;
}
jQuery('.note_expert_field_save_mode').closest('.control-group').show();
jQuery('#jform_on_get_model_field').closest('.control-group').show();
// add required attribute to on_get_model_field field
if (jform_vvvvwdhvxw_required)
{
updateFieldRequired('on_get_model_field',0);
jQuery('#jform_on_get_model_field').prop('required','required');
jQuery('#jform_on_get_model_field').attr('aria-required',true);
jQuery('#jform_on_get_model_field').addClass('required');
jform_vvvvwdhvxw_required = false;
}
}
else
{
jQuery('#jform_initiator_on_get_model').closest('.control-group').hide();
jQuery('#jform_initiator_on_save_model').closest('.control-group').hide();
jQuery('#jform_on_save_model_field').closest('.control-group').hide();
// remove required attribute from on_save_model_field field
if (!jform_vvvvwdhvxv_required)
{
updateFieldRequired('on_save_model_field',1);
jQuery('#jform_on_save_model_field').removeAttr('required');
jQuery('#jform_on_save_model_field').removeAttr('aria-required');
jQuery('#jform_on_save_model_field').removeClass('required');
jform_vvvvwdhvxv_required = true;
}
jQuery('.note_expert_field_save_mode').closest('.control-group').hide();
jQuery('#jform_on_get_model_field').closest('.control-group').hide();
// remove required attribute from on_get_model_field field
if (!jform_vvvvwdhvxw_required)
{
updateFieldRequired('on_get_model_field',1);
jQuery('#jform_on_get_model_field').removeAttr('required');
jQuery('#jform_on_get_model_field').removeAttr('aria-required');
jQuery('#jform_on_get_model_field').removeClass('required');
jform_vvvvwdhvxw_required = true;
}
}
}
// the vvvvwdh Some function
function datatype_vvvvwdh_SomeFunc(datatype_vvvvwdh)
{
// set the function logic
if (datatype_vvvvwdh == 'CHAR' || datatype_vvvvwdh == 'VARCHAR' || datatype_vvvvwdh == 'TEXT' || datatype_vvvvwdh == 'MEDIUMTEXT' || datatype_vvvvwdh == 'LONGTEXT' || datatype_vvvvwdh == 'BLOB' || datatype_vvvvwdh == 'TINYBLOB' || datatype_vvvvwdh == 'MEDIUMBLOB' || datatype_vvvvwdh == 'LONGBLOB')
{
return true;
}
return false;
}
// the vvvvwdh Some function
function store_vvvvwdh_SomeFunc(store_vvvvwdh)
{
// set the function logic
if (store_vvvvwdh == 6)
{
return true;
}
return false;
}
// the vvvvwdi function
function vvvvwdi(add_css_view_vvvvwdi)
{
// set the function logic
if (add_css_view_vvvvwdi == 1)
if (add_css_view_vvvvwdg == 1)
{
jQuery('#jform_css_view-lbl').closest('.control-group').show();
}
@ -629,11 +434,11 @@ function vvvvwdi(add_css_view_vvvvwdi)
}
}
// the vvvvwdj function
function vvvvwdj(add_css_views_vvvvwdj)
// the vvvvwdh function
function vvvvwdh(add_css_views_vvvvwdh)
{
// set the function logic
if (add_css_views_vvvvwdj == 1)
if (add_css_views_vvvvwdh == 1)
{
jQuery('#jform_css_views-lbl').closest('.control-group').show();
}
@ -643,11 +448,11 @@ function vvvvwdj(add_css_views_vvvvwdj)
}
}
// the vvvvwdk function
function vvvvwdk(add_javascript_view_footer_vvvvwdk)
// the vvvvwdi function
function vvvvwdi(add_javascript_view_footer_vvvvwdi)
{
// set the function logic
if (add_javascript_view_footer_vvvvwdk == 1)
if (add_javascript_view_footer_vvvvwdi == 1)
{
jQuery('#jform_javascript_view_footer-lbl').closest('.control-group').show();
}
@ -657,11 +462,11 @@ function vvvvwdk(add_javascript_view_footer_vvvvwdk)
}
}
// the vvvvwdl function
function vvvvwdl(add_javascript_views_footer_vvvvwdl)
// the vvvvwdj function
function vvvvwdj(add_javascript_views_footer_vvvvwdj)
{
// set the function logic
if (add_javascript_views_footer_vvvvwdl == 1)
if (add_javascript_views_footer_vvvvwdj == 1)
{
jQuery('#jform_javascript_views_footer-lbl').closest('.control-group').show();
}

View File

@ -227,8 +227,7 @@
type="category"
name="catid"
label="COM_COMPONENTBUILDER_FIELD_CATID_LABEL"
extension="com_componentbuilder.fields"
default=""
extension="com_componentbuilder.field"
description="COM_COMPONENTBUILDER_FIELD_CATID_DESCRIPTION"
class="inputbox"
/>

File diff suppressed because it is too large Load Diff

View File

@ -449,7 +449,7 @@
type="category"
name="catid"
label="COM_COMPONENTBUILDER_FIELDTYPE_CATID_LABEL"
extension="com_componentbuilder.fieldtypes"
extension="com_componentbuilder.fieldtype"
default=""
description="COM_COMPONENTBUILDER_FIELDTYPE_CATID_DESCRIPTION"
class="inputbox"

View File

@ -9,98 +9,210 @@
*/
// Some Global Values
jform_vvvvwekvyq_required = false;
jform_vvvvwelvyr_required = false;
jform_vvvvwemvys_required = false;
jform_vvvvwenvyt_required = false;
jform_vvvvwepvyu_required = false;
jform_vvvvweivyn_required = false;
jform_vvvvwejvyo_required = false;
jform_vvvvwekvyp_required = false;
jform_vvvvwelvyq_required = false;
jform_vvvvwenvyr_required = false;
// Initial Script
jQuery(document).ready(function()
{
var location_vvvvwek = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwek(location_vvvvwek);
var location_vvvvwei = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwei(location_vvvvwei);
var location_vvvvwel = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwel(location_vvvvwel);
var location_vvvvwej = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwej(location_vvvvwej);
var type_vvvvwek = jQuery("#jform_type").val();
vvvvwek(type_vvvvwek);
var type_vvvvwel = jQuery("#jform_type").val();
vvvvwel(type_vvvvwel);
var type_vvvvwem = jQuery("#jform_type").val();
vvvvwem(type_vvvvwem);
var type_vvvvwen = jQuery("#jform_type").val();
vvvvwen(type_vvvvwen);
var type_vvvvweo = jQuery("#jform_type").val();
vvvvweo(type_vvvvweo);
var target_vvvvwep = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwep(target_vvvvwep);
var target_vvvvwen = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwen(target_vvvvwen);
});
// the vvvvwek function
function vvvvwek(location_vvvvwek)
// the vvvvwei function
function vvvvwei(location_vvvvwei)
{
// set the function logic
if (location_vvvvwek == 1)
if (location_vvvvwei == 1)
{
jQuery('#jform_admin_view').closest('.control-group').show();
// add required attribute to admin_view field
if (jform_vvvvwekvyq_required)
if (jform_vvvvweivyn_required)
{
updateFieldRequired('admin_view',0);
jQuery('#jform_admin_view').prop('required','required');
jQuery('#jform_admin_view').attr('aria-required',true);
jQuery('#jform_admin_view').addClass('required');
jform_vvvvwekvyq_required = false;
jform_vvvvweivyn_required = false;
}
}
else
{
jQuery('#jform_admin_view').closest('.control-group').hide();
// remove required attribute from admin_view field
if (!jform_vvvvwekvyq_required)
if (!jform_vvvvweivyn_required)
{
updateFieldRequired('admin_view',1);
jQuery('#jform_admin_view').removeAttr('required');
jQuery('#jform_admin_view').removeAttr('aria-required');
jQuery('#jform_admin_view').removeClass('required');
jform_vvvvwekvyq_required = true;
jform_vvvvweivyn_required = true;
}
}
}
// the vvvvwel function
function vvvvwel(location_vvvvwel)
// the vvvvwej function
function vvvvwej(location_vvvvwej)
{
// set the function logic
if (location_vvvvwel == 2)
if (location_vvvvwej == 2)
{
jQuery('#jform_site_view').closest('.control-group').show();
// add required attribute to site_view field
if (jform_vvvvwelvyr_required)
if (jform_vvvvwejvyo_required)
{
updateFieldRequired('site_view',0);
jQuery('#jform_site_view').prop('required','required');
jQuery('#jform_site_view').attr('aria-required',true);
jQuery('#jform_site_view').addClass('required');
jform_vvvvwelvyr_required = false;
jform_vvvvwejvyo_required = false;
}
}
else
{
jQuery('#jform_site_view').closest('.control-group').hide();
// remove required attribute from site_view field
if (!jform_vvvvwelvyr_required)
if (!jform_vvvvwejvyo_required)
{
updateFieldRequired('site_view',1);
jQuery('#jform_site_view').removeAttr('required');
jQuery('#jform_site_view').removeAttr('aria-required');
jQuery('#jform_site_view').removeClass('required');
jform_vvvvwelvyr_required = true;
jform_vvvvwejvyo_required = true;
}
}
}
// the vvvvwek function
function vvvvwek(type_vvvvwek)
{
if (isSet(type_vvvvwek) && type_vvvvwek.constructor !== Array)
{
var temp_vvvvwek = type_vvvvwek;
var type_vvvvwek = [];
type_vvvvwek.push(temp_vvvvwek);
}
else if (!isSet(type_vvvvwek))
{
var type_vvvvwek = [];
}
var type = type_vvvvwek.some(type_vvvvwek_SomeFunc);
// set this function logic
if (type)
{
jQuery('#jform_url').closest('.control-group').show();
// add required attribute to url field
if (jform_vvvvwekvyp_required)
{
updateFieldRequired('url',0);
jQuery('#jform_url').prop('required','required');
jQuery('#jform_url').attr('aria-required',true);
jQuery('#jform_url').addClass('required');
jform_vvvvwekvyp_required = false;
}
}
else
{
jQuery('#jform_url').closest('.control-group').hide();
// remove required attribute from url field
if (!jform_vvvvwekvyp_required)
{
updateFieldRequired('url',1);
jQuery('#jform_url').removeAttr('required');
jQuery('#jform_url').removeAttr('aria-required');
jQuery('#jform_url').removeClass('required');
jform_vvvvwekvyp_required = true;
}
}
}
// the vvvvwek Some function
function type_vvvvwek_SomeFunc(type_vvvvwek)
{
// set the function logic
if (type_vvvvwek == 3)
{
return true;
}
return false;
}
// the vvvvwel function
function vvvvwel(type_vvvvwel)
{
if (isSet(type_vvvvwel) && type_vvvvwel.constructor !== Array)
{
var temp_vvvvwel = type_vvvvwel;
var type_vvvvwel = [];
type_vvvvwel.push(temp_vvvvwel);
}
else if (!isSet(type_vvvvwel))
{
var type_vvvvwel = [];
}
var type = type_vvvvwel.some(type_vvvvwel_SomeFunc);
// set this function logic
if (type)
{
jQuery('#jform_article').closest('.control-group').show();
// add required attribute to article field
if (jform_vvvvwelvyq_required)
{
updateFieldRequired('article',0);
jQuery('#jform_article').prop('required','required');
jQuery('#jform_article').attr('aria-required',true);
jQuery('#jform_article').addClass('required');
jform_vvvvwelvyq_required = false;
}
}
else
{
jQuery('#jform_article').closest('.control-group').hide();
// remove required attribute from article field
if (!jform_vvvvwelvyq_required)
{
updateFieldRequired('article',1);
jQuery('#jform_article').removeAttr('required');
jQuery('#jform_article').removeAttr('aria-required');
jQuery('#jform_article').removeClass('required');
jform_vvvvwelvyq_required = true;
}
}
}
// the vvvvwel Some function
function type_vvvvwel_SomeFunc(type_vvvvwel)
{
// set the function logic
if (type_vvvvwel == 1)
{
return true;
}
return false;
}
// the vvvvwem function
function vvvvwem(type_vvvvwem)
{
@ -117,118 +229,6 @@ function vvvvwem(type_vvvvwem)
var type = type_vvvvwem.some(type_vvvvwem_SomeFunc);
// set this function logic
if (type)
{
jQuery('#jform_url').closest('.control-group').show();
// add required attribute to url field
if (jform_vvvvwemvys_required)
{
updateFieldRequired('url',0);
jQuery('#jform_url').prop('required','required');
jQuery('#jform_url').attr('aria-required',true);
jQuery('#jform_url').addClass('required');
jform_vvvvwemvys_required = false;
}
}
else
{
jQuery('#jform_url').closest('.control-group').hide();
// remove required attribute from url field
if (!jform_vvvvwemvys_required)
{
updateFieldRequired('url',1);
jQuery('#jform_url').removeAttr('required');
jQuery('#jform_url').removeAttr('aria-required');
jQuery('#jform_url').removeClass('required');
jform_vvvvwemvys_required = true;
}
}
}
// the vvvvwem Some function
function type_vvvvwem_SomeFunc(type_vvvvwem)
{
// set the function logic
if (type_vvvvwem == 3)
{
return true;
}
return false;
}
// the vvvvwen function
function vvvvwen(type_vvvvwen)
{
if (isSet(type_vvvvwen) && type_vvvvwen.constructor !== Array)
{
var temp_vvvvwen = type_vvvvwen;
var type_vvvvwen = [];
type_vvvvwen.push(temp_vvvvwen);
}
else if (!isSet(type_vvvvwen))
{
var type_vvvvwen = [];
}
var type = type_vvvvwen.some(type_vvvvwen_SomeFunc);
// set this function logic
if (type)
{
jQuery('#jform_article').closest('.control-group').show();
// add required attribute to article field
if (jform_vvvvwenvyt_required)
{
updateFieldRequired('article',0);
jQuery('#jform_article').prop('required','required');
jQuery('#jform_article').attr('aria-required',true);
jQuery('#jform_article').addClass('required');
jform_vvvvwenvyt_required = false;
}
}
else
{
jQuery('#jform_article').closest('.control-group').hide();
// remove required attribute from article field
if (!jform_vvvvwenvyt_required)
{
updateFieldRequired('article',1);
jQuery('#jform_article').removeAttr('required');
jQuery('#jform_article').removeAttr('aria-required');
jQuery('#jform_article').removeClass('required');
jform_vvvvwenvyt_required = true;
}
}
}
// the vvvvwen Some function
function type_vvvvwen_SomeFunc(type_vvvvwen)
{
// set the function logic
if (type_vvvvwen == 1)
{
return true;
}
return false;
}
// the vvvvweo function
function vvvvweo(type_vvvvweo)
{
if (isSet(type_vvvvweo) && type_vvvvweo.constructor !== Array)
{
var temp_vvvvweo = type_vvvvweo;
var type_vvvvweo = [];
type_vvvvweo.push(temp_vvvvweo);
}
else if (!isSet(type_vvvvweo))
{
var type_vvvvweo = [];
}
var type = type_vvvvweo.some(type_vvvvweo_SomeFunc);
// set this function logic
if (type)
{
@ -240,45 +240,45 @@ function vvvvweo(type_vvvvweo)
}
}
// the vvvvweo Some function
function type_vvvvweo_SomeFunc(type_vvvvweo)
// the vvvvwem Some function
function type_vvvvwem_SomeFunc(type_vvvvwem)
{
// set the function logic
if (type_vvvvweo == 2)
if (type_vvvvwem == 2)
{
return true;
}
return false;
}
// the vvvvwep function
function vvvvwep(target_vvvvwep)
// the vvvvwen function
function vvvvwen(target_vvvvwen)
{
// set the function logic
if (target_vvvvwep == 1)
if (target_vvvvwen == 1)
{
jQuery('#jform_groups').closest('.control-group').show();
// add required attribute to groups field
if (jform_vvvvwepvyu_required)
if (jform_vvvvwenvyr_required)
{
updateFieldRequired('groups',0);
jQuery('#jform_groups').prop('required','required');
jQuery('#jform_groups').attr('aria-required',true);
jQuery('#jform_groups').addClass('required');
jform_vvvvwepvyu_required = false;
jform_vvvvwenvyr_required = false;
}
}
else
{
jQuery('#jform_groups').closest('.control-group').hide();
// remove required attribute from groups field
if (!jform_vvvvwepvyu_required)
if (!jform_vvvvwenvyr_required)
{
updateFieldRequired('groups',1);
jQuery('#jform_groups').removeAttr('required');
jQuery('#jform_groups').removeAttr('aria-required');
jQuery('#jform_groups').removeClass('required');
jform_vvvvwepvyu_required = true;
jform_vvvvwenvyr_required = true;
}
}
}

View File

@ -367,7 +367,7 @@
default="Copyright (C) 2015. All Rights Reserved"
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_DESCRIPTION"
class="text_area span12"
filter="HTML"
filter="SAFEHTML"
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_HINT"
required="true"
/>

View File

@ -90,7 +90,6 @@
type="joomlamodules"
name="joomla_module"
label="COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_JOOMLA_MODULE_LABEL"
description="JFIELD_TITLE_DESC"
class="list_class span12"
multiple="false"
default="0"

View File

@ -90,7 +90,6 @@
type="joomlamodules"
name="joomla_module"
label="COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_JOOMLA_MODULE_LABEL"
description="JFIELD_TITLE_DESC"
class="list_class span12"
multiple="false"
default="0"

View File

@ -90,7 +90,6 @@
type="joomlaplugins"
name="joomla_plugin"
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_JOOMLA_PLUGIN_LABEL"
description="JFIELD_TITLE_DESC"
class="list_class span12"
multiple="false"
default="0"

View File

@ -90,7 +90,6 @@
type="joomlaplugins"
name="joomla_plugin"
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_JOOMLA_PLUGIN_LABEL"
description="JFIELD_TITLE_DESC"
class="list_class span12"
multiple="false"
default="0"

View File

@ -92,7 +92,6 @@
label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE_LABEL"
rows="4"
cols="5"
description="JFIELD_TITLE_DESC"
message="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE_MESSAGE"
class="text_area span12"
filter="safehtml"
@ -150,7 +149,7 @@
cols="20"
message="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION_MESSAGE"
class="text_area translation_text_area"
filter="SAFEHTML"
filter="RAW"
hint="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION_HINT"
/>
<!-- Language Field. Type: Lang. (custom) -->

View File

@ -9,24 +9,28 @@
*/
// Some Global Values
jform_vvvvweavyg_required = false;
jform_vvvvweavyh_required = false;
jform_vvvvweavyi_required = false;
jform_vvvvwdyvyd_required = false;
jform_vvvvwdyvye_required = false;
jform_vvvvwdyvyf_required = false;
jform_vvvvwdyvyg_required = false;
jform_vvvvwdyvyh_required = false;
jform_vvvvwdzvyi_required = false;
jform_vvvvweavyj_required = false;
jform_vvvvweavyk_required = false;
jform_vvvvwebvyl_required = false;
jform_vvvvwecvym_required = false;
jform_vvvvweevyn_required = false;
jform_vvvvwegvyo_required = false;
jform_vvvvwecvyk_required = false;
jform_vvvvweevyl_required = false;
// Initial Script
jQuery(document).ready(function()
{
var protocol_vvvvwea = jQuery("#jform_protocol").val();
vvvvwea(protocol_vvvvwea);
var protocol_vvvvwdy = jQuery("#jform_protocol").val();
vvvvwdy(protocol_vvvvwdy);
var protocol_vvvvweb = jQuery("#jform_protocol").val();
vvvvweb(protocol_vvvvweb);
var protocol_vvvvwdz = jQuery("#jform_protocol").val();
vvvvwdz(protocol_vvvvwdz);
var protocol_vvvvwea = jQuery("#jform_protocol").val();
var authentication_vvvvwea = jQuery("#jform_authentication").val();
vvvvwea(protocol_vvvvwea,authentication_vvvvwea);
var protocol_vvvvwec = jQuery("#jform_protocol").val();
var authentication_vvvvwec = jQuery("#jform_authentication").val();
@ -39,14 +43,206 @@ jQuery(document).ready(function()
var protocol_vvvvweg = jQuery("#jform_protocol").val();
var authentication_vvvvweg = jQuery("#jform_authentication").val();
vvvvweg(protocol_vvvvweg,authentication_vvvvweg);
var protocol_vvvvwei = jQuery("#jform_protocol").val();
var authentication_vvvvwei = jQuery("#jform_authentication").val();
vvvvwei(protocol_vvvvwei,authentication_vvvvwei);
});
// the vvvvwdy function
function vvvvwdy(protocol_vvvvwdy)
{
if (isSet(protocol_vvvvwdy) && protocol_vvvvwdy.constructor !== Array)
{
var temp_vvvvwdy = protocol_vvvvwdy;
var protocol_vvvvwdy = [];
protocol_vvvvwdy.push(temp_vvvvwdy);
}
else if (!isSet(protocol_vvvvwdy))
{
var protocol_vvvvwdy = [];
}
var protocol = protocol_vvvvwdy.some(protocol_vvvvwdy_SomeFunc);
// set this function logic
if (protocol)
{
jQuery('#jform_authentication').closest('.control-group').show();
// add required attribute to authentication field
if (jform_vvvvwdyvyd_required)
{
updateFieldRequired('authentication',0);
jQuery('#jform_authentication').prop('required','required');
jQuery('#jform_authentication').attr('aria-required',true);
jQuery('#jform_authentication').addClass('required');
jform_vvvvwdyvyd_required = false;
}
jQuery('#jform_host').closest('.control-group').show();
// add required attribute to host field
if (jform_vvvvwdyvye_required)
{
updateFieldRequired('host',0);
jQuery('#jform_host').prop('required','required');
jQuery('#jform_host').attr('aria-required',true);
jQuery('#jform_host').addClass('required');
jform_vvvvwdyvye_required = false;
}
jQuery('#jform_port').closest('.control-group').show();
// add required attribute to port field
if (jform_vvvvwdyvyf_required)
{
updateFieldRequired('port',0);
jQuery('#jform_port').prop('required','required');
jQuery('#jform_port').attr('aria-required',true);
jQuery('#jform_port').addClass('required');
jform_vvvvwdyvyf_required = false;
}
jQuery('#jform_path').closest('.control-group').show();
// add required attribute to path field
if (jform_vvvvwdyvyg_required)
{
updateFieldRequired('path',0);
jQuery('#jform_path').prop('required','required');
jQuery('#jform_path').attr('aria-required',true);
jQuery('#jform_path').addClass('required');
jform_vvvvwdyvyg_required = false;
}
jQuery('.note_ssh_security').closest('.control-group').show();
jQuery('#jform_username').closest('.control-group').show();
// add required attribute to username field
if (jform_vvvvwdyvyh_required)
{
updateFieldRequired('username',0);
jQuery('#jform_username').prop('required','required');
jQuery('#jform_username').attr('aria-required',true);
jQuery('#jform_username').addClass('required');
jform_vvvvwdyvyh_required = false;
}
}
else
{
jQuery('#jform_authentication').closest('.control-group').hide();
// remove required attribute from authentication field
if (!jform_vvvvwdyvyd_required)
{
updateFieldRequired('authentication',1);
jQuery('#jform_authentication').removeAttr('required');
jQuery('#jform_authentication').removeAttr('aria-required');
jQuery('#jform_authentication').removeClass('required');
jform_vvvvwdyvyd_required = true;
}
jQuery('#jform_host').closest('.control-group').hide();
// remove required attribute from host field
if (!jform_vvvvwdyvye_required)
{
updateFieldRequired('host',1);
jQuery('#jform_host').removeAttr('required');
jQuery('#jform_host').removeAttr('aria-required');
jQuery('#jform_host').removeClass('required');
jform_vvvvwdyvye_required = true;
}
jQuery('#jform_port').closest('.control-group').hide();
// remove required attribute from port field
if (!jform_vvvvwdyvyf_required)
{
updateFieldRequired('port',1);
jQuery('#jform_port').removeAttr('required');
jQuery('#jform_port').removeAttr('aria-required');
jQuery('#jform_port').removeClass('required');
jform_vvvvwdyvyf_required = true;
}
jQuery('#jform_path').closest('.control-group').hide();
// remove required attribute from path field
if (!jform_vvvvwdyvyg_required)
{
updateFieldRequired('path',1);
jQuery('#jform_path').removeAttr('required');
jQuery('#jform_path').removeAttr('aria-required');
jQuery('#jform_path').removeClass('required');
jform_vvvvwdyvyg_required = true;
}
jQuery('.note_ssh_security').closest('.control-group').hide();
jQuery('#jform_username').closest('.control-group').hide();
// remove required attribute from username field
if (!jform_vvvvwdyvyh_required)
{
updateFieldRequired('username',1);
jQuery('#jform_username').removeAttr('required');
jQuery('#jform_username').removeAttr('aria-required');
jQuery('#jform_username').removeClass('required');
jform_vvvvwdyvyh_required = true;
}
}
}
// the vvvvwdy Some function
function protocol_vvvvwdy_SomeFunc(protocol_vvvvwdy)
{
// set the function logic
if (protocol_vvvvwdy == 2)
{
return true;
}
return false;
}
// the vvvvwdz function
function vvvvwdz(protocol_vvvvwdz)
{
if (isSet(protocol_vvvvwdz) && protocol_vvvvwdz.constructor !== Array)
{
var temp_vvvvwdz = protocol_vvvvwdz;
var protocol_vvvvwdz = [];
protocol_vvvvwdz.push(temp_vvvvwdz);
}
else if (!isSet(protocol_vvvvwdz))
{
var protocol_vvvvwdz = [];
}
var protocol = protocol_vvvvwdz.some(protocol_vvvvwdz_SomeFunc);
// set this function logic
if (protocol)
{
jQuery('.note_ftp_signature').closest('.control-group').show();
jQuery('#jform_signature').closest('.control-group').show();
// add required attribute to signature field
if (jform_vvvvwdzvyi_required)
{
updateFieldRequired('signature',0);
jQuery('#jform_signature').prop('required','required');
jQuery('#jform_signature').attr('aria-required',true);
jQuery('#jform_signature').addClass('required');
jform_vvvvwdzvyi_required = false;
}
}
else
{
jQuery('.note_ftp_signature').closest('.control-group').hide();
jQuery('#jform_signature').closest('.control-group').hide();
// remove required attribute from signature field
if (!jform_vvvvwdzvyi_required)
{
updateFieldRequired('signature',1);
jQuery('#jform_signature').removeAttr('required');
jQuery('#jform_signature').removeAttr('aria-required');
jQuery('#jform_signature').removeClass('required');
jform_vvvvwdzvyi_required = true;
}
}
}
// the vvvvwdz Some function
function protocol_vvvvwdz_SomeFunc(protocol_vvvvwdz)
{
// set the function logic
if (protocol_vvvvwdz == 1)
{
return true;
}
return false;
}
// the vvvvwea function
function vvvvwea(protocol_vvvvwea)
function vvvvwea(protocol_vvvvwea,authentication_vvvvwea)
{
if (isSet(protocol_vvvvwea) && protocol_vvvvwea.constructor !== Array)
{
@ -60,115 +256,45 @@ function vvvvwea(protocol_vvvvwea)
}
var protocol = protocol_vvvvwea.some(protocol_vvvvwea_SomeFunc);
if (isSet(authentication_vvvvwea) && authentication_vvvvwea.constructor !== Array)
{
var temp_vvvvwea = authentication_vvvvwea;
var authentication_vvvvwea = [];
authentication_vvvvwea.push(temp_vvvvwea);
}
else if (!isSet(authentication_vvvvwea))
{
var authentication_vvvvwea = [];
}
var authentication = authentication_vvvvwea.some(authentication_vvvvwea_SomeFunc);
// set this function logic
if (protocol)
if (protocol && authentication)
{
jQuery('#jform_authentication').closest('.control-group').show();
// add required attribute to authentication field
if (jform_vvvvweavyg_required)
{
updateFieldRequired('authentication',0);
jQuery('#jform_authentication').prop('required','required');
jQuery('#jform_authentication').attr('aria-required',true);
jQuery('#jform_authentication').addClass('required');
jform_vvvvweavyg_required = false;
}
jQuery('#jform_host').closest('.control-group').show();
// add required attribute to host field
if (jform_vvvvweavyh_required)
{
updateFieldRequired('host',0);
jQuery('#jform_host').prop('required','required');
jQuery('#jform_host').attr('aria-required',true);
jQuery('#jform_host').addClass('required');
jform_vvvvweavyh_required = false;
}
jQuery('#jform_port').closest('.control-group').show();
// add required attribute to port field
if (jform_vvvvweavyi_required)
{
updateFieldRequired('port',0);
jQuery('#jform_port').prop('required','required');
jQuery('#jform_port').attr('aria-required',true);
jQuery('#jform_port').addClass('required');
jform_vvvvweavyi_required = false;
}
jQuery('#jform_path').closest('.control-group').show();
// add required attribute to path field
jQuery('#jform_password').closest('.control-group').show();
// add required attribute to password field
if (jform_vvvvweavyj_required)
{
updateFieldRequired('path',0);
jQuery('#jform_path').prop('required','required');
jQuery('#jform_path').attr('aria-required',true);
jQuery('#jform_path').addClass('required');
updateFieldRequired('password',0);
jQuery('#jform_password').prop('required','required');
jQuery('#jform_password').attr('aria-required',true);
jQuery('#jform_password').addClass('required');
jform_vvvvweavyj_required = false;
}
jQuery('.note_ssh_security').closest('.control-group').show();
jQuery('#jform_username').closest('.control-group').show();
// add required attribute to username field
if (jform_vvvvweavyk_required)
{
updateFieldRequired('username',0);
jQuery('#jform_username').prop('required','required');
jQuery('#jform_username').attr('aria-required',true);
jQuery('#jform_username').addClass('required');
jform_vvvvweavyk_required = false;
}
}
else
{
jQuery('#jform_authentication').closest('.control-group').hide();
// remove required attribute from authentication field
if (!jform_vvvvweavyg_required)
{
updateFieldRequired('authentication',1);
jQuery('#jform_authentication').removeAttr('required');
jQuery('#jform_authentication').removeAttr('aria-required');
jQuery('#jform_authentication').removeClass('required');
jform_vvvvweavyg_required = true;
}
jQuery('#jform_host').closest('.control-group').hide();
// remove required attribute from host field
if (!jform_vvvvweavyh_required)
{
updateFieldRequired('host',1);
jQuery('#jform_host').removeAttr('required');
jQuery('#jform_host').removeAttr('aria-required');
jQuery('#jform_host').removeClass('required');
jform_vvvvweavyh_required = true;
}
jQuery('#jform_port').closest('.control-group').hide();
// remove required attribute from port field
if (!jform_vvvvweavyi_required)
{
updateFieldRequired('port',1);
jQuery('#jform_port').removeAttr('required');
jQuery('#jform_port').removeAttr('aria-required');
jQuery('#jform_port').removeClass('required');
jform_vvvvweavyi_required = true;
}
jQuery('#jform_path').closest('.control-group').hide();
// remove required attribute from path field
jQuery('#jform_password').closest('.control-group').hide();
// remove required attribute from password field
if (!jform_vvvvweavyj_required)
{
updateFieldRequired('path',1);
jQuery('#jform_path').removeAttr('required');
jQuery('#jform_path').removeAttr('aria-required');
jQuery('#jform_path').removeClass('required');
updateFieldRequired('password',1);
jQuery('#jform_password').removeAttr('required');
jQuery('#jform_password').removeAttr('aria-required');
jQuery('#jform_password').removeClass('required');
jform_vvvvweavyj_required = true;
}
jQuery('.note_ssh_security').closest('.control-group').hide();
jQuery('#jform_username').closest('.control-group').hide();
// remove required attribute from username field
if (!jform_vvvvweavyk_required)
{
updateFieldRequired('username',1);
jQuery('#jform_username').removeAttr('required');
jQuery('#jform_username').removeAttr('aria-required');
jQuery('#jform_username').removeClass('required');
jform_vvvvweavyk_required = true;
}
}
}
@ -183,58 +309,11 @@ function protocol_vvvvwea_SomeFunc(protocol_vvvvwea)
return false;
}
// the vvvvweb function
function vvvvweb(protocol_vvvvweb)
{
if (isSet(protocol_vvvvweb) && protocol_vvvvweb.constructor !== Array)
{
var temp_vvvvweb = protocol_vvvvweb;
var protocol_vvvvweb = [];
protocol_vvvvweb.push(temp_vvvvweb);
}
else if (!isSet(protocol_vvvvweb))
{
var protocol_vvvvweb = [];
}
var protocol = protocol_vvvvweb.some(protocol_vvvvweb_SomeFunc);
// set this function logic
if (protocol)
{
jQuery('.note_ftp_signature').closest('.control-group').show();
jQuery('#jform_signature').closest('.control-group').show();
// add required attribute to signature field
if (jform_vvvvwebvyl_required)
{
updateFieldRequired('signature',0);
jQuery('#jform_signature').prop('required','required');
jQuery('#jform_signature').attr('aria-required',true);
jQuery('#jform_signature').addClass('required');
jform_vvvvwebvyl_required = false;
}
}
else
{
jQuery('.note_ftp_signature').closest('.control-group').hide();
jQuery('#jform_signature').closest('.control-group').hide();
// remove required attribute from signature field
if (!jform_vvvvwebvyl_required)
{
updateFieldRequired('signature',1);
jQuery('#jform_signature').removeAttr('required');
jQuery('#jform_signature').removeAttr('aria-required');
jQuery('#jform_signature').removeClass('required');
jform_vvvvwebvyl_required = true;
}
}
}
// the vvvvweb Some function
function protocol_vvvvweb_SomeFunc(protocol_vvvvweb)
// the vvvvwea Some function
function authentication_vvvvwea_SomeFunc(authentication_vvvvwea)
{
// set the function logic
if (protocol_vvvvweb == 1)
if (authentication_vvvvwea == 1 || authentication_vvvvwea == 3 || authentication_vvvvwea == 5)
{
return true;
}
@ -272,28 +351,28 @@ function vvvvwec(protocol_vvvvwec,authentication_vvvvwec)
// set this function logic
if (protocol && authentication)
{
jQuery('#jform_password').closest('.control-group').show();
// add required attribute to password field
if (jform_vvvvwecvym_required)
jQuery('#jform_private').closest('.control-group').show();
// add required attribute to private field
if (jform_vvvvwecvyk_required)
{
updateFieldRequired('password',0);
jQuery('#jform_password').prop('required','required');
jQuery('#jform_password').attr('aria-required',true);
jQuery('#jform_password').addClass('required');
jform_vvvvwecvym_required = false;
updateFieldRequired('private',0);
jQuery('#jform_private').prop('required','required');
jQuery('#jform_private').attr('aria-required',true);
jQuery('#jform_private').addClass('required');
jform_vvvvwecvyk_required = false;
}
}
else
{
jQuery('#jform_password').closest('.control-group').hide();
// remove required attribute from password field
if (!jform_vvvvwecvym_required)
jQuery('#jform_private').closest('.control-group').hide();
// remove required attribute from private field
if (!jform_vvvvwecvyk_required)
{
updateFieldRequired('password',1);
jQuery('#jform_password').removeAttr('required');
jQuery('#jform_password').removeAttr('aria-required');
jQuery('#jform_password').removeClass('required');
jform_vvvvwecvym_required = true;
updateFieldRequired('private',1);
jQuery('#jform_private').removeAttr('required');
jQuery('#jform_private').removeAttr('aria-required');
jQuery('#jform_private').removeClass('required');
jform_vvvvwecvyk_required = true;
}
}
}
@ -313,7 +392,7 @@ function protocol_vvvvwec_SomeFunc(protocol_vvvvwec)
function authentication_vvvvwec_SomeFunc(authentication_vvvvwec)
{
// set the function logic
if (authentication_vvvvwec == 1 || authentication_vvvvwec == 3 || authentication_vvvvwec == 5)
if (authentication_vvvvwec == 2 || authentication_vvvvwec == 3)
{
return true;
}
@ -351,28 +430,28 @@ function vvvvwee(protocol_vvvvwee,authentication_vvvvwee)
// set this function logic
if (protocol && authentication)
{
jQuery('#jform_private').closest('.control-group').show();
// add required attribute to private field
if (jform_vvvvweevyn_required)
jQuery('#jform_private_key').closest('.control-group').show();
// add required attribute to private_key field
if (jform_vvvvweevyl_required)
{
updateFieldRequired('private',0);
jQuery('#jform_private').prop('required','required');
jQuery('#jform_private').attr('aria-required',true);
jQuery('#jform_private').addClass('required');
jform_vvvvweevyn_required = false;
updateFieldRequired('private_key',0);
jQuery('#jform_private_key').prop('required','required');
jQuery('#jform_private_key').attr('aria-required',true);
jQuery('#jform_private_key').addClass('required');
jform_vvvvweevyl_required = false;
}
}
else
{
jQuery('#jform_private').closest('.control-group').hide();
// remove required attribute from private field
if (!jform_vvvvweevyn_required)
jQuery('#jform_private_key').closest('.control-group').hide();
// remove required attribute from private_key field
if (!jform_vvvvweevyl_required)
{
updateFieldRequired('private',1);
jQuery('#jform_private').removeAttr('required');
jQuery('#jform_private').removeAttr('aria-required');
jQuery('#jform_private').removeClass('required');
jform_vvvvweevyn_required = true;
updateFieldRequired('private_key',1);
jQuery('#jform_private_key').removeAttr('required');
jQuery('#jform_private_key').removeAttr('aria-required');
jQuery('#jform_private_key').removeClass('required');
jform_vvvvweevyl_required = true;
}
}
}
@ -392,7 +471,7 @@ function protocol_vvvvwee_SomeFunc(protocol_vvvvwee)
function authentication_vvvvwee_SomeFunc(authentication_vvvvwee)
{
// set the function logic
if (authentication_vvvvwee == 2 || authentication_vvvvwee == 3)
if (authentication_vvvvwee == 4 || authentication_vvvvwee == 5)
{
return true;
}
@ -430,29 +509,11 @@ function vvvvweg(protocol_vvvvweg,authentication_vvvvweg)
// set this function logic
if (protocol && authentication)
{
jQuery('#jform_private_key').closest('.control-group').show();
// add required attribute to private_key field
if (jform_vvvvwegvyo_required)
{
updateFieldRequired('private_key',0);
jQuery('#jform_private_key').prop('required','required');
jQuery('#jform_private_key').attr('aria-required',true);
jQuery('#jform_private_key').addClass('required');
jform_vvvvwegvyo_required = false;
}
jQuery('#jform_secret').closest('.control-group').show();
}
else
{
jQuery('#jform_private_key').closest('.control-group').hide();
// remove required attribute from private_key field
if (!jform_vvvvwegvyo_required)
{
updateFieldRequired('private_key',1);
jQuery('#jform_private_key').removeAttr('required');
jQuery('#jform_private_key').removeAttr('aria-required');
jQuery('#jform_private_key').removeClass('required');
jform_vvvvwegvyo_required = true;
}
jQuery('#jform_secret').closest('.control-group').hide();
}
}
@ -471,68 +532,7 @@ function protocol_vvvvweg_SomeFunc(protocol_vvvvweg)
function authentication_vvvvweg_SomeFunc(authentication_vvvvweg)
{
// set the function logic
if (authentication_vvvvweg == 4 || authentication_vvvvweg == 5)
{
return true;
}
return false;
}
// the vvvvwei function
function vvvvwei(protocol_vvvvwei,authentication_vvvvwei)
{
if (isSet(protocol_vvvvwei) && protocol_vvvvwei.constructor !== Array)
{
var temp_vvvvwei = protocol_vvvvwei;
var protocol_vvvvwei = [];
protocol_vvvvwei.push(temp_vvvvwei);
}
else if (!isSet(protocol_vvvvwei))
{
var protocol_vvvvwei = [];
}
var protocol = protocol_vvvvwei.some(protocol_vvvvwei_SomeFunc);
if (isSet(authentication_vvvvwei) && authentication_vvvvwei.constructor !== Array)
{
var temp_vvvvwei = authentication_vvvvwei;
var authentication_vvvvwei = [];
authentication_vvvvwei.push(temp_vvvvwei);
}
else if (!isSet(authentication_vvvvwei))
{
var authentication_vvvvwei = [];
}
var authentication = authentication_vvvvwei.some(authentication_vvvvwei_SomeFunc);
// set this function logic
if (protocol && authentication)
{
jQuery('#jform_secret').closest('.control-group').show();
}
else
{
jQuery('#jform_secret').closest('.control-group').hide();
}
}
// the vvvvwei Some function
function protocol_vvvvwei_SomeFunc(protocol_vvvvwei)
{
// set the function logic
if (protocol_vvvvwei == 2)
{
return true;
}
return false;
}
// the vvvvwei Some function
function authentication_vvvvwei_SomeFunc(authentication_vvvvwei)
{
// set the function logic
if (authentication_vvvvwei == 2 || authentication_vvvvwei == 3 || authentication_vvvvwei == 4 || authentication_vvvvwei == 5)
if (authentication_vvvvweg == 2 || authentication_vvvvweg == 3 || authentication_vvvvweg == 4 || authentication_vvvvweg == 5)
{
return true;
}

View File

@ -415,7 +415,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);

View File

@ -278,7 +278,7 @@ class ComponentbuilderModelHelp_documents extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -296,7 +296,24 @@ class ComponentbuilderModelHelp_documents extends JModelList
// From the componentbuilder_help_document table
$query->from($db->quoteName('#__componentbuilder_help_document', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -426,7 +426,15 @@ class ComponentbuilderModelImport extends JModelLegacy
$jinput = JFactory::getApplication()->input;
foreach($target_headers as $header)
{
$data['target_headers'][$header] = $jinput->getString($header, null);
if (($column = $jinput->getString($header, false)) !== false ||
($column = $jinput->getString(strtolower($header), false)) !== false)
{
$data['target_headers'][$header] = $column;
}
else
{
$data['target_headers'][$header] = null;
}
}
// set the data
if(isset($package['dir']))

View File

@ -419,24 +419,32 @@ class ComponentbuilderModelImport_language_translations extends JModelLegacy
{
if (ComponentbuilderHelper::checkArray($target_headers))
{
// make sure the file is loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
// make sure the file is loaded
ComponentbuilderHelper::composerAutoload('phpspreadsheet');
$jinput = JFactory::getApplication()->input;
foreach($target_headers as $header)
{
$data['target_headers'][$header] = $jinput->getString($header, null);
if (($column = $jinput->getString($header, false)) !== false ||
($column = $jinput->getString(strtolower($header), false)) !== false)
{
$data['target_headers'][$header] = $column;
}
else
{
$data['target_headers'][$header] = null;
}
}
// set the data
if(isset($package['dir']))
{
$inputFileType = PHPExcel_IOFactory::identify($package['dir']);
$excelReader = PHPExcel_IOFactory::createReader($inputFileType);
$inputFileType = IOFactory::identify($package['dir']);
$excelReader = IOFactory::createReader($inputFileType);
$excelReader->setReadDataOnly(true);
$excelObj = $excelReader->load($package['dir']);
$data['array'] = $excelObj->getActiveSheet()->toArray(null, true,true,true);
$excelObj->disconnectWorksheets();
unset($excelObj);
return $this->save($data,$table);
return $this->save($data, $table);
}
}
return false;
@ -463,10 +471,14 @@ class ComponentbuilderModelImport_language_translations extends JModelLegacy
{
$source_key = $data['target_headers']['Source'];
}
else
elseif (isset($data['target_headers']['English']))
{
$source_key = $data['target_headers']['English'];
}
else
{
$source_key = null;
}
// get the first array set
$firstSet = reset($data['array']);
// check if first array is a header array and remove if true

View File

@ -694,8 +694,8 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -878,7 +878,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
@ -1385,8 +1385,15 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "joomla_component", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('joomla_component', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "joomla_component", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -1672,6 +1672,11 @@ class ComponentbuilderModelJoomla_components extends JModelList
*/
protected function setLanguageTranslation(&$id, $target = 'components')
{
// check if the export of language strings is allowed
if ($this->params->get('export_language_strings', 1) != 1)
{
return;
}
// Create a new query object.
$query = $this->_db->getQuery(true);
$query->select(array('a.*'));
@ -2252,7 +2257,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -2270,7 +2275,24 @@ class ComponentbuilderModelJoomla_components extends JModelList
// From the componentbuilder_joomla_component table
$query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -514,8 +514,8 @@ class ComponentbuilderModelJoomla_module extends JModelAdmin
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -698,7 +698,7 @@ class ComponentbuilderModelJoomla_module extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
@ -1199,8 +1199,15 @@ class ComponentbuilderModelJoomla_module extends JModelAdmin
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "joomla_module", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('joomla_module', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "joomla_module", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -479,8 +479,8 @@ class ComponentbuilderModelJoomla_plugin extends JModelAdmin
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -663,7 +663,7 @@ class ComponentbuilderModelJoomla_plugin extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
@ -1162,8 +1162,15 @@ class ComponentbuilderModelJoomla_plugin extends JModelAdmin
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "joomla_plugin", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('joomla_plugin', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "joomla_plugin", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -249,7 +249,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -267,7 +267,24 @@ class ComponentbuilderModelLanguage_translations extends JModelList
// From the componentbuilder_language_translation table
$query->from($db->quoteName('#__componentbuilder_language_translation', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -322,7 +322,7 @@ class ComponentbuilderModelLanguages extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -340,7 +340,24 @@ class ComponentbuilderModelLanguages extends JModelList
// From the componentbuilder_language table
$query->from($db->quoteName('#__componentbuilder_language', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -255,7 +255,7 @@ class ComponentbuilderModelLayouts extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -273,7 +273,24 @@ class ComponentbuilderModelLayouts extends JModelList
// From the componentbuilder_layout table
$query->from($db->quoteName('#__componentbuilder_layout', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -358,8 +358,8 @@ class ComponentbuilderModelLibrary extends JModelAdmin
}
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -542,7 +542,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
@ -1048,8 +1048,15 @@ class ComponentbuilderModelLibrary extends JModelAdmin
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "library", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('library', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "library", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -201,7 +201,7 @@ class ComponentbuilderModelPlaceholders extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -219,7 +219,24 @@ class ComponentbuilderModelPlaceholders extends JModelList
// From the componentbuilder_placeholder table
$query->from($db->quoteName('#__componentbuilder_placeholder', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -191,7 +191,7 @@ class ComponentbuilderModelServer extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getVyplinked_components()
public function getVymlinked_components()
{
// Get the user object.
$user = JFactory::getUser();
@ -557,7 +557,7 @@ class ComponentbuilderModelServer extends JModelAdmin
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (ComponentbuilderHelper::checkString($data['not_required']))
if (isset($data['not_required']) && ComponentbuilderHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);

View File

@ -244,7 +244,7 @@ class ComponentbuilderModelServers extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -262,7 +262,24 @@ class ComponentbuilderModelServers extends JModelList
// From the componentbuilder_server table
$query->from($db->quoteName('#__componentbuilder_server', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -527,8 +527,8 @@ class ComponentbuilderModelSite_view extends JModelAdmin
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -1146,8 +1146,15 @@ class ComponentbuilderModelSite_view extends JModelAdmin
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "site_view", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('site_view', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "site_view", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -287,7 +287,7 @@ class ComponentbuilderModelSite_views extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -305,7 +305,24 @@ class ComponentbuilderModelSite_views extends JModelList
// From the componentbuilder_site_view table
$query->from($db->quoteName('#__componentbuilder_site_view', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -243,8 +243,8 @@ class ComponentbuilderModelSnippet extends JModelAdmin
}
}
// Only load the GUID if new item
if (0 == $id)
// Only load the GUID if new item (or empty)
if (0 == $id || !($val = $form->getValue('guid')))
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
@ -852,8 +852,15 @@ class ComponentbuilderModelSnippet extends JModelAdmin
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'], "snippet", $data['id']))
if (empty($data['guid']) && $data['id'] > 0)
{
// get the existing one
$data['guid'] = (string) ComponentbuilderHelper::getVar('snippet', $data['id'], 'id', 'guid');
}
// Set the GUID if empty or not valid
while (!ComponentbuilderHelper::validGUID($data['guid'], "snippet", $data['id']))
{
// must always be set
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}

View File

@ -343,7 +343,7 @@ class ComponentbuilderModelSnippets extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -361,7 +361,24 @@ class ComponentbuilderModelSnippets extends JModelList
// From the componentbuilder_snippet table
$query->from($db->quoteName('#__componentbuilder_snippet', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -255,7 +255,7 @@ class ComponentbuilderModelTemplates extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -273,7 +273,24 @@ class ComponentbuilderModelTemplates extends JModelList
// From the componentbuilder_template table
$query->from($db->quoteName('#__componentbuilder_template', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

View File

@ -199,7 +199,7 @@ class ComponentbuilderModelValidation_rules extends JModelList
public function getExportData($pks, $user = null)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (($pks_size = ComponentbuilderHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true;
@ -217,7 +217,24 @@ class ComponentbuilderModelValidation_rules extends JModelList
// From the componentbuilder_validation_rule table
$query->from($db->quoteName('#__componentbuilder_validation_rule', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// The bulk export path
if ('bulk' === $pks)
{
$query->where('a.id > 0');
}
// A large array of ID's will not work out well
elseif ($pks_size > 500)
{
// Use lowest ID
$query->where('a.id >= ' . (int) min($pks));
// Use highest ID
$query->where('a.id <= ' . (int) max($pks));
}
// The normal default path
else
{
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{

File diff suppressed because one or more lines are too long

View File

@ -63,7 +63,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'admin_custom_tabsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('admin_custom_tabs.delete') || $this->canDo->get('admin_custom_tabs.edit.created_by') || $this->canDo->get('admin_custom_tabs.edit.state') || $this->canDo->get('admin_custom_tabs.edit.created')) : ?>
<?php if ($this->canDo->get('admin_custom_tabs.edit.created_by') || $this->canDo->get('admin_custom_tabs.edit.created') || $this->canDo->get('admin_custom_tabs.edit.state') || ($this->canDo->get('admin_custom_tabs.delete') && $this->canDo->get('admin_custom_tabs.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_custom_tabsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">

View File

@ -189,7 +189,13 @@ class ComponentbuilderViewAdmin_custom_tabs extends JViewLegacy
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admin_custom_tabs.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_custom_tabs/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_custom_tabs/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
JText::script('view not acceptable. Error');
}
}

View File

@ -63,7 +63,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'admin_fieldsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('admin_fields.delete') || $this->canDo->get('admin_fields.edit.created_by') || $this->canDo->get('admin_fields.edit.state') || $this->canDo->get('admin_fields.edit.created')) : ?>
<?php if ($this->canDo->get('admin_fields.edit.created_by') || $this->canDo->get('admin_fields.edit.created') || $this->canDo->get('admin_fields.edit.state') || ($this->canDo->get('admin_fields.delete') && $this->canDo->get('admin_fields.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fieldsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">

View File

@ -191,12 +191,15 @@ class ComponentbuilderViewAdmin_fields extends JViewLegacy
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_fields/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 extra style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
// add Uikit v2 extra JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
JText::script('COM_COMPONENTBUILDER_THE_BNONE_DBB_OPTION_WILL_REMOVE_THIS_FIELD_FROM_BEING_SAVED_IN_THE_DATABASE');

View File

@ -63,7 +63,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'admin_fields_conditionsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('admin_fields_conditions.delete') || $this->canDo->get('admin_fields_conditions.edit.created_by') || $this->canDo->get('admin_fields_conditions.edit.state') || $this->canDo->get('admin_fields_conditions.edit.created')) : ?>
<?php if ($this->canDo->get('admin_fields_conditions.edit.created_by') || $this->canDo->get('admin_fields_conditions.edit.created') || $this->canDo->get('admin_fields_conditions.edit.state') || ($this->canDo->get('admin_fields_conditions.delete') && $this->canDo->get('admin_fields_conditions.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_conditionsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">

View File

@ -191,7 +191,13 @@ class ComponentbuilderViewAdmin_fields_conditions extends JViewLegacy
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_fields_conditions/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_fields_conditions/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
JText::script('view not acceptable. Error');
}
}

View File

@ -63,7 +63,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'admin_fields_relationsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('admin_fields_relations.delete') || $this->canDo->get('admin_fields_relations.edit.created_by') || $this->canDo->get('admin_fields_relations.edit.state') || $this->canDo->get('admin_fields_relations.edit.created')) : ?>
<?php if ($this->canDo->get('admin_fields_relations.edit.created_by') || $this->canDo->get('admin_fields_relations.edit.created') || $this->canDo->get('admin_fields_relations.edit.state') || ($this->canDo->get('admin_fields_relations.delete') && $this->canDo->get('admin_fields_relations.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_relationsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">

View File

@ -192,6 +192,12 @@ class ComponentbuilderViewAdmin_fields_relations extends JViewLegacy
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_fields_relations/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here

View File

@ -161,7 +161,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'admin_viewTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('admin_view.delete') || $this->canDo->get('admin_view.edit.created_by') || $this->canDo->get('admin_view.edit.state') || $this->canDo->get('admin_view.edit.created')) : ?>
<?php if ($this->canDo->get('admin_view.edit.created_by') || $this->canDo->get('admin_view.edit.created') || $this->canDo->get('admin_view.edit.state') || ($this->canDo->get('admin_view.delete') && $this->canDo->get('admin_view.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">

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