Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
3 | | CiviCRM version 4.3 | | |
4 | +--------------------------------------------------------------------+ | |
5 | | Copyright CiviCRM LLC (c) 2004-2013 | | |
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 | ||
42 | {include file="CRM/common/enableDisable.tpl"} | |
43 | {include file="CRM/common/jsortable.tpl"} | |
44 | ||
45 | <div id="mainTabContainer" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> | |
46 | <ul class="crm-extensions-tabs-list"> | |
47 | <li id="tab_summary" class="crm-tab-button"> | |
48 | <a href="#extensions-main" title="{ts}Extensions{/ts}"> | |
49 | <span> </span> {ts}Extensions{/ts} | |
50 | <em> </em> | |
51 | </a> | |
52 | </li> | |
53 | <li id="tab_addnew" class="crm-tab-button"> | |
54 | <a href="#extensions-addnew" title="{ts}Add New{/ts}"> | |
55 | <span> </span> {ts}Add New{/ts} | |
56 | <em> </em> | |
57 | </a> | |
58 | </li> | |
59 | </ul> | |
60 | ||
61 | <div id="extensions-main" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> | |
62 | {include file="CRM/Admin/Page/Extensions/Main.tpl"} | |
63 | </div> | |
64 | <div id="extensions-addnew" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> | |
65 | {if $extAddNewEnabled} | |
66 | {if $extAddNewReqs} | |
67 | {include file="CRM/Admin/Page/Extensions/AddNewReq.tpl"} | |
68 | {else} | |
69 | {include file="CRM/Admin/Page/Extensions/AddNew.tpl"} | |
70 | {/if} | |
71 | {else} | |
72 | {ts}The system administrator has disabled this feature.{/ts} | |
73 | {/if} | |
74 | </div> | |
75 | ||
76 | <div class="clear"></div> | |
77 | </div> | |
78 | ||
79 | {if $action ne 1 and $action ne 2} | |
80 | {include file="CRM/Admin/Page/Extensions/Refresh.tpl"} | |
81 | {/if} | |
82 | ||
83 | {* Expand/Collapse *} | |
84 | {literal} | |
85 | <script type="text/javascript"> | |
86 | cj( function( ) { | |
87 | cj('.collapsed').click( function( ) { | |
88 | var currentObj = cj( this ); | |
89 | if ( currentObj.hasClass( 'expanded') ) { | |
90 | currentObj.removeClass( 'expanded' ); | |
91 | currentObj.parent( ).parent( ).next( ).hide( ); | |
92 | } else { | |
93 | currentObj.addClass( 'expanded' ); | |
94 | currentObj.parent( ).parent( ).next( ).show( ); | |
95 | } | |
96 | ||
97 | return false; | |
98 | }); | |
99 | }); | |
100 | </script> | |
101 | {/literal} | |
102 | ||
103 | {* Tab management *} | |
104 | <script type="text/javascript"> | |
105 | var selectedTab = 'summary'; | |
106 | var spinnerImage = '<img src="{$config->resourceBase}i/loading.gif" style="width:10px;height:10px"/>'; | |
107 | {if $selectedChild}selectedTab = "{$selectedChild}";{/if} | |
108 | ||
109 | {literal} | |
110 | ||
111 | //explicitly stop spinner | |
112 | function stopSpinner( ) { | |
113 | cj('li.crm-tab-button').each(function(){ cj(this).find('span').text(' ');}) | |
114 | } | |
115 | ||
116 | cj( function() { | |
117 | var tabIndex = cj('#tab_' + selectedTab).prevAll().length; | |
118 | cj("#mainTabContainer").tabs({ selected: tabIndex, spinner: spinnerImage, cache: true, load: stopSpinner}); | |
119 | cj(".crm-tab-button").addClass("ui-corner-bottom"); | |
120 | }); | |
121 | {/literal} | |
122 | </script> | |
123 | ||
124 | {* Refresh buttons *} | |
125 | {literal} | |
126 | <script type="text/javascript"> | |
127 | cj(function() { | |
128 | cj('.crm-extensions-refresh').click(function(event){ | |
129 | event.stopPropagation(); | |
130 | CRM.alert('', '{/literal}{ts escape="js"}Refreshing...{/ts}{literal}', 'crm-msg-loading', {expires: 0}); | |
131 | CRM.api('Extension', 'refresh', {}, { | |
132 | 'callBack' : function(result){ | |
133 | if (result.is_error) { | |
134 | CRM.alert(result.error_message, '{/literal}{ts escape="js"}Refresh Error{/ts}{literal}', 'error'); | |
135 | } else { | |
136 | window.location.reload(); | |
137 | } | |
138 | } | |
139 | }); | |
140 | return false; | |
141 | }); // .click | |
142 | }); // onload | |
143 | </script> | |
144 | {/literal} | |
145 | {/if} |