Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
image_block.php
Go to the documentation of this file.
1 <?php
22 $body = elgg_extract('body', $vars, '');
23 $image = elgg_extract('image', $vars, '');
24 $alt_image = elgg_extract('image_alt', $vars, '');
25 
26 $class = 'elgg-image-block';
28 if ($additional_class) {
29  $class = "$class $additional_class";
30 }
31 
32 $id = '';
33 if (isset($vars['id'])) {
34  $id = "id=\"{$vars['id']}\"";
35 }
36 
37 
38 $body = "<div class=\"elgg-body\">$body</div>";
39 
40 if ($image) {
41  $image = "<div class=\"elgg-image\">$image</div>";
42 }
43 
44 if ($alt_image) {
45  $alt_image = "<div class=\"elgg-image-alt\">$alt_image</div>";
46 }
47 
48 echo <<<HTML
49 <div class="$class clearfix" $id>
51 </div>
52 HTML;
$additional_class
Definition: image_block.php:27
$alt_image
Definition: image_block.php:24
$vars['entity']
if($additional_class) $id
Definition: image_block.php:32
$image
Definition: image_block.php:23
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1310
$class
Definition: image_block.php:26
$body
Elgg image block pattern.
Definition: image_block.php:22