/application/views/lib/form/link.php
PHP | 80 lines | 54 code | 26 blank | 0 comment | 2 complexity | fdec22493598766e14c43ba61815ca34 MD5 | raw file
Possible License(s): LGPL-2.1, MIT, BSD-3-Clause
- <script type="text/javascript">
- $(document).ready(function() {
-
- $('#page-link-dialog-${id}').dialog({
- modal: true,
- autoOpen: false,
- width: 800,
- height: 500,
- title: "${php: __('admin/content/pages/label.pagestree')}"
- });
- $("div.input-select input[type=submit]").click(function() {
-
- var id = $(this).parent().attr("id");
- $("#page-link-dialog-" + id).dialog("open");
- return false;
- });
- $("div#page-link-dialog-${id} div#tree-${id}").dynatree({
-
- generateIds: true,
- idPrefix: "",
- onClick: function(node, event)
- {
- if (node.getEventTargetType(event) == "title")
- {
- var id = node.li.id;
- var link = id.replace("treenode-", "");
- $("input#value${id}").val(link);
- $("#${id} span").html(node.data["title"]);
- $("#page-link-dialog-${id}").dialog("close");
-
- }
- return false;
- }
-
- });
-
- $("div.input-select input[type=text]").blur(function() {
-
- var id = $(this).parent().attr("id");
- $("#value" + id).val($(this).val());
-
- });
-
- $("div.input-select a.clearlink").click(function() {
-
- $("input#value${id}").val("");
- $("#${id} span").html("");
- return false;
-
- });
- });
- </script>
- <div class="form-link">
-
- <div class="input-select" id="${id}">
-
- <span>${pagetitle | nothing}</span>
- ${structure php: Form::submit('submit', 'wybierz')}
- [<a href="#" class="clearlink" style="font-size: 8pt">${php: Language::get("admin/form/link.clear")}</a>]
-
- </div>
-
- <input type="hidden" name="${name}" id="value${id}" value="${php: Input::post(name)}" />
-
- <div id="page-link-dialog-${id}" class="left" style="display: none">
-
- <div id="tree-${id}" class="left">
-
- ${structure tree}
-
- </div>
-
- </div>
-
- </div>