From e223d2ce6302269490f8f28741754ffce18f985c Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 24 Apr 2011 12:26:41 +0200 Subject: [PATCH] Added feature to hide portal name on acp configuration page for all modules (was only for latest bots module) --- root/includes/acp/acp_portal.php | 4 ++-- root/portal/modules/portal_default.php | 5 +++++ root/portal/modules/portal_latest_bots.php | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/root/includes/acp/acp_portal.php b/root/includes/acp/acp_portal.php index d3d92828..a10f1014 100644 --- a/root/includes/acp/acp_portal.php +++ b/root/includes/acp/acp_portal.php @@ -104,7 +104,7 @@ class acp_portal $module_name = $user->lang[$c_class->name]; $display_vars = $c_class->get_template_acp($module_id); $template->assign_vars(array( - 'MODULE_NAME' => ($module_data['module_classname'] != 'latest_bots')? $module_data['module_name'] : '', + 'MODULE_NAME' => (isset($c_class->hide_name) && $c_class->hide_name == true)? '' : $module_data['module_name'], 'MODULE_IMAGE' => $module_data['module_image_src'], 'MODULE_IMAGE_WIDTH' => $module_data['module_image_width'], 'MODULE_IMAGE_HEIGHT' => $module_data['module_image_height'], @@ -267,7 +267,7 @@ class acp_portal 'module_status' => request_var('module_status', B3_MODULE_ENABLED), ); - if($module_data['module_classname'] != 'latest_bots') + if(!(isset($c_class->hide_name) && $c_class->hide_name == true)) { $sql_ary['module_name'] = utf8_normalize_nfc(request_var('module_name', '', true)); } diff --git a/root/portal/modules/portal_default.php b/root/portal/modules/portal_default.php index a879bcea..d82ca472 100644 --- a/root/portal/modules/portal_default.php +++ b/root/portal/modules/portal_default.php @@ -52,6 +52,11 @@ class portal_modulename_module * file must be in "adm/style/portal/" */ public $custom_acp_tpl = ''; + + /** + * hide module name in ACP configuration page + */ + public $hide_name = false; public function get_template_center($module_id) { diff --git a/root/portal/modules/portal_latest_bots.php b/root/portal/modules/portal_latest_bots.php index f83d5ef5..cc9ae657 100755 --- a/root/portal/modules/portal_latest_bots.php +++ b/root/portal/modules/portal_latest_bots.php @@ -46,6 +46,12 @@ class portal_latest_bots_module * file must be in "language/{$user->lang}/mods/portal/" */ public $language = 'portal_latest_bots_module'; + + /** + * hide module name in ACP configuration page + */ + public $hide_name = true; + public function get_template_side($module_id) {