From 13f957de9b1d5aee8bd5a6dc890575ea1ed751e1 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Tue, 1 Oct 2019 16:27:42 +0200 Subject: [PATCH] Issue 365: Opening modules in the same or a new window is configurable. In common/configuration.ini: [settings] open_new_windows = Y/N By default, the links are opened in a new window/tab. --- common/common_directory.php | 4 ++++ common/configuration_sample.ini | 1 + licensing/templates/header.php | 12 +++++++----- management/templates/header.php | 12 +++++++----- organizations/templates/header.php | 13 +++++++------ resources/templates/header.php | 14 ++++++++------ usage/templates/header.php | 12 +++++++----- 7 files changed, 41 insertions(+), 27 deletions(-) diff --git a/common/common_directory.php b/common/common_directory.php index c1ac86ab9..6c9d65dba 100644 --- a/common/common_directory.php +++ b/common/common_directory.php @@ -161,7 +161,11 @@ function create_date_from_js_format($input) { $datepicker_format = return_datepicker_date_format(); $php_format = create_php_date_format_from_js_format($datepicker_format); return date_create_from_format($php_format, $input); +} +function getTarget() { + $config = new Configuration(); + return ($config->settings->open_new_windows == "N") ? "" : "target='_blank'"; } function debug($value) { diff --git a/common/configuration_sample.ini b/common/configuration_sample.ini index c79a2b3e4..cd0d88104 100644 --- a/common/configuration_sample.ini +++ b/common/configuration_sample.ini @@ -58,3 +58,4 @@ date_format = "%m/%d/%Y" datepicker_date_format = "mm/dd/yyyy"; #number_locale = "en_US" #number_decimals = 2 +#open_new_windows = Y diff --git a/licensing/templates/header.php b/licensing/templates/header.php index a3539f04e..5c12f07bb 100644 --- a/licensing/templates/header.php +++ b/licensing/templates/header.php @@ -41,6 +41,8 @@ //get CORAL URL for 'Change Module' and logout link $coralURL = $util->getCORALURL(); +$target = getTarget(); + ?> @@ -348,27 +350,27 @@ -->
  • diff --git a/management/templates/header.php b/management/templates/header.php index e3d584a70..344c13e10 100644 --- a/management/templates/header.php +++ b/management/templates/header.php @@ -40,6 +40,8 @@ //get CORAL URL for 'Change Module' and logout link $coralURL = $util->getCORALURL(); +$target = getTarget(); + ?> @@ -280,27 +282,27 @@
  • diff --git a/organizations/templates/header.php b/organizations/templates/header.php index b5429abb7..0c4144ce1 100644 --- a/organizations/templates/header.php +++ b/organizations/templates/header.php @@ -31,6 +31,7 @@ //get CORAL URL for 'Change Module' and logout link $coralURL = $util->getCORALURL(); +$target = getTarget(); ?> @@ -249,32 +250,32 @@
  • diff --git a/resources/templates/header.php b/resources/templates/header.php index fc31b8f1b..5d88ae891 100644 --- a/resources/templates/header.php +++ b/resources/templates/header.php @@ -30,6 +30,8 @@ //get CORAL URL for 'Change Module' and logout link. $coralURL = $util->getCORALURL(); + +$target = getTarget(); ?> @@ -123,7 +125,7 @@ ?>
    - settings->authModule == 'Y'){ echo "" . _("logout") . " | " . _("Help") . " | "; } ?> + settings->authModule == 'Y'){ echo "" . _("logout") . " | " . _("Help") . " | "; } ?>