2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 +--------------------------------------------------------------------+
29 background: transparent;
32 #mainTabContainer pre {
38 #mainTabContainer ul.ui-tabs-nav {
47 border: 1px solid lightgrey;
51 #api-params-table th:first-child,
52 #api-params-table td:first-child {
55 #api-params-table td:first-child + td,
56 #api-params-table th:first-child + th,
57 #api-generated td:first-child {
63 #api-params .red-icon {
66 #mainTabContainer label {
70 #api-generated-wraper,
74 #api-explorer .api-options-row + .api-options-row label {
77 .api-options-row td:first-child {
80 .select2-choice .icon {
82 background-image: url("{/literal}{$config->resourceBase}{literal}/i/icons/jquery-ui-2786C2.png");
84 .select2-default .icon {
85 background-image: url("{/literal}{$config->resourceBase}{literal}/i/icons/jquery-ui-52534D.png");
89 list-style-type: decimal;
92 pre ol.linenums li:hover {
94 background-color: #f2f2f2;
96 pre li.L1, pre li.L3, pre li.L5, pre li.L7, pre li.L9,
97 #api-generated td + td,
98 #mainTabContainer pre {
99 background-color: #f9f9f9;
103 border-top: 1px solid #d3d3d3;
105 .api-doc-code .collapsible-title {
116 <div id="mainTabContainer">
118 <li class="ui-corner-all" title="GUI to build and execute API calls">
119 <a href="#explorer-tab">{ts}Explorer{/ts}</a>
121 <li class="ui-corner-all" title="Auto-generated examples from the test suite">
122 <a href="#examples-tab">{ts}Examples{/ts}</a>
124 <li class="ui-corner-all" title="API source-code and code-level documentation">
125 <a href="#docs-tab">{ts}Code Docs{/ts}</a>
129 <div id="explorer-tab">
131 <form id="api-explorer">
132 <label for="api-entity">{ts}Entity{/ts}:</label>
133 <select class="crm-form-select big required" id="api-entity" name="entity">
134 <option value="" selected="selected">{ts}Choose{/ts}...</option>
135 {crmAPI entity="Entity" action="get" var="entities" version=3}
136 {foreach from=$entities.values item=entity}
137 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
143 <label for="api-action">{ts}Action{/ts}:</label>
144 <input class="crm-form-text" id="api-action" name="action" value="get">
147 <label for="debug-checkbox" title="{ts}Display debug output with results.{/ts}">
148 <input type="checkbox" class="crm-form-checkbox api-param-checkbox api-input" id="debug-checkbox" name="debug" value="1" >debug
152 <label for="sequential-checkbox" title="{ts}Sequential is more compact format, well-suited for json and smarty.{/ts}">
153 <input type="checkbox" class="crm-form-checkbox api-param-checkbox api-input" id="sequential-checkbox" name="sequential" checked="checked" value="1">sequential
156 <table id="api-params-table">
157 <thead style="display: none;">
159 <th>{ts}Name{/ts} {help id='param-name'}</th>
160 <th>{ts}Operator{/ts} {help id='param-op'}</th>
161 <th>{ts}Value{/ts} {help id='param-value'}</th>
164 <tbody id="api-params"></tbody>
166 <div id="api-param-buttons" style="display: none;">
167 <a href="#" class="crm-hover-button" id="api-params-add"><span class="icon ui-icon-plus"></span>{ts}Add Parameter{/ts}</a>
168 <a href="#" class="crm-hover-button" id="api-option-add"><span class="icon ui-icon-gear"></span>{ts}Add Option{/ts}</a>
169 <a href="#" class="crm-hover-button" id="api-chain-add"><span class="icon ui-icon-link"></span>{ts}Chain API Call{/ts}</a>
171 <div id="api-generated-wraper">
172 <table id="api-generated" border=1>
173 <caption>{ts}Code{/ts}</caption>
174 <tr><td>Rest</td><td><pre id="api-rest"></pre></td></tr>
175 <tr><td>Smarty</td><td><pre class="linenums" id="api-smarty" title='smarty syntax (for get actions)'></pre></td></tr>
176 <tr><td>Php</td><td><pre class="linenums" id="api-php" title='php syntax'></pre></td></tr>
177 <tr><td>Javascript</td><td><pre class="linenums" id="api-json" title='javascript syntax'></pre></td></tr>
178 {if $config->userSystem->is_drupal}
179 <tr><td>Drush</td><td><pre id="api-drush" title='drush syntax'></pre></td></tr>
181 {if $config->userSystem->is_wordpress}
182 <tr><td>WP-CLI</td><td><pre id="api-wpcli" title='wp-cli syntax'></pre></td></tr>
186 <div class="crm-submit-buttons">
187 <span class="crm-button crm-icon-button">
188 <span class="crm-button-icon ui-icon-check"> </span> <input type="submit" value="{ts}Execute{/ts}" class="crm-form-submit" accesskey="S" title="{ts}Execute API call and display results{/ts}"/>
191 <pre id="api-result" class="linenums">
192 {ts}Results are displayed here.{/ts}
197 <div id="examples-tab">
198 <form id="api-examples">
199 <label for="example-entity">{ts}Entity{/ts}:</label>
200 <select class="crm-form-select big required" id="example-entity" name="entity">
201 <option value="" selected="selected">{ts}Choose{/ts}...</option>
202 {foreach from=$examples item=entity}
203 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
209 <label for="example-action">{ts}Example{/ts}:</label>
210 <select class="crm-form-select big crm-select2" id="example-action" name="action">
211 <option value="" selected="selected">{ts}Choose{/ts}...</option>
213 <pre id="example-result" class="linenums lang-php" title="{ts escape='html'}Results are displayed here.{/ts}">
214 {ts}Results are displayed here.{/ts}
221 <label for="doc-entity">{ts}Entity{/ts}:</label>
222 <select class="crm-form-select big required" id="doc-entity" name="entity">
223 <option value="" selected="selected">{ts}Choose{/ts}...</option>
224 {foreach from=$entities.values item=entity}
225 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
231 <label for="doc-action">{ts}Action{/ts}:</label>
232 <select class="crm-form-select big crm-select2" id="doc-action" name="action">
233 <option value="" selected="selected">{ts}Choose{/ts}...</option>
235 <div id="doc-result" title="{ts escape='html'}Results are displayed here.{/ts}">
236 {ts}Results are displayed here.{/ts}
243 <script type="text/template" id="api-param-tpl">
244 <tr class="api-param-row">
245 <td><input style="width: 100%;" class="crm-form-text api-param-name api-input" value="<%= name %>" placeholder="{ts}Parameter{/ts}" /></td>
247 <select class="crm-form-select api-param-op">
248 {foreach from=$operators item='op'}
249 <option value="{$op|htmlspecialchars}">{$op|htmlspecialchars}</option>
254 <input style="width: 85%;" class="crm-form-text api-param-value api-input" placeholder="{ts}Value{/ts}"/>
255 <a class="crm-hover-button api-param-remove" href="#"><span class="icon ui-icon-close"></span></a>
260 <script type="text/template" id="api-return-tpl">
261 <tr class="api-return-row">
263 <label for="api-return-value">{ts}Fields to return{/ts}:</label>
264 <input type="hidden" class="api-param-name" value="return" />
265 <input style="width: 50%;" id="api-return-value" class="crm-form-text api-param-value api-input" placeholder="{ts}Leave blank for default{/ts}"/>
270 <script type="text/template" id="api-options-tpl">
271 <tr class="api-options-row">
273 <label>{ts}Options{/ts}: </label>
276 <input class="crm-form-text api-option-name api-input" style="width: 12em;" placeholder="{ts}Option{/ts}"/>
279 <input style="width: 85%;" class="crm-form-text api-option-value api-input" placeholder="{ts}Value{/ts}"/>
280 <a class="crm-hover-button api-param-remove" href="#"><span class="icon ui-icon-close"></span></a>
285 <script type="text/template" id="api-chain-tpl">
286 <tr class="api-chain-row">
288 <select style="width: 100%;" class="crm-form-select api-chain-entity">
289 <option value=""></option>
290 {foreach from=$entities.values item=entity}
291 <option value="{$entity}" {if !empty($entities.deprecated) && in_array($entity, $entities.deprecated)}class="strikethrough"{/if}>
298 <select class="crm-form-select api-chain-action">
299 <option value="get">get</option>
303 <input style="width: 85%;" class="crm-form-text api-param-value api-input" value="{ldelim}{rdelim}" placeholder="{ts}Api Params{/ts}"/>
304 <a class="crm-hover-button api-param-remove" href="#"><span class="icon ui-icon-close"></span></a>
309 <script type="text/template" id="doc-code-tpl">
310 <div class="crm-collapsible collapsed api-doc-code">
311 <div class="collapsible-title">{ts}Source Code{/ts}</div>
313 <div class="doc-filename"><%- file %></div>
314 <pre class="prettyprint lang-php linenums"><%- code %></pre>