1<?php
2/**
3 * Displays an invalid plugin on the admin screen.
4 *
5 * An invalid plugin is a plugin whose isValid() method returns false.
6 * This usually means there are required files missing, unreadable or in the
7 * wrong format.
8 */
9/* @var ElggPlugin $plugin */
10$plugin = elgg_extract('entity', $vars);
11
12$error = elgg_echo('admin:plugins:warning:invalid', [$plugin->getError()]);
13$error .= ' ' . elgg_echo('admin:plugins:label:location') . ": " . htmlspecialchars($plugin->getPath());
14
15$body = elgg_view_message('error', $error, ['title' => false, 'class' => 'elgg-subtext']);
16$body .= elgg_view_message('notice', elgg_echo('admin:plugins:warning:invalid:check_docs'), ['title' => false, 'class' => 'elgg-subtext']);
17
18echo elgg_view('object/elements/summary', [
19	'entity' => $plugin,
20	'class' => 'elgg-state-draggable elgg-plugin elgg-state-inactive elgg-state-cannot-activate',
21	'id' => preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID()),
22	'data-guid' => $plugin->guid,
23	'icon' => elgg_echo('admin:plugins:cannot_activate'),
24	'title' => $plugin->getID(),
25	'subtitle' => false,
26	'content' => $body,
27]);
28