Merge pull request #5252 from JKingsnorth/CRM-10551
[civicrm-core.git] / templates / CRM / Admin / Page / Extensions.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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/enableDisableApi.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>&nbsp;</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>&nbsp;</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 CRM.$(function($) {
87 $('.collapsed').click( function( ) {
88 var currentObj = $( 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 {if $selectedChild}selectedTab = "{$selectedChild}";{/if}
107
108 {literal}
109
110 CRM.$(function($) {
111 var tabIndex = $('#tab_' + selectedTab).prevAll().length;
112 $("#mainTabContainer").tabs({active: tabIndex});
113 $(".crm-tab-button").addClass("ui-corner-bottom");
114 });
115 {/literal}
116 </script>
117
118 {* Refresh buttons *}
119 {literal}
120 <script type="text/javascript">
121 CRM.$(function($) {
122 $('.crm-extensions-refresh').click(function(event){
123 event.stopPropagation();
124 CRM.alert('', '{/literal}{ts escape="js"}Refreshing...{/ts}{literal}', 'crm-msg-loading', {expires: 0});
125 CRM.api('Extension', 'refresh', {}, {
126 'callBack' : function(result){
127 if (result.is_error) {
128 CRM.alert(result.error_message, '{/literal}{ts escape="js"}Refresh Error{/ts}{literal}', 'error');
129 } else {
130 window.location.reload();
131 }
132 }
133 });
134 return false;
135 }); // .click
136 }); // onload
137 </script>
138 {/literal}
139 {/if}