Elgg  Version 3.0
dependencies.php
Go to the documentation of this file.
1 <?php
11 $plugin = elgg_extract('plugin', $vars, false);
12 $deps = $plugin->getPackage()->checkDependencies(true);
13 
14 $columns = ['type', 'name', 'expected_value', 'local_value', 'comment'];
15 
16 echo '<table class="elgg-plugin-dependencies styled elgg-table"><tr>';
17 
18 foreach ($columns as $column) {
19  $column = elgg_echo("admin:plugins:dependencies:$column");
20  echo "<th class=\"pas\">$column</th>";
21 }
22 
23 echo '</tr>';
24 
25 foreach ($deps as $dep) {
26  $fields = _elgg_services()->plugins->getDependencyStrings($dep);
27  $type = $dep['type'];
28 
29  if ($dep['status']) {
30  $class = "elgg-state-success elgg-dependency elgg-dependency-$type";
31  } elseif ($dep['type'] == 'suggests') {
32  $class = "elgg-state-warning elgg-dependency elgg-dependency-$type";
33  } else {
34  $class = "elgg-state-error elgg-dependency elgg-dependency-$type";
35  }
36 
37  echo "<tr>";
38 
39  foreach ($columns as $column) {
40  echo "<td class=\"pas $class\">{$fields[$column]}</td>";
41  }
42 
43  echo '</tr>';
44 }
45 
46 echo '</table>';
$column
Definition: add.php:10
$columns
$type
Definition: delete.php:21
$plugin
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$class
Definition: field.php:29
elgg echo
Translates a string.
Definition: languages.js:43
$fields
Definition: save.php:28
$deps
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif(is_callable([$item, 'getType']))
Definition: item.php:39
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
$vars['type']
Definition: save.php:11
_elgg_services()
Get the global service provider.
Definition: elgglib.php:1292