aboutsummaryrefslogtreecommitdiff
path: root/views/default/forms/avatar
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/forms/avatar')
-rw-r--r--views/default/forms/avatar/crop.php42
-rw-r--r--views/default/forms/avatar/upload.php16
2 files changed, 58 insertions, 0 deletions
diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php
new file mode 100644
index 000000000..3e798cb27
--- /dev/null
+++ b/views/default/forms/avatar/crop.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Avatar crop form
+ *
+ * @uses $vars['entity']
+ */
+
+elgg_load_js('jquery.imgareaselect');
+elgg_load_js('elgg.avatar_cropper');
+elgg_load_css('jquery.imgareaselect');
+
+$master_img = elgg_view('output/img', array(
+ 'src' => $vars['entity']->getIconUrl('master'),
+ 'alt' => elgg_echo('avatar'),
+ 'class' => 'mrl',
+ 'id' => 'user-avatar-cropper',
+));
+
+$preview_img = elgg_view('output/img', array(
+ 'src' => $vars['entity']->getIconUrl('master'),
+ 'alt' => elgg_echo('avatar'),
+));
+
+?>
+<div class="clearfix">
+ <?php echo $master_img; ?>
+ <div id="user-avatar-preview-title"><label><?php echo elgg_echo('avatar:preview'); ?></label></div>
+ <div id="user-avatar-preview"><?php echo $preview_img; ?></div>
+</div>
+<div class="elgg-foot">
+<?php
+$coords = array('x1', 'x2', 'y1', 'y2');
+foreach ($coords as $coord) {
+ echo elgg_view('input/hidden', array('name' => $coord, 'value' => $vars['entity']->$coord));
+}
+
+echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid));
+
+echo elgg_view('input/submit', array('value' => elgg_echo('avatar:create')));
+
+?>
+</div>
diff --git a/views/default/forms/avatar/upload.php b/views/default/forms/avatar/upload.php
new file mode 100644
index 000000000..d91e8575e
--- /dev/null
+++ b/views/default/forms/avatar/upload.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Avatar upload form
+ *
+ * @uses $vars['entity']
+ */
+
+?>
+<div>
+ <label><?php echo elgg_echo("avatar:upload"); ?></label><br />
+ <?php echo elgg_view("input/file",array('name' => 'avatar')); ?>
+</div>
+<div class="elgg-foot">
+ <?php echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid)); ?>
+ <?php echo elgg_view('input/submit', array('value' => elgg_echo('upload'))); ?>
+</div>