diff --git a/app.php b/app.php index 12e7ecb..78ed6f1 100644 --- a/app.php +++ b/app.php @@ -261,6 +261,8 @@ function($f3) { } } + \Flash::instance()->setKey('shareinformations', true); + $f3->reroute($f3->get('REVERSE_PROXY_URL').'/signature/'.$hash.$symmetricKey); } diff --git a/templates/signature.html.php b/templates/signature.html.php index aec596e..650b0c0 100644 --- a/templates/signature.html.php +++ b/templates/signature.html.php @@ -272,6 +272,9 @@ var maxPage = ; var sharingMode = ; var pdfHash = null; + getKey('shareinformations')): ?> + alert('showinfos'); + var direction = ''; pdfHash = ""; diff --git a/vendor/fatfree/flash.php b/vendor/fatfree/flash.php new file mode 100644 index 0000000..3bc2b61 --- /dev/null +++ b/vendor/fatfree/flash.php @@ -0,0 +1,105 @@ + + * https://github.com/ikkez/F3-Sugar/ + * + * @version 1.0.2 + * @date: 13.12.2020 + * @since: 21.01.2015 + **/ + +class Flash extends \Prefab { + + /** @var \Base */ + protected $f3; + + /** @var array */ + protected $msg; + + /** @var array */ + protected $key; + + /** + * Flash constructor. + * @param string $key + */ + public function __construct($key='flash') { + $this->f3 = \Base::instance(); + $this->msg = &$this->f3->ref('SESSION.'.$key.'.msg'); + $this->key = &$this->f3->ref('SESSION.'.$key.'.key'); + } + + /** + * add a message to the stack + * @param $text + * @param string $status + */ + public function addMessage($text,$status='info') { + $this->msg[] = ['text'=>$text,'status'=>$status]; + } + + /** + * dump all messages and clear them + * @return array + */ + public function getMessages() { + $out = $this->msg; + $this->clearMessages(); + return $out ?: []; + } + + /** + * reset message stack + */ + public function clearMessages() { + $this->msg = []; + } + + /** + * check if there messages in the stack + * @return bool + */ + public function hasMessages() { + return !empty($this->msg); + } + + /** + * set a flash key + * @param $key + * @param bool $val + */ + public function setKey($key,$val=TRUE) { + $this->key[$key] = $val; + } + + /** + * get and clear a flash key, if it's existing + * @param $key + * @return mixed|null + */ + public function getKey($key) { + $out = NULL; + if ($this->hasKey($key)) { + $out = $this->key[$key]; + unset($this->key[$key]); + } + return $out; + } + + /** + * check if there's a flash key existing + * @param $key + * @return bool + */ + public function hasKey($key) { + return ($this->key && array_key_exists($key, $this->key)); + } +}