1 <mt:setvarblock name="page_title"><__trans phrase="Plugin Manager"> - <__trans phrase="Add/Remove Plugin" /></mt:setvarblock>
3 <mt:setvarblock name="system_msg">
4 <div id="msg-container">
10 <__trans phrase="Package list has been updated.">
16 <mt:setvarblock name="related_content">
17 <mt:include name="include/pm_menus.tmpl">
20 <mt:setvarblock name="html_head" append="1">
21 <script type="text/javascript">
26 var upgrade_status = {};
27 var ftp_password = null;
29 function process(task, callback) {
31 $.each(task, function() {
34 t.process = 'not_yet';
36 if (! finish || t.process == 'done') {
41 removeClass('not_yet').
45 if (finish && t.tasks) {
46 process(t.tasks, function() {
47 $(t.list_item).removeClass('doing').addClass('done');
49 process(task, callback);
53 if (finish && t.action) {
55 t.action += '&ftp_password=' + ftp_password;
58 $.get(t.action, function(data) {
59 var ret = eval('(' + data + ')');
61 $(t.list_item).removeClass('doing').addClass('done');
64 process(task, callback);
75 if (finish && callback) {
80 $('#do_upgrade, #do_remove').click(function(ev) {
84 var command = this.id;
85 if (command == 'do_remove') {
86 var confirmed = window.confirm('<__trans phrase="Are you sure you want to remove the selected plugin?" />');
92 if (<mt:Var name="writable" /> == 1) {
93 $('#' + this.id).trigger('process');
97 jQuery.fn.mtDialog.open(
98 ScriptURI + '?' + '__mode=pluginmanager&' +
99 'op=ftp_prompt&blog_id=0&id=' + this.id
102 bind('process', function(ev, ftp_pass) {
103 var command = this.id;
108 var form = $('#do_upgrade_form');
109 form.find('input[name="packages"]:checked').each(function(m) {
110 param.packages.push(this.value);
111 if (command == 'do_upgrade') {
112 param[this.value] = form.
113 find('input[name="' + this.value + '"]').
118 ftp_password = param['ftp_password'] = ftp_pass;
121 //$('#package_list').hide();
122 $('#package_list').remove();
123 $('#upgrade_progress').show();
125 $.get('<mt:var name="link_upgrade">', param, function(data) {
126 $('#upgrade_progress_loading').hide();
128 upgrade = eval('(' + data + ')');
129 var ul0 = document.createElement('ul');
130 $.each(upgrade.tasks, function() {
131 var li = document.createElement('li');
132 li.appendChild(document.createTextNode(this.name));
133 $(li).addClass('not_yet');
136 var ul = document.createElement('ul');
139 $.each(this.tasks, function() {
140 var li = document.createElement('li');
142 li.innerHTML = this.name;
143 $(li).addClass('not_yet');
149 $('#upgrade_progress_progress').append(ul0);
152 var li = document.createElement('li');
153 li.appendChild(document.createTextNode('<__trans phrase="Complete">'));
154 $(li).addClass('not_yet');
157 process(upgrade.tasks, function() {
158 $(li).addClass('done');
159 if (upgrade_status.upgrade_required) {
160 $(li).append('<ul><li><a href="' + upgrade.upgrade_script + '" target="_blank"><__trans phrase="Upgrade Now"></a></li></ul>');
162 setTimeout(function() {
163 if (command == 'do_upgrade') {
164 alert('<__trans phrase="Installation/Upgrade successful." />');
167 alert('<__trans phrase="Removing successful." />');
176 $('#do_close_window').click(function() {
177 $('#package_list').show();
178 $('#upgrade_progress').hide();
180 $('#upgrade_progress_progress').empty();
186 <style type="text/css">
187 #plugin_manager_contents {
191 #plugin_manager_contents ul {
192 margin: 0px 0px 0px 20px;
195 #plugin_manager_contents li.not_yet {
199 #plugin_manager_contents li.doing {
203 #plugin_manager_contents li.done {
208 #upgrade_progress_loading {
214 <mt:include name="include/header.tmpl">
216 <div id="plugin_manager_contents">
217 <div id="package_list">
218 <mt:include name="include/pm_package_list_table.tmpl">
220 <div id="upgrade_progress" style="display: none">
221 <div id="upgrade_progress_loading">
222 <img src="<mt:StaticWebPath />images/loadingAnimation.gif" />
224 <div id="upgrade_progress_progress">
226 <div id="upgrade_progress_buttons">
227 <a href="<mt:var name="link_package_list">"><__trans phrase="Back To List"></a>
232 <mt:include name="include/footer.tmpl">