Elgg  Version master
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 $started = $entity->getStartTime();
16 if ($started > 0) {
17  // older upgrades don't have a start time
18  $imprint[] = [
19  'icon_name' => 'calendar-alt',
20  'content' => elgg_view('output/date', [
21  'value' => $started,
22  'format' => elgg_echo('friendlytime:date_format'),
23  ]),
24  ];
25 }
26 
27 $imprint[] = [
28  'icon_name' => 'flag-checkered',
29  'content' => elgg_view('output/date', [
30  'value' => $entity->getCompletedTime(),
31  'format' => elgg_echo('friendlytime:date_format'),
32  ]),
33 ];
34 
35 /* @var $batch Elgg\Upgrade\Batch */
36 $batch = $entity->getBatch();
37 if (!empty($batch)) {
38  if ($batch->shouldBeSkipped()) {
39  $imprint[] = [
40  'icon_name' => 'info',
41  'content' => elgg_echo('upgrade:should_be_skipped'),
42  ];
43  } else {
44  $count = $batch->countItems();
45  if (!empty($count)) {
46  $imprint[] = [
47  'icon_name' => 'hashtag',
48  'content' => elgg_echo('upgrade:count_items', [$count]),
49  ];
50  }
51  }
52 }
53 
55  'entity' => $entity,
56  'title' => $entity->getDisplayName(),
57  'content' => elgg_echo($entity->description),
58  'imprint' => $imprint,
59  'byline' => false,
60  'access' => false,
61 ];
63 
64 echo elgg_view('object/elements/summary', $params);
if($started > 0) $batch
Definition: completed.php:36
$started
Definition: completed.php:15
if(!empty($batch)) $params
Definition: completed.php:54
if(!$entity instanceof ElggUpgrade) $imprint
Definition: completed.php:13
$entity
Completed view of an ElggUpgrade.
Definition: completed.php:8
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
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
Represents an upgrade that runs outside of the upgrade.php script.
Definition: ElggUpgrade.php:26
$count
Definition: ban.php:24
$vars
Definition: theme.php:5