AC_4897, AC_4898, AC_4899: Multifile uploader fixes.
[acontent.git] / updater / include / common.inc.php
1 <?php\r
2 /************************************************************************/\r
3 /* AContent                                                             */\r
4 /************************************************************************/\r
5 /* Copyright (c) 2010                                                   */\r
6 /* Inclusive Design Institute                                           */\r
7 /*                                                                      */\r
8 /* This program is free software. You can redistribute it and/or        */\r
9 /* modify it under the terms of the GNU General Public License          */\r
10 /* as published by the Free Software Foundation.                        */\r
11 /************************************************************************/\r
12 \r
13 function print_errors( $errors, $notes='' ) {\r
14         ?>\r
15         <div class="input-form">\r
16         <table>\r
17         <tr>\r
18                 <td>\r
19                 <h3><img src="images/bad.gif" align="top" alt="" class="img" /> Warning</h3>\r
20                 <?php\r
21                         echo '<ul>';\r
22                         foreach ($errors as $p) {\r
23                                 echo '<li>'.$p.'</li>';\r
24                         }\r
25                         echo '</ul>';\r
26                 ?>\r
27                 </td>\r
28         </tr>\r
29         <tr>\r
30                 <td>\r
31                 <?php echo $notes; ?>\r
32                 </td>\r
33         </tr>\r
34         </table>\r
35         </div>\r
36 <?php\r
37 }\r
38 \r
39 function print_feedback( $feedback, $notes='' ) {\r
40 ?>\r
41         <div class="input-form">\r
42         <table>\r
43         <tr>\r
44         <td><h3><img src="images/feedback.gif" align="top" alt="" class="img" /> <?php echo _AT('TR_FEEDBACK_UPDATE_INSTALLED_SUCCESSFULLY')?></h3>\r
45                 <?php\r
46                         echo '<ul>';\r
47                         foreach ($feedback as $p) {\r
48                                 echo '<li>'.$p.'</li>';\r
49                         }\r
50                         echo '</ul>';\r
51                 ?></td>\r
52         </tr>\r
53         <tr>\r
54                 <td>\r
55                 <?php echo $notes; ?>\r
56                 </td>\r
57         </tr>\r
58         </table>\r
59         </div>\r
60 <?php\r
61 }\r
62 \r
63 /**\r
64  * Check if the patch has been installed\r
65  */\r
66 function is_patch_installed($patch_id)\r
67 {\r
68         $patchesDAO = new PatchesDAO();\r
69         $rows = $patchesDAO->getInstalledPatchByIDAndVersion($patch_id, VERSION);\r
70 \r
71         if (is_array($rows)) return true;\r
72         else return false;\r
73 }\r
74 \r
75 ?>\r