1 | <?php |
||
2 | /** |
||
3 | * Lists pending upgrades |
||
4 | */ |
||
5 | |||
6 | elgg_require_js('core/js/upgrader'); |
||
7 | |||
8 | $upgrades = elgg_get_entities([ |
||
9 | 'type' => 'object', |
||
10 | 'subtype' => 'elgg_upgrade', |
||
11 | 'limit' => false, |
||
12 | 'private_setting_name' => 'is_completed', |
||
13 | 'private_setting_value' => 0, |
||
14 | ]); |
||
15 | |||
16 | if ($upgrades) { |
||
17 | foreach ($upgrades as $key => $upgrade) { |
||
18 | // unsupported upgrade objects could still exist in the database and not be marked as completed |
||
19 | // don't know what to do with them, so skipping if they are not supported by the output view |
||
20 | if (!isset($upgrade->class)) { |
||
21 | unset($upgrades[$key]); |
||
22 | } |
||
23 | } |
||
24 | } |
||
25 | |||
26 | if (!$upgrades) { |
||
27 | echo elgg_echo('admin:upgrades:none'); |
||
28 | return; |
||
29 | } |
||
30 | |||
31 | elgg_register_menu_item('title', [ |
||
32 | 'name' => 'run_upgrades', |
||
33 | 'text' => elgg_echo('admin:upgrades:run'), |
||
34 | 'id' => 'elgg-upgrades-run', |
||
35 | 'link_class' => 'elgg-button elgg-button-action', |
||
36 | ]); |
||
37 | |||
38 | echo elgg_view_entity_list($upgrades); |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
39 |