Commit bb13bf8a authored by Sven Rhinow's avatar Sven Rhinow

get entries without start and stop

parent ab7a13e2
<?php
namespace Srhinow\recurringElement;
use Patchwork\Utf8;
/**
* Contao Open Source CMS
*
......@@ -47,7 +49,7 @@ class ModuleCurrentItem extends \Module
{
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['currentitem'][0]) . ' ###';
$objTemplate->wildcard = '### ' . Utf8::strtoupper($GLOBALS['TL_LANG']['FMD']['currentitem'][0]) . ' ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
......@@ -56,11 +58,12 @@ class ModuleCurrentItem extends \Module
return $objTemplate->parse();
}
if(strlen($this->recel_template) >0) $this->strTemplate = $this->recel_template;
// Return if there are no recurring_element
if (!is_integer($this->recel_recurringelement) || (int) $this->recel_recurringelement == 0)
{
#return '';
}
return parent::generate();
......@@ -74,17 +77,17 @@ class ModuleCurrentItem extends \Module
{
global $objPage;
$time = time();
// $time = time();
$rElObj = $this->Database->prepare("SELECT * FROM `tl_recurring_element_items` WHERE `pid`=? AND (start='' OR start<$time) AND (stop='' OR stop>$time) AND `published` = 1 ORDER BY `priority` DESC")
$rElObj = $this->Database->prepare("SELECT * FROM `tl_recurring_element_items` WHERE `pid`=? AND `published` = 1 ORDER BY `priority` DESC")
->execute($this->recel_recurringelement);
// dump($rElObj); die();
if($rElObj->numRows > 0)
{
$this->Template->element = $this->getCurrElement($rElObj);
}
$this->Template->headline = $this->headline;
$this->Template->headline = $this->headline;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment