<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title> <?php print _('Welcome to the Gallery Installer') ?> </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" type="text/css" href="styles/style.css"/>
  </head>

  <body<?php if (isset($translator)
	     && $translator->isRightToLeft()) print ' style="direction:rtl"' ?>>
    <table id="box" cellspacing="0">
      <tr><td id="header" colspan="2">
	<img src="images/g2Logo_install_head.png" alt="Gallery Installer"/>
      </td></tr>
      <tr><td id="navbar"><div>
	<table cellspacing="0">
	  <tr><td class="heading" colspan="2">
	    <?php print _('Install Steps') ?>
	  </td></tr>
	  <?php for ($i = 0; $i < count($steps); $i++): ?>
	  <tr><td class="navnum">
	    <?php if ($i <= $currentStep->getStepNumber()
		  && ($steps[$i]->isComplete() || $steps[$i]->isOptional())): ?>
	      <span class="success">&radic;</span>
	    <?php elseif ($steps[$i]->isInError()): ?>
	      <span class="error">&#10007;</span>
	    <?php else: ?>
	      <?php print $i ?>
	    <?php endif; ?>
	  </td><td class="navtext">
	    <?php $linkable = ($i == 0 ||
		    ($i <= $currentStep->getStepNumber() + 1 &&
			($steps[$i-1]->isComplete() || $steps[$i-1]->isOptional())));
	    ?>
	    <?php if ($linkable): ?>
	      <a href="<?php printf('%s?step=%s', INDEX_PHP, $i) ?>">
	    <?php endif; ?>
	    <?php print $steps[$i]->stepName(); ?>
	    <?php if ($linkable): ?>
	      </a>
	    <?php endif; ?>
	  </td></tr>
	  <?php endfor; ?>
	  <tr class="help"><td>
	    <span class="helpBox">?</span>
	  </td><td>
	    <a href="../README.html" target="_blank"><?php print _('Installer Help'); ?></a>
	  </td></tr>
	  <tr><td>
	    <span class="helpBox">X</span>
	  </td><td>
	    <a href="<?php print INDEX_PHP ?>?startOver=1"><?php print _('Start Over'); ?></a>
	  </td></tr>
	</table>
      </div></td>
      <td id="main">
	<?php if (!empty($templateData['errors'])): ?>
	<h2 class="error">
	  <?php foreach ($templateData['errors'] as $error): ?>
	  <?php print $error ?> <br/>
	  <?php endforeach; ?>
	</h2>
	<?php endif; ?>

	<?php if (!empty($templateData['warnings'])): ?>
	<h2 class="warning">
	  <?php foreach ($templateData['warnings'] as $warning): ?>
	  <?php print $warning ?> <br/>
	  <?php endforeach; ?>
	</h2>
	<?php endif; ?>

	<?php include(dirname(__FILE__) . '/' . $templateData['bodyFile']); ?>

	<?php if ($currentStep->isComplete() && !$currentStep->isLastStep()): ?>
	<div class="go">
	  <?php if ($currentStep->isRedoable()): ?>
	  <span class="goToNextL">
	    <a href="<?php printf('%s?step=%s', INDEX_PHP, $stepNumber) ?>&amp;doOver=1">
	      <?php print _('Redo this step'); ?>
	    </a>
	  </span>
	  <?php endif; ?>

	  <?php $nextStep = $stepNumber + 1 ?>
	  <span class="goToNext">
	    <a href="<?php printf('%s?step=%s', INDEX_PHP, $nextStep) ?>">
	      <?php printf(_('Continue to Step %d&raquo;'), $nextStep); ?>
	    </a>
	  </span>
	</div>
	<?php endif; ?>
      </td></tr>
      <tr><td id="bottom" colspan="2">
	<h3><?php print _('Installation Status') ?></h3>
	<table id="statusTable" cellspacing="0">
	  <tr>
	    <?php if ($templateData['percentComplete'] != 0): ?>
	    <td class="progressMade"
		style="width:<?php print $templateData['percentComplete'] ?>%"><h3>&nbsp;</h3></td>
	    <?php endif; ?>

	    <?php if ($templateData['percentComplete'] != 100): ?>
	    <td class="progressToGo"
		style="width:<?php print (100 - $templateData['percentComplete']) . '%' .
		  (($templateData['percentComplete'] == 0) ? '' : ';border-left:none')
		?>"><h3>&nbsp;</h3></td>
	    <?php endif; ?>
	  </tr>
	</table>
	<?php printf(_('Install %d%% complete'), $templateData['percentComplete']); ?>
      </td></tr>
    </table>
    <div id="footer">
      <?php print _('Gallery: <strong>your photos</strong> on <strong>your website</strong>') ?>
      &raquo; <a target="_blank" href="http://gallery.sourceforge.net/">gallery.sourceforge.net</a>
    </div>
  </body>
</html>
