<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/information.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="save('save');" class="button"><?php echo $button_save; ?></a><a onclick="$('#form').submit();" class="button"><?php echo $button_saveclose; ?></a><a onclick="save('new');" class="button"><?php echo $button_savenew; ?></a><a href="<?php echo $cancel; ?>" class="button"><?php echo $button_cancel; ?></a></div>
    </div>
    <div class="content">
      <div id="tabs" class="htabs"><a href="#tab-general"><?php echo $tab_general; ?></a><a href="#tab-data"><?php echo $tab_data; ?></a><a href="#tab-design"><?php echo $tab_design; ?></a><?php if (MijoShop::get('base')->isMijosefInstalled()) { ?><a href="#tab-mijosef">MijoSEF</a><?php } ?></div>
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
		<script language="text/javascript">
			function submitbutton(pressbutton) {
				<?php foreach ($languages as $language) { ?>
					<?php echo MijoShop::get('base')->editor()->save("information_description[".$language['language_id']."][description]"); ?>
				<?php } ?>
				submitform(pressbutton);
			}
		</script>
		
        <div id="tab-general">
          <div id="languages" class="htabs">
            <?php foreach ($languages as $language) { ?>
            <a href="#language<?php echo $language['language_id']; ?>"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a>
            <?php } ?>
          </div>
          <?php foreach ($languages as $language) { ?>
          <div id="language<?php echo $language['language_id']; ?>">
            <table class="form">
              <tr>
                <td><span class="required">*</span> <?php echo $entry_title; ?></td>
                <td><input type="text" name="information_description[<?php echo $language['language_id']; ?>][title]" size="100" value="<?php echo isset($information_description[$language['language_id']]) ? $information_description[$language['language_id']]['title'] : ''; ?>" />
                  <?php if (isset($error_title[$language['language_id']])) { ?>
                  <span class="error"><?php echo $error_title[$language['language_id']]; ?></span>
                  <?php } ?></td>
              </tr>
              <tr>
                  <td><?php echo JText::_('COM_MIJOSHOP_ALIAS'); ?></td>
                  <td><input type="text" size="100" name="keyword[<?php echo $language['language_id']; ?>]" value="<?php echo isset($keyword[$language['language_id']]) ? $keyword[$language['language_id']] : ''; ?>" /></td>
              </tr>
              <tr>
                <td><span class="required">*</span> <?php echo $entry_description; ?></td>
                <td>
					<?php
						$desc = isset($information_description[$language['language_id']]) ? $information_description[$language['language_id']]['description'] : '';
						echo MijoShop::get('base')->editor()->display("information_description[".$language['language_id']."][description]", $desc, '97% !important', '320', '50', '11');
					?>
					
                  <?php if (isset($error_description[$language['language_id']])) { ?>
                  <span class="error"><?php echo $error_description[$language['language_id']]; ?></span>
                  <?php } ?></td>
              </tr>
            </table>
          </div>
          <?php } ?>
        </div>
        <div id="tab-data">
          <table class="form">
            <tr>
              <td><?php echo $entry_store; ?></td>
              <td><div class="scrollbox">
                  <?php $class = 'even'; ?>
                  <div class="<?php echo $class; ?>">
                    <?php if (in_array(0, $information_store)) { ?>
                    <input type="checkbox" name="information_store[]" value="0" checked="checked" />
                    <?php echo $text_default; ?>
                    <?php } else { ?>
                    <input type="checkbox" name="information_store[]" value="0" />
                    <?php echo $text_default; ?>
                    <?php } ?>
                  </div>
                  <?php foreach ($stores as $store) { ?>
                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                  <div class="<?php echo $class; ?>">
                    <?php if (in_array($store['store_id'], $information_store)) { ?>
                    <input type="checkbox" name="information_store[]" value="<?php echo $store['store_id']; ?>" checked="checked" />
                    <?php echo $store['name']; ?>
                    <?php } else { ?>
                    <input type="checkbox" name="information_store[]" value="<?php echo $store['store_id']; ?>" />
                    <?php echo $store['name']; ?>
                    <?php } ?>
                  </div>
                  <?php } ?>
                </div></td>
            </tr>
            <tr>
              



              <td><?php echo $entry_bottom; ?></td>
              <td><?php if ($bottom) { ?>
                <input type="checkbox" name="bottom" value="1" checked="checked" />
                <?php } else { ?>
                <input type="checkbox" name="bottom" value="1" />
                <?php } ?></td>
            </tr>            
            <tr>
              <td><?php echo $entry_status; ?></td>
              <td><select name="status">
                  <?php if ($status) { ?>
                  <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                  <option value="0"><?php echo $text_disabled; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_enabled; ?></option>
                  <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                  <?php } ?>
                </select></td>
            </tr>
            <tr>
              <td><?php echo $entry_sort_order; ?></td>
              <td><input type="text" name="sort_order" value="<?php echo $sort_order; ?>" size="1" /></td>
            </tr>
          </table>
        </div>

        <?php if (MijoShop::get('base')->isMijosefInstalled()) { ?>
        <div id="tab-mijosef">
            <div id="languagessef" class="htabs">
                <?php foreach ($languages as $language) { ?>
                <a href="#languagesef<?php echo $language['language_id']; ?>"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a>
                <?php } ?>
            </div>
            <?php foreach ($languages as $language) { ?>
            <div id="languagesef<?php echo $language['language_id']; ?>">
                <table class="form">
                    <tr>
                        <td><span class="required">*</span> SEF URL</td>
                        <td><input type="text" name="mijosef[<?php echo $language['language_id']; ?>][url_sef]" size="100" value="<?php echo MijoShop::get('mijosef')->get('url_sef', 'information', JRequest::getInt('information_id', 0, 'get'), $language['language_id']); ?>" />
                    </tr>
                    <tr>
                        <td>&nbsp;&nbsp;Meta Title</td>
                        <td><input type="text" name="mijosef[<?php echo $language['language_id']; ?>][title]" size="100" value="<?php echo MijoShop::get('mijosef')->get('title', 'information', JRequest::getInt('information_id', 0, 'get'), $language['language_id']); ?>" />
                    </tr>
                    <tr>
                        <td>&nbsp;&nbsp;Meta Description</td>
                        <td><textarea class="text_area" name="mijosef[<?php echo $language['language_id']; ?>][description]" cols="57" rows="5"><?php echo MijoShop::get('mijosef')->get('description', 'information', JRequest::getInt('information_id', 0, 'get'), $language['language_id']); ?></textarea>
                    </tr>
                    <tr>
                        <td>&nbsp;&nbsp;Meta Keywords</td>
                        <td><textarea class="text_area" name="mijosef[<?php echo $language['language_id']; ?>][keywords]" cols="57" rows="5"><?php echo MijoShop::get('mijosef')->get('keywords', 'information', JRequest::getInt('information_id', 0, 'get'), $language['language_id']); ?></textarea>
                    </tr>
                    <tr>
                        <td>&nbsp;&nbsp;Meta Language</td>
                        <td><input type="text" name="mijosef[<?php echo $language['language_id']; ?>][lang]" size="30" value="<?php echo MijoShop::get('mijosef')->get('lang', 'information', JRequest::getInt('information_id', 0, 'get'), $language['language_id']); ?>" />
                    </tr>
                    <tr>
                        <td>&nbsp;&nbsp;Meta Robots</td>
                        <td><input type="text" name="mijosef[<?php echo $language['language_id']; ?>][robots]" size="30" value="<?php echo MijoShop::get('mijosef')->get('robots', 'information', JRequest::getInt('information_id', 0, 'get'), $language['language_id']); ?>" />
                    </tr>
                    <tr>
                        <td>&nbsp;&nbsp;Meta Googlebot </td>
                        <td><input type="text" name="mijosef[<?php echo $language['language_id']; ?>][googlebot]" size="30" value="<?php echo MijoShop::get('mijosef')->get('googlebot', 'information', JRequest::getInt('information_id', 0, 'get'), $language['language_id']); ?>" />
                    </tr>
                    <tr>
                        <td>&nbsp;&nbsp;Meta Canonical URL</td>
                        <td><input type="text" name="mijosef[<?php echo $language['language_id']; ?>][canonical]" size="100" value="<?php echo MijoShop::get('mijosef')->get('canonical', 'information', JRequest::getInt('information_id', 0, 'get'), $language['language_id']); ?>" />
                    </tr>
                </table>
                <input type="hidden" name="mijosef[<?php echo $language['language_id']; ?>][url_id]" value="<?php echo MijoShop::get('mijosef')->get('url_id', 'information', JRequest::getInt('information_id', 0, 'get'), $language['language_id']); ?>" />
                <input type="hidden" name="mijosef[<?php echo $language['language_id']; ?>][meta_id]" value="<?php echo MijoShop::get('mijosef')->get('meta_id', 'information', JRequest::getInt('information_id', 0, 'get'), $language['language_id']); ?>" />
                <input type="hidden" name="mijosef[<?php echo $language['language_id']; ?>][route_var]" value="route=information/information" />
                <input type="hidden" name="mijosef[<?php echo $language['language_id']; ?>][route_id]" value="information_id=<?php echo JRequest::getInt('information_id', 0, 'get'); ?>" />
            </div>
            <?php } ?>
        </div>
        <?php } ?>
        <div id="tab-design">
          <table class="list">
            <thead>
              <tr>
                <td class="left"><?php echo $entry_store; ?></td>
                <td class="left"><?php echo $entry_layout; ?></td>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td class="left"><?php echo $text_default; ?></td>
                <td class="left"><select name="information_layout[0][layout_id]">
                    <option value=""></option>
                    <?php foreach ($layouts as $layout) { ?>
                    <?php if (isset($information_layout[0]) && $information_layout[0] == $layout['layout_id']) { ?>
                    <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
                    <?php } else { ?>
                    <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
                    <?php } ?>
                    <?php } ?>
                  </select></td>
              </tr>
            </tbody>
            <?php foreach ($stores as $store) { ?>
            <tbody>
              <tr>
                <td class="left"><?php echo $store['name']; ?></td>
                <td class="left"><select name="information_layout[<?php echo $store['store_id']; ?>][layout_id]">
                    <option value=""></option>
                    <?php foreach ($layouts as $layout) { ?>
                    <?php if (isset($information_layout[$store['store_id']]) && $information_layout[$store['store_id']] == $layout['layout_id']) { ?>
                    <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
                    <?php } else { ?>
                    <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
                    <?php } ?>
                    <?php } ?>
                  </select></td>
              </tr>
            </tbody>
            <?php } ?>
          </table>
        </div>
      </form>
    </div>
  </div>
</div>
 












<script type="text/javascript"><!--
$('#tabs a').tabs(); 
$('#languages a').tabs(); 

$('#languagessef a').tabs();
        
//--></script> 
<?php echo $footer; ?>

<script type="text/javascript"><!--
function save(type){
    var input = document.createElement('input');
    input.type = 'hidden';
    input.name = 'button';
    input.value = type;
    document.getElementById('form').appendChild(input);
    $('#form').submit();
}
//--></script>