Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 4 | | | |
1188c7a8 TO |
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 | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | ||
11 | {if $action eq 1 or $action eq 2 or $action eq 8 or $action eq 32 or $action eq 64} | |
12 | {include file="CRM/Admin/Form/Extensions.tpl"} | |
13 | {else} | |
036aa39d | 14 | <div class="crm-content-block crm-block"> |
6a488035 TO |
15 | {if $action ne 1 and $action ne 2} |
16 | {include file="CRM/Admin/Page/Extensions/Refresh.tpl"} | |
17 | {/if} | |
18 | ||
19 | {if $extDbUpgrades} | |
20 | <div class="messages warning"> | |
036aa39d | 21 | <p>{ts 1=$extDbUpgradeUrl}Your extensions require database updates. Please <a href="%1">execute the updates</a>.{/ts}</p> |
6a488035 TO |
22 | </div> |
23 | {/if} | |
24 | ||
25 | {include file="CRM/Admin/Page/Extensions/About.tpl"} | |
26 | ||
4d17a233 | 27 | {include file="CRM/common/enableDisableApi.tpl"} |
6a488035 TO |
28 | {include file="CRM/common/jsortable.tpl"} |
29 | ||
30 | <div id="mainTabContainer" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> | |
31 | <ul class="crm-extensions-tabs-list"> | |
32 | <li id="tab_summary" class="crm-tab-button"> | |
33 | <a href="#extensions-main" title="{ts}Extensions{/ts}"> | |
34 | <span> </span> {ts}Extensions{/ts} | |
35 | <em> </em> | |
36 | </a> | |
37 | </li> | |
38 | <li id="tab_addnew" class="crm-tab-button"> | |
39 | <a href="#extensions-addnew" title="{ts}Add New{/ts}"> | |
40 | <span> </span> {ts}Add New{/ts} | |
41 | <em> </em> | |
42 | </a> | |
43 | </li> | |
44 | </ul> | |
45 | ||
46 | <div id="extensions-main" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> | |
47 | {include file="CRM/Admin/Page/Extensions/Main.tpl"} | |
48 | </div> | |
49 | <div id="extensions-addnew" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> | |
50 | {if $extAddNewEnabled} | |
51 | {if $extAddNewReqs} | |
52 | {include file="CRM/Admin/Page/Extensions/AddNewReq.tpl"} | |
53 | {else} | |
54 | {include file="CRM/Admin/Page/Extensions/AddNew.tpl"} | |
55 | {/if} | |
56 | {else} | |
57 | {ts}The system administrator has disabled this feature.{/ts} | |
58 | {/if} | |
59 | </div> | |
60 | ||
61 | <div class="clear"></div> | |
62 | </div> | |
63 | ||
64 | {if $action ne 1 and $action ne 2} | |
65 | {include file="CRM/Admin/Page/Extensions/Refresh.tpl"} | |
66 | {/if} | |
036aa39d | 67 | </div> |
6a488035 TO |
68 | {* Expand/Collapse *} |
69 | {literal} | |
70 | <script type="text/javascript"> | |
3cc60a06 | 71 | CRM.$(function($) { |
ae8f569f CW |
72 | $('.collapsed').click( function( ) { |
73 | var currentObj = $( this ); | |
6a488035 TO |
74 | if ( currentObj.hasClass( 'expanded') ) { |
75 | currentObj.removeClass( 'expanded' ); | |
76 | currentObj.parent( ).parent( ).next( ).hide( ); | |
77 | } else { | |
78 | currentObj.addClass( 'expanded' ); | |
79 | currentObj.parent( ).parent( ).next( ).show( ); | |
80 | } | |
81 | ||
82 | return false; | |
83 | }); | |
84 | }); | |
85 | </script> | |
86 | {/literal} | |
87 | ||
be7196c4 | 88 | {include file="CRM/common/TabHeader.tpl" defaultTab="summary"} |
6a488035 TO |
89 | |
90 | {* Refresh buttons *} | |
91 | {literal} | |
92 | <script type="text/javascript"> | |
3cc60a06 | 93 | CRM.$(function($) { |
ae8f569f | 94 | $('.crm-extensions-refresh').click(function(event){ |
6a488035 TO |
95 | event.stopPropagation(); |
96 | CRM.alert('', '{/literal}{ts escape="js"}Refreshing...{/ts}{literal}', 'crm-msg-loading', {expires: 0}); | |
edc51caa | 97 | CRM.api('Extension', 'refresh', {}, { |
6a488035 TO |
98 | 'callBack' : function(result){ |
99 | if (result.is_error) { | |
100 | CRM.alert(result.error_message, '{/literal}{ts escape="js"}Refresh Error{/ts}{literal}', 'error'); | |
101 | } else { | |
102 | window.location.reload(); | |
103 | } | |
edc51caa | 104 | } |
6a488035 TO |
105 | }); |
106 | return false; | |
107 | }); // .click | |
108 | }); // onload | |
109 | </script> | |
110 | {/literal} | |
111 | {/if} |