<?php
$formname    = "form_permission_card";
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
$inputname   = "input_id";
?>

<div id="overlaycrumb">
    <?php if ($input_permission["id"] == "") {
        echo $translation->get("new_permission");
    } else {
        echo $translation->get("edit_permission");
    }
    ?>
    <div id="closeoverlay" onclick="disableOverlay();"></div>
</div>
    <ul class="toolbar_menu">
        <?= button("save", $translation->get("save"), $formname, "loadCard('save', true)"); ?>
        <?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save', true, '', true)"); ?>
        <li>
            <ul>
                <?php
                if ($input_permission["id"] != "") {
                    echo button("delete", $translation->get("delete"), $formname, "loadCard('delete', true, '{$translation->get('delete_permission_confirm')}', true)", "", FALSE);
                }
                ?>
                <?= button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE); ?>
            </ul>
        </li>
    </ul>

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

<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
    <input name="input_id" type="hidden" value="<?= $input_permission["id"] ?>">

    <table class="cardform" border="0" cellspacing="0" cellpadding="0">
        <div class=''>
            <? input($translation->get("description"), "input_description", "text", $input_permission["description"], 100) ?>
        </div>
        <? input($translation->get("code"), "input_code", "text", $input_permission["code"], 100) ?>
        <? input($translation->get("short_text"), "input_short_text", "textarea", $input_permission["short_text"]) ?>
        <? input($translation->get("only_main_mandant"), "input_only_main_mandant", "checkbox", $input_permission["only_main_mandant"], 10); ?>
        <? input($translation->get("default_active"), "input_default_active", "checkbox", $input_permission["default_active"], 10); ?>
    </table>
</form>