File: D:/HostingSpaces/NVonken/mijneigenlied.com/wwwroot/Core/Page Elements/hatches.element.php
<?php
class Element_Hatches
{
public $elementName = 'Hatches';
private $_settings;
private $_tpl;
function __construct()
{
General::Load("Hatch");
General::Load("HatchTranslation");
General::Load("HatchPage");
$this->_tpl = new tpl();
}
public static function Settings()
{
return array("Pageable" => false,
"DisplayName" => "Nieuwsitems",
"Version" => 1.0,
"Available" => true,
"Filename" => "hatches.element.php");
}
public function Run()
{
$hatches = Hatch::SelectAll();
$hatchTranslations = General::MapArray(HatchTranslation::SelectRange(General::GetField($hatches, "Id"), ACTIVE_LANGUAGE), "HatchId");
$hatchList = "";
foreach ($hatches as $hatch) {
$hatchPage = HatchPage::SelectByHatchLanguage($hatch->Id, ACTIVE_LANGUAGE);
//$page = Page::Select($hatchPage->PageId);
$this->_tpl->assign("hatchName", htmlspecialchars($hatchTranslations[$hatch->Id]->Name));
$this->_tpl->assign("hatchNameUrl", General::UrlSafe($hatchTranslations[$hatch->Id]->Name));
//$this->_tpl->assign("hatchUrl", General::UrlSafe($page->PageTitle)); //General::UrlSafe($hatchTranslations[$hatch->Id]->Name));
$hatchList .= $this->_tpl->parse("Elements/Hatches/overview-item");
}
$this->_tpl->assign("hatchItems", $hatchList);
return $this->_tpl->parse("Elements/Hatches/overview");
}
}
?>