1
Changeset c4e2312 – MultiMag

Changeset c4e2312


Ignore:
Timestamp:
Nov 26, 2019, 12:31:23 AM (4 years ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
79b2416, d311f11
Parents:
594f591 (diff), ee33d0c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
lazersib <blacklight@…> (26/11/19 00:31:23)
git-committer:
GitHub <noreply@…> (26/11/19 00:31:23)
Message:

Merge pull request #4 from magnatiwe/fix_cart_modal

Fix cart modal

Location:
web
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • web/core.php

    r594f591 rc4e2312  
    192192        if(isset($_REQUEST[$varname]))  return $_REQUEST[$varname];
    193193        return $def;
     194}
     195
     196/// Проверяет был ли получен запрос через ajax
     197/// @return boolean
     198function isAjaxRequest()
     199{
     200        return isset($_SERVER['HTTP_X_REQUESTED_WITH'])
     201                && !empty($_SERVER['HTTP_X_REQUESTED_WITH'])
     202                && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
    194203}
    195204
  • web/css/comm.js

    r594f591 rc4e2312  
    379379    httpRequest.onreadystatechange = function() { popupReqWin(httpRequest,popup); };
    380380    httpRequest.open('GET', url, true);
     381        httpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
    381382    httpRequest.send(null);
    382383    return false;
     
    405406                //popup.innerHTML="Обработка...";
    406407        }
    407         else popup.innerHTML="state "+httpRequest.readyState;
    408408}
    409409
  • web/skins/default/basic.css

    r594f591 rc4e2312  
    193193div.notify
    194194{
    195     width: 97%;
    196195    BORDER: #999900 1px solid;
    197196    FONT-SIZE: 14px;
  • web/vitrina.php

    r594f591 rc4e2312  
    194194                }
    195195            } else {
    196                 if (getenv("HTTP_REFERER")) {
    197                     redirect(getenv("HTTP_REFERER"));
    198                 }
    199                 $tmpl->msg("Товар добавлен в корзину!", "info", "<a class='urllink' href='/vitrina.php?mode=basket'>Ваша корзина</a>");
     196                    if(isAjaxRequest()) {
     197                            $tmpl->msg("Товар добавлен в корзину!", "info", "<a class='urllink' href='/vitrina.php?mode=basket'>Ваша корзина</a>");
     198                    } else {
     199                            if (getenv("HTTP_REFERER")) {
     200                                    redirect(getenv("HTTP_REFERER"));
     201                            }
     202                    }
    200203            }
    201204        } else {
Note: See TracChangeset for help on using the changeset viewer.