Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
10ae096b
Commit
10ae096b
authored
Sep 20, 2017
by
Carsten Rose
Browse files
#4593 / Punktetool 2.0 / Annotate / Fabric - first proof of concept in QFQ
parent
bec81dab
Changes
4
Show whitespace changes
Inline
Side-by-side
extension/qfq/qfq/AbstractBuildForm.php
View file @
10ae096b
...
...
@@ -98,6 +98,7 @@ abstract class AbstractBuildForm {
FE_TYPE_SELECT
=>
'Select'
,
FE_TYPE_SUBRECORD
=>
'Subrecord'
,
FE_TYPE_UPLOAD
=>
'File'
,
FE_TYPE_ANNOTATE
=>
'Annotate'
,
'fieldset'
=>
'Fieldset'
,
'pill'
=>
'Pill'
,
'templateGroup'
=>
'TemplateGroup'
,
...
...
@@ -121,6 +122,7 @@ abstract class AbstractBuildForm {
FE_TYPE_SELECT
=>
'Native'
,
FE_TYPE_SUBRECORD
=>
'Subrecord'
,
FE_TYPE_UPLOAD
=>
'Native'
,
FE_TYPE_ANNOTATE
=>
'Native'
,
'fieldset'
=>
'Fieldset'
,
'pill'
=>
'Pill'
,
'templateGroup'
=>
'TemplateGroup'
,
...
...
@@ -2767,6 +2769,49 @@ abstract class AbstractBuildForm {
return
$htmlTextDelete
.
$htmlInputFile
.
$hiddenSipUpload
.
$formElement
[
FE_TMP_EXTRA_BUTTON_HTML
]
.
$formElement
[
FE_INPUT_EXTRA_BUTTON_INFO
];
}
/**
* Build an Upload (File) Button.
*
* @param array $formElement
* @param string $htmlFormElementName
* @param string $value
* @param array $json
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
*
* @return string
* @throws CodeException
* @throws \qfq\UserFormException
*/
public
function
buildAnnotate
(
array
$formElement
,
$htmlFormElementName
,
$value
,
array
&
$json
,
$mode
=
FORM_LOAD
)
{
$htmlImage
=
''
;
if
(
!
empty
(
$formElement
[
FE_IMAGE_SOURCE
]))
{
if
(
is_readable
(
$formElement
[
FE_IMAGE_SOURCE
]))
{
throw
new
UserFormException
(
"Error reading file: "
.
$formElement
[
FE_IMAGE_SOURCE
],
ERROR_IO_READ_FILE
);
}
$htmlImage
=
Support
::
wrapTag
(
'<img src="'
.
$formElement
[
FE_IMAGE_SOURCE
]
.
'" class="qfq-fabric-image">'
,
''
,
false
);
}
$attributeFabric
=
''
;
$attributeFabric
.
=
Support
::
doAttribute
(
'id'
,
'fabric'
);
$attributeFabric
.
=
Support
::
doAttribute
(
'data-cotrol-name'
,
$formElement
[
FE_HTML_ID
]);
$attributeFabric
.
=
Support
::
doAttribute
(
'data-buttons'
,
'typo3conf/ext/qfq/Resources/Public/Json/fabric.buttons.json'
);
$attributeFabric
.
=
Support
::
doAttribute
(
'data-emojis'
,
'typo3conf/ext/qfq/Resources/Public/Json/qfq.emoji.json'
);
$attributeFabric
.
=
$this
->
getAttributeFeMode
(
$formElement
[
FE_MODE
]);
$htmlFabric
=
Support
::
wrapTag
(
'<div '
.
$attributeFabric
.
' >'
,
''
,
false
);
$attributeInput
=
''
;
$attributeInput
.
=
Support
::
doAttribute
(
'id'
,
$formElement
[
FE_HTML_ID
]);
$attributeInput
.
=
Support
::
doAttribute
(
'name'
,
$htmlFormElementName
);
$attributeInput
.
=
Support
::
doAttribute
(
'type'
,
'hidden'
);
$html
=
$htmlImage
.
$htmlFabric
.
$this
->
getHelpBlock
()
.
$attributeInput
;
// $json = $this->getFormElementForJson($htmlFormElementName, $value, $formElement);
return
$html
;
}
/**
* Builds HTML 'input' element.
* Format: <input name="$htmlFormElementName" <type="date" [autocomplete="autocomplete"] [autofocus="autofocus"]
...
...
extension/qfq/qfq/Constants.php
View file @
10ae096b
...
...
@@ -827,6 +827,7 @@ const FE_FILE_REPLACE_MODE_ALWAYS = 'always'; // Target pathFilename for an uplo
const
FE_FILE_MIME_TYPE_ACCEPT
=
'accept'
;
// Target pathFilename for an uploaded file.
const
FE_FILE_MAX_FILE_SIZE
=
'maxFileSize'
;
// Target pathFilename for an uploaded file.
const
FE_FILE_CAPTURE
=
'capture'
;
// On a smartphone opens the camera
const
FE_IMAGE_SOURCE
=
'imageSource'
;
// On a smartphone opens the camera
const
FE_SQL_VALIDATE
=
'sqlValidate'
;
// Action: Query to validate form load
const
FE_EXPECT_RECORDS
=
'expectRecords'
;
// Action: expected number of rows of FE_SQL_VALIDATE
const
FE_MESSAGE_FAIL
=
'messageFail'
;
// Action: Message to display, if FE_SQL_VALIDATE fails.
...
...
@@ -925,6 +926,7 @@ const FE_TYPE_PASSWORD = 'password';
const
FE_TYPE_RADIO
=
'radio'
;
const
FE_TYPE_SELECT
=
'select'
;
const
FE_TYPE_UPLOAD
=
'upload'
;
const
FE_TYPE_ANNOTATE
=
'annotate'
;
const
FE_TYPE_EXTRA
=
'extra'
;
const
FE_TYPE_SUBRECORD
=
'subrecord'
;
const
FE_TYPE_NOTE
=
'note'
;
...
...
extension/qfq/qfq/database/DatabaseUpdateData.php
View file @
10ae096b
...
...
@@ -57,7 +57,7 @@ $UPDATE_ARRAY = array(
"ALTER TABLE `Form` ADD `dirtyMode` ENUM( 'exclusive', 'advisory', 'none' ) NOT NULL DEFAULT 'exclusive' AFTER `requiredParameter`"
,
"ALTER TABLE `Form` ADD `recordLockTimeoutSeconds` INT NOT NULL DEFAULT '900' AFTER `parameter`"
,
"CREATE TABLE IF NOT EXISTS `Period` (`id` INT(11) NOT NULL AUTO_INCREMENT, `start` DATETIME NOT NULL, `name` VARCHAR(255) NOT NULL, `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `created` DATETIME NOT NULL, PRIMARY KEY (`id`), KEY `start` (`start`)) ENGINE = InnoDB DEFAULT CHARSET = utf8 AUTO_INCREMENT = 0;"
,
"INSERT INTO Period (start, name, created) VALUES (NOW(), 'dummy', NOW());"
"INSERT INTO Period (start, name, created) VALUES (NOW(), 'dummy', NOW());"
,
],
'0.19.5'
=>
[
...
...
@@ -69,9 +69,12 @@ $UPDATE_ARRAY = array(
"ALTER TABLE `FormElement` ADD `parameterLanguageA` TEXT NOT NULL AFTER `parameter`"
,
"ALTER TABLE `FormElement` ADD `parameterLanguageB` TEXT NOT NULL AFTER `parameterLanguageA`"
,
"ALTER TABLE `FormElement` ADD `parameterLanguageC` TEXT NOT NULL AFTER `parameterLanguageB`"
,
"ALTER TABLE `FormElement` ADD `parameterLanguageD` TEXT NOT NULL AFTER `parameterLanguageC`"
"ALTER TABLE `FormElement` ADD `parameterLanguageD` TEXT NOT NULL AFTER `parameterLanguageC`"
,
],
'0.24.0'
=>
[
"ALTER TABLE `FormElement` CHANGE `type` `type` ENUM( 'checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text', 'editor', 'time', 'note', 'password', 'radio', 'select', 'subrecord', 'upload', 'annotate', 'fieldset', 'pill', 'templateGroup', 'beforeLoad', 'beforeSave', 'beforeInsert', 'beforeUpdate', 'beforeDelete', 'afterLoad', 'afterSave', 'afterInsert', 'afterUpdate', 'afterDelete', 'sendMail', 'paste' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'text';"
,
],
);
...
...
mockup/fabric.html
View file @
10ae096b
...
...
@@ -41,15 +41,9 @@
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<div
id=
"fabric"
data-buttons=
"mockData/fabric.buttons.json"
data-emojis=
"mockData/qfq.emoji.json"
data-images=
'{"images": [{"page": 1, "selector": "qfq-fabric-image-1"}, {"page":2, "selector": "#qfq..."}]}'
></div>
<div
id=
"fabric"
data-buttons=
"mockData/fabric.buttons.json"
data-emojis=
"mockData/qfq.emoji.json"
></div>
<input
id=
"fabric-output"
name=
"fabric-data"
type=
"hidden"
>
<div
class=
"text-insert"
style=
"display:none;"
id=
"user-text-control"
>
<textarea
class=
"fabric-text"
placeholder=
"Remember, be nice!"
id=
"text-user-value"
></textarea>
<div
class=
"text-options"
>
<button
type=
"button"
class=
"btn btn-primary"
id=
"text-bg-submit"
>
Draw Textbox
</button>
</div>
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment