Skip to content

Commit f658190

Browse files
committed
Fix on demand JS when calling from modal; closes #7075
1 parent 6b800f0 commit f658190

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

front/dropdown.common.form.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@
121121
}
122122

123123
} else if (isset($_GET['_in_modal'])) {
124-
Html::popHeader($dropdown->getTypeName(1), $_SERVER['PHP_SELF']);
124+
Html::popHeader(
125+
$dropdown->getTypeName(1),
126+
$_SERVER['PHP_SELF'],
127+
false,
128+
$dropdown->first_level_menu,
129+
$dropdown->second_level_menu, $dropdown->getType()
130+
);
125131
$dropdown->showForm($_GET["id"]);
126132
Html::popFooter();
127133

inc/commondropdown.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ abstract class CommonDropdown extends CommonDBTM {
4646

4747
//Menu & navigation
4848
public $first_level_menu = "config";
49-
public $second_level_menu = "CommonDropdown";
49+
public $second_level_menu = "commondropdown";
5050
public $third_level_menu = "";
5151

5252
public $display_dropdowntitle = true;

inc/html.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ static function header($title, $url = '', $sector = "none", $item = "none", $opt
15441544

15451545
// If in modal : display popHeader
15461546
if (isset($_REQUEST['_in_modal']) && $_REQUEST['_in_modal']) {
1547-
return self::popHeader($title, $url);
1547+
return self::popHeader($title, $url, false, $sector, $item, $option);
15481548
}
15491549
// Print a nice HTML-head for every page
15501550
if ($HEADER_LOADED) {
@@ -1624,7 +1624,7 @@ static function header($title, $url = '', $sector = "none", $item = "none", $opt
16241624
static function footer($keepDB = false) {
16251625
global $CFG_GLPI, $FOOTER_LOADED, $TIMER_DEBUG;
16261626

1627-
// If in modal : display popHeader
1627+
// If in modal : display popFooter
16281628
if (isset($_REQUEST['_in_modal']) && $_REQUEST['_in_modal']) {
16291629
return self::popFooter();
16301630
}

0 commit comments

Comments
 (0)