working at video comments
[living-lab-site.git] / application / views / user / register_view.php
index 42159c2..59fee7e 100644 (file)
@@ -10,20 +10,16 @@ function _set_value($userdata, $field, $default = '')
                ? $userdata[ str_replace('-','_',$field) ]
                : $post_value);
 }
-?>
-<?php 
-if (!$userdata):
-       echo form_open("user/register/$redirect");
-else:
-       echo form_open("user/account/$redirect");
-endif;
+
+if (!$userdata)
+       echo form_open_multipart("user/register/$redirect");
+else
+       echo form_open_multipart("user/account/$redirect");
 ?>
 
 <?php if ($userdata): ?>
 <input type="hidden" name="user-id" value="<?php echo $userdata['id'] ?>" />
 <input type="hidden" name="username" value="<?php echo $userdata['username'] ?>" />
-<!--<input type="hidden" name="password" value="12345" />
-<input type="hidden" name="password-confirmation" value="12345" />-->
 <?php endif ?>
 
 <table class="form">
@@ -41,7 +37,7 @@ endif;
                        <input type="text" name="username" size="16" value="<?php echo _set_value($userdata, 'username') ?>" />
                </td>
          <?php else: ?>
-               <th><?php echo $this->lang->line('user_username'). ': ' ?></th>
+               <th><?php echo $this->lang->line('user_username'). ' : ' ?></th>
                <td>
                        &nbsp;<em><?php echo $userdata['username'] ?></em>
                </td>`
@@ -143,6 +139,30 @@ endif;
        </tr>
        <tr><td></td><td><?php echo form_error('locality') ?></td></tr>
        
+  <?php if ($userdata && $userdata['picture']): ?>
+       <tr>
+               <th><?php echo $this->lang->line('user_picture'). ' : ' ?></th>
+               <td>
+                       <a href="<?php echo $userdata['picture'] ?>"><img src="<?php echo $userdata['picture_thumb'] ?>" alt="<?php echo $userdata['username'] ?>" /></a>
+               </td>
+       </tr>
+       <tr><td></td><td></td></tr>
+  <?php endif ?>
+       
+       <tr>
+               <th>
+                 <?php if (! $userdata || ($userdata && ! $userdata['picture'])): ?>
+                       <?php echo $this->lang->line('user_picture'). ' : ' ?>
+                 <?php else: ?>
+                       <?php echo $this->lang->line('user_change_picture'). ' : ' ?>
+                 <?php endif ?>
+               </th>
+               <td>
+                       <input type="file" name="picture" size="16" />
+               </td>
+       </tr>
+       <tr><td></td><td><?php echo $error_upload ?></td></tr>
+       
        <tr><td></td><td>&nbsp;</td></tr>
        
        <tr>