PageRenderTime 45ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/duplicator-pro/installer/dup-installer/views/view.api.php

https://bitbucket.org/totaladvertising/indian-springs
PHP | 72 lines | 70 code | 2 blank | 0 comment | 3 complexity | 6af6f130b4ea1585f54833216ec79bae MD5 | raw file
Possible License(s): GPL-2.0, MIT
  1. <?php defined("DUPXABSPATH") or die(""); ?>
  2. <!-- START OF VIEW API -->
  3. <style>
  4. div#content {width:70%}
  5. div#api-area {margin:auto; line-height:21px }
  6. div#api-area table {width:100%}
  7. div#api-area table td:first-child{width:40%; padding-right:15px}
  8. div#api-area table td{vertical-align:top; text-align:left}
  9. iframe#api-results {margin:auto; width:97%; height:90%; border:1px solid silver; min-height: 500px}
  10. div.api-details {font-size:11px}
  11. form.api-form {display:none; padding-left:20px}
  12. form.api-form input[type=text] {width:100%; font-size:12px; padding:3px}
  13. input#api-results-txt {width:97% !important; background: #efefef;}
  14. div.api-area a.operation {font-weight: bold; font-size:14px}
  15. div.api-area pre {font-size:11px; line-height: 13px; padding: 2px; border:1px solid silver; background: #efefef; border-radius: 3px}
  16. </style>
  17. <script>
  18. function RequestAPI(template, test) {
  19. var url = window.location.href;
  20. url = url.replace("/api/", "");
  21. url = url + template;
  22. if (test == 0) {
  23. $('#api-results-txt').val(url);
  24. $('#api-results').attr('src', url);
  25. } else {
  26. window.open(url, 'api-window');
  27. }
  28. }
  29. </script>
  30. <div id="api-area">
  31. <div class="hdr-main">
  32. API ROUTES:
  33. <!--div style="float:right; font-size:12px">
  34. <input type="checkbox" name="api-debug" id="api-debug">
  35. <label for="api-debug">Debug Routes</label>
  36. </div-->
  37. </div>
  38. <div class="api-area">
  39. <table>
  40. <tr>
  41. <td>
  42. <b>OPERATIONS:</b>
  43. <?php foreach($API_Server->controllers as $class) : ?>
  44. <div style="padding: 5px 0 5px 0">
  45. <?php
  46. $id = uniqid();
  47. $name = str_replace('/api/', '', $class->operation);
  48. ?>
  49. <a href="javascript:void(0)" onclick="$('#frm-<?php echo esc_js($id);?>').toggle()" class="operation">&#xbb;<?php echo esc_html($name);?></a><br/>
  50. <form id="frm-<?php echo DUPX_U::esc_attr($id);?>" class="api-form">
  51. <input id="txt-<?php echo DUPX_U::esc_attr($id);?>" type="text" value="<?php echo DUPX_U::esc_attr($class->template);?>" /> <br/>
  52. <a href="javascript:void(0)" onclick="RequestAPI($('#txt-<?php echo DUPX_U::esc_attr($id);?>').val(), 0)">[Test]</a> &nbsp;
  53. <a href="javascript:void(0)" onclick="RequestAPI($('#txt-<?php echo DUPX_U::esc_attr($id);?>').val(), 1)">[New Window]</a> &nbsp;
  54. <div class="api-details" id="details-<?php echo DUPX_U::esc_attr($id);?>">
  55. <?php DUPX_U::dump($class, 1); ?>
  56. </div>
  57. </form>
  58. </div>
  59. <?php endforeach; ?>
  60. </td>
  61. <td>
  62. <b>TEST RESULTS:</b> <br/>
  63. <input id="api-results-txt" type="text" readonly="true" /> <br/>
  64. <iframe id="api-results" />
  65. </td>
  66. </tr>
  67. </table>
  68. </div>
  69. </div>
  70. <!-- END OF VIEW API -->