30 $can_deactivate =
true;
31 }
catch (\
Elgg\Exceptions\PluginException $e) {
33 $can_deactivate =
false;
36 $can_deactivate =
false;
40 }
catch (\
Elgg\Exceptions\PluginException $e) {
56 if ($can_deactivate) {
58 $options[
'class'] =
'elgg-button elgg-button-cancel elgg-plugin-state-change';
60 $classes[] =
'elgg-state-cannot-deactivate';
63 $options[
'class'] =
'elgg-button elgg-button-cancel elgg-state-disabled';
70 $options[
'class'] =
'elgg-button elgg-button-submit elgg-plugin-state-change';
74 $classes[] =
'elgg-state-cannot-activate';
77 $options[
'class'] =
'elgg-button elgg-button-submit elgg-state-disabled';
101 $css_class = preg_replace(
'/[^a-z0-9-]/i',
'-', $category);
102 $classes[] =
"elgg-plugin-category-{$css_class}";
106 'href' =>
"ajax/view/object/plugin/details?guid={$plugin->guid}",
107 'text' =>
$plugin->getDisplayName(),
108 'class' =>
'elgg-lightbox',
119 echo
elgg_view(
'object/elements/summary', [
122 'image_block_vars' => [
124 'id' => preg_replace(
'/[^a-z0-9-]/i',
'-',
$plugin->getID()),
129 'subtitle' =>
elgg_view(
'output/longtext', [
130 'value' =>
$plugin->getDescription(),
elgg_generate_action_url(string $action, array $query=[], bool $add_csrf_tokens=true)
Generate an action URL.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Plugin class containing helper functions for plugin activation/deactivation, dependency checking capa...
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
if(!$plugin instanceof\ElggPlugin) $reordering
elgg_trigger_event_results(string $event, string $type, array $params=[], $returnvalue=null)
Triggers an event where it is expected that the mixed return value could be manipulated by event call...
if(!elgg_is_admin_logged_in()) $plugin
Displays a plugin.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
if(!in_array(elgg_extract('active_filter', $vars), $categories)) foreach($categories as $category) $title
elgg_view_message(string $type, string $body, array $vars=[])
Wrapper function for the message display pattern.
catch(\Elgg\Exceptions\PluginException $e) $options