-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcustom_submit.php
More file actions
27 lines (21 loc) · 908 Bytes
/
custom_submit.php
File metadata and controls
27 lines (21 loc) · 908 Bytes
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
<?php
/*
* This is a custom form processor, it takes an input array submitted by this module's settings form and does some extra
* preprocessing before the array gets passed back to the Modules Class to be serialized and saved into the database.
* data comes into this file as '$inputArray' and MUST be passed back out as '$outputArray' in order for the data to be saved.
*/
### Data comes in as '$inputArray' ###
$moduleOptions = $inputArray;
// Build array to update GPIO Pins DB table for pin registration with OS
$gpio_array[] = [
'gpio_num' => $moduleOptions['fan_gpio'],
'direction' => 'out',
'active' => $moduleOptions['fan_gpio_active_state'],
'description' => 'TxFan: Fan GPIO',
];
// Update GPIO pins table with new pins.
$this->update_gpios('TxFan',$gpio_array);
// Pass NEW array back out as $outputArray
$outputArray = $moduleOptions;
### Data MUST leave as '$outputArray' ###
?>