/usr/share/fusiondirectory/plugins/addons/argonaut/class_argonautEventTypes.inc is in fusiondirectory-plugin-argonaut 1.0.19-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | <?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2015-2016 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class argonautEventTypes
{
static protected function get_event_types_list()
{
die('get_event_types_list needs to be implemented in all subclass of argonautEventTypes');
}
/*! \brief Returns a complete list of all available events.
@return Array Containing info for all available events.
*/
static public function get_event_types()
{
global $class_mapping;
if (session::is_set('argonautEventTypes::get_event_types')) {
return session::get('argonautEventTypes::get_event_types');
} else {
$ret = array();
foreach (array_keys($class_mapping) as $class) {
if (is_subclass_of($class, 'argonautEventTypes')) {
$ret = array_merge($ret, $class::get_event_types_list());
}
}
session::set('argonautEventTypes::get_event_types', $ret);
return $ret;
}
}
/*! \brief Returns event information, like menu strings, images ...
@return Array Event information.
*/
static public function get_event_info($action)
{
$events = static::get_event_types();
if (isset($events[$action])) {
$infos = $events[$action];
$infos['listimg'] = '<img src="'.$infos['img'].'" title="'.$infos['name'].
'"alt="'.$infos['name'].'" class="center"/>';
return $infos;
} else {
return FALSE;
}
}
}
class argonautEventSystem extends argonautEventTypes
{
static protected function get_event_types_list()
{
return array(
'System.halt' => array(
'name' => _('Switch off'),
'img' => 'geticon.php?context=actions&icon=system-shutdown&size=16'
)
);
}
}
class argonautEventDeployment extends argonautEventTypes
{
static protected function get_event_types_list()
{
return array(
'Deployment.reboot' => array(
'name' => _('Reboot'),
'img' => 'geticon.php?context=actions&icon=system-reboot&size=16'
),
'Deployment.wake' => array(
'name' => _('Wake up'),
'img' => 'geticon.php?context=status&icon=task-running&size=16'
),
'Deployment.update' => array(
'name' => _('Software update'),
'img' => 'geticon.php?context=actions&icon=system-update&size=16'
),
'Deployment.reinstall' => array(
'name' => _('(Re)Install'),
'img' => 'geticon.php?context=actions&icon=system-reinstall&size=16'
),
);
}
}
|