aboutsummaryrefslogtreecommitdiff
path: root/views/default/admin/components/plugin_dependencies.php
blob: cd38e98b068e4ecbef068fb6a598a7c7c2867df5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
 * Shows a table of plugin dependecies for ElggPlugin in $vars['plugin'].
 *
 * This uses a table because it's a table of data.
 *
 * @package Elgg.Core
 * @subpackage Admin.Plugins
 */

$plugin = elgg_get_array_value('plugin', $vars, false);
$deps = $plugin->package->checkDependencies(true);

$columns = array('type', 'name', 'expected_value', 'local_value', 'comment');

echo '<table class="elgg-plugins-dependencies styled">
	<tr>
';

foreach ($columns as $column) {
	$column = elgg_echo("admin:plugins:dependencies:$column");
	echo "<th class=\"pas\">$column</th>";
}

echo '<tr/>';

$row = 'odd';
foreach ($deps as $dep) {
	$fields = elgg_get_plugin_dependency_strings($dep);

	if ($dep['status']) {
		$class = 'elgg-satisfied-dependency';
	} else {
		$class = 'elgg-unsatisfied-dependency';
	}

	echo "<tr class=\"$row\">";

	foreach ($columns as $column) {
		echo "<td class=\"pas $class\">{$fields[$column]}</td>";
	}

	echo '</tr>';

	$row = ($row == 'odd') ? 'even' : 'odd';
}

echo '</table>';