- Removed messagelink from controller system/infocenter/InfoCenter.php

- Improved MessageLib
- Added method getMessageVarsPerson to MessageLib
- Moved JS from views/system/messageWrite.php to public/js/messaging/messageWrite.js
- Added new controller controllers/system/FASMessages.php
- Adapted content/fasoverlay.js.php and content/messages.js.php to use FASMessages
This commit is contained in:
Paolo
2019-01-25 17:16:57 +01:00
parent d3803a848f
commit 306da46c80
10 changed files with 530 additions and 427 deletions
+34 -9
View File
@@ -39,6 +39,9 @@ class MessageLib
$this->ci->lang->load('message');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* getMessage() - returns the specified received message for a specified person
*/
@@ -750,7 +753,37 @@ class MessageLib
return $sent;
}
// ------------------------------------------------------------------------
/**
* parseMessageText
*/
public function parseMessageText($text, $data = array())
{
return $this->ci->parser->parse_string($text, $data, true);
}
/**
* Gets data for Person from view vw_msg_vars_person
* @param $person_id
*/
public function getMessageVarsPerson()
{
$variablesArray = array();
$variables = $this->ci->MessageModel->getMessageVarsPerson();
if (hasData($variables))
{
// Skip person_id
for ($i = 1; $i < count($variables->retval); $i++)
{
$variablesArray['{'.str_replace(' ', '_', strtolower($variables->retval[$i])).'}'] = $variables->retval[$i];
}
array_shift($variables->retval); // Remove person_id
}
return $variablesArray;
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
@@ -932,12 +965,4 @@ class MessageLib
{
return success($retval, $code, MessageLib::MSG_INDX_PREFIX);
}
/**
*
*/
public function parseMessageText($text, $data = array())
{
return $this->ci->parser->parse_string($text, $data, true);
}
}