Commit 2df4900d authored by Carsten  Rose's avatar Carsten Rose
Browse files

QuickFormQuery.php: added function to check if there are copyForm paste records

parent b1456ef2
......@@ -87,4 +87,5 @@ WKHTMLTOPDF = /opt/wkhtmltox/bin/wkhtmltopdf
;NEW_BUTTON_CLASS = btn btn-default navbar-btn
;NEW_BUTTON_GLYPH_ICON = glyphicon-plus
; auto | always | never
;DB_UPDATE=auto
\ No newline at end of file
......@@ -307,7 +307,7 @@ const CLIENT_REQUEST_URI = 'REQUEST_URI';
const CLIENT_SCRIPT_NAME = 'SCRIPT_NAME';
const CLIENT_PHP_SELF = 'PHP_SELF';
// $_COOKIE
// _COOKIE
const CLIENT_COOKIE_QFQ = 'cookieQfq';
// T3 Bodytext Keywords
......@@ -320,6 +320,7 @@ const TYPO3_FE_USER_GROUP = 'feUserGroup';
const TYPO3_TT_CONTENT_UID = 'ttcontentUid';
const TYPO3_PAGE_ID = 'pageId';
const TYPO3_PAGE_TYPE = 'pageType';
const TYPO3_PAGE_LANGUAGE = 'pageLanguage';
const TYPO3_DEBUG_SHOW_BODY_TEXT = 'debugShowBodyText';
const TYPO3_SQL_LOG = 'sqlLog';
......@@ -1053,7 +1054,7 @@ const TOKEN_ACTION_DELETE_CLOSE = 'c';
const TOKEN_CLASS_NONE = 'n';
const TOKEN_CLASS_INTERNAL = 'i';
const TOKEN_CLASS_EXTERNAL = 'e';
const TOKEN_CLASfindS_EXTERNAL = 'e';
const WKHTML_OPTION_VIEWPORT = '--viewport-size';
const WKHTML_OPTION_VIEWPORT_VALUE = '1280x1024';
......
......@@ -391,6 +391,10 @@ class QuickFormQuery {
*/
private function pasteClipboard($formId, FormAction $formAction) {
if (!$this->isPasteRecord()) {
return;
}
$cookieQfq = $this->store->getVar(CLIENT_COOKIE_QFQ, STORE_CLIENT, SANITIZE_ALLOW_ALNUMX);
if ($cookieQfq === false || $cookieQfq == '') {
throw new UserFormException('Qfq Session missing', ERROR_QFQ_SESSION_MISSING);
......@@ -407,6 +411,20 @@ class QuickFormQuery {
} # doClipboard()
/**
* @return bool true if there is at least one paste record, else false.
*/
private function isPasteRecord() {
foreach ($this->feSpecAction as $formElement) {
if ($formElement[FE_TYPE] == FE_TYPE_PASTE) {
return true;
}
}
return false;
}
/**
* Set F_FORWARD_MODE to F_FORWARD_MODE_PAGE and builds a redirection URL to the current page with the already
* used parameters. Do this by building a new SIP with the new recordId.
......
......@@ -16,6 +16,7 @@ require_once(__DIR__ . '/../report/Sendmail.php');
require_once(__DIR__ . '/../helper/HelperFormElement.php');
require_once(__DIR__ . '/../exceptions/UserFormException.php');
/**
* Class formAction
* @package qfq
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment