register.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Avatar upload form
  4. *
  5. * @uses $vars['entity']
  6. */
  7. elgg_require_js('webcam');
  8. $tabs = array('acquire', 'upload');
  9. $selected_tab = get_input('tab', 'acquire');
  10. $options = array(
  11. 'tabs' => array(),
  12. 'class' => 'avatar-tabs'
  13. );
  14. foreach ($tabs as $tab) {
  15. $options['tabs'][] = array(
  16. 'text' => elgg_echo("webcam:tab:$tab"),
  17. 'id' => "avatar-$tab-tab",
  18. 'selected' => $selected_tab == $tab,
  19. 'href' => '#'
  20. );
  21. }
  22. $tab_nav = elgg_view('navigation/tabs', $options);
  23. echo "<div class='mandatory'>";
  24. echo "<br><label for='avatar'>";
  25. echo elgg_echo('avatar');
  26. echo "</label><br><br>";
  27. echo $tab_nav;
  28. echo "</div>";
  29. ?>
  30. <div id="avatar-options">
  31. <div id="avatar-upload" class="hidden">
  32. <label><?php echo elgg_echo("avatar:upload"); ?></label><br />
  33. <?php echo elgg_view("input/file", array('name' => 'avatar')); ?>
  34. </div>
  35. <div id="avatar-acquire">
  36. <label><?php echo elgg_echo("webcam:acquire:info"); ?></label><br />
  37. <div id="webcam">
  38. <canvas id="webcam-canvas" class="hidden"></canvas>
  39. <video id="webcam-video"></video>
  40. </div>
  41. </div>
  42. </div>