<?php
/**
* Contao Open Source CMS
*
* Copyright (C) 2005-2013 Leo Feyer
*
* @package Comments
* @link https://contao.org
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*/
/**
* Run in a custom namespace, so the class can be replaced
*/
namespace hideaway;
/**
* Class CeHideawayList
*
* @copyright Leo Feyer 2005-2013
* @author Leo Feyer <https://contao.org>
* @package Comments
*/
class CeHideawayHotelReader extends \ContentElement
{
/**
* Template
* @var string
*/
protected $strTemplate = 'ce_hideaway_hotel_reader';
/**
* Display a wildcard in the back end
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE')
{
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### Hideaway Hotel Reader ###';
$objTemplate->title = $this->headline;
return $objTemplate->parse();
}
// Set the item from the auto_item parameter
if (!isset($_GET['items']) && $GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item']))
{
\Input::setGet('items', \Input::get('auto_item'));
}
return parent::generate();
}
/**
* Generate the module
*/
protected function compile()
{
global $objPage;
$id = $this->Input->get('items');
$this->import('Hideaway');
$obj = $this->Hideaway->getHotelEntry($id, true);
$this->Template->entry = $obj;
$this->Template->related = $this->Hideaway->getHotelsByRegionId($obj['row']['region']);
//var_dump();
}
}