<?php
/**
 * Part of SimpleViewer.net portfolio web site 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>');
 
/**
 * Provides objects to the advanced themer to construct custom gallery index pages
 *
 * @package Showkase
 */
Class GalleryLink
{
    /**
     * @var array of link data
     */
    private $data = array();
    
    /**
     * Constructor
     */
    public function __construct(array $data)
    {
        $this->data = $data;
    }
    
    /**
     * Getter for template variables
     * @param string variable name
     * @return string value
     */
    public function __get($name)
    {
        if (!array_key_exists($name, $this->data)) {
            Board::addMessage('Theme problem: variable '.$name.' is not defined');
            return '';
        }
        if ($name == 'navName') {
            return htmlspecialchars($this->data['navName'], ENT_QUOTES, 'UTF-8');
        }
        return $this->data[$name];
    }
}