<?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 CeHideawayCountryHeaderReader extends \ContentElement{ /** * Template * @var string */ protected $strTemplate = 'ce_hideaway_country_header_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 Country Header 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'); $country = $this->Hideaway->getCountryByUrl(); //var_dump($country); $this->Template->entry = $country; // Testimonials für dieses Land laden $testimonials = array(); if ($country && isset($country['row']['id'])) { $objTestimonials = \Database::getInstance() ->prepare("SELECT * FROM tl_hideaway_testimonial WHERE published='1' AND country=? ORDER BY sorting ASC") ->execute($country['row']['id']); while ($objTestimonials->next()) { $testimonials[] = (object) array( 'name' => $objTestimonials->name, 'rating' => (int) $objTestimonials->rating, 'title' => $objTestimonials->title, 'text' => $objTestimonials->text, ); } } $this->Template->testimonials = $testimonials; //die('Country Header'); /*$obj = $this->Hideaway->getHotelEntry($id); $this->Template->entry = $obj; */ }}