PageRenderTime 33ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/magehelp/application/views/utilities/add_category.php

https://bitbucket.org/jit_bec/shopifine
PHP | 149 lines | 75 code | 16 blank | 58 comment | 4 complexity | 5187a74c8e3c9b12c470f09006b88475 MD5 | raw file
Possible License(s): LGPL-3.0
  1. <html>
  2. <head>
  3. <?php $this->load->view("common/header"); ?>
  4. <link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/shopifine.css" />
  5. <script type="text/javascript" src="http://static.jstree.com/v.1.0pre/jquery.jstree.js"></script>
  6. <style type="text/css">
  7. * { font-family: Verdana; font-size: 96%; }
  8. label { width: 10em; float: left; }
  9. label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
  10. p { clear: both; }
  11. .submit { margin-left: 12em; }
  12. em { font-weight: bold; padding-right: 1em; vertical-align: top; }
  13. .field {
  14. clear:both;
  15. }
  16. </style>
  17. <script>
  18. $(document).ready(function(){
  19. $("#treeViewDiv")
  20. .jstree({
  21. "plugins" : ["themes", "json_data", "ui"],
  22. "json_data" : {
  23. "ajax" : {
  24. "type": 'GET',
  25. "url": function (node) {
  26. var nodeId = "";
  27. var url = ""
  28. if (node == -1)
  29. {
  30. url = "index.php/utilities/renderParents";
  31. }
  32. else
  33. {
  34. nodeId = node.attr('id');
  35. url = "index.php/utilities/renderChildren";
  36. }
  37. return url;
  38. },
  39. data : function(node) {
  40. if (node != -1){
  41. return {
  42. "nodeid":$.trim(node.attr('id'))
  43. }
  44. }
  45. },
  46. "success": function (new_data) {
  47. return new_data;
  48. }
  49. }
  50. }})
  51. // .jstree({
  52. // "json_data" : {
  53. // "ajax" : {
  54. // "type": 'GET',
  55. // "url": function (node) {
  56. // var nodeId = "";
  57. // var url = ""
  58. // if (node == -1)
  59. // {
  60. // url = "http://localhost/introspection/introspection/product/";
  61. // }
  62. // else
  63. // {
  64. // nodeId = node.attr('id');
  65. // url = "http://localhost/introspection/introspection/children/" + nodeId;
  66. // }
  67. //
  68. // return url;
  69. // },
  70. // "success": function (new_data) {
  71. // return new_data;
  72. // }
  73. // }
  74. // },
  75. // "json_data" : {
  76. // "data":<?php echo $treedata ?>,
  77. // "ajax" : {
  78. // "url" : "index.php/utilities/renderChildren"
  79. //// data : function(n) {
  80. //// return {
  81. //// "nodeid":$.trim(n.attr('id'))
  82. //// }
  83. //// }
  84. // }
  85. // },
  86. //
  87. // "plugins" : [ "themes", "json_data", "ui" ]
  88. //"json_data" : {
  89. //"data":<?php echo $treedata ?>,
  90. // "data":[{"data":"Furniture","attr":{"id":"10"},"state":"closed"},{"data":"Electronics","attr":{"id":"13"},"state":"closed"},{"data":"Apparel","attr":{"id":"18"},"state":"closed"},{"data":"Household Items","attr":{"id":"20"},"state":"closed"},{"data":"Home","attr":{"id":"36"},"state":"closed"}],
  91. // "data" : [
  92. // {
  93. // "data" : "A node",
  94. // "state" : "closed"
  95. // },
  96. //{"data":"Furniture","attr":{"id":"10"},"state":"closed"},
  97. // {
  98. // "attr" : { "id" : "li.node.id3" },
  99. // "data" : {
  100. // "title" : "Long format demo",
  101. // "attr" : { "href" : "#" }
  102. // }
  103. // }
  104. // ],
  105. // "ajax" : { "url" : "index.php/utilities/renderChildren" }
  106. // },
  107. // "plugins" : [ "themes", "json_data" ]
  108. // })
  109. $("#test").click(function(){console.log($('#treeViewDiv').jstree('get_selected').data('id'));
  110. })
  111. $("#testattr").click(function(){console.log($('#treeViewDiv').jstree('get_selected').attr('id'));
  112. })
  113. });
  114. </script>
  115. </head>
  116. <body>
  117. <?php $this->load->view("common/menubar"); ?>
  118. <div id="treeViewDiv">
  119. </div>
  120. <button id="test">test</button>
  121. <button id="testattr">test Attr</button>
  122. <!-- <div id="categoryForm" class="utilityform">
  123. <form action="index.php/utilities/createCategory" method="post" id="deliverypointform">
  124. <fieldset>
  125. <div>
  126. </div>
  127. </fieldset>
  128. </form>
  129. </div>-->
  130. <?php $this->load->view("partial/footer"); ?>
  131. </body>
  132. </html>