Commit 15ea4816 authored by Ad Schellevis's avatar Ad Schellevis

(ids) add local modification time and correct sort order when listing installable rule files

parent c9aba7a6
......@@ -222,10 +222,18 @@ class SettingsController extends ApiControllerBase
$data = json_decode($response, true);
if ($data != null && array_key_exists("items", $data)) {
$result = array("items"=>array());
ksort($data['items']);
foreach ($data['items'] as $filename => $fileinfo) {
$item = array();
$item['description'] = $fileinfo['description'];
$item['filename'] = $fileinfo['filename'];
// format timestamps
if ($fileinfo['modified_local'] == null) {
$item['modified_local'] = null ;
} else {
$item['modified_local'] = date('Y/m/d G:i', $fileinfo['modified_local']) ;
}
// retrieve status from model
$item['enabled'] = (string)$this->getModel()->getFileNode($fileinfo['filename'])->enabled;
$result['rows'][] = $item;
......
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