Skip to content

Commit 9d3ae4e

Browse files
committed
fix(form): anonymous forms don't load JS
1 parent a32b056 commit 9d3ae4e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

setup.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ function plugin_init_formcreator() {
220220
|| strpos($_SERVER['REQUEST_URI'], 'formcreator/front/formlist.php') !== false
221221
|| strpos($_SERVER['REQUEST_URI'], 'formcreator/front/wizard.php') !== false) {
222222
$PLUGIN_HOOKS['add_javascript']['formcreator'][] = 'lib/slinky/assets/js/jquery.slinky.js';
223-
224-
$PLUGIN_HOOKS['add_javascript']['formcreator'][] = 'lib/masonry.pkgd.min.js';
225223
}
226224

227225
Plugin::registerClass(PluginFormcreatorForm::class, ['addtabon' => Central::class]);
@@ -236,6 +234,14 @@ function plugin_init_formcreator() {
236234

237235
Plugin::registerClass(PluginFormcreatorEntityconfig::class, ['addtabon' => Entity::class]);
238236
}
237+
238+
if (strpos($_SERVER['REQUEST_URI'], 'plugins/formcreator') !== false
239+
|| strpos($_SERVER['REQUEST_URI'], 'central.php') !== false
240+
|| isset($_SESSION['glpiactiveprofile']) &&
241+
$_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') {
242+
// Add specific JavaScript
243+
$PLUGIN_HOOKS['add_javascript']['formcreator'][] = 'js/scripts.js.php';
244+
}
239245
}
240246
}
241247

0 commit comments

Comments
 (0)