blob: 46c58f864abde5156698aad5fe38ebf106b6ab4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
<?php
/**
* Elgg image block pattern
*
* Common pattern where there is an image, icon, media object to the left
* and a descriptive block of text to the right.
*
* ---------------------------------------------------------------
* | | | alt |
* | image | body | image |
* | block | block | block |
* | | | (optional)|
* ---------------------------------------------------------------
*
* @uses $vars['body'] HTML content of the body block
* @uses $vars['image'] HTML content of the image block
* @uses $vars['image_alt'] HTML content of the alternate image block
* @uses $vars['class'] Optional additional class for media element
* @uses $vars['id'] Optional id for the media element
*/
$body = elgg_get_array_value('body', $vars, '');
$image = elgg_get_array_value('image', $vars, '');
$alt_image = elgg_get_array_value('image_alt', $vars, '');
$class = 'elgg-image-block';
$additional_class = elgg_get_array_value('class', $vars, '');
if ($additional_class) {
$class = "$class $additional_class";
}
$id = '';
if (isset($vars['id'])) {
$id = "id=\"{$vars['id']}\"";
}
$body = "<div class=\"elgg-body\">$body</div>";
if ($image) {
$image = "<div class=\"elgg-image\">$image</div>";
}
if ($alt_image) {
$alt_image = "<div class=\"elgg-image elgg-alt\">$alt_image</div>";
}
echo <<<HTML
<div class="$class clearfix" $id>
$image$alt_image$body
</div>
HTML;
|