public function __construct($name, $value, Pagemill_Tag $tag) { parent::__construct($name, $value, $tag); $tag->attachPreprocess(new Typeframe_TagPreprocessor_Method($value)); Typeframe_Tag_Scriptonce::Generate(TYPEF_WEB_DIR . '/files/static/jquery/jquery.js', 'text/javascript', $tag); Typeframe_Tag_Scriptonce::Generate(TYPEF_WEB_DIR . '/files/static/jquery/jquery.linkmethod.js', 'text/javascript', $tag); }
public function __construct($name, $value, \Pagemill_Tag $tag) { parent::__construct($name, $value, $tag); $tag->setAttribute('data-confirm', $value); Typeframe_Tag_Scriptonce::Generate(TYPEF_WEB_DIR . '/files/static/jquery/jquery.js', 'text/javascript', $tag); Typeframe_Tag_Scriptonce::Generate(TYPEF_WEB_DIR . '/files/static/jquery/jquery.linkmethod.js', 'text/javascript', $tag); }
public function __construct($name, array $attributes = array(), \Pagemill_Tag $parent = null, \Pagemill_Doctype $doctype = null) { parent::__construct($name, $attributes, $parent, $doctype); $this->name = 'a'; $this->setAttribute('data-confirm', $this->getAttribute('confirm')); $this->removeAttribute('confirm'); $this->attachPreprocess(new Typeframe_TagPreprocessor_Method('post')); //Typeframe_Tag_Scriptonce::Generate(TYPEF_WEB_DIR . '/files/static/jquery/jquery.js', 'text/javascript', $this); Typeframe_Tag_Scriptonce::Generate(TYPEF_WEB_DIR . '/files/static/jquery/jquery.linkmethod.js', 'text/javascript', $this); }
<?php if (!isset($_SESSION['scriptonce'])) { $_SESSION['scriptonce'] = array(); } if (!requestIsAjax()) { $url = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://'; $url .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $_SESSION['scriptonce'][$url] = array(); } else { if (!empty($_SERVER['HTTP_REFERER']) && isset($_SESSION['scriptonce'][$_SERVER['HTTP_REFERER']])) { Typeframe_Tag_Scriptonce::AlreadyLoaded($_SESSION['scriptonce'][$_SERVER['HTTP_REFERER']]); } else { trigger_error('Request appears to be Ajax but does not have a referer'); } }
public static function AlreadyLoaded($array) { self::$_scripts = array_merge(self::$_scripts, $array); }