本文整理汇总了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;
}
示例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;
}