2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2019 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
28 #mainTabContainer pre {
34 #mainTabContainer ul.ui-tabs-nav {
45 border: 1px solid lightgrey;
52 #api-params-table th:first-child,
53 #api-params-table td:first-child {
57 #api-params-table td[colspan] {
60 #api-params-table td:first-child + td,
61 #api-params-table th:first-child + th {
64 #api-params-table td:first-child + td select {
67 #api-params-table td:first-child + td + td,
68 #api-params-table th:first-child + th + th {
71 #api-params .api-sort-handle {
75 #api-params tr td > .crm-i,
76 #api-params tr td > a .crm-i {
79 #api-params tr:hover td > .crm-i,
80 #api-params tr:hover td > a .crm-i {
83 #api-params .api-and-or {
91 #api-params .api-and-or > span {
97 #api-params tr.or .api-and {
100 #api-params tr.or .api-or {
103 #api-params .api-and-or .crm-i {
104 transform: rotate(180deg);
106 #api-params tr.or .api-and-or .crm-i {
109 #api-params .api-and-or:hover .crm-i {
113 border-top: 3px solid lightgrey;
114 border-left: 3px solid lightgrey;
115 border-right: 3px solid lightgrey;
117 #api-params tr.or + tr {
118 border-left: 3px solid lightgrey;
119 border-right: 3px solid lightgrey;
120 border-bottom: 3px solid lightgrey;
122 #api-params tr.or + tr.or {
126 #api-generated td:first-child {
132 #api-params .red-icon {
138 #mainTabContainer label {
142 #mainTabContainer label.api-checkbox-label {
145 #mainTabContainer h4 {
148 margin: .2em .2em 0.5em;
156 padding: 0 0 0.25em 2.5em;
161 #api-join li.join-enabled > i {
164 #api-join li.join-not-available {
167 #api-generated-wraper,
171 #api-explorer .api-options-row + .api-options-row label {
174 .api-options-row td:first-child {
177 .select2-choice .icon {
179 background-image: url("{/literal}{$config->resourceBase}{literal}/i/icons/jquery-ui-2786C2.png");
181 .select2-default .icon {
182 background-image: url("{/literal}{$config->resourceBase}{literal}/i/icons/jquery-ui-52534D.png");
190 .select2-highlighted .api-field-desc,
191 .select2-highlighted .crm-marker {
194 .api-param-op[readonly] {
198 list-style-type: decimal;
201 pre ol.linenums li:hover {
203 background-color: #f2f2f2;
205 pre li.L1, pre li.L3, pre li.L5, pre li.L7, pre li.L9,
206 #api-generated td + td,
207 #mainTabContainer pre {
208 background-color: #f9f9f9;
212 border-top: 1px solid #d3d3d3;
214 .api-doc-code .collapsible-title {
225 <div class="crm-block crm-content-block">
226 <div id="mainTabContainer">
228 <li class="ui-corner-all" title="GUI to build and execute API calls">
229 <a href="#explorer-tab"><i class="crm-i fa-search"></i> {ts}Explorer{/ts}</a>
231 <li class="ui-corner-all" title="Auto-generated examples from the test suite">
232 <a href="#examples-tab"><i class="crm-i fa-book"></i> {ts}Examples{/ts}</a>
234 <li class="ui-corner-all" title="API source-code and code-level documentation">
235 <a href="#docs-tab"><i class="crm-i fa-code"></i> {ts}Code Docs{/ts}</a>
239 <div id="explorer-tab">
240 <div class="crm-block crm-form-block">
241 <form id="api-explorer">
242 <label for="api-entity">{ts}Entity{/ts}:</label>
243 <select class="crm-form-select big required" id="api-entity" name="entity">
244 <option value="" selected="selected">{ts}Choose{/ts}...</option>
245 {crmAPI entity="Entity" var="entities"}
246 {foreach from=$entities.values item=entity}
247 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
253 <label for="api-action">{ts}Action{/ts}:</label>
254 <input class="crm-form-text" id="api-action" name="action" value="get">
257 <label for="debug-checkbox" class="api-checkbox-label" title="{ts}Display debug output with results.{/ts}">
258 <input type="checkbox" class="crm-form-checkbox api-param-checkbox api-input" id="debug-checkbox" name="debug" value="1" >debug
262 <label for="sequential-checkbox" class="api-checkbox-label" title="{ts}Sequential is more compact format, well-suited for json and smarty.{/ts}">
263 <input type="checkbox" class="crm-form-checkbox api-param-checkbox api-input" id="sequential-checkbox" name="sequential" checked="checked" value="1">sequential
266 <div id="api-join" class="crm-form-block crm-collapsible collapsed" style="display:none;">
267 <h4 class="collapsible-title">{ts}Join on:{/ts} {help id='api-join'}</h4>
271 <table id="api-params-table">
272 <thead style="display: none;">
274 <th>{ts}Name{/ts} {help id='param-name'}</th>
275 <th>{ts}Operator{/ts} {help id='param-op'}</th>
276 <th>{ts}Value{/ts} {help id='param-value'}</th>
279 <tbody id="api-params"></tbody>
281 <div id="api-param-buttons" style="display: none;">
282 <a href="#" class="crm-hover-button" id="api-params-add"><i class="crm-i fa-plus"></i> {ts}Add Parameter{/ts}</a>
283 <a href="#" class="crm-hover-button" id="api-option-add"><i class="crm-i fa-cog"></i> {ts}Add Option{/ts}</a>
284 <a href="#" class="crm-hover-button" id="api-chain-add"><i class="crm-i fa-link"></i> {ts}Chain API Call{/ts}</a>
285 {help id="api-chain"}
287 <div id="api-generated-wraper">
288 <table id="api-generated" border=1>
289 <caption>{ts}Code{/ts}</caption>
290 <tr><td>Rest</td><td><pre id="api-rest"></pre></td></tr>
291 <tr><td>Smarty</td><td><pre class="linenums" id="api-smarty" title='smarty syntax (for get actions)'></pre></td></tr>
292 <tr><td>Php</td><td><pre class="linenums" id="api-php" title='php syntax'></pre></td></tr>
293 <tr><td>Javascript</td><td><pre class="linenums" id="api-json" title='javascript syntax'></pre></td></tr>
294 <tr><td><a href="https://github.com/civicrm/cv" target="_blank">cv</a></td><td><pre id="api-cv" title='cv cli syntax'></pre></td></tr>
295 {if $config->userSystem->is_drupal}
296 <tr><td><a href="http://www.drush.org/" target="_blank">drush</a></td><td><pre id="api-drush" title='drush syntax'></pre></td></tr>
298 {if $config->userSystem->is_wordpress}
299 <tr><td><a href="http://wp-cli.org/" target="_blank">wp-cli</a></td><td><pre id="api-wpcli" title='wp-cli syntax'></pre></td></tr>
303 <div class="crm-submit-buttons">
304 <span class="crm-button crm-i-button">
305 <i class="crm-i fa-bolt"></i><input type="submit" value="{ts}Execute{/ts}" class="crm-form-submit" accesskey="S" title="{ts}Execute API call and display results{/ts}"/>
309 <pre id="api-result" class="linenums">
310 {ts}Results are displayed here.{/ts}
316 <div id="examples-tab">
317 <div class="crm-block crm-form-block">
318 <form id="api-examples">
319 <label for="example-entity">{ts}Entity{/ts}:</label>
320 <select class="crm-form-select big required" id="example-entity" name="entity">
321 <option value="" selected="selected">{ts}Choose{/ts}...</option>
322 {foreach from=$examples item=entity}
323 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
329 <label for="example-action">{ts}Example{/ts}:</label>
330 <select class="crm-form-select big crm-select2" id="example-action" name="action">
331 <option value="" selected="selected">{ts}Choose{/ts}...</option>
333 <pre id="example-result" class="linenums lang-php" placeholder="{ts escape='html'}Results are displayed here.{/ts}">
334 {ts}Results are displayed here.{/ts}
341 <div class="crm-block crm-form-block">
343 <label for="doc-entity">{ts}Entity{/ts}:</label>
344 <select class="crm-form-select big required" id="doc-entity" name="entity">
345 <option value="" selected="selected">{ts}Choose{/ts}...</option>
346 {foreach from=$entities.values item=entity}
347 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
353 <label for="doc-action">{ts}Action{/ts}:</label>
354 <select class="crm-form-select big crm-select2" id="doc-action" name="action">
355 <option value="" selected="selected">{ts}Choose{/ts}...</option>
357 <div id="doc-result">
358 {ts}Results are displayed here.{/ts}
366 <script type="text/template" id="api-param-tpl">
367 <tr class="api-param-row">
369 <i class="crm-i api-sort-handle fa-arrows"></i>
370 <input style="width: 90%;" class="crm-form-text api-param-name api-input" value="<%= name %>" placeholder="{ts}Parameter{/ts}" />
371 <div class="api-and-or"><span><span class="api-and">{ts}AND{/ts}</span> <i class="crm-i fa-toggle-on"></i> <span class="api-or">{ts}OR{/ts}</span></span></div>
376 <input class="crm-form-text api-param-op" value="=" readonly="true" title="{/literal}{ts}Other operators not available for this action.{/ts}{literal}" />
379 <select class="crm-form-select api-param-op">
380 {foreach from=$operators item='op'}
381 <option value="{$op|htmlspecialchars}">{$op|htmlspecialchars}</option>
389 <input style="width: 85%;" class="crm-form-text api-param-value api-input" placeholder="{ts}Value{/ts}"/>
390 <a class="crm-hover-button api-param-remove" href="#"><i class="crm-i fa-times"></i></a>
395 <script type="text/template" id="api-return-tpl">
396 <tr class="api-return-row">
398 <label for="api-return-value">
400 <% if(required) {ldelim} %> <span class="crm-marker">*</span> <% {rdelim} %>
402 <input type="hidden" class="api-param-name" value="return" />
403 <input style="width: 50%;" id="api-return-value" class="crm-form-text api-param-value api-input"/>
408 <script type="text/template" id="api-options-tpl">
409 <tr class="api-options-row">
411 <label>{ts}Options{/ts}: </label>
414 <input class="crm-form-text api-option-name api-input" style="width: 12em;" placeholder="{ts}Option{/ts}"/>
417 <input style="width: 85%;" class="crm-form-text api-option-value api-input" placeholder="{ts}Value{/ts}"/>
418 <a class="crm-hover-button api-param-remove" href="#"><i class="crm-i fa-times"></i></a>
423 <script type="text/template" id="api-chain-tpl">
424 <tr class="api-chain-row">
426 <i class="crm-i api-sort-handle fa-arrows"></i>
427 <select style="width: 90%;" class="crm-form-select api-chain-entity">
428 <option value=""></option>
429 {foreach from=$entities.values item=entity}
430 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
437 <select class="crm-form-select api-chain-action">
438 <option value="get">get</option>
442 <input style="width: 85%;" class="crm-form-text api-param-value api-input" value="{ldelim}{rdelim}" placeholder="{ts}API Params{/ts}"/>
443 <a class="crm-hover-button api-param-remove" href="#"><i class="crm-i fa-times"></i></a>
448 <script type="text/template" id="doc-code-tpl">
449 <div class="crm-collapsible collapsed api-doc-code">
450 <div class="collapsible-title">{ts}Source Code{/ts}</div>
452 <div class="doc-filename"><%- file %></div>
453 <pre class="lang-php linenums"><%- code %></pre>
458 <script type="text/template" id="join-tpl">
461 <% _.forEach(joins, function(join, name) { %>
462 <li <% if(join.checked) { %>class="join-enabled"<% } if(join.disabled) { %>class="join-not-available"<% }%>>
463 <i class="fa-li crm-i fa-reply fa-rotate-180"></i>
464 <label for="select-join-<%= name %>" class="api-checkbox-label">
465 <input type="checkbox" id="select-join-<%= name %>" value="<%= name %>" data-entity="<%= join.entity %>" <% if(join.checked) { %>checked<% } if(join.disabled) { %>disabled<% } %>/>
469 <% if(join.children) print(tpl({joins: join.children, tpl: tpl})); %>