From 58ced7a6e77124c9765107283ea2be4c656e8dc8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 26 Oct 2013 14:56:35 +0200 Subject: [PATCH] [fix/acp-logs] Do not create duplicate acp logs and fix custom module logs --- root/includes/acp/acp_portal.php | 6 +++++- root/portal/modules/portal_custom.php | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/root/includes/acp/acp_portal.php b/root/includes/acp/acp_portal.php index 172a1f8d..d64262d4 100644 --- a/root/includes/acp/acp_portal.php +++ b/root/includes/acp/acp_portal.php @@ -263,9 +263,13 @@ class acp_portal $this->cache->destroy('portal_modules'); $this->cache->destroy('sql', CONFIG_TABLE); + if(isset($module_name)) { - add_log('admin', 'LOG_PORTAL_CONFIG', $module_name); + if ($module_data['module_classname'] !== 'custom') + { + add_log('admin', 'LOG_PORTAL_CONFIG', $module_name); + } } else { diff --git a/root/portal/modules/portal_custom.php b/root/portal/modules/portal_custom.php index e4c69d38..13007490 100644 --- a/root/portal/modules/portal_custom.php +++ b/root/portal/modules/portal_custom.php @@ -169,7 +169,16 @@ class portal_custom_module $custom_permission = array_intersect($custom_permission, $groups_ary); $custom_permission = implode(',', $custom_permission); - add_log('admin', 'LOG_PORTAL_CONFIG', $user->lang['PORTAL_CUSTOM'] . ' - ' . $config['board3_custom_' . $module_id . '_title']); + if (isset($user->lang[$custom_title])) + { + $log_title = $user->lang[$custom_title]; + } + else + { + $log_title = $custom_title; + } + + add_log('admin', 'LOG_PORTAL_CONFIG', $user->lang['PORTAL_CUSTOM'] . ': ' . $log_title); // set_portal_config will take care of escaping the welcome message set_portal_config('board3_custom_' . $module_id . '_code', $custom_code);