More clear UI
[owncloud:apps.git] / updater / templates / admin.php
1 <?php
2
3 /**
4  * ownCloud - Updater plugin
5  * 
6  * @author Victor Dubiniuk
7  * @copyright 2012 Victor Dubiniuk victor.dubiniuk@gmail.com
8  * 
9  * This file is licensed under the Affero General Public License version 3 or
10  * later.
11  */
12
13 ?>
14
15 <fieldset class="personalblock">
16         <strong>Updater</strong>
17         <br />
18         <?php echo OC_Updater::ShowUpdatingHint() ?>
19         <br />
20         <?php $data=OC_Updater::check();
21                 if(isset($data['version']) && !empty($data['version'])) { ?>
22                         <button id="updater_backup"><?php echo $l->t('Update') ?></button>
23                         
24         <?php   }               ?>
25 </fieldset>
26 <script type="text/javascript">
27     $(document).ready(function(){
28                 $('#updater_backup').click(function(){
29                         $('#updater_backup').attr('disabled', 'disabled');
30                         $('#updater_backup').after('<div id="upgrade_status">In progress...</div>');
31                         $.post(OC.filePath('updater', 'ajax', 'admin.php'),
32                         {},
33                         function(response){
34                                 if (response.status && response.status == 'success'){
35                                         $('#upgrade_status').html('Done. Reload the page to proceed.');
36                                 } else {
37                                         var error = response.msg ? ': '+response.msg : '';
38                                         $('#upgrade_status').html('Error' + error);
39                                 }
40                         }
41                 )
42                 });
43     });    
44 </script>