2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
12 #mainTabContainer pre {
18 #mainTabContainer ul.ui-tabs-nav {
29 border: 1px solid lightgrey;
36 #api-params-table th:first-child,
37 #api-params-table td:first-child {
41 #api-params-table td[colspan] {
44 #api-params-table td:first-child + td,
45 #api-params-table th:first-child + th {
48 #api-params-table td:first-child + td select {
51 #api-params-table td:first-child + td + td,
52 #api-params-table th:first-child + th + th {
55 #api-params .api-sort-handle {
59 #api-params tr td > .crm-i,
60 #api-params tr td > a .crm-i {
63 #api-params tr:hover td > .crm-i,
64 #api-params tr:hover td > a .crm-i {
67 #api-params .api-and-or {
75 #api-params .api-and-or > span {
81 #api-params tr.or .api-and {
84 #api-params tr.or .api-or {
87 #api-params .api-and-or .crm-i {
88 transform: rotate(180deg);
90 #api-params tr.or .api-and-or .crm-i {
93 #api-params .api-and-or:hover .crm-i {
97 border-top: 3px solid lightgrey;
98 border-left: 3px solid lightgrey;
99 border-right: 3px solid lightgrey;
101 #api-params tr.or + tr {
102 border-left: 3px solid lightgrey;
103 border-right: 3px solid lightgrey;
104 border-bottom: 3px solid lightgrey;
106 #api-params tr.or + tr.or {
110 #api-generated td:first-child {
116 #api-params .red-icon {
122 #mainTabContainer label {
126 #mainTabContainer label.api-checkbox-label {
129 #mainTabContainer h4 {
132 margin: .2em .2em 0.5em;
140 padding: 0 0 0.25em 2.5em;
145 #api-join li.join-enabled > i {
148 #api-join li.join-not-available {
151 #api-generated-wraper,
155 #api-explorer .api-options-row + .api-options-row label {
158 .api-options-row td:first-child {
161 .select2-choice .icon {
163 background-image: url("{/literal}{$config->resourceBase}{literal}/i/icons/jquery-ui-2786C2.png");
165 .select2-default .icon {
166 background-image: url("{/literal}{$config->resourceBase}{literal}/i/icons/jquery-ui-52534D.png");
174 .select2-highlighted .api-field-desc,
175 .select2-highlighted .crm-marker {
178 .api-param-op[readonly] {
182 list-style-type: decimal;
185 pre ol.linenums li:hover {
187 background-color: #f2f2f2;
189 pre li.L1, pre li.L3, pre li.L5, pre li.L7, pre li.L9,
190 #api-generated td + td,
191 #mainTabContainer pre {
192 background-color: #f9f9f9;
196 border-top: 1px solid #d3d3d3;
198 .api-doc-code .collapsible-title {
209 <div class="crm-block crm-content-block">
210 <div id="mainTabContainer">
212 <li class="ui-corner-all" title="GUI to build and execute API calls">
213 <a href="#explorer-tab"><i class="crm-i fa-search"></i> {ts}Explorer{/ts}</a>
215 <li class="ui-corner-all" title="Auto-generated examples from the test suite">
216 <a href="#examples-tab"><i class="crm-i fa-book"></i> {ts}Examples{/ts}</a>
218 <li class="ui-corner-all" title="API source-code and code-level documentation">
219 <a href="#docs-tab"><i class="crm-i fa-code"></i> {ts}Code Docs{/ts}</a>
223 <div id="explorer-tab">
224 <div class="crm-block crm-form-block">
225 <form id="api-explorer">
226 <label for="api-entity">{ts}Entity{/ts}:</label>
227 <select class="crm-form-select big required" id="api-entity" name="entity">
228 <option value="" selected="selected">{ts}Choose{/ts}...</option>
229 {crmAPI entity="Entity" var="entities"}
230 {foreach from=$entities.values item=entity}
231 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
237 <label for="api-action">{ts}Action{/ts}:</label>
238 <input class="crm-form-text" id="api-action" name="action" value="get">
241 <label for="debug-checkbox" class="api-checkbox-label" title="{ts}Display debug output with results.{/ts}">
242 <input type="checkbox" class="crm-form-checkbox api-param-checkbox api-input" id="debug-checkbox" name="debug" value="1" >debug
246 <label for="sequential-checkbox" class="api-checkbox-label" title="{ts}Sequential is more compact format, well-suited for json and smarty.{/ts}">
247 <input type="checkbox" class="crm-form-checkbox api-param-checkbox api-input" id="sequential-checkbox" name="sequential" checked="checked" value="1">sequential
250 <div id="api-join" class="crm-form-block crm-collapsible collapsed" style="display:none;">
251 <h4 class="collapsible-title">{ts}Join on:{/ts} {help id='api-join'}</h4>
255 <table id="api-params-table">
256 <thead style="display: none;">
258 <th>{ts}Name{/ts} {help id='param-name'}</th>
259 <th>{ts}Operator{/ts} {help id='param-op'}</th>
260 <th>{ts}Value{/ts} {help id='param-value'}</th>
263 <tbody id="api-params"></tbody>
265 <div id="api-param-buttons" style="display: none;">
266 <a href="#" class="crm-hover-button" id="api-params-add"><i class="crm-i fa-plus"></i> {ts}Add Parameter{/ts}</a>
267 <a href="#" class="crm-hover-button" id="api-option-add"><i class="crm-i fa-cog"></i> {ts}Add Option{/ts}</a>
268 <a href="#" class="crm-hover-button" id="api-chain-add"><i class="crm-i fa-link"></i> {ts}Chain API Call{/ts}</a>
269 {help id="api-chain"}
271 <div id="api-generated-wraper">
272 <table id="api-generated" border=1>
273 <caption>{ts}Code{/ts}</caption>
274 <tr><td>Rest</td><td><pre id="api-rest"></pre></td></tr>
275 <tr><td>Smarty</td><td><pre class="linenums" id="api-smarty" title='smarty syntax (for get actions)'></pre></td></tr>
276 <tr><td>Php</td><td><pre class="linenums" id="api-php" title='php syntax'></pre></td></tr>
277 <tr><td>Javascript</td><td><pre class="linenums" id="api-json" title='javascript syntax'></pre></td></tr>
278 <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>
279 {if $config->userSystem->is_drupal}
280 <tr><td><a href="http://www.drush.org/" target="_blank">drush</a></td><td><pre id="api-drush" title='drush syntax'></pre></td></tr>
282 {if $config->userSystem->is_wordpress}
283 <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>
287 <div class="crm-submit-buttons">
288 <span class="crm-button crm-i-button">
289 <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}"/>
293 <pre id="api-result" class="linenums">
294 {ts}Results are displayed here.{/ts}
300 <div id="examples-tab">
301 <div class="crm-block crm-form-block">
302 <form id="api-examples">
303 <label for="example-entity">{ts}Entity{/ts}:</label>
304 <select class="crm-form-select big required" id="example-entity" name="entity">
305 <option value="" selected="selected">{ts}Choose{/ts}...</option>
306 {foreach from=$examples item=entity}
307 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
313 <label for="example-action">{ts}Example{/ts}:</label>
314 <select class="crm-form-select big crm-select2" id="example-action" name="action">
315 <option value="" selected="selected">{ts}Choose{/ts}...</option>
317 <pre id="example-result" class="linenums lang-php" placeholder="{ts escape='html'}Results are displayed here.{/ts}">
318 {ts}Results are displayed here.{/ts}
325 <div class="crm-block crm-form-block">
327 <label for="doc-entity">{ts}Entity{/ts}:</label>
328 <select class="crm-form-select big required" id="doc-entity" name="entity">
329 <option value="" selected="selected">{ts}Choose{/ts}...</option>
330 {foreach from=$entities.values item=entity}
331 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
337 <label for="doc-action">{ts}Action{/ts}:</label>
338 <select class="crm-form-select big crm-select2" id="doc-action" name="action">
339 <option value="" selected="selected">{ts}Choose{/ts}...</option>
341 <div id="doc-result">
342 {ts}Results are displayed here.{/ts}
350 <script type="text/template" id="api-param-tpl">
351 <tr class="api-param-row">
353 <i class="crm-i api-sort-handle fa-arrows"></i>
354 <input style="width: 90%;" class="crm-form-text api-param-name api-input" value="<%= name %>" placeholder="{ts}Parameter{/ts}" />
355 <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>
360 <input class="crm-form-text api-param-op" value="=" readonly="true" title="{/literal}{ts}Other operators not available for this action.{/ts}{literal}" />
363 <select class="crm-form-select api-param-op">
364 {foreach from=$operators item='op'}
365 <option value="{$op|htmlspecialchars}">{$op|htmlspecialchars}</option>
373 <input style="width: 85%;" class="crm-form-text api-param-value api-input" placeholder="{ts}Value{/ts}"/>
374 <a class="crm-hover-button api-param-remove" href="#"><i class="crm-i fa-times"></i></a>
379 <script type="text/template" id="api-return-tpl">
380 <tr class="api-return-row">
382 <label for="api-return-value">
384 <% if(required) {ldelim} %> <span class="crm-marker">*</span> <% {rdelim} %>
386 <input type="hidden" class="api-param-name" value="return" />
387 <input style="width: 50%;" id="api-return-value" class="crm-form-text api-param-value api-input"/>
392 <script type="text/template" id="api-options-tpl">
393 <tr class="api-options-row">
395 <label>{ts}Options{/ts}: </label>
398 <input class="crm-form-text api-option-name api-input" style="width: 12em;" placeholder="{ts}Option{/ts}"/>
401 <input style="width: 85%;" class="crm-form-text api-option-value api-input" placeholder="{ts}Value{/ts}"/>
402 <a class="crm-hover-button api-param-remove" href="#"><i class="crm-i fa-times"></i></a>
407 <script type="text/template" id="api-chain-tpl">
408 <tr class="api-chain-row">
410 <i class="crm-i api-sort-handle fa-arrows"></i>
411 <select style="width: 90%;" class="crm-form-select api-chain-entity">
412 <option value=""></option>
413 {foreach from=$entities.values item=entity}
414 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
421 <select class="crm-form-select api-chain-action">
422 <option value="get">get</option>
426 <input style="width: 85%;" class="crm-form-text api-param-value api-input" value="{ldelim}{rdelim}" placeholder="{ts}API Params{/ts}"/>
427 <a class="crm-hover-button api-param-remove" href="#"><i class="crm-i fa-times"></i></a>
432 <script type="text/template" id="doc-code-tpl">
433 <div class="crm-collapsible collapsed api-doc-code">
434 <div class="collapsible-title">{ts}Source Code{/ts}</div>
436 <div class="doc-filename"><%- file %></div>
437 <pre class="lang-php linenums"><%- code %></pre>
442 <script type="text/template" id="join-tpl">
445 <% _.forEach(joins, function(join, name) { %>
446 <li <% if(join.checked) { %>class="join-enabled"<% } if(join.disabled) { %>class="join-not-available"<% }%>>
447 <i class="fa-li crm-i fa-reply fa-rotate-180"></i>
448 <label for="select-join-<%= name %>" class="api-checkbox-label">
449 <input type="checkbox" id="select-join-<%= name %>" value="<%= name %>" data-entity="<%= join.entity %>" <% if(join.checked) { %>checked<% } if(join.disabled) { %>disabled<% } %>/>
453 <% if(join.children) print(tpl({joins: join.children, tpl: tpl})); %>