<?php
/**
 * @package DJ-Catalog2
 * @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
 * @license http://www.gnu.org/licenses GNU/GPL
 * @author url: http://dj-extensions.com
 * @author email contact@dj-extensions.com
 */

// no direct access
defined('_JEXEC') or die;

Joomla\CMS\Factory::getDocument()->getWebAssetManager()->useScript('form.validate');

//Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen', 'select');

//Joomla\CMS\HTML\HTMLHelper::_('behavior.tabstate');

$app = JFactory::getApplication();

?>
<script type="text/javascript">
	Joomla.submitbutton = function(task)
	{
		if (task == 'producercategory.cancel' || document.formvalidator.isValid(document.getElementById('producercategory-form'))) {
			Joomla.submitform(task, document.getElementById('producercategory-form'));
		}
		else {
			alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED'));?>');
		}
	}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_djcatalog2&view=producercategory&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="producercategory-form" class="form-validate" enctype="multipart/form-data">
	<div class="row row-fluid">
		<div class="col-md-12 form-horizontal">
			<fieldset>
			
				<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.startTabSet', 'myTab', array('recall' => true, 'active' => 'details')); ?>
				
				<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.addTab', 'myTab', 'details', JText::_('COM_DJCATALOG2_EDIT')); ?>
				
				<?php echo $this->form->renderField('name'); ?>
				<?php echo $this->form->renderField('alias'); ?>
				<?php echo $this->form->renderField('parent_id'); ?>
				<?php echo $this->form->renderField('published'); ?>
				<?php echo $this->form->renderField('language'); ?>
				<?php echo $this->form->renderField('access'); ?>
				<?php echo $this->form->renderField('id'); ?>
				<?php echo $this->form->renderField('created'); ?>
				
				<?php echo $this->form->renderField('created_by'); ?>
				<?php echo $this->form->renderField('description'); ?>
				
				<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.endTab'); ?>
				
				<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.addTab', 'myTab', 'publishing', JText::_('JGLOBAL_FIELDSET_PUBLISHING')); ?>
				
				<div class="control-group">
					<div class="control-label"><?php echo $this->form->getLabel('heading'); ?></div>
					<div class="controls"><?php echo $this->form->getInput('heading'); ?></div>
				</div>
				<div class="control-group">
					<div class="control-label"><?php echo $this->form->getLabel('metatitle'); ?></div>
					<div class="controls"><?php echo $this->form->getInput('metatitle'); ?></div>
				</div>
				
				<div class="control-group">
					<div class="control-label"><?php echo $this->form->getLabel('metadesc'); ?></div>
					<div class="controls"><?php echo $this->form->getInput('metadesc'); ?></div>
				</div>
				
				<div class="control-group">
					<div class="control-label"><?php echo $this->form->getLabel('metakey'); ?></div>
					<div class="controls"><?php echo $this->form->getInput('metakey'); ?></div>
				</div>
				
				<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.endTab'); ?>
				
				<?php if (JLanguageAssociations::isEnabled()) : ?>
				<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.addTab', 'myTab', 'associations', JText::_('COM_DJCATALOG2_ASSOCIATIONS')); ?>
					<div class="row row-fluid">
						<div class="col-md-12">
							<?php echo JLayoutHelper::render('joomla.edit.associations', $this);  ?>
						</div>
					</div>
				<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.endTab'); ?>
				<?php endif; ?>
				
				<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.addTab', 'myTab', 'images', JText::_('COM_DJCATALOG2_IMAGES')); ?>
					<?php echo DJCatalog2ImageHelper::renderInput('producercategory',$app->input->get('id', null, 'int'), (bool)JComponentHelper::getParams('com_djcatalog2')->get('multiple_image_upload', true)); ?>
				<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.endTab'); ?>
				
				<?php echo $this->loadTemplate('params'); ?>
				
				<?php echo Joomla\CMS\HTML\HTMLHelper::_('uitab.endTabSet'); ?>
				
			</fieldset>
		</div>
	</div>
	<input type="hidden" name="task" value="" />
	<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token'); ?>
</form>