<?php
/**
 * sh404SEF - SEO extension for Joomla!
 *
 * @author      Yannick Gaultier
 * @copyright   (c) Yannick Gaultier 2014
 * @package     sh404SEF
 * @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @version     4.4.4.1791
 * @date		2014-07-01
 */

// Security check to ensure this file is being included by a parent file.
if (!defined('_JEXEC')) die('Direct Access to this location is not allowed.');

?>
<div id="sh404sef-popup" class="sh404sef-popup">
  <div id="content-box">
    <div class="border">
        <div id="toolbar-box">
        <div class="t">
        <div class="t">
          <div class="t"></div>
        </div>
      </div>
      <div class="m">
        <?php echo $this->toolbar->render(); ?>
        <?php echo $this->toolbarTitle; ?>
        <div class="clr"></div>
      </div>
      <div class="b">
        <div class="b">
          <div class="b"></div>
        </div>
      </div>
      </div>
      <div class="clr"></div>
    <div class="clr"></div>
  <div class="clr"></div>
</div>
</div>
<div class="clr"></div>
  <dl id="system-message">
  <dt class="error"></dt>
  <dd class="error message fade">
    <div id="sh-error-box">
  <?php if (!empty( $this->errors)) : ?>
      <div id="error-box-content">
        <ul>
        <?php
          foreach ($this->errors as $error) :
            echo '<li>' . $error . '</li>';
          endforeach;
        ?>
        </ul>
      </div>
    <?php endif; ?>
    </div>
  </dd>
  </dl>

  <dl id="system-message">
  <dt class="message"></dt>
  <dd class="message message fade">
  <div id="sh-message-box">
  <?php if (!empty( $this->message)) : ?>
    <ul>
      <li><div id="message-box-content"><?php if (!empty( $this->message)) echo $this->message; ?></div></li>
    </ul>
    <?php endif; ?>
    </div>
  </dd>
  </dl>

<div id="element-box">
  <div class="t">
    <div class="t">
      <div class="t"></div>
    </div>
  </div>
  <div class="m">

<form action="index.php" method="post" name="adminForm" id="adminForm">

  <div id="editcell">
  <?php

    jimport( 'joomla.html.pane');
    echo JHtml::_('tabs.start', 'sh404SEFEditurl', array( 'startOffset' => $this->startOffset));

    // don't display url edit panel for home page, as user can't change the url
    if (!$this->home) {
      echo JHtml::_('tabs.panel', JText::_('COM_SH404SEF_EDIT_URL'), 'editurl');
      echo $this->loadTemplate($this->joomlaVersionPrefix . '_url');
    }

    echo JHtml::_('tabs.panel', JText::_('COM_SH404SEF_EDIT_META'), 'seo');
    echo $this->loadTemplate($this->joomlaVersionPrefix . '_seo');

    echo JHtml::_('tabs.panel', JText::_('COM_SH404SEF_ALIASES'), 'aliases');
    echo $this->loadTemplate($this->joomlaVersionPrefix . '_aliases');

    echo JHtml::_('tabs.panel', JText::_('COM_SH404SEF_OG_CONFIG'), 'social_seo');
    echo $this->loadTemplate($this->joomlaVersionPrefix . '_social_seo');

    echo JHtml::_('tabs.end');

    // if automatic url, some items are not editable, we pass them as hidden fields
    if (!$this->canEditNewUrl) : ?>
    <input type="hidden" name="newurl" value="<?php echo $this->escape( $this->url->get('newurl')); ?>" />
  <?php endif;

    // if can edit the newurl, then the old is fixed (404 pages for instances)
    $oldUrl = $this->url->get('oldurl');
    if ($this->canEditNewUrl && !empty ($oldUrl)) : ?>
    <input type="hidden" name="oldurl" value="<?php echo $this->escape( $this->url->get('oldurl')); ?>" />
  <?php endif; ?>


    <input type="hidden" name="id" value="<?php echo $this->url->get('id'); ?>" />

    <input type="hidden" name="c" value="editurl" />
    <input type="hidden" name="view" value="editurl" />
    <input type="hidden" name="format" value="raw" />
    <input type="hidden" name="option" value="com_sh404sef" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="shajax" value="1" />
    <input type="hidden" name="tmpl" value="component" />
    <input type="hidden" name="previousSefUrl" value="<?php echo $this->escape( $this->url->get('oldurl')); ?>" />
    <input type="hidden" name="previousNonSefUrl" value="<?php echo $this->escape( $this->url->get('newurl')); ?>" />
    <input type="hidden" name="meta_id" value="<?php echo $this->meta->id; ?>" />
    <?php if ($this->home || $this->noUrlEditing) : ?>
      <input type="hidden" name="oldurl" value="<?php echo $this->escape( $this->url->get('oldurl')); ?>" />
      <input type="hidden" name="newurl" value="<?php echo $this->escape( $this->url->get('newurl')); ?>" />
      <input type="hidden" name="pageid" value="" />
    <?php endif; ?>
    <?php echo JHTML::_( 'form.token' ); ?>
  </div>
</form>


    <div class="clr"></div>
  </div>
  <div class="b">
    <div class="b">
      <div class="b"></div>
    </div>
  </div>
</div>

</div>