<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.3.0
 * @author	hikashop.com
 * @copyright	(C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><fieldset>
	<div class="toolbar" id="toolbar" style="float: right;">
		<button class="btn" type="button" onclick="submitbutton('save_translation');"><img src="<?php echo HIKASHOP_IMAGES; ?>save.png"/><?php echo JText::_('OK'); ?></button>
	</div>
</fieldset>
<div class="iframedoc" id="iframedoc"></div>
<form action="index.php?option=<?php echo HIKASHOP_COMPONENT ?>&amp;ctrl=category" method="post"  name="adminForm" id="adminForm" enctype="multipart/form-data">

<?php
	echo $this->tabs->startPane( 'translations');
		if(!empty($this->element->translations)){
			foreach($this->element->translations as $language_id => $translation){
				$this->category_name_input = "translation[category_name][".$language_id."]";
				$this->element->category_name = @$translation->category_name->value;
				$this->editor->name = 'translation_category_description_'.$language_id;
				$this->element->category_description = @$translation->category_description->value;
				if(isset($translation->category_name->published)){
					$this->category_name_published = $translation->category_name->published;
					$this->category_name_id = $translation->category_name->id;
				}
				if(isset($translation->category_description->published)){
					$this->category_description_published = $translation->category_description->published;
					$this->category_description_id = $translation->category_description->id;
				}
				$this->category_meta_description_input = "translation[category_meta_description][".$language_id."]";
				$this->element->category_meta_description = @$translation->category_meta_description->value;
				if(isset($translation->category_meta_description->published)){
					$this->category_meta_description_published = $translation->category_meta_description->published;
					$this->category_meta_description_id = $translation->category_meta_description->id;
				}

				$this->category_keywords_input = "translation[category_keywords][".$language_id."]";
				$this->element->category_keywords = @$translation->category_keywords->value;
				if(isset($translation->category_keywords->published)){
					$this->category_keywords_published = $translation->category_keywords->published;
					$this->category_keywords_id = $translation->category_keywords->id;
				}

				$this->category_page_title_input = "translation[category_page_title][".$language_id."]";
				$this->element->category_page_title = @$translation->category_page_title->value;
				if(isset($translation->category_page_title->published)){
					$this->category_page_title_published = $translation->category_page_title->published;
					$this->category_page_title_id = $translation->category_page_title->id;
				}
				$this->category_alias_input = "translation[category_alias][".$language_id."]";
				$this->element->category_alias = @$translation->category_alias->value;
				if(isset($translation->category_alias->published)){
					$this->category_alias_published = $translation->category_alias->published;
					$this->category_alias_id = $translation->category_alias->id;
				}
				$this->category_canonical_input = "translation[category_canonical][".$language_id."]";
				$this->element->category_canonical = @$translation->category_canonical->value;
				if(isset($translation->category_canonical->published)){
					$this->category_canonical_published = $translation->category_canonical->published;
					$this->category_canonical_id = $translation->category_canonical->id;
				}
				echo $this->tabs->startPanel($this->transHelper->getFlag($language_id), 'translation_'.$language_id);
					$this->setLayout('normal');
					echo $this->loadTemplate();
				echo $this->tabs->endPanel();
			}
		}
	echo $this->tabs->endPane();
?>
	<input type="hidden" name="cid[]" value="<?php echo @$this->element->category_id; ?>" />
	<input type="hidden" name="option" value="<?php echo HIKASHOP_COMPONENT; ?>" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="ctrl" value="category" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
