<?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 'settings'.DIRECTORY_SEPARATOR.'constants.php';
 
/**
 * Error screen
 *
 * @package Showkase
 */
class ErrorScreen extends Screen
{
  /**
   * constructs ErrorScreen class
   * @param string contains text for html <title></title> tags
   * @param string html id for body tag
   */
  function __construct($message = "Error")
  {
      $this->message = $message;
      $htmlTitleTag = 'Showkase – error';
      $htmlBodyClass = 'error';
      parent::__construct($htmlTitleTag, $htmlBodyClass);
  }
  
  /**
   * Return content html
   *
   * @param array
   * @return string
   */
   public function getContentHtml($context)
   {
       if (DEBUG)  {
           return '<p class="error">'.$context['message'].'</p>';
       }
       return '<p class="error">'.$context['message'].'</p>';
   }
}