|
|
|
@ -272,7 +272,34 @@ class Chat extends Model |
|
|
|
|
|
|
|
|
|
return $text; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* SET Disable Chat |
|
|
|
|
* @param boolean status to disable chat |
|
|
|
|
* @return void |
|
|
|
|
*/ |
|
|
|
|
public static function setDisableChat($status = true) |
|
|
|
|
{ |
|
|
|
|
$_SESSION['disable_chat'] = $status; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Disable Chat - disable the chat |
|
|
|
|
* @return boolean - return true if setDisableChat status is true |
|
|
|
|
*/ |
|
|
|
|
public static function disableChat() |
|
|
|
|
{ |
|
|
|
|
if (!empty($_SESSION['disable_chat'])){ |
|
|
|
|
$status = $_SESSION['disable_chat']; |
|
|
|
|
if ($status == true){ |
|
|
|
|
$_SESSION['disable_chat'] = null; |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function is_chat_blocked_by_exercises() |
|
|
|
|
{ |
|
|
|
|
if (isset($_SESSION['current_exercises'])) { |
|
|
|
|