Elgg  Version 2.3
image_block.php
Go to the documentation of this file.
1 <?php
22 $body = elgg_extract('body', $vars, '');
23 unset($vars['body']);
24 
25 $image = elgg_extract('image', $vars, '');
26 unset($vars['image']);
27 
28 $alt_image = elgg_extract('image_alt', $vars, '');
29 unset($vars['image_alt']);
30 
31 $class = elgg_extract_class($vars, ['elgg-image-block', 'clearfix']);
32 unset($vars['class']);
33 
34 $body = elgg_format_element('div', [
35  'class' => 'elgg-body',
36 ], $body);
37 
38 if ($image) {
39  $image = elgg_format_element('div', [
40  'class' => 'elgg-image',
41  ], $image);
42 }
43 
44 if ($alt_image) {
46  'class' => 'elgg-image-alt',
47  ], $alt_image);
48 }
49 
51 $params['class'] = $class;
52 
if($image) if($alt_image) $params
Definition: image_block.php:50
$alt_image
Definition: image_block.php:28
elgg_extract_class(array $array, $existing=[])
Extract class names from an array with key "class", optionally merging into a preexisting set...
Definition: elgglib.php:1396
$vars['entity']
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:208
elgg echo
Translates a string.
Definition: languages.js:48
$image
Definition: image_block.php:25
$body
Elgg image block pattern.
Definition: image_block.php:22
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:1375
$class
Definition: image_block.php:31