Skip to content

Commit

Permalink
fix: not loaded resource for anonymous form
Browse files Browse the repository at this point in the history
fix #1536

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Oct 15, 2019
1 parent 74c83bb commit bea27a1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,6 @@ function plugin_init_formcreator() {
];
}

// Load JS and CSS files if we are on a page which need them
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';
}

if (strpos($_SERVER['REQUEST_URI'], 'plugins/formcreator/front/targetticket.form.php') !== false) {
Html::requireJs('tinymce');
}
Expand All @@ -247,6 +237,16 @@ function plugin_init_formcreator() {

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

// Load JS and CSS files if we are on a page which need them
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 bea27a1

Please sign in to comment.