<?php
/**
 * Part of Showkase web site management package
 *
 * @package Showkase
 * @author Jack Hardie {@link http://www.jhardie.com}
 * @copyright Copyright (c) 2012, SimpleViewer Inc.
 */
defined('SK_ACCESS')||die('<h1>403: Forbidden</h1>');
require_once 'classes'.DIRECTORY_SEPARATOR.'screen.php';
require_once 'classes'.DIRECTORY_SEPARATOR.'systembuttonbar.php';
 
/**
 * Repair screen
 *
 * @package Showkase
 */
class RepairScreen extends Screen
{
 /**
   * Constructs Screen
   *
   * @access public
   * @return void
   * @param string content for html title tag
   * @param string body id
   */
   public function __construct($htmlTitle, $bodyId='', $bodyClass='allpages')
   {
       parent::__construct($htmlTitle, $bodyId, $bodyClass);
       $bb = new SystemButtonbar();
       $this->subNavHtml = $bb->getHtml();
   }
  /**
  * Returns list of pages as html table
  * @access public
  * @return string html table
  * @param array context
  */
  function getContentHtml($context)
  {
    $html = <<<EOD
  <form action = "index.php?cmd=repair" method="post">
    <div class="subhead">
      <div class="hgroup">
        <h2>Rebuild the Page Records</h2>
      </div>
      <ul class="buttons">
        <li><button type="button" onclick="window.location='index.php';" class="btn btn-danger">Cancel</button></li>
        <li>
          <input type="hidden" name="token" value="{$context['token']}" >
          <input type="hidden" name="repairsubmitted" value="true" >
          <button type="submit" class="btn btn-success formbutton" >Repair</button>
        </li>
      </ul>
    </div>
    <div class="prompt">
      <p class="prompt">If some of your pages are not showing in the pages list then there may be a problem with the page records.</p>
      <p class="prompt">Click the Repair button to scan your content directory and rebuild the page records.</p>
    </div>
  </form>
EOD;
    return $html;
  }
}