HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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");
    }
}

?>