move code up one directory
[atutor.git] / themes / simplified-desktop / admin / patcher / index_admin.tmpl.php
1 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">
2 <div class="input-form">
3
4 <table class="data" summary="" style="width: 100%" rules="cols">
5 <thead>
6         <tr>
7                 <th scope="col">&nbsp;</th>
8                 <th scope="col"><?php echo _AT('atutor_patch_id');?></th>
9                 <th scope="col"><?php echo _AT('description');?></th>
10                 <th scope="col"><?php echo _AT('status');?></th>
11                 <th scope="col"><?php echo _AT('available_to');?></th>
12                 <th scope="col"><?php echo _AT('author');?></th>
13                 <th scope="col"><?php echo _AT('installed_date');?></th>
14                 <th scope="col"><?php echo _AT('view_message');?></th>
15         </tr>
16 </thead>
17         
18 <tbody>
19 <?php 
20 if ($this->num_of_patches == 0)
21 {
22 ?>
23
24 <tr>
25         <td colspan="8">
26 <?php 
27         echo _AT('none_found');
28 ?>
29         </td>
30 </tr>
31
32 <?php 
33 }
34 else
35 {
36         while ($row = mysql_fetch_assoc($this->result))
37         {
38                         print_patch_row($row, $row['patches_id'], false);
39         }
40         
41         $array_id = 0;
42         // display un-installed patches
43         if(is_array($this->patch_list_array))
44         {
45                 foreach ($this->patch_list_array as $row_num => $new_patch)
46                 {
47                         if (!is_patch_installed($new_patch['atutor_patch_id']))
48                         {
49                                 $dependent_patches_installed = true;
50                                 $dependent_patches = "";
51                                 
52                                 // check if the dependent patches are installed
53                                 if (is_array($new_patch["dependent_patches"]))
54                                 {
55                                         
56                                         foreach ($new_patch["dependent_patches"] as $num => $dependent_patch)
57                                         {
58                                                 if (!is_patch_installed($dependent_patch))
59                                                 {
60                                                         $dependent_patches_installed = false;
61                                                         $dependent_patches .= $dependent_patch. ", ";
62                                                 }
63                                         }
64                                         
65                                         // remove the last comma in the string
66                                         if ($dependent_patches <> "") $dependent_patches = substr($dependent_patches, 0, -2);
67                                 }
68         
69                                 // display patch row
70                                 if ($dependent_patches_installed)
71                                         print_patch_row($new_patch, $array_id++, true);
72                                 else
73                                 {
74                                         print_patch_row($new_patch, $array_id++, false);
75                                         $dependent_patches_installed = true;
76                                 }
77                         }
78                         else
79                                 $array_id++;
80                 }
81         }
82 ?>
83 </tbody>
84 <tfoot>
85 <tr>
86         <td colspan="8">
87                 <input type="submit" name="install" value="<?php echo _AT('install'); ?>" />
88         </td>
89 </tr>
90 </tfoot>
91
92 <?php 
93 }
94 ?>
95 </table>
96
97 </div>
98 </form>
99
100 <form name="frm_upload" enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
101         
102 <div class="input-form">
103                 <div class="row"><?php echo _AT("upload_patch"); ?></div>
104
105                 <div class="row">
106                         <input type="hidden" name="MAX_FILE_SIZE" value="52428800" />
107                         <input type="file" name="patchfile"  size="50" />
108                 </div>
109                 
110                 <div class="row buttons">
111                         <input type="submit" name="install_upload" value="Install" onclick="javascript: return validate_filename(); " class="submit" />
112                         <input type="hidden" name="uploading" value="1" />
113                 </div>
114 </div>
115
116 </form>