mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 05:44:07 -07:00
Integrated new api interface.
This commit is contained in:
parent
4a9bfc94ad
commit
4306a4fb4f
116 changed files with 10371 additions and 0 deletions
25
web/api/v1/list/notifications/index.php
Normal file
25
web/api/v1/list/notifications/index.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
$TAB = 'NOTIFICATIONS';
|
||||
error_reporting(NULL);
|
||||
|
||||
// Main include
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
|
||||
// Data
|
||||
exec (VESTA_CMD."v-list-user-notifications $user json", $output, $return_var);
|
||||
$notifications = json_decode(implode('', $output), true);
|
||||
$notifications = array_reverse($notifications,true);
|
||||
foreach($notifications as $key => $note){
|
||||
$note['ID'] = $key;
|
||||
$notifications[$key] = $note;
|
||||
}
|
||||
|
||||
// Back uri
|
||||
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
|
||||
|
||||
$result = array(
|
||||
'result' => empty($notifications) ? [] : $notifications
|
||||
);
|
||||
|
||||
echo json_encode($result);
|
Loading…
Add table
Add a link
Reference in a new issue