Elgg  Version 6.1
pending.php
Go to the documentation of this file.
1 <?php
9 
10 $entity = elgg_extract('entity', $vars);
11 if (!$entity instanceof ElggUpgrade) {
12  return;
13 }
14 
15 $batch = $entity->getBatch();
16 if (!$batch || $batch->shouldBeSkipped()) {
17  // Something went wrong with class resolution
18  return;
19 }
20 
21 $count = $batch->countItems();
22 
24  'class' => 'upgrade-data hidden',
25  'data-total' => $count,
26 ]);
27 
28 $timer = elgg_format_element('span', ['class' => 'upgrade-timer'], '00:00:00');
29 
30 $counter = elgg_format_element('span', ['class' => 'upgrade-counter float-alt'],
31  $count === Batch::UNKNOWN_COUNT ? '0/???' : "0/{$count}"
32 );
33 
35  'class' => 'elgg-progressbar',
36 ]);
37 
38 $errors_link = elgg_view('output/url', [
39  'href' => "#upgrade-errors-{$entity->guid}",
40  'text' => elgg_echo('upgrade:error_count', [0]),
41  'class' => ['elgg-toggle', 'upgrade-error-counter'],
42 ]);
43 
45  'id' => "upgrade-errors-{$entity->guid}",
46  'class' => 'upgrade-messages elgg-message elgg-state-error hidden',
47 ]);
48 
50  'entity' => $entity,
51  'title' => $entity->getDisplayName(),
52  'subtitle' => elgg_echo($entity->description),
53  'content' => $data . $counter . $timer . $progressbar . $errors_link . $errors,
54 ];
56 
57 echo elgg_view('object/elements/summary', $params);
$errors
Definition: pending.php:44
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$errors_link
Definition: pending.php:38
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:256
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$params
Definition: pending.php:49
$entity
Definition: pending.php:10
Represents an upgrade that runs outside of the upgrade.php script.
Definition: ElggUpgrade.php:26
$data
Definition: pending.php:23
if(!$batch||$batch->shouldBeSkipped()) $count
Definition: pending.php:21
$timer
Definition: pending.php:28
$counter
Definition: pending.php:30
if(!$entity instanceof ElggUpgrade) $batch
Definition: pending.php:15
$vars
Definition: theme.php:5
$progressbar
Definition: pending.php:34
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145