move code up one directory
[atutor.git] / mods / _standard / profile_pictures / html / profile_picture.inc.php
1 <?php
2 /***********************************************************************/
3 /* ATutor                                                                                                                          */
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010                                             */
6 /* Inclusive Design Institute                                          */
7 /* http://atutor.ca                                                                                                        */
8 /*                                                                                                                                         */
9 /* This program is free software. You can redistribute it and/or           */
10 /* modify it under the terms of the GNU General Public License             */
11 /* as published by the Free Software Foundation.                                           */
12 /***********************************************************************/
13 // $Id$
14 // $Id$
15 if (!defined('AT_INCLUDE_PATH')) { exit; }
16 require(AT_INCLUDE_PATH.'header.inc.php');
17
18 $gd_info = gd_info();
19 $supported_images = array();
20 if ($gd_info['GIF Create Support']) {
21         $supported_images[] = 'gif';
22 }
23 if ($gd_info['JPG Support'] || $gd_info['JPEG Support']) {
24         $supported_images[] = 'jpg';
25 }
26 if ($gd_info['PNG Support']) {
27         $supported_images[] = 'png';
28 };
29 ?>
30
31 <form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>?member_id=<?php echo $member_id; ?>" name="form">
32 <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_config['prof_pic_max_file_size']; ?>" />
33 <div class="input-form">
34 <?php if (profile_image_exists($member_id)): ?>
35         <div class="row">
36                 <a href="get_profile_img.php?id=<?php echo $member_id.SEP.'size=o'; ?>"><img src="get_profile_img.php?id=<?php echo $member_id; ?>" alt="" /></a>
37                 <input type="checkbox" name="delete" value="1" id="del"/><label for="del"><?php echo _AT('delete'); ?></label>
38         </div>
39 <?php endif; ?>
40         <div class="row">
41                 <h3><?php echo _AT('upload_new_picture'); ?></h3>
42                 <input type="file" name="file" /> (<?php echo implode(', ', $supported_images); ?>)</div>
43
44         <div class="row buttons">
45                 <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" />
46                 <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
47         </div>
48 </div>
49 </form>
50
51 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>