move code up one directory
[atutor.git] / themes / default / admin / system_preferences / themes / index.tmpl.php
1 <?php if (!is_writeable(realpath('./../../../themes'))): ?>
2         <div class="input-form">
3                 <div class="row">
4                         <?php echo _AT('install_themes_text', realpath('./../../../themes')); ?>                
5                 </div>
6         </div>
7 <?php else: ?>
8         <form name="importForm" method="post" action="mods/_core/themes/import.php" enctype="multipart/form-data">
9         <div class="input-form" style="width:95%;">
10                 <div class="row">
11                         <h3><?php echo _AT('import_theme'); ?></h3>
12                 </div>
13
14                 <div class="row">
15                         <label for="file"><?php echo _AT('upload_theme_package'); ?></label><br />
16                         <input type="file" name="file" size="40" id="file" />
17                 </div>
18
19                 <div class="row">
20                         <label for="url"><?php echo _AT('specify_url_to_theme_package'); ?></label><br />
21                         <input type="text" name="url" value="http://" size="40" id="url" />
22                 </div>
23                         
24                 <div class="row buttons">
25                         <input type= "submit" name="import" value="<?php echo _AT('import'); ?>" />
26                 </div>
27         </div>
28         </form>
29         <br />
30 <?php endif; ?>
31 <?php function print_data_table($this->result, $type) {
32         if (@mysql_num_rows($this->result) == 0) return;
33 ?>
34 <h3><?php if ($type == DESKTOP_DEVICE) echo _AT('themes_for_desktop'); else echo _AT('themes_for_mobile');?></h3><br />
35 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get" name="form_<?php echo $type; ?>">
36 <input type="hidden" name="type" value="<?php echo $type; ?>" />
37 <table class="data" summary="" rules="cols">
38 <thead>
39 <tr>
40         <th scope="col">&nbsp;</th>
41         <th scope="col"><?php echo _AT('title'); ?></th>
42         <th scope="col"><?php echo _AT('status'); ?></th>
43         <th scope="col"><?php echo _AT('version'); ?></th>
44         <th scope="col"><?php echo _AT('directory_name'); ?></th>
45         <th scope="col"><?php echo _AT('description'); ?></th>
46         <th scope="col"><?php echo _AT('theme_screenshot'); ?></th>
47 </tr>
48 </thead>
49 <tfoot>
50 <tr>
51         <td colspan="7">
52                 <input type="submit" name="preview"  value="<?php echo _AT('preview'); ?>" />
53                 <input type="submit" name="enable"  value="<?php echo _AT('enable'); ?>" />
54                 <input type="submit" name="disable" value="<?php echo _AT('disable'); ?>" />
55                 <input type="submit" name="default" value="<?php echo _AT('set_default').'&nbsp;'; if ($type == DESKTOP_DEVICE) echo _AT('desktop_theme'); else echo _AT('mobile_theme'); ?>" />
56                 <input type="submit" name="export"  value="<?php echo _AT('export'); ?>" />
57                 <input type="submit" name="delete"  value="<?php echo _AT('delete'); ?>" />
58         </td>
59 </tr>
60 </tfoot>
61 <?php while($row = mysql_fetch_assoc($this->result)) : ?>
62         <tbody>
63         <tr onmousedown="document.form_<?php echo $type; ?>['t_<?php echo $row['dir_name']; ?>'].checked = true; rowselect(this);" id="r_<?php echo $row['dir_name']; ?>">
64                 <td valign="top">
65                         <input type="radio" id="t_<?php echo $row['dir_name']; ?>" name="theme_dir" value="<?php echo $row['dir_name']; ?>" />
66                         <input type="hidden" name="<?php echo $row['dir_name']; ?>_version" value="<?php echo $row['version']; ?>" />
67                 </td>
68                 <td nowrap="nowrap" valign="top"><label for="t_<?php echo $row['dir_name']; ?>"><?php echo AT_print($row['title'], 'themes.title'); ?></label></td>
69                 <td valign="top"><?php
70                         if ($row['status'] == 0) {
71                                 echo _AT('disabled');
72                         } else if ($row['status'] == 1) {
73                                 echo _AT('enabled');
74                         } else if (($type == DESKTOP_DEVICE && $row['status'] == 2) || ($type == MOBILE_DEVICE && $row['status'] == 3)) {
75                                 echo '<strong>'._AT('default').'</strong>'; 
76                         }
77                         ?>
78                 </td>
79                 <td valign="top"><?php echo $row['version']; ?></td>
80                 <td valign="top"><code><?php echo $row['dir_name']; ?>/</code></td>
81                 <td valign="top"><?php echo $row['extra_info']; ?></td>
82                 <td valign="top"><?php
83                         if (file_exists('../../../themes/'.$row['dir_name'].'/screenshot.jpg')) { ?>
84                                   <img src="<?php echo AT_BASE_HREF; ?>themes/<?php echo $row['dir_name']; ?>/screenshot.jpg" border="1" alt="<?php echo _AT('theme_screenshot'); ?>" />
85                         <?php           
86                         } else if (file_exists('../../../themes/'.$row['dir_name'].'/screenshot.gif')) { ?>
87                                  <img src="<?php echo AT_BASE_HREF; ?>themes/<?php echo $row['dir_name']; ?>/screenshot.gif" border="1" alt="<?php echo _AT('theme_screenshot'); ?>" />
88                         <?php } ?>
89                 </td>
90         </tr>
91         </tbody>
92 <?php endwhile; ?>
93 </table>
94 </form>
95 <?php
96 }?>