<?php

namespace JetStudioModule\DataModel;

use Jet\Tr;
use Jet\UI;
use Jet\UI_button;
use JetStudio\JetStudio;

$current = DataModels::getCurrentProperty();


$form = $current->getEditForm();

echo $form->start();

$default_fields = [
	'type',
	'name',
	'database_column_name',

	'is_id',
	'is_key',
	'is_do_not_export',
];
?>
<br>
<div class="form-fields">
<?php

foreach( $default_fields as $fn ) {
	if( !$form->fieldExists( $fn ) ) {
		continue;
	}

	echo $form->field( $fn );
}


$current->showEditFormFields();

?>
	<div></div>
	<div>
		<?=UI::button(Tr::_('Form field definition'))->setUrl(
			JetStudio::getModule_Forms()?->getPropertyEditURL( DataModels::getCurrentClassName(), $current->getName() )??''
		)->setClass( UI_button::CLASS_INFO )?><br><br>
		
	</div>
</div>
	<?php
echo $form->end();
