Merge pull request #3066 from relldoesphp/CRM-14466
[civicrm-core.git] / templates / CRM / Admin / Page / APIExplorer.tpl
index c3a2aa0ad288fafcc8f634a165772470b4223cd7..5b387b0d963942a7e838a43d679a1e3f0bdf2630 100644 (file)
@@ -41,8 +41,9 @@
     width: 35%;
   }
   #api-params-table td:first-child + td,
-  #api-params-table th:first-child + th {
-    width: 10em;
+  #api-params-table th:first-child + th,
+  #api-generated td:first-child {
+    width: 9em;
   }
   #api-params {
     min-height: 1em;
   #api-params .red-icon {
     margin-top: .5em;
   }
-  #api-generated td:first-child {
-    width: 10em;
-  }
   #api-explorer label {
-    display:inline;
+    display: inline;
     font-weight: bold;
   }
   #api-generated-wraper,
   #api-result {
     overflow: auto;
   }
+  #api-explorer .api-options-row + .api-options-row label {
+    display: none;
+  }
+  .api-options-row td:first-child {
+    text-align: right;
+  }
   .select2-choice .icon {
     margin-top: .2em;
     background-image: url("{/literal}{$config->resourceBase}{literal}/i/icons/jquery-ui-2786C2.png");
@@ -94,7 +98,7 @@
     
 
   <label for="debug-checkbox" title="{ts}Display debug output with results.{/ts}">
-    <input type="checkbox" class="crm-form-checkbox api-param-checkbox api-input" id="debug-checkbox" name="debug" checked="checked" value="1" >debug
+    <input type="checkbox" class="crm-form-checkbox api-param-checkbox api-input" id="debug-checkbox" name="debug" value="1" >debug
   </label>
   &nbsp;|&nbsp;
 
   </table>
   <div id="api-param-buttons" style="display: none;">
     <a href="#" class="crm-hover-button" id="api-params-add"><span class="icon ui-icon-plus"></span>{ts}Add Parameter{/ts}</a>
+    <a href="#" class="crm-hover-button" id="api-option-add"><span class="icon ui-icon-gear"></span>{ts}Add Option{/ts}</a>
     <a href="#" class="crm-hover-button" id="api-chain-add"><span class="icon ui-icon-link"></span>{ts}Chain API Call{/ts}</a>
   </div>
   <div id="api-generated-wraper">
     <table id="api-generated" border=1>
       <caption>{ts}Code{/ts}</caption>
-      <tr><td>Rest</td><td><pre class="prettyprint linenums" id="api-rest"></pre></td></tr>
+      <tr><td>Rest</td><td><pre class="prettyprint" id="api-rest"></pre></td></tr>
       <tr><td>Smarty</td><td><pre class="prettyprint linenums" id="api-smarty" title='smarty syntax (for get actions)'></pre></td></tr>
       <tr><td>Php</td><td><pre class="prettyprint linenums" id="api-php" title='php syntax'></pre></td></tr>
       <tr><td>Javascript</td><td><pre class="prettyprint linenums" id="api-json" title='javascript syntax'></pre></td></tr>
   </tr>
 </script>
 
+<script type="text/template" id="api-return-tpl">
+  <tr class="api-return-row">
+    <td colspan="3">
+      <label for="api-return-value">{ts}Fields to return{/ts}:</label> &nbsp;
+      <input type="hidden" class="api-param-name" value="return" />
+      <input style="width: 50%;" id="api-return-value" class="crm-form-text api-param-value api-input" placeholder="{ts}Leave blank for default{/ts}"/>
+    </td>
+  </tr>
+</script>
+
+<script type="text/template" id="api-options-tpl">
+  <tr class="api-options-row">
+    <td>
+      <label>{ts}Options{/ts}: &nbsp;</label>
+    </td>
+    <td>
+      <input class="crm-form-text api-option-name api-input" style="width: 12em;" placeholder="{ts}Option{/ts}"/>
+    </td>
+    <td>
+      <input style="width: 85%;" class="crm-form-text api-option-value api-input" placeholder="{ts}Value{/ts}"/>
+      <a class="crm-hover-button api-param-remove" href="#"><span class="icon ui-icon-close"></span></a>
+    </td>
+  </tr>
+</script>
+
 <script type="text/template" id="api-chain-tpl">
   <tr class="api-chain-row">
     <td>