{$Project = QUI::getRewrite()->getProject()}
{$host=$Project->get(1)->getUrlRewrittenWithHost()}

<!-- FOOTER -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="width: 100%;">
    <tr>
        <td bgcolor="#f8f8f8" align="center">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="width: 100%;">
                <tr>
                    <td style="padding: 20px 0px 20px 0px;">
                        <table width="500" border="0" cellspacing="0" cellpadding="0" align="center" class="responsive-table">
                            <tr>
                                <td align="center" width="500" valign="middle" style="font-size: 12px; line-height: 18px; font-family: Helvetica, Arial, sans-serif; color:#666666; padding: 10px 0;">
                                    <a href="{$Project->get(1)->getUrlRewrittenWithHost()}">
                                        <img alt="Logo" src="{image image=$Project->getMedia()->getLogoImage() height=40 onlysrc='true' host=1}" height="30" style="display: block; font-family: Helvetica, Arial, sans-serif; color: #666666; font-size: 16px;" border="0">
                                    </a>
                                </td>
                            </tr>

                            <tr>
                                <td align="center" width="500" valign="middle" style="font-size: 12px; line-height: 18px; font-family: Helvetica, Arial, sans-serif; color:#666666; padding: 10px 0;">

                                    {* legal notes (Impressum) *}
                                    {$legalNotes = $Project->getSites([
                                        'where' => [
                                            'type' => [
                                                'type'  => 'IN',
                                                'value' => 'quiqqer/sitetypes:types/legalnotes'
                                            ]
                                        ],
                                        'limit' => 1
                                    ])}

                                    {* privacy policy (Datenschutzerklärung) *}
                                    {$privacyPolicy = $Project->getSites([
                                        'where' => [
                                            'type' => [
                                            'type'  => 'IN',
                                            'value' => 'quiqqer/sitetypes:types/privacypolicy'
                                            ]
                                        ],
                                        'limit' => 1
                                    ])}

                                    {* general terms and conditinos (AGB) *}
                                    {$generalTermsAndConditions = $Project->getSites([
                                        'where' => [
                                            'type' => [
                                            'type'  => 'IN',
                                            'value' => 'quiqqer/sitetypes:types/generalTermsAndConditions'
                                            ]
                                        ],
                                        'limit' => 1
                                    ])}

                                    {* contact *}
                                    {$contact = $Project->getSites([
                                        'where' => [
                                            'type' => [
                                            'type'  => 'IN',
                                            'value' => 'quiqqer/contact:types/contact'
                                            ]
                                        ],
                                        'limit' => 1
                                    ])}

                                    {if !$contact|count}
                                        {$contact = $Project->getSites([
                                        'where' => [
                                            'type' => [
                                            'type'  => 'IN',
                                            'value' => 'quiqqer/sitetypes:types/contact'
                                            ]
                                        ],
                                        'limit' => 1
                                        ])}
                                    {/if}

                                    {if $legalNotes|count}
                                        <a href="{$legalNotes[0]->getUrlRewrittenWithHost()}">{$legalNotes[0]->getAttribute('title')}</a>
                                    {/if}
                                    {if $privacyPolicy|count}
                                        | <a href="{$privacyPolicy[0]->getUrlRewrittenWithHost()}">{$privacyPolicy[0]->getAttribute('title')}</a>
                                    {/if}
                                    {if $generalTermsAndConditions|count}
                                        | <a href="{$generalTermsAndConditions[0]->getUrlRewrittenWithHost()}">{$generalTermsAndConditions[0]->getAttribute('title')}</a>
                                    {/if}
                                    {if $contact|count}
                                        | <a href="{$contact[0]->getUrlRewrittenWithHost()}">{$contact[0]->getAttribute('title')}</a>
                                    {/if}

                                </td>
                            </tr>

                            <tr>
                                <td align="center" valign="middle" width="500" style="font-size: 12px; line-height: 18px; font-family: Helvetica, Arial, sans-serif; color:#666666; padding: 10px 0;">
                                    {locale group="quiqqer/core" var="templates.mail.body.footer.social" HOST=$host}
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
