Elgg  Version master
chip.php
Go to the documentation of this file.
1 <?php
13 $entity = elgg_extract('entity', $vars);
14 if (!$entity instanceof ElggEntity) {
15  return;
16 }
17 
18 $title = elgg_extract('title', $vars, '');
19 if ($title === '') {
20  $title = elgg_view('object/elements/summary/title', $vars);
21 }
22 
24 if (!isset($icon)) {
26 }
27 
28 $params = (array) elgg_extract('image_block_vars', $vars, []);
31 $params['class'] = $class;
32 $params['data-guid'] = $entity->guid;
33 
$entity
Object chip Renders a simple image block with an icon and title.
Definition: chip.php:13
elgg_view_image_block(string $image, string $body, array $vars=[])
Wrapper function for the image block display pattern.
Definition: views.php:898
if(!isset($icon)) $params
Definition: chip.php:28
if($title=== '') $icon
Definition: chip.php:23
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
elgg_view_entity_icon(\ElggEntity $entity, string $size= 'medium', array $vars=[])
View the icon of an entity.
Definition: views.php:542
$class
Definition: chip.php:29
$vars
Definition: theme.php:5
elgg_extract_class(array $array, array|string $existing=[], string $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:277
if(!$entity instanceof ElggEntity) $title
Definition: chip.php:18