mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- Added new controller system/messages/MessageClient used to read and write messages using a new GUI based on ajax and tabulator
- system/messages/MessageClient currently has only two methods: read and listMessages - Added new view system/messages/ajaxRead.php used for the GUI to read messages - Added new parameters to templates/FHC-Header: tabulator and momentjs - Added new packages to composer: tabulator and momentjs
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class MessageClient extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'read' => array('basis/message:r'),
|
||||
'listMessages' => array('basis/message:r')
|
||||
)
|
||||
);
|
||||
|
||||
// Loads model CLMessagesModel which contains the GUI logic
|
||||
$this->load->model('CL/Messages_model', 'CLMessagesModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the GUI used to read all the personal messages
|
||||
*/
|
||||
public function read()
|
||||
{
|
||||
// Loads the view to read messages
|
||||
$this->load->view('system/messages/ajaxRead');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns JSON that that contains all the received messages by the currently logged user
|
||||
* This JSON structure is nested data used by tabulator
|
||||
*/
|
||||
public function listMessages()
|
||||
{
|
||||
$jsonNestedData = $this->CLMessagesModel->prepareAjaxRead();
|
||||
|
||||
$this->outputJson($jsonNestedData);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user