27 $can_deactivate =
true;
28 }
catch (\
Elgg\Exceptions\PluginException $e) {
30 $can_deactivate =
false;
33 $can_deactivate =
false;
37 }
catch (\
Elgg\Exceptions\PluginException $e) {
53 if ($can_deactivate) {
55 $options[
'class'] =
'elgg-button elgg-button-cancel elgg-plugin-state-change';
57 $classes[] =
'elgg-state-cannot-deactivate';
60 $options[
'class'] =
'elgg-button elgg-button-cancel';
68 $options[
'class'] =
'elgg-button elgg-button-submit elgg-plugin-state-change';
72 $classes[] =
'elgg-state-cannot-activate';
75 $options[
'class'] =
'elgg-button elgg-button-submit';
100 $css_class = preg_replace(
'/[^a-z0-9-]/i',
'-', $category);
101 $classes[] =
"elgg-plugin-category-{$css_class}";
105 'href' =>
"ajax/view/object/plugin/details?guid={$plugin->guid}",
106 'text' =>
$plugin->getDisplayName(),
107 'class' =>
'elgg-lightbox',
121 'image_block_vars' => [
123 'id' => preg_replace(
'/[^a-z0-9-]/i',
'-',
$plugin->getID()),
128 'subtitle' =>
elgg_view(
'output/longtext', [
129 'value' =>
$plugin->getDescription(),
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
elgg_generate_action_url($action, array $query=[], $add_csrf_tokens=true)
Generate an action URL.
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
if(!elgg_is_admin_logged_in()) $plugin
Displays a plugin.
if(!in_array(elgg_extract('active_filter', $vars), $categories)) foreach($categories as $category) $title
elgg_view_message($type, $body, array $vars=[])
Wrapper function for the message display pattern.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg echo
Translates a string.
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
catch(\Elgg\Exceptions\PluginException $e) $options