Skip to content

Commit

Permalink
fix(form): anonymous forms don't load JS
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jul 9, 2019
1 parent a32b056 commit 9d3ae4e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ function plugin_init_formcreator() {
|| strpos($_SERVER['REQUEST_URI'], 'formcreator/front/formlist.php') !== false
|| strpos($_SERVER['REQUEST_URI'], 'formcreator/front/wizard.php') !== false) {
$PLUGIN_HOOKS['add_javascript']['formcreator'][] = 'lib/slinky/assets/js/jquery.slinky.js';

$PLUGIN_HOOKS['add_javascript']['formcreator'][] = 'lib/masonry.pkgd.min.js';
}

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

Plugin::registerClass(PluginFormcreatorEntityconfig::class, ['addtabon' => Entity::class]);
}

if (strpos($_SERVER['REQUEST_URI'], 'plugins/formcreator') !== false
|| strpos($_SERVER['REQUEST_URI'], 'central.php') !== false
|| isset($_SESSION['glpiactiveprofile']) &&
$_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') {
// Add specific JavaScript
$PLUGIN_HOOKS['add_javascript']['formcreator'][] = 'js/scripts.js.php';
}
}
}

Expand Down

0 comments on commit 9d3ae4e

Please sign in to comment.