Source of file ElementDatePortal.php

Size: 1,714 Bytes - Last Modified: 2016-05-18T03:08:26+02:00

buildproject/core/module_pages/portal/elements/ElementDatePortal.php

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
<?php
/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2014 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
*-------------------------------------------------------------------------------------------------------*
*	$Id$                                      *
********************************************************************************************************/

namespace Kajona\Pages\Portal\Elements;

use Kajona\Pages\Portal\ElementPortal;
use Kajona\Pages\Portal\PortalElementInterface;
use Kajona\Pages\System\PagesPageelement;
use Kajona\System\System\TemplateMapper;


/**
 * Portal-Part of the date element
 *
 * @author jschroeter@kajona.de
 * @targetTable element_universal.content_id
 */
class ElementDatePortal extends ElementPortal implements PortalElementInterface
{

    /**
     * Does a little "make-up" to the contents
     *
     * @return string
     */
    public function loadData()
    {

        $strTemplate = $this->arrElementData["char1"];
        //fallback
        if ($strTemplate == "") {
            $strTemplate = "date.tpl";
        }

        $objPageElement = new PagesPageelement($this->getSystemid());
        $objAdmin = $objPageElement->getConcreteAdminInstance();
        $objAdmin->loadElementData();

        $objMapper = new TemplateMapper($objAdmin);
        return $objMapper->writeToTemplate("/element_date/".$strTemplate, "date");
    }

}