Elgg  Version 7.1
elgg_upgrade.php
Go to the documentation of this file.
1 <?php
6 $entity = elgg_extract('entity', $vars);
7 if (!$entity instanceof \ElggUpgrade) {
8  return;
9 }
10 
11 $component = $entity->getComponent();
12 $version = $entity->getVersion();
13 
14 $description = elgg_echo("{$component}:upgrade:{$version}:description");
15 
17 
18 $vars['title'] = ($plugin instanceof \ElggPlugin ? $plugin->getDisplayName() . ': ' : '') . $entity->getDisplayName();
19 
20 if (!$entity->isCompleted()) {
21  $vars['subtitle'] = $description;
22 
23  echo elgg_view('object/elgg_upgrade/pending', $vars);
24  return;
25 }
26 
27 $vars['content'] = $description;
28 
29 echo elgg_view('object/elgg_upgrade/completed', $vars);
Represents an upgrade that runs outside the upgrade.php script.
Definition: ElggUpgrade.php:26
$version
$entity
ElggUpgrade view.
Definition: elgg_upgrade.php:6
$description
$vars['title']
if(! $entity instanceof \ElggUpgrade) $component
$plugin
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:246
elgg_get_plugin_from_id(string $plugin_id)
Elgg plugins library Contains functions for managing plugins.
Definition: plugins.php:15
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
elgg_view(string $view, array $vars=[], string $viewtype='')
Return a parsed view.
Definition: views.php:156