move code up one directory
[atutor.git] / mods / _core / courses / html / course_icon.inc.php
1 <?php\r
2 /************************************************************************/\r
3 /* ATutor                                                                                                                               */\r
4 /************************************************************************/\r
5 /* Copyright (c) 2002-2010                                              */\r
6 /* Inclusive Design Institute                                           */\r
7 /* http://atutor.ca                                                                                                             */\r
8 /*                                                                                                                                              */\r
9 /* This program is free software. You can redistribute it and/or        */\r
10 /* modify it under the terms of the GNU General Public License          */\r
11 /* as published by the Free Software Foundation.                        */\r
12 /************************************************************************/\r
13 // $Id$\r
14 if (!defined('AT_INCLUDE_PATH')) { exit; }\r
15 \r
16 \r
17 // check if GD is installed\r
18 if (!extension_loaded('gd')) {\r
19         $msg->addInfo('FEATURE_NOT_AVAILABLE');\r
20 }else{\r
21 \r
22         $gd_info = gd_info();\r
23         $supported_images = array();\r
24 \r
25         if ($gd_info['GIF Create Support']) {\r
26                 $supported_images[] = 'gif';\r
27         }\r
28         if ($gd_info['JPG Support'] || $gd_info['JPEG Support']) {\r
29                 $supported_images[] = 'jpg';\r
30         }\r
31         if ($gd_info['PNG Support']) {\r
32                 $supported_images[] = 'png';\r
33         }\r
34         \r
35         if (!$supported_images) {\r
36                 $msg->addInfo('FEATURE_NOT_AVAILABLE');\r
37         }\r
38 }\r
39 ?>\r
40 <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_config['prof_pic_max_file_size']; ?>" />\r
41 \r
42     <div style="float:right;width:40%;">\r
43                 <h3 style="padding-top:0;"><?php echo _AT('upload_icon'); ?></h3>\r
44                 <?php\r
45                         if(!extension_loaded('gd')){\r
46                                 $msg->printInfos();\r
47                         }else{\r
48 \r
49                 ?>\r
50                 <input type="file"  name="customicon" id="customicon" /> (<?php echo implode(', ', $supported_images); ?>)\r
51                 <?php } ?>\r
52         </div>\r