Resolved gh-410 to allow default data type values for the database to be set per fieldtype.

This commit is contained in:
2019-05-03 01:00:05 +02:00
parent b55d824e63
commit d7b555e7af
37 changed files with 2138 additions and 512 deletions

View File

@ -0,0 +1,34 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'has_defaults',
'datatype',
'datalenght',
'datalenght_other',
'datadefault',
'datadefault_other'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
?>
<?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?>

View File

@ -0,0 +1,32 @@
<?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 - 2019 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'indexes',
'null_switch',
'store',
'note_whmcs_encryption'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
?>
<?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?>

View File

@ -0,0 +1,31 @@
<?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 - 2019 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'name'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
?>
<div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?>
</div>

View File

@ -16,7 +16,8 @@ $form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'note_on_fields',
'properties'
'properties',
'not_required'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();

View File

@ -15,7 +15,6 @@ defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'name',
'catid',
'short_description'
);

View File

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

View File

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