Elgg  Version 3.0
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_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:1153
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
elgg echo
Translates a string.
Definition: languages.js:43
$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:1131
$vars['type']
Definition: save.php:11
$class
Definition: image_block.php:31