Skip to content

Commit

Permalink
version 1.4.7
Browse files Browse the repository at this point in the history
path segment added
  • Loading branch information
bihor committed Dec 8, 2020
1 parent cc4fd08 commit 8780384
Show file tree
Hide file tree
Showing 14 changed files with 142 additions and 7 deletions.
30 changes: 30 additions & 0 deletions Configuration/Routes/Default.yaml
@@ -0,0 +1,30 @@
# You can simply include this Route in your site configuration:
# imports:
# - { resource: "EXT:fp_masterquiz/Configuration/Routes/Default.yaml" }
routeEnhancers:
QuizPlugin:
type: Extbase
extension: FpMasterquiz
plugin: Pi1
routes:
- { routePath: '/', _controller: 'FpMasterquiz::list' }
- { routePath: '/quiz', _controller: 'FpMasterquiz::show' }
- { routePath: '/result', _controller: 'FpMasterquiz::result' }
- routePath: '/quiz/{quiz_title}'
_controller: 'FpMasterquiz::show'
_arguments:
quiz_title: quiz
- routePath: '/result/{quiz_title}'
_controller: 'FpMasterquiz::result'
_arguments:
quiz_title: quiz
defaultController: 'FpMasterquiz::list'
requirements:
tag_title: '^[a-z0-9].*$'
aspects:
quiz_title:
type: PersistedAliasMapper
tableName: tx_fpmasterquiz_domain_model_quiz
routeFieldPattern: '^(?P<path_segment>.+)$'
routeFieldResult: '{path_segment}'
routeFieldName: path_segment
25 changes: 23 additions & 2 deletions Configuration/TCA/tx_fpmasterquiz_domain_model_quiz.php
Expand Up @@ -21,10 +21,10 @@
'iconfile' => 'EXT:fp_masterquiz/Resources/Public/Icons/tx_fpmasterquiz_domain_model_quiz.gif'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, about, questions, evaluations',
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, path_segment, about, questions, evaluations',
],
'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, about, questions, evaluations, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, path_segment, about, questions, evaluations, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
],
'columns' => [
'sys_language_uid' => [
Expand Down Expand Up @@ -125,6 +125,27 @@
'eval' => 'trim,required'
],
],
'path_segment' => [
'exclude' => true,
'label' => 'LLL:EXT:fp_masterquiz/Resources/Private/Language/locallang_db.xlf:tx_fpmasterquiz_domain_model_quiz.path_segment',
'config' => [
'type' => 'slug',
'size' => 50,
'generatorOptions' => [
'fields' => ['name'],
'replacements' => [
'/' => '-',
'[' => '',
']' => '',
'(' => '',
')' => ''
],
],
'fallbackCharacter' => '-',
'eval' => 'unique',
'default' => ''
]
],
'about' => [
'exclude' => true,
'label' => 'LLL:EXT:fp_masterquiz/Resources/Private/Language/locallang_db.xlf:tx_fpmasterquiz_domain_model_quiz.about',
Expand Down
6 changes: 5 additions & 1 deletion Documentation/Administrator/Index.rst
Expand Up @@ -76,4 +76,8 @@ FAQ

- How can I rename or hide some fields in the Backend?

See chapter “Configuration / Page TSConfig”.
See chapter “Configuration / Page TSConfig”.

- How can I use routing / speaking urls?

See chapter “Configuration / Routing”.
2 changes: 2 additions & 0 deletions Documentation/ChangeLog/Index.rst
Expand Up @@ -60,6 +60,8 @@ ChangeLog
Important bugfix for PHP 7.3 and other bugfixes points related.

1.5.0: Bodytext and image added to the evaluation.
Routing/slug/path segment added to a quiz.
Categories added to a quiz.
Layout of yes/no-questions changed.
Another bugfix points related.
See issues #12 - #16.
1 change: 1 addition & 0 deletions Documentation/Configuration/Index.rst
Expand Up @@ -264,3 +264,4 @@ FAQ
:glob:

PageTSconfig/Index
Routing/Index
60 changes: 60 additions & 0 deletions Documentation/Configuration/Routing/Index.rst
@@ -0,0 +1,60 @@
.. include:: ../../Includes.txt

.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. ==================================================
.. DEFINE SOME TEXTROLES
.. --------------------------------------------------
.. role:: underline
.. role:: typoscript(code)
.. role:: ts(typoscript)
:class: typoscript
.. role:: php(code)


Frontend Routing Setup
^^^^^^^^^^^^^^^^^^^^^^

The extension provides a frontend route enhancer configuration that you can include
in your site configuration `config/sites/mysite/config.yaml`.

.. code-block:: yaml
imports:
- { resource: "EXT:fp_masterquiz/Configuration/Routes/Default.yaml" }
Feel free to modify or enhance this configuration.

Note: every quiz must have set the path segment before you can use this feature!


Example
~~~~~~~

You write your own frontend route configuration by adding the following to your site configuration::

routeEnhancers:
QuizPlugin:
type: Extbase
extension: FpMasterquiz
plugin: Pi1
routes:
- { routePath: '/', _controller: 'FpMasterquiz::list' }
- { routePath: '/umfrage', _controller: 'FpMasterquiz::show' }
- routePath: '/umfrage/{quiz_title}'
_controller: 'FpMasterquiz::show'
_arguments:
quiz_title: quiz
defaultController: 'FpMasterquiz::list'
requirements:
tag_title: '^[a-z0-9].*$'
aspects:
quiz_title:
type: PersistedAliasMapper
tableName: tx_fpmasterquiz_domain_model_quiz
routeFieldPattern: '^(?P<path_segment>.+)$'
routeFieldResult: '{path_segment}'
routeFieldName: path_segment
4 changes: 2 additions & 2 deletions README.md
@@ -1,6 +1,6 @@
# fp_masterquiz

version 1.4.6
version 1.4.7

TYPO3 extension to create a quiz, poll or test. The participant result will be saved in the DB too and can be deleted automatically via Scheduler.

Expand All @@ -10,4 +10,4 @@ Features: a quiz, poll or test can be played by submitting a form or by submitti

You find the documentation at typo3.org: https://docs.typo3.org/p/fixpunkt/fp-masterquiz/master/en-us/

Last feature: categories for a quiz.
Last feature: routing added.
3 changes: 3 additions & 0 deletions Resources/Private/Language/de.locallang.xlf
Expand Up @@ -12,6 +12,9 @@
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.about">
<target>Beschreibung</target>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.path_segment">
<target>Sprechendes Url Segment</target>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.questions">
<target>Fragen</target>
</trans-unit>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/de.locallang_db.xlf
Expand Up @@ -18,6 +18,9 @@
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.about">
<target>Beschreibung dieses Quiz/Test</target>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.path_segment">
<source>Sprechendes Url Segment</source>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.questions">
<target>Fragen des Quiz</target>
</trans-unit>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang.xlf
Expand Up @@ -12,6 +12,9 @@
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.about">
<source>About</source>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.path_segment">
<source>Path segment</source>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.questions">
<source>Questions</source>
</trans-unit>
Expand Down
Expand Up @@ -9,6 +9,9 @@
<trans-unit id="about.description">
<source>Text about this quiz</source>
</trans-unit>
<trans-unit id="path_segment.description">
<source>Path segment</source>
</trans-unit>
<trans-unit id="questions.description">
<source>Questions</source>
</trans-unit>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang_db.xlf
Expand Up @@ -18,6 +18,9 @@
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.about">
<source>Text about this quiz</source>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.path_segment">
<source>Path segment</source>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.questions">
<source>Questions</source>
</trans-unit>
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Expand Up @@ -12,15 +12,15 @@

$EM_CONF[$_EXTKEY] = [
'title' => 'Master-Quiz',
'description' => 'A modern extension that offers quiz, polls and tests. The result can be displayed as a chart. Supports 7 question modes.',
'description' => 'A modern extension that offers quiz, polls and tests. The result can be displayed as a chart too. Supports 7 question modes.',
'category' => 'plugin',
'author' => 'Kurt Gusbeth',
'author_email' => 'info@quizpalme.de',
'state' => 'stable',
'uploadfolder' => 0,
'createDirs' => '',
'clearCacheOnLoad' => 0,
'version' => '1.4.6',
'version' => '1.4.7',
'constraints' => [
'depends' => [
'typo3' => '9.5.20-10.4.99',
Expand Down
2 changes: 2 additions & 0 deletions ext_tables.sql
Expand Up @@ -10,6 +10,7 @@ CREATE TABLE tx_fpmasterquiz_domain_model_quiz (
about text,
questions int(11) unsigned DEFAULT '0' NOT NULL,
evaluations int(11) unsigned DEFAULT '0' NOT NULL,
path_segment varchar(2048),
categories int(11) unsigned DEFAULT '0' NOT NULL,

tstamp int(11) unsigned DEFAULT '0' NOT NULL,
Expand Down Expand Up @@ -38,6 +39,7 @@ CREATE TABLE tx_fpmasterquiz_domain_model_quiz (

PRIMARY KEY (uid),
KEY parent (pid),
KEY path_segment (path_segment(185),uid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY language (l10n_parent,sys_language_uid)

Expand Down

0 comments on commit 8780384

Please sign in to comment.