Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
819d0d41 | 3 | | CiviCRM version 4.5 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
819d0d41 | 5 | | Copyright CiviCRM LLC (c) 2004-2014 | |
6a488035 TO |
6 | +--------------------------------------------------------------------+ |
7 | | This file is a part of CiviCRM. | | |
8 | | | | |
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. | | |
12 | | | | |
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. | | |
17 | | | | |
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 | +--------------------------------------------------------------------+ | |
25 | *} | |
26 | ||
27 | {if $action eq 1 or $action eq 2 or $action eq 8 or $action eq 32 or $action eq 64} | |
28 | {include file="CRM/Admin/Form/Extensions.tpl"} | |
29 | {else} | |
30 | {if $action ne 1 and $action ne 2} | |
31 | {include file="CRM/Admin/Page/Extensions/Refresh.tpl"} | |
32 | {/if} | |
33 | ||
34 | {if $extDbUpgrades} | |
35 | <div class="messages warning"> | |
36 | <p>{ts 1=$extDbUpgradeUrl}Your extensions require database updates. Please <a href="%1">execute the updates</a>.{/ts} | |
37 | </div> | |
38 | {/if} | |
39 | ||
40 | {include file="CRM/Admin/Page/Extensions/About.tpl"} | |
41 | ||
4d17a233 CW |
42 | {include file="CRM/common/enableDisableApi.tpl"} |
43 | {include file="CRM/common/crmeditable.tpl"} | |
6a488035 TO |
44 | {include file="CRM/common/jsortable.tpl"} |
45 | ||
46 | <div id="mainTabContainer" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> | |
47 | <ul class="crm-extensions-tabs-list"> | |
48 | <li id="tab_summary" class="crm-tab-button"> | |
49 | <a href="#extensions-main" title="{ts}Extensions{/ts}"> | |
50 | <span> </span> {ts}Extensions{/ts} | |
51 | <em> </em> | |
52 | </a> | |
53 | </li> | |
54 | <li id="tab_addnew" class="crm-tab-button"> | |
55 | <a href="#extensions-addnew" title="{ts}Add New{/ts}"> | |
56 | <span> </span> {ts}Add New{/ts} | |
57 | <em> </em> | |
58 | </a> | |
59 | </li> | |
60 | </ul> | |
61 | ||
62 | <div id="extensions-main" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> | |
63 | {include file="CRM/Admin/Page/Extensions/Main.tpl"} | |
64 | </div> | |
65 | <div id="extensions-addnew" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> | |
66 | {if $extAddNewEnabled} | |
67 | {if $extAddNewReqs} | |
68 | {include file="CRM/Admin/Page/Extensions/AddNewReq.tpl"} | |
69 | {else} | |
70 | {include file="CRM/Admin/Page/Extensions/AddNew.tpl"} | |
71 | {/if} | |
72 | {else} | |
73 | {ts}The system administrator has disabled this feature.{/ts} | |
74 | {/if} | |
75 | </div> | |
76 | ||
77 | <div class="clear"></div> | |
78 | </div> | |
79 | ||
80 | {if $action ne 1 and $action ne 2} | |
81 | {include file="CRM/Admin/Page/Extensions/Refresh.tpl"} | |
82 | {/if} | |
83 | ||
84 | {* Expand/Collapse *} | |
85 | {literal} | |
86 | <script type="text/javascript"> | |
3cc60a06 | 87 | CRM.$(function($) { |
6a488035 TO |
88 | cj('.collapsed').click( function( ) { |
89 | var currentObj = cj( this ); | |
90 | if ( currentObj.hasClass( 'expanded') ) { | |
91 | currentObj.removeClass( 'expanded' ); | |
92 | currentObj.parent( ).parent( ).next( ).hide( ); | |
93 | } else { | |
94 | currentObj.addClass( 'expanded' ); | |
95 | currentObj.parent( ).parent( ).next( ).show( ); | |
96 | } | |
97 | ||
98 | return false; | |
99 | }); | |
100 | }); | |
101 | </script> | |
102 | {/literal} | |
103 | ||
104 | {* Tab management *} | |
105 | <script type="text/javascript"> | |
106 | var selectedTab = 'summary'; | |
6a488035 TO |
107 | {if $selectedChild}selectedTab = "{$selectedChild}";{/if} |
108 | ||
109 | {literal} | |
edc51caa | 110 | |
3cc60a06 | 111 | CRM.$(function($) { |
6a488035 | 112 | var tabIndex = cj('#tab_' + selectedTab).prevAll().length; |
cc7ca4a7 | 113 | cj("#mainTabContainer").tabs({active: tabIndex}); |
6a488035 TO |
114 | cj(".crm-tab-button").addClass("ui-corner-bottom"); |
115 | }); | |
116 | {/literal} | |
117 | </script> | |
118 | ||
119 | {* Refresh buttons *} | |
120 | {literal} | |
121 | <script type="text/javascript"> | |
3cc60a06 | 122 | CRM.$(function($) { |
6a488035 TO |
123 | cj('.crm-extensions-refresh').click(function(event){ |
124 | event.stopPropagation(); | |
125 | CRM.alert('', '{/literal}{ts escape="js"}Refreshing...{/ts}{literal}', 'crm-msg-loading', {expires: 0}); | |
edc51caa | 126 | CRM.api('Extension', 'refresh', {}, { |
6a488035 TO |
127 | 'callBack' : function(result){ |
128 | if (result.is_error) { | |
129 | CRM.alert(result.error_message, '{/literal}{ts escape="js"}Refresh Error{/ts}{literal}', 'error'); | |
130 | } else { | |
131 | window.location.reload(); | |
132 | } | |
edc51caa | 133 | } |
6a488035 TO |
134 | }); |
135 | return false; | |
136 | }); // .click | |
137 | }); // onload | |
138 | </script> | |
139 | {/literal} | |
140 | {/if} |