mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
- system/messages/MessageClient->read now loads view system/messages/ajaxRead with $this->CLMessagesModel->prepareAjaxRead() as parameter
- view system/messages/ajaxRead.php can hide the button to write new messages - Added new public method prepareAjaxRead to model CL/Messages_model
This commit is contained in:
@@ -34,7 +34,7 @@ class MessageClient extends FHC_Controller
|
||||
public function read()
|
||||
{
|
||||
// Loads the view to read messages
|
||||
$this->load->view('system/messages/ajaxRead');
|
||||
$this->load->view('system/messages/ajaxRead', $this->CLMessagesModel->prepareAjaxRead());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -91,6 +91,23 @@ class Messages_model extends CI_Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares data for the view system/messages/ajaxRead
|
||||
*/
|
||||
public function prepareAjaxRead()
|
||||
{
|
||||
$psResult = $this->PrestudentModel->loadWhere(array('person_id' => getAuthPersonId()));
|
||||
|
||||
if (isError($psResult)) show_error('An error occurred while loading this page, please contact the site administrator');
|
||||
|
||||
if (hasData($psResult))
|
||||
{
|
||||
return array('writeButton' => '<input id="writeMessage" type="button" value="'.$this->p->t('ui', 'nachrichtSenden').'">');
|
||||
}
|
||||
|
||||
return array('writeButton' => '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares data for the view system/messages/ajaxWrite
|
||||
*/
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<span class="buttonsSpacer"></span>
|
||||
|
||||
<span>
|
||||
<input id="writeMessage" type="button" value="<?php echo $this->p->t('ui', 'nachrichtSenden'); ?>">
|
||||
<?php echo $writeButton; ?>
|
||||
|
||||
<input id="replyMessage" type="button" value="<?php echo $this->p->t('global', 'reply'); ?>">
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user