Файл: system/classes/AjaxPage.php
Строк: 15
<?php
class AjaxPage {
private function __construct() { }
public static function setScript($title = false)
{
echo '<script src="/public/assets/ajax/ajax_file.js"></script><link rel="stylesheet" href="/public/assets/ajax/style/ajax_page.css" type="text/css" /><div id="box_loader" data-title="'.$title.'"><div class="loader"></div><div class="back"></div></div>';
if(self::isAjax())
{
if(empty($_POST['ajax_back']))
{
?>
<script type="text/javascript">
if(isHistory() && '<?= $_SERVER['REQUEST_URI'] ?>' != window.location)
window.history.pushState(null, null, '<?= $_SERVER['REQUEST_URI'] ?>');
</script>
<?
}
}
}
public static function isAjax()
{
return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
}
}