<?php
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
include("forwarding_config.inc.php");
?>

<div class="forwarding-wrapper">

    <?
    $query      = "SELECT * FROM forwarding_line WHERE header_id = '" . $sitepart_id . "'";
    $result = mysqli_query($GLOBALS['mysql_con'], $query);

    if (@mysqli_num_rows($result) > 0) {

        while ($row = @mysqli_fetch_array($result)) {

            $parameter = $row['forward_parameter'];

            // pruefen um was es sich fuer ein menupunkt handelt
            switch ($row['forward_type']) {

                case 1: // interne weiterleitung
                    $url = get_link_to_navigation($row['forward_navigation_id']);
                    break;

                case 2: // interne pfad weiterleitung
                    if (substr($row['forward_url'], 0, 1) != "/") {
                        $url = "/" . $row['forward_url'];
                    }
                    $url = $row['forward_url'];
                    break;

                case 3: // externe weiterleitung
                    $url = $row['forward_url'];
                    break;
            }

            echo '
                <div class="forwarding_container">';

            echo "<a href=\"" . $url . $parameter . "\">
                    <div class=\"forwarding_content_container\">
                        <div class=\"forwarding_content\">
                            <div class=\"forwarding_image\">
                                " . $forwarding_icon_images[$row["forward_icon"]]["image"] . "
                            </div>
                            <div class=\"forwarding_text\">
                                " . $row['description'] . "
                            </div>
                        </div>
                </div></a>";

            echo '</div>';
        }
    }
    //$row[forward_icon]
    ?>
</div>