Elgg  Version 3.0
completed.php
Go to the documentation of this file.
1 <?php
8 $entity = elgg_extract('entity', $vars);
9 if (!$entity instanceof ElggUpgrade) {
10  return;
11 }
12 
13 $imprint = [];
14 
15 $imprint[] = [
16  'icon_name' => 'flag-checkered',
17  'content' => elgg_view('output/date', [
18  'value' => $entity->getCompletedTime(),
19  'format' => elgg_echo('friendlytime:date_format'),
20  ]),
21 ];
22 
23 /* @var $batch Elgg\Upgrade\Batch */
24 $batch = $entity->getBatch();
25 if (!empty($batch)) {
26  if ($batch->shouldBeSkipped()) {
27  $imprint[] = [
28  'icon_name' => 'info',
29  'content' => elgg_echo('upgrade:should_be_skipped'),
30  ];
31  } else {
32  $count = $batch->countItems();
33  if (!empty($count)) {
34  $imprint[] = [
35  'icon_name' => 'hashtag',
36  'content' => elgg_echo('upgrade:count_items', [$count]),
37  ];
38  }
39  }
40 }
41 
43  'entity' => $entity,
44  'title' => $entity->getDisplayName(),
45  'content' => elgg_echo($entity->description),
46  'imprint' => $imprint,
47  'byline' => false,
48  'access' => false,
49 ];
51 
52 echo elgg_view('object/elements/summary', $params);
if(!empty($batch)) $params
Definition: completed.php:42
if(!$entity instanceof ElggUpgrade) $imprint
Definition: completed.php:13
$entity
Completed view of an ElggUpgrade.
Definition: completed.php:8
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg echo
Translates a string.
Definition: languages.js:43
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
if(elgg_in_context('widget')) $count
Definition: pagination.php:21
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
$batch
Definition: completed.php:24