PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/application/views/lib/form/link-manual.php

https://bitbucket.org/chrispiechowicz/zepto
PHP | 67 lines | 46 code | 21 blank | 0 comment | 2 complexity | 8e8a4a1763e4177e4cda9a346357929c MD5 | raw file
Possible License(s): LGPL-2.1, MIT, BSD-3-Clause
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. $('#page-link-dialog-${id}').dialog({
  4. modal: true,
  5. autoOpen: false,
  6. width: 800,
  7. height: 500,
  8. title: "${php: __('admin/content/pages/label.pagestree')}"
  9. });
  10. $("div.input-select input[type=submit]").click(function() {
  11. var id = $(this).parent().attr("id");
  12. $("#page-link-dialog-" + id).dialog("open");
  13. return false;
  14. });
  15. $("div#page-link-dialog-${id} div#tree-${id}").dynatree({
  16. generateIds: true,
  17. idPrefix: "",
  18. onClick: function(node, event)
  19. {
  20. if (node.getEventTargetType(event) == "title")
  21. {
  22. var id = node.li.id;
  23. var link = id.replace("treenode-", "");
  24. $("input#value${id}").val(link);
  25. $("#${id} input[type=text]").val(node.data["title"]);
  26. $("#page-link-dialog-${id}").dialog("close");
  27. }
  28. return false;
  29. }
  30. });
  31. $("div.input-select input[type=text]").blur(function() {
  32. var id = $(this).parent().attr("id");
  33. $("#value" + id).val($(this).val());
  34. });
  35. });
  36. </script>
  37. <div class="form-link">
  38. <div style="margin-bottom: 5px">${php: Language::get("admin/form/label.link-manual")}</div>
  39. <div class="input-select" id="${id}">${structure php: Form::input('value_' . name, pagetitle)} ${structure php: Form::submit('submit', 'wybierz')}</div>
  40. <input type="hidden" name="${name}" id="value${id}" value="${php: Input::post(name)}" />
  41. <div id="page-link-dialog-${id}" class="left" style="display: none">
  42. <div id="tree-${id}" class="left">
  43. ${structure tree}
  44. </div>
  45. </div>
  46. </div>