Commit 1f13d6b0 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier

Fixes: #2325 Fixed systems action menu

parent 2fb3dc4d
......@@ -62,12 +62,30 @@ class systemManagement extends management
// Register Daemon Events
if (class_available("DaemonEvent") && class_available("supportDaemon")) {
$headpage->xmlData['actionmenu']['action'][2]['action'] = array();
$headpage->xmlData['actionmenu']['action'][3]['action'] = array();
$events = DaemonEvent::get_event_types();
foreach($events as $name => $data){
$this->registerAction("T_".$name, "handleEvent");
$headpage->xmlData['actionmenu']['action'][2]['action'][] = array(
'name' => 'T_'.$name,
'type' => 'entry',
'image' => $data['img'],
'label' => $data['name'],
);
$this->registerAction("S_".$name, "handleEvent");
$headpage->xmlData['actionmenu']['action'][3]['action'][] = array(
'name' => 'S_'.$name,
'type' => 'entry',
'image' => $data['img'],
'label' => $data['name'],
);
}
$this->registerAction("activateMultiple", "activateMultiple");
} else {
unset($headpage->xmlData['actionmenu']['action'][2]);
unset($headpage->xmlData['actionmenu']['action'][3]);
$headpage->xmlData['actionmenu']['action'] = array_values($headpage->xmlData['actionmenu']['action']);
}
$this->registerAction("saveEvent","saveEventDialog");
$this->registerAction("createISO","createISO");
......@@ -245,9 +263,8 @@ class systemManagement extends management
// Detect triggere or scheduled actions
$headpage = $this->getHeadpage();
$event = preg_replace("/^[TS]_/", "", $action);
if (preg_match("/^[TS]_/", $action)) {
}
echo "<h1>launching action $action</h1>\n";
// Now send remaining FAI/Argonaut events here.
if (count($target) && $this->si_active) {
......@@ -290,6 +307,7 @@ class systemManagement extends management
$o_queue->append($this->dialogObject);
if ($o_queue->is_error()) {
msg_dialog::display(_("Service infrastructure"), msgPool::siError($o_queue->get_error()), ERROR_DIALOG);
$this->closeDialogs();
} else {
$this->closeDialogs();
}
......
......@@ -289,132 +289,17 @@
</action>
<action>
<type>sub</type>
<image>images/rocket.png</image>
<label>Trigger action</label>
<action>
<name>T_halt</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>images/lists/off.png</image>
<label>Halt </label>
</action>
<action>
<name>T_reboot</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>images/lists/reload.png</image>
<label>Reboot</label>
</action>
<action>
<name>T_wakeup</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>images/lists/on.png</image>
<label>Wakeup</label>
</action>
<action>
<name>T_update</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>plugins/systems/images/update.png</image>
<label>Update</label>
</action>
<action>
<name>T_lock</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>images/lists/locked.png</image>
<label>Lock</label>
</action>
<action>
<name>T_activate</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>images/lists/unlocked.png</image>
<label>Activate</label>
</action>
<action>
<name>T_reinstall</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>plugins/systems/images/reinstall.png</image>
<label>(Re)Install</label>
</action>
<type>sub</type>
<image>images/rocket.png</image>
<label>Trigger action</label>
<depends>DaemonEvent</depends>
</action>
<action>
<type>sub</type>
<image>plugins/systems/images/clock.png</image>
<label>Schedule action</label>
<action>
<name>S_halt</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>images/lists/off.png</image>
<label>Halt</label>
</action>
<action>
<name>S_reboot</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>images/lists/reload.png</image>
<label>Reboot</label>
</action>
<action>
<name>S_wakeup</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>images/lists/on.png</image>
<label>Wakeup</label>
</action>
<action>
<name>S_update</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>plugins/systems/images/update.png</image>
<label>Update</label>
</action>
<action>
<name>S_lock</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>images/lists/locked.png</image>
<label>Lock</label>
</action>
<action>
<name>S_activate</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>images/lists/unlocked.png</image>
<label>Activate</label>
</action>
<action>
<name>S_reinstall</name>
<depends>DaemonEvent</depends>
<type>entry</type>
<image>plugins/systems/images/reinstall.png</image>
<label>(Re)Install</label>
</action>
<depends>DaemonEvent</depends>
</action>
<action>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment