<?php
$translation    = \DynCom\mysyde\common\classes\Registry::get("translation");
$formname       = "form_page_line_properties";
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
$input_page_id  = $_REQUEST["input_page_id"];

$query = "SELECT layout_class_defined FROM main_page_link WHERE id = '".$input_line["id"]."'";
$layout_class_defined = @mysqli_query($GLOBALS['mysql_con'], $query);

if(@mysqli_num_rows($layout_class_defined) > 0) {
    $defined_class = @mysqli_fetch_array($layout_class_defined);
} else {
    $defined_class = "";
}

?>

<script type="text/javascript">
    function save_and_close_page_line() {
        jQuery('#save_and_close', jQuery('#<?php echo $formname; ?>')).val("1");
        loadCard('save_line_properties_page', true);
    }
</script>

<div id="overlaycrumb">
    <?php echo $translation->get("edit_page_content_properties"); ?>
    <div id="closeoverlay" onclick="disableOverlay();"></div>
</div>

<ul class="toolbar_menu">
    <?= button("left", $translation->get("overview"), $formname, "loadCard('edit_content_page', true)"); ?>
    <?= button("save", $translation->get("save"), $formname, "loadCard('save_line_properties_page', true)"); ?>
    <?= button("save", $translation->get("save_and_close"), $formname, "save_and_close_page_line();"); ?>
    <?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
</ul>
<div class="clearfix"></div>

<?php
if ($messages !== null) {
    if (count($messages)) {
            echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
    } 
  }
?>

<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
    <input name="input_page_id" type="hidden" value="<?= $input_page_id ?>">
    <input name="input_id" type="hidden" value="<?= $input_line["id"] ?>">
    <input name="input_main_layout_id" type="hidden" value="<?= $main_layout_id ?>">
    <input name="save_and_close" id="save_and_close" type="hidden" value="0" />

    <table class="cardform" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <? layout_area_select($translation->get("layout_area"), "input_layout_area_id", $input_line['layout_area_id']); ?>
                <? layout_class_select($translation->get("layout_class"), "input_layout_class_id", $input_line['layout_class_id']); ?>
            </td>
            <td>
                <? input($translation->get("active"), "input_active", "checkbox", $input_line["active"]) ?>
            </td>
        </tr>
        <tr>
            <td>
                <? input($translation->get("self_definded_class"), "input_layout_class_defined", "text", $defined_class['layout_class_defined']) ?>
            </td>
            
        </tr>
    </table>
</form>