mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 08:22:17 +00:00
- Changed helper and language autoload
- Changed language config - Removed never used constants - Changed rest_language in rest config file - Adapted models that where extending FHC_Model - Adapted code to load hlp_return_object - Adapted code to use exit status codes constants
This commit is contained in:
@@ -199,7 +199,7 @@ class DmsLib
|
||||
if ($this->ci->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->ci->db->trans_rollback();
|
||||
$result = error($result->msg, EXIT_ERROR);
|
||||
$result = error('An error occurred while performing a delete operation', EXIT_ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -36,9 +36,6 @@ class MessageLib
|
||||
$this->_ci->load->model('system/MsgStatus_model', 'MsgStatusModel');
|
||||
$this->_ci->load->model('system/Recipient_model', 'RecipientModel');
|
||||
$this->_ci->load->model('system/Attachment_model', 'AttachmentModel');
|
||||
|
||||
// Loads phrases
|
||||
$this->_ci->lang->load('message');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -970,7 +967,7 @@ class MessageLib
|
||||
if ($this->_ci->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->_ci->db->trans_rollback();
|
||||
$result = $this->_error($result->msg, EXIT_ERROR);
|
||||
$result = $this->_error('An error occurred while saving a message', EXIT_ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -984,16 +981,16 @@ class MessageLib
|
||||
/**
|
||||
* Wrapper for function error
|
||||
*/
|
||||
private function _error($retval = '', $code = null)
|
||||
private function _error($retval, $code)
|
||||
{
|
||||
return error($retval, $code, MessageLib::MSG_INDX_PREFIX);
|
||||
return error($retval, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for function success
|
||||
*/
|
||||
private function _success($retval = '', $code = null)
|
||||
private function _success($retval, $code = null)
|
||||
{
|
||||
return success($retval, $code, MessageLib::MSG_INDX_PREFIX);
|
||||
return success($retval, $code);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,8 +82,7 @@ class PhrasesLib
|
||||
*/
|
||||
public function getPhrasentextById($phrasentext_id)
|
||||
{
|
||||
if (isEmptyString($phrasentext_id))
|
||||
return error($this->_ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
if (isEmptyString($phrasentext_id)) return error('Not a valid phrasentext_id');
|
||||
|
||||
return $this->_ci->PhrasentextModel->load($phrasentext_id);
|
||||
}
|
||||
@@ -170,8 +169,7 @@ class PhrasesLib
|
||||
*/
|
||||
public function parseVorlagetext($text, $data = array())
|
||||
{
|
||||
if (isEmptyString($text))
|
||||
return error($this->_ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
if (isEmptyString($text)) return error('Not a valid text');
|
||||
|
||||
return $this->_ci->parser->parse_string($text, $data, true);
|
||||
}
|
||||
|
||||
@@ -72,8 +72,7 @@ class VorlageLib
|
||||
*/
|
||||
public function getVorlagetextByVorlage($vorlage_kurzbz)
|
||||
{
|
||||
if (isEmptyString($vorlage_kurzbz))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
if (isEmptyString($vorlage_kurzbz)) return error('Not a valid vorlage_kurzbz');
|
||||
|
||||
$vorlage = $this->ci->VorlageStudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz));
|
||||
return $vorlage;
|
||||
@@ -90,8 +89,7 @@ class VorlageLib
|
||||
*/
|
||||
public function loadVorlagetext($vorlage_kurzbz, $oe_kurzbz = null, $orgform_kurzbz = null, $sprache = null)
|
||||
{
|
||||
if (isEmptyString($vorlage_kurzbz))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
if (isEmptyString($vorlage_kurzbz)) return error('Not a valid vorlage_kurzbz');
|
||||
|
||||
// Try to search the template with the given vorlage_kurzbz and other parameters if present
|
||||
$queryParameters = array("vorlage_kurzbz" => $vorlage_kurzbz, "aktiv" => true);
|
||||
@@ -200,9 +198,8 @@ class VorlageLib
|
||||
*/
|
||||
public function parseVorlagetext($text, $data = array())
|
||||
{
|
||||
if (isEmptyString($text))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
$text = $this->ci->parser->parse_string($text, $data, true);
|
||||
return $text;
|
||||
if (isEmptyString($text)) return error('Not a valid text');
|
||||
|
||||
return $this->ci->parser->parse_string($text, $data, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user