当前位置: 首页>>代码示例>>PHP>>正文


PHP Filter::getCsrfToken方法代码示例

本文整理汇总了PHP中Fisharebest\Webtrees\Filter::getCsrfToken方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::getCsrfToken方法的具体用法?PHP Filter::getCsrfToken怎么用?PHP Filter::getCsrfToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fisharebest\Webtrees\Filter的用法示例。


在下文中一共展示了Filter::getCsrfToken方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pageHeader

    /**
     * Print the page header, using the theme
     *
     * @param bool $popup Is this a popup window
     *
     * @return $this
     */
    public function pageHeader($popup = false)
    {
        global $WT_TREE;
        $this->popup = $popup;
        // Give Javascript access to some PHP constants
        $this->addInlineJavascript('
			var WT_STATIC_URL  = "' . Filter::escapeJs(WT_STATIC_URL) . '";
			var WT_MODULES_DIR = "' . Filter::escapeJs(WT_MODULES_DIR) . '";
			var WT_GEDCOM      = "' . Filter::escapeJs($WT_TREE ? $WT_TREE->getName() : '') . '";
			var textDirection  = "' . Filter::escapeJs(I18N::direction()) . '";
			var WT_SCRIPT_NAME = "' . Filter::escapeJs(WT_SCRIPT_NAME) . '";
			var WT_LOCALE      = "' . Filter::escapeJs(WT_LOCALE) . '";
			var WT_CSRF_TOKEN  = "' . Filter::escapeJs(Filter::getCsrfToken()) . '";
		', self::JS_PRIORITY_HIGH);
        Theme::theme()->sendHeaders();
        echo Theme::theme()->doctype();
        echo Theme::theme()->html();
        echo Theme::theme()->head($this);
        if ($this->popup) {
            echo Theme::theme()->bodyHeaderPopupWindow();
            // We've displayed the header - display the footer automatically
            register_shutdown_function(array($this, 'pageFooterPopupWindow'), $this->popup);
        } else {
            echo Theme::theme()->bodyHeader();
            // We've displayed the header - display the footer automatically
            register_shutdown_function(array($this, 'pageFooter'), $this->popup);
        }
        return $this;
    }
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:36,代码来源:PageController.php

示例2: pageHeader

    /**
     * Print the page header, using the theme
     *
     * @param bool $popup Is this a popup window
     *
     * @return $this
     */
    public function pageHeader($popup = false)
    {
        global $WT_TREE;
        $this->popup = $popup;
        // Give Javascript access to some PHP constants
        $this->addInlineJavascript('
			var WT_STATIC_URL  = "' . Filter::escapeJs(WT_STATIC_URL) . '";
			var WT_MODULES_DIR = "' . Filter::escapeJs(WT_MODULES_DIR) . '";
			var WT_GEDCOM      = "' . Filter::escapeJs($WT_TREE ? $WT_TREE->getName() : '') . '";
			var textDirection  = "' . Filter::escapeJs(I18N::direction()) . '";
			var WT_SCRIPT_NAME = "' . Filter::escapeJs(WT_SCRIPT_NAME) . '";
			var WT_LOCALE      = "' . Filter::escapeJs(WT_LOCALE) . '";
			var WT_CSRF_TOKEN  = "' . Filter::escapeJs(Filter::getCsrfToken()) . '";
		', self::JS_PRIORITY_HIGH);
        // Temporary fix for access to main menu hover elements on android/blackberry touch devices
        $this->addInlineJavascript('
			if(navigator.userAgent.match(/Android|PlayBook/i)) {
				jQuery(".primary-menu > li > a").attr("href", "#");
			}
		');
        Theme::theme()->sendHeaders();
        echo Theme::theme()->doctype();
        echo Theme::theme()->html();
        echo Theme::theme()->head($this);
        if ($this->popup) {
            echo Theme::theme()->bodyHeaderPopupWindow();
            // We've displayed the header - display the footer automatically
            register_shutdown_function(array($this, 'pageFooterPopupWindow'), $this->popup);
        } else {
            echo Theme::theme()->bodyHeader();
            // We've displayed the header - display the footer automatically
            register_shutdown_function(array($this, 'pageFooter'), $this->popup);
        }
        // Flush the output, so the browser can render the header and load javascript
        // while we are preparing data for the page
        if (ini_get('output_buffering')) {
            ob_flush();
        }
        flush();
        return $this;
    }
开发者ID:jflash,项目名称:webtrees,代码行数:48,代码来源:PageController.php


注:本文中的Fisharebest\Webtrees\Filter::getCsrfToken方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。