Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
crop.php
Go to the documentation of this file.
1 <?php
8 elgg_load_js('jquery.imgareaselect');
9 elgg_load_js('elgg.avatar_cropper');
10 elgg_load_css('jquery.imgareaselect');
11 
12 $master_img = elgg_view('output/img', array(
13  'src' => $vars['entity']->getIconUrl('master'),
14  'alt' => elgg_echo('avatar'),
15  'class' => 'mrl',
16  'id' => 'user-avatar-cropper',
17 ));
18 
19 $preview_img = elgg_view('output/img', array(
20  'src' => $vars['entity']->getIconUrl('master'),
21  'alt' => elgg_echo('avatar'),
22 ));
23 
24 ?>
25 <div class="clearfix">
26  <?php echo $master_img; ?>
27  <div id="user-avatar-preview-title"><label><?php echo elgg_echo('avatar:preview'); ?></label></div>
28  <div id="user-avatar-preview"><?php echo $preview_img; ?></div>
29 </div>
30 <div class="elgg-foot">
31 <?php
32 $coords = array('x1', 'x2', 'y1', 'y2');
33 foreach ($coords as $coord) {
34  echo elgg_view('input/hidden', array('name' => $coord, 'value' => $vars['entity']->$coord));
35 }
36 
37 echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid));
38 
39 echo elgg_view('input/submit', array('value' => elgg_echo('avatar:create')));
40 
41 ?>
42 </div>
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$vars['entity']
elgg_load_css($name)
Load a CSS file for this page.
Definition: elgglib.php:286
$preview_img
Definition: crop.php:19
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
elgg_load_js($name)
Load a JavaScript resource on this page.
Definition: elgglib.php:208
$master_img
Definition: crop.php:12
if(!$owner||!($owner instanceof ElggUser)||!$owner->canEdit()) $coords
Definition: crop.php:15