/home/coolpkct/www/websites/cake3.cool.rocks/admin/classes/themeselectscreen.php
<?php
/**
 * Part of Showkase web site management package
 *
 * @package Showkase
 * @author Jack Hardie {@link http://www.jhardie.com}
 * @copyright Copyright (c) 2014, SimpleViewer Inc.
 */
defined('SK_ACCESS')||die('<h1>403: Forbidden</h1>');
require_once 'classes'.DIRECTORY_SEPARATOR.'sitebuttonbar.php';
 
/**
 * Theme screen
 *
 * @package Showkase
 */
class ThemeSelectScreen extends Screen
{
 /**
   * Constructor
   *
   * @access public
   * @return void
   * @param string content for html title tag
   * @param string body id
   */
   public function __construct($htmlTitle, $bodyId='', $bodyClass='')
   {
     parent::__construct($htmlTitle, $bodyId, $bodyClass);
     $bb = new SiteButtonbar();
     $this->subNavHtml = $bb->getHtml();
   }
  
 /**
  * Returns screen content
  *
  * @return string
  * @param boolean
  * @param boolean passwords do not match
  * @access public
  */
  function getContentHtml($context)
  {
    $config = $context['themeSet']->getThemeConfigData();
    if (count($config) == 0)
    {
      return '<p>No themes found</p>';
    }
    $html = '
    <div class="subhead">
      <div class="hgroup">
        <h2><a href="#" class="popper"  title="Themes" data-content="Themes determine the overall appearance of your web site. Remember to republish the site after changing theme. First republish after a theme change will take longer." >Current Theme is <i>'.$context['themeSet']->getThemeDisplayName($context['theme']).'</i></a></h2>
      </div>
      <ul class="buttons">
        <li><button type="button" onclick="window.location=\'index.php\';" class="btn btn-danger">Cancel</button></li>
      </ul>
    </div>
    <table class="showkase-actions">
      <thead>
        <tr>
        <th colspan="3">New theme</th>
        </tr>
      </thead>
      <tbody>
';
    foreach ($config as $theme=>$data)
    {
      if (!($data['exposed'])) continue;
      $html .='
      <tr>
        <td>'.htmlspecialchars($data['displayName'], ENT_QUOTES, 'UTF-8').' '.$data['version'].'</td>
        <td>'.htmlspecialchars($data['description'], ENT_QUOTES, 'UTF-8').'</td>
        <td class="commit"><a href="index.php?cmd=themeselect&amp;newtheme='.$theme.'&amp;token='.$context['token'].'">Select</a></td>
      </tr>';
      
    }
      $html .='
        </tbody>
      </table>
';
    return $html;
  }
}