Version 0.3.3

This commit is contained in:
dmzx
2016-01-28 20:54:41 +01:00
parent 08b6b57225
commit 6a3cb1cd04
54 changed files with 1906 additions and 4475 deletions

View File

@@ -11,15 +11,9 @@ namespace dmzx\mchat\ucp;
class ucp_mchat_module
{
/** @var \dmzx\mchat\core\functions_mchat */
protected $functions_mchat;
function main($id, $mode)
{
global $cache, $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request;
global $phpbb_container;
$this->functions_mchat = $phpbb_container->get('dmzx.mchat.functions_mchat');
$submit = (isset($_POST['submit'])) ? true : false;
$error = $data = array();
@@ -73,11 +67,6 @@ class ucp_mchat_module
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
if (($mchat_cache = $cache->get('_mchat_config')) === false)
{
$this->functions_mchat->mchat_cache();
}
$mchat_cache = $cache->get('_mchat_config');
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
@@ -89,8 +78,8 @@ class ucp_mchat_module
'S_AVATARS_MCHAT' => $data['user_mchat_avatars'],
'S_INPUT_MCHAT' => $data['user_mchat_input_area'],
'S_MCHAT_TOPICS' => $config['mchat_new_posts'],
'S_MCHAT_INDEX' => ($config['mchat_on_index'] || $config['mchat_stats_index']) ? true : false,
'S_MCHAT_AVATARS' => $mchat_cache['avatars'],
'S_MCHAT_INDEX' => $config['mchat_on_index'] || $config['mchat_stats_index'],
'S_MCHAT_AVATARS' => $config['mchat_avatars'],
));
break;