Update the field area to be more user friendly, phase A of gh-258

This commit is contained in:
2018-04-11 22:05:47 +02:00
parent 6d4c823ea6
commit e6b2b48ac7
27 changed files with 943 additions and 412 deletions

View File

@ -58,37 +58,50 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('field.set_properties_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'fieldTab', array('active' => 'details')); ?>
<?php echo JHtml::_('bootstrap.startTabSet', 'fieldTab', array('active' => 'set_properties')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'fieldTab', 'details', JText::_('COM_COMPONENTBUILDER_FIELD_DETAILS', true)); ?>
<?php echo JHtml::_('bootstrap.addTab', 'fieldTab', 'set_properties', JText::_('COM_COMPONENTBUILDER_FIELD_SET_PROPERTIES', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('field.details_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('field.details_right', $this); ?>
</div>
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('field.details_fullwidth', $this); ?>
<?php echo JLayoutHelper::render('field.set_properties_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'fieldTab', 'data_base', JText::_('COM_COMPONENTBUILDER_FIELD_DATA_BASE', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('field.data_base_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('field.data_base_right', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'fieldTab', 'scripts', JText::_('COM_COMPONENTBUILDER_FIELD_SCRIPTS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('field.scripts_left', $this); ?>
</div>
<div class="span6">
<div class="span12">
<?php echo JLayoutHelper::render('field.scripts_right', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'fieldTab', 'type_info', JText::_('COM_COMPONENTBUILDER_FIELD_TYPE_INFO', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('field.type_info_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if ($this->canDo->get('field.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('field.edit.state') || $this->canDo->get('core.edit.created')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'fieldTab', 'publishing', JText::_('COM_COMPONENTBUILDER_FIELD_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
@ -131,7 +144,7 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
</div>
<div class="clearfix"></div>
<?php echo JLayoutHelper::render('field.details_under', $this); ?>
<?php echo JLayoutHelper::render('field.set_properties_under', $this); ?>
</form>
</div>
@ -322,22 +335,13 @@ jQuery.fn.selText = function() {
return this;
}
jQuery('#details').on('change', '#jform_fieldtype',function (e) {
jQuery('#adminForm').on('change', '#jform_fieldtype',function (e) {
e.preventDefault();
// get type value
var fieldId = jQuery("#jform_fieldtype option:selected").val();
getFieldOptions(fieldId,true);
getFieldOptions(fieldId);
});
jQuery(document).ready(function() {
// get type value
var fieldId = jQuery("#jform_fieldtype option:selected").val();
if(jQuery('#jform_xml').length == 0) {
getFieldOptions(fieldId,true);
} else {
getFieldOptions(fieldId,false);
}
});
<?php
$app = JFactory::getApplication();

View File

@ -209,7 +209,16 @@ class ComponentbuilderViewField extends JViewLegacy
$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);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
// add the libs for subform (since not adding it via xml but ajax)
JHtml::_('jquery.ui', array('core', 'sortable'));
JHtml::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true));
// set some lang
JText::script('COM_COMPONENTBUILDER_PROPERTY_ALREADY_SELECTED_TRY_ANOTHER');
JText::script('COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS');
JText::script('COM_COMPONENTBUILDER_NO_RESULTS_MATCH');
JText::script('COM_COMPONENTBUILDER_SELECT_A_PROPERTY');
JText::script('COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND');
JText::script('view not acceptable. Error');
}
}