remove old readme
[atutor.git] / themes / simplified-desktop / admin / modules / install_modules.tmpl.php
1
2 <form name="frm_upload" enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
3         
4 <div class="input-form">
5                 <div class="row"><?php echo _AT("upload_module"); ?></div>
6
7                 <div class="row">
8                         <input type="hidden" name="MAX_FILE_SIZE" value="52428800" />
9                         <input type="file" name="modulefile"  size="50" />
10                 </div>
11                 
12                 <div class="row buttons">
13                         <input type="submit" name="install_upload" value="<?php echo _AT('install'); ?>" onclick="javascript: return validate_filename(); " class="submit" />
14                         <input type="hidden" name="uploading" value="1" />
15                 </div>
16 </div>
17
18 </form>
19
20 <?php 
21 if (count($this->keys) > 0)
22 {
23 ?>
24 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="installform">
25 <table class="data" summary="" rules="cols">
26 <thead>
27 <tr>
28         <th scope="col">&nbsp;</th>
29         <th scope="col"><?php echo _AT('module_name'); ?></th>
30         <th scope="col"><?php echo _AT('directory_name'); ?></th>
31         <th scope="col"><?php echo _AT('description'); ?></th>
32 </tr>
33 </thead>
34
35 <tfoot>
36 <tr>
37         <td colspan="4">
38                 <input type="submit" name="install_manually"  value="<?php echo _AT('install'); ?>" />
39         </td>
40 </tr>
41 </tfoot>
42
43 <tbody>
44 <?php if (!empty($this->keys)): ?>
45         <?php foreach($this->keys as $dir_name) : $module =& $this->module_list[$dir_name]; ?>
46                 <tr onmousedown="document.installform['m_<?php echo $dir_name; ?>'].checked = true; rowselect(this);" id="r_<?php echo $dir_name; ?>">
47                         <td valign="top"><input type="radio" id="m_<?php echo $dir_name; ?>" name="mod" value="<?php echo $dir_name; ?>" /></td>
48                         <td valign="top"><label for="m_<?php echo $row['dir_name']; ?>"><?php echo $module->getName(); ?></label></td>
49                         <td valign="top"><code><?php echo $dir_name; ?>/</code></td>
50                         <td valign="top"><?php echo $module->getDescription($_SESSION['lang']); ?></td>
51                 </tr>
52         <?php endforeach; ?>
53 <?php else: ?>
54         <tr>
55                 <td colspan="4"><?php echo _AT('none_found'); ?></td>
56         </tr>
57 <?php endif; ?>
58 </tbody>
59 </table>
60 </form>
61 <br />
62 <?php 
63 }
64 ?>
65
66 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">
67 <?php 
68 ?>
69 <table class="data" summary="" rules="cols">
70 <thead>
71         <tr>
72                 <th scope="col">&nbsp;</th>
73                 <th scope="col"><?php echo _AT('module_name');?></th>
74                 <th scope="col"><?php echo _AT('description');?></th>
75                 <th scope="col"><?php echo _AT('version');?></th>
76                 <th scope="col"><?php echo _AT('atutor_version_tested_with');?></th>
77                 <th scope="col"><?php echo _AT('maintainers');?></th>
78                 <th scope="col"><?php echo _AT('installed').'?';?></th>
79         </tr>
80 </thead>
81         
82 <tfoot>
83 <tr>
84         <td colspan="7">
85                 <input type="submit" name="install" value="<?php echo _AT('install'); ?>" />
86                 <input type="submit" name="download" value="<?php echo _AT('download'); ?>" />
87                 <input type="submit" name="version_history" value="<?php echo _AT('version_history'); ?>" />
88         </td>
89 </tr>
90 </tfoot>
91
92 <tbody>
93 <?php 
94 $num_of_modules = count($this->module_list_array);
95
96 if ($num_of_modules == 0)
97 {
98 ?>
99
100 <tr>
101         <td colspan="7"><?php echo _AT('none_found'); ?></td>
102 </tr>
103
104 <?php 
105 }
106 else
107 {
108         // display modules
109         if(is_array($this->module_list_array))
110         {
111                 for ($i=0; $i < $num_of_modules; $i++)
112                 {
113                         // check if the module has been installed
114                         //$sql = "SELECT * FROM ".TABLE_PREFIX."modules WHERE dir_name = '" . $this->module_list_array[$i]["history"][0]["install_folder"] . "'";
115                         //$result = mysql_query($sql, $db) or die(mysql_error());
116
117                         if (mysql_num_rows($this->result) == 0) $installed = false;
118                         else $installed = true;
119
120 ?>
121         <tr onmousedown="document.form['m<?php echo $i; ?>'].checked = true; rowselect(this);"  id="r_<?php echo $i; ?>">
122                 <td><input type="radio" name="id" value="<?php echo $i; ?>" id="m<?php echo $i; ?>" <?php if ($installed) echo 'disabled="disabled"'; ?> /></td>
123                 <td><label for="m<?php echo $i; ?>"><?php echo $this->module_list_array[$i]["name"]; ?></label></td>
124                 <td><?php echo $this->module_list_array[$i]["description"]; ?></td>
125                 <td><?php echo $this->module_list_array[$i]["history"][0]["version"]; ?></td>
126                 <td><?php echo $this->module_list_array[$i]["atutor_version"]; ?></td>
127                 <td><?php echo $this->module_list_array[$i]["history"][0]["maintainer"]; ?></td>
128                 <td><?php if ($installed) echo _AT("installed"); else echo _AT("not_installed"); ?></td>
129         </tr>
130
131 <?php 
132                 }
133         }
134
135 ?>
136 </tbody>
137
138 <?php 
139 }
140 ?>
141 </table>
142 </form>