mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
ac1df7691a
- Replaced TinyMCE V4 with V5 - Dropped TinyMCE V4 - Added new JS public/js/messaging/fasMessageWrite.js to be included by application/views/system/messages/FAShtmlWriteTemplate.php
61 lines
1.4 KiB
PHP
61 lines
1.4 KiB
PHP
<?php
|
|
|
|
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
class FASMessages extends Auth_Controller
|
|
{
|
|
/**
|
|
*
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct(
|
|
array(
|
|
'writeTemplate' => 'basis/message:rw',
|
|
'writeReplyTemplate' => 'basis/message:rw'
|
|
)
|
|
);
|
|
|
|
// Loads model CLMessagesModel which contains the GUI logic
|
|
$this->load->model('CL/Messages_model', 'CLMessagesModel');
|
|
|
|
// Phrases used in loaded views
|
|
$this->loadPhrases(
|
|
array(
|
|
'global',
|
|
'ui'
|
|
)
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Writes a new message to a prestudent using templates
|
|
*/
|
|
public function writeTemplate()
|
|
{
|
|
$prestudents = $this->input->post('prestudent_id'); // recipients prestudend_id(s)
|
|
|
|
// Loads the view to write a new message with a template
|
|
$this->load->view(
|
|
'system/messages/FAShtmlWriteTemplate',
|
|
$this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents)
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Writes a reply to a message identified by parameters $message_id and $recipient_id
|
|
* The recipient is a prestudent
|
|
* Uses templates
|
|
*/
|
|
public function writeReplyTemplate($message_id, $recipient_id)
|
|
{
|
|
$prestudents = $this->input->post('prestudent_id'); // recipients prestudend_id(s)
|
|
|
|
// Loads the view to write a new message with a template
|
|
$this->load->view(
|
|
'system/messages/FAShtmlWriteTemplate',
|
|
$this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents, $message_id, $recipient_id)
|
|
);
|
|
}
|
|
}
|