PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/chrispiechowicz/zepto
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
  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} span").html(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. $("div.input-select a.clearlink").click(function() {
  36. $("input#value${id}").val("");
  37. $("#${id} span").html("");
  38. return false;
  39. });
  40. });
  41. </script>
  42. <div class="form-link">
  43. <div class="input-select" id="${id}">
  44. <span>${pagetitle | nothing}</span>
  45. &nbsp;&nbsp;&nbsp; ${structure php: Form::submit('submit', 'wybierz')}
  46. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<a href="#" class="clearlink" style="font-size: 8pt">${php: Language::get("admin/form/link.clear")}</a>]
  47. </div>
  48. <input type="hidden" name="${name}" id="value${id}" value="${php: Input::post(name)}" />
  49. <div id="page-link-dialog-${id}" class="left" style="display: none">
  50. <div id="tree-${id}" class="left">
  51. ${structure tree}
  52. </div>
  53. </div>
  54. </div>