Skip to content

Commit

Permalink
fix(wizard): consistent breadcrumb on several pages
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Nov 2, 2022
1 parent b748182 commit 6639cda
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
6 changes: 5 additions & 1 deletion front/formlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
if (plugin_formcreator_replaceHelpdesk()) {
Html::redirect('issue.php');
} else {
Html::helpHeader(__('Form list', 'formcreator'));
Html::helpHeader(
__('Form list', 'formcreator'),
'seek_assistance',
PluginFormcreatorForm::class
);
}
} else {
Html::header(__('Form list', 'formcreator'));
Expand Down
6 changes: 5 additions & 1 deletion front/knowbaseitem.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
}

if (Session::getCurrentInterface() == 'helpdesk') {
Html::helpHeader(__('Service catalog', 'formcreator'));
Html::helpHeader(
__('Service catalog', 'formcreator'),
'faq',
PluginFormcreatorForm::class
);
} else {
Html::header(__('Service catalog', 'formcreator'));
}
Expand Down
6 changes: 5 additions & 1 deletion front/wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
}

if (Session::getCurrentInterface() == "helpdesk") {
Html::helpHeader(__('Service catalog', 'formcreator'));
Html::helpHeader(
__('Service catalog', 'formcreator'),
'seek_assistance',
PluginFormcreatorForm::class
);
} else {
Html::header(__('Service catalog', 'formcreator'));
}
Expand Down
6 changes: 5 additions & 1 deletion inc/common.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,11 @@ public static function header() {
switch (self::getInterface()) {
case "servicecatalog":
case "self-service":
return Html::helpHeader(__('Form list', 'formcreator'), $_SERVER['PHP_SELF']);
return Html::helpHeader(
__('Form list', 'formcreator'),
'seek_assistance',
PluginFormcreatorForm::class
);
case "central":
return Html::header(
__('Form Creator', 'formcreator'),
Expand Down
16 changes: 14 additions & 2 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,9 @@ function plugin_formcreator_hook(): void {
if (strpos($_SERVER['REQUEST_URI'], 'helpdesk') !== false
|| strpos($_SERVER['REQUEST_URI'], 'central.php') !== false
|| strpos($_SERVER['REQUEST_URI'], 'formcreator/front/formlist.php') !== false
|| strpos($_SERVER['REQUEST_URI'], 'formcreator/front/knowbaseitem.php') !== false
|| strpos($_SERVER['REQUEST_URI'], 'formcreator/front/wizard.php') !== false) {
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['formcreator'][] = 'lib/jquery-slinky/dist/slinky.min.js';
$CFG_GLPI['javascript']['self-service']['none'] = [
$CFG_GLPI['javascript']['seek_assistance'][PluginFormcreatorForm::class] = [
'dashboard',
'gridstack'
];
Expand All @@ -354,6 +353,19 @@ function plugin_formcreator_hook(): void {
'gridstack'
];
}
if (strpos($_SERVER['REQUEST_URI'], 'formdisplay.php') !== false) {
$CFG_GLPI['javascript']['seek_assistance'][PluginFormcreatorForm::class] = [
'dashboard',
'gridstack'
];
}
if (strpos($_SERVER['REQUEST_URI'], 'knowbaseitem.php') !== false) {
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['formcreator'][] = 'lib/jquery-slinky/dist/slinky.min.js';
$CFG_GLPI['javascript']['faq'][PluginFormcreatorForm::class] = [
'dashboard',
'gridstack'
];
}
}
}

Expand Down

0 comments on commit 6639cda

Please sign in to comment.