/**
 * Add the csrf token as a hidden input field.
 */
function input_token()
{
    echo '<input type="hidden" name="token" value="';
    qe(Session::getInstance()->token);
    echo '">';
}
Exemple #2
0
<?php 
/* Determine language from parameter. */
define('LANGUAGE', !empty($_GET['lang']) && in_array($_GET['lang'], array_keys(unserialize(LANGUAGES))) ? $_GET['lang'] : 'en');
?>

jQuery(document).ready(function () {
    /* Load Modal after user clicked on a download button. */
    jQuery('.download').bind('click', function (e) {
        e.preventDefault();
        var url = jQuery(this).attr('href');

        (function (url) {
            location.href = url;
            jQuery('#afterdownload').load('<?php 
qe(url('afterdownload'));
?>
', null, function() {
                jQuery('#afterdownload').modal('show');
            });
        })(url)
    });

    /* Simple application js enhancement. */
    jQuery('select[name="device-type"]').selectpicker({style: 'btn-primary', menuStyle: 'dropdown-inverse'});
    jQuery('select[name="device-country"]').selectpicker({style: 'btn-primary', menuStyle: 'dropdown-inverse'});

    /* Make collapsable teaser boxes. */
    $('.teaser-box').each(function() {
        if($(this).height() > 450) {
            var more_link = $('<a>', {