Elgg  Version 3.0
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 
29 $timer = elgg_format_element('span', ['class' => 'upgrade-timer'], '00:00:00');
30 
31 $counter = elgg_format_element('span', ['class' => 'upgrade-counter float-alt'],
32  $count === Batch::UNKNOWN_COUNT ? "0/???" : "0/$count"
33 );
34 
36  'class' => 'elgg-progressbar',
37 ]);
38 
39 $errors_link = elgg_view('output/url', [
40  'href' => "#upgrade-errors-{$entity->guid}",
41  'text' => elgg_echo('upgrade:error_count', [0]),
42  'rel' => 'toggle',
43  'class' => 'upgrade-error-counter',
44 ]);
45 
47  'id' => "upgrade-errors-{$entity->guid}",
48  'class' => 'upgrade-messages elgg-message elgg-state-error hidden',
49 ]);
50 
52  'entity' => $entity,
53  'title' => $entity->getDisplayName(),
54  'subtitle' => elgg_echo($entity->description),
55  'content' => $data . $counter . $timer . $progressbar . $errors_link . $errors,
56 ];
58 
59 echo elgg_view('object/elements/summary', $params);
$errors
Definition: pending.php:46
$errors_link
Definition: pending.php:39
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$params
Definition: pending.php:51
$entity
Definition: pending.php:10
$data
Definition: pending.php:23
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
if(!$batch||$batch->shouldBeSkipped()) $count
Definition: pending.php:21
elgg echo
Translates a string.
Definition: languages.js:43
$timer
Definition: pending.php:29
$counter
Definition: pending.php:31
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
if(!$entity instanceof ElggUpgrade) $batch
Definition: pending.php:15
$vars['type']
Definition: save.php:11
$progressbar
Definition: pending.php:35
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246