mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
N°5655 - Refactor object modification logic to a dedicated controller for both page / modal modes
This commit is contained in:
@@ -17,5 +17,16 @@ namespace Combodo\iTop\Controller;
|
||||
*/
|
||||
class AbstractController
|
||||
{
|
||||
// Empty stub for now, factorized needs might come later
|
||||
/**
|
||||
* It works if your JavaScript library sets an X-Requested-With HTTP header.
|
||||
* It is known to work with common JavaScript frameworks: {@link https://wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript}
|
||||
*
|
||||
* @see \Symfony\Component\HttpFoundation\Request::isXmlHttpRequest() Inspired by
|
||||
*
|
||||
* @return bool True if the current request is an XmlHttpRequest (eg. an AJAX request)
|
||||
*/
|
||||
public function IsHandlingXmlHttpRequest(): bool
|
||||
{
|
||||
return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user