Skip to content

Commit 5bf6f99

Browse files
committed
INSTALL: Add CodevTT to mantis menu
1 parent 795ec7c commit 5bf6f99

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

install/install_step3.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ function appendToFile($destFile, $toAppendFile, $checkStr = NULL) {
152152
function updateMantisCustomFiles() {
153153

154154
$mantisPath = Constants::$mantisPath;
155+
$codevttURL = Constants::$codevURL;
155156

156157
// --- check mantis version (config files have been moved in v1.3)
157158
if (is_dir($mantisPath.DIRECTORY_SEPARATOR.'config')) {
@@ -177,6 +178,20 @@ function updateMantisCustomFiles() {
177178
appendToFile($path_mantis_config.'/custom_relationships_inc.php',
178179
Install::FILENAME_CUSTOM_RELATIONSHIPS_CODEVTT,
179180
'BUG_CUSTOM_RELATIONSHIP_CONSTRAINED_BY');
181+
182+
// add COdevTT to mantis menu
183+
$path_mantis_config_inc = $path_mantis_config.'/config_inc.php';
184+
if (is_writable($path_mantis_config_inc)) {
185+
186+
$stringToAdd = "# --- Add CodevTT to mantis main menu ---\n";
187+
$stringToAdd .= "array_push(\$g_main_menu_custom_options, array( 'CodevTT', NULL, '$codevttURL' ));\n";
188+
189+
$errStr = @file_put_contents($path_mantis_config_inc, $stringToAdd, FILE_APPEND);
190+
if (FALSE === $errStr) {
191+
throw new Exception ("Could not update file " . $path_mantis_config_inc . ": ".$errStr);
192+
}
193+
}
194+
180195
return NULL;
181196
}
182197

0 commit comments

Comments
 (0)