/home/coolpkct/www/websites/cake3.cool.rocks/admin/classes/site.php
<?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.'page.php';
 
/**
 * About page
 *
 * @package Showkase
 */
class Site extends Layer
{
    /**
     * @var string page type
     */
    protected $pageType = 'site';
    
    /**
     * @var string page ref
     */
    protected $pageRef = 'site';
    
    /**
     * @var boolean
     */
    protected $supportedPageType = true;
    
    
    /**
     * Constructor
     */
    public function __construct(ThemeSet $themeSet)
    {
        $this->themeSet = $themeSet;
        $config = SkConfig::getInstance();
        $this->pagePathRelSvm =
            $config->getRelativeContentPath(getcwd()).
            '_data'.DIRECTORY_SEPARATOR.
            'sitedata'.DIRECTORY_SEPARATOR;
        $this->settingsPath = $this->pagePathRelSvm.'site.xml';
        $settingsDirectory = rtrim($this->pagePathRelSvm, '\\/');
        if (!file_exists($settingsDirectory)) {
            if (!Filer::skMkdir($settingsDirectory, NEW_DIR_MODE, true)) {
                throw new Exception('Cannot create site data folder, changes will not be saved.');
            }
        }
        $this->incomingFields = array();
        $this->layerFields = $this->readFieldInis($themeSet->getSiteIniPaths());
        foreach ($this->layerFields as $name => $field) {
            $this->layerDefaults[$name] = $field->getValue();
        }
        $layerSettings = PageReader::readPageVars($this->settingsPath);
        $deprecated = array('ss_metaDescription' => 'ss_pageDescription');
        $this->loadFields($this->layerFields, $layerSettings, $deprecated);
        $this->accumulatedFields = $this->layerFields;
    }
    
    /**
     * Is this page type a gallery
     *
     * @return boolean
     */
     public function isGallery()
     {
       return false;
     }
    
    /**
     * Get viewer fields
     *
     * @return array
     */
    /*
    public function getViewerFields()
    {
        return array();
    }
    */
}