Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathieu Loiseau
MagicWord
Commits
5521d86d
Commit
5521d86d
authored
May 21, 2019
by
Arnaud Bey
Browse files
add CKEditor for some textareas
parent
7cb78ec7
Changes
7
Hide whitespace changes
Inline
Side-by-side
application/app/AppKernel.php
View file @
5521d86d
...
...
@@ -23,6 +23,7 @@ class AppKernel extends Kernel
new
WiktionaryBundle\WiktionaryBundle
(),
new
LexiconBundle\LexiconBundle
(),
new
Bazinga\Bundle\JsTranslationBundle\BazingaJsTranslationBundle
(),
new
FOS\CKEditorBundle\FOSCKEditorBundle
()
];
if
(
in_array
(
$this
->
getEnvironment
(),
[
'dev'
,
'test'
],
true
))
{
...
...
application/app/config/config.yml
View file @
5521d86d
...
...
@@ -42,6 +42,8 @@ framework:
twig
:
debug
:
"
%kernel.debug%"
strict_variables
:
"
%kernel.debug%"
form_themes
:
-
'
@FOSCKEditor/Form/ckeditor_widget.html.twig'
services
:
twig.extension.text
:
...
...
application/composer.json
View file @
5521d86d
...
...
@@ -36,7 +36,8 @@
"ramsey/uuid"
:
"^3.5"
,
"willdurand/js-translation-bundle"
:
"^2.6"
,
"twig/twig"
:
"^1.0||^2.0"
,
"michelf/php-markdown"
:
"^1.7"
"michelf/php-markdown"
:
"^1.7"
,
"friendsofsymfony/ckeditor-bundle"
:
"^3.0@dev"
},
"require-dev"
:
{
"sensio/generator-bundle"
:
"^3.0"
,
...
...
application/composer.lock
View file @
5521d86d
...
...
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "
bed2e8ded5c256f932deac78427fdd7a
",
"content-hash": "
08fb25c88931fa1c19bede3f17d1153d
",
"packages": [
{
"name": "composer/ca-bundle",
...
...
@@ -885,12 +885,12 @@
"version": "2.7.x-dev",
"source": {
"type": "git",
"url": "https://github.com/doctrine/
doctrine2
.git",
"url": "https://github.com/doctrine/
orm
.git",
"reference": "01cff97edae8d7d80cc8fb3ac6804cdb7cf9a4d5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/
doctrine2
/zipball/01cff97edae8d7d80cc8fb3ac6804cdb7cf9a4d5",
"url": "https://api.github.com/repos/doctrine/
orm
/zipball/01cff97edae8d7d80cc8fb3ac6804cdb7cf9a4d5",
"reference": "01cff97edae8d7d80cc8fb3ac6804cdb7cf9a4d5",
"shasum": ""
},
...
...
@@ -1176,6 +1176,84 @@
],
"time": "2016-10-17T18:31:11+00:00"
},
{
"name": "friendsofsymfony/ckeditor-bundle",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfSymfony/FOSCKEditorBundle.git",
"reference": "7858870c50b93fe630bc922ee75f16fd79db3cba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FriendsOfSymfony/FOSCKEditorBundle/zipball/7858870c50b93fe630bc922ee75f16fd79db3cba",
"reference": "7858870c50b93fe630bc922ee75f16fd79db3cba",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-zip": "*",
"php": "^7.1",
"symfony/asset": "^3.4 || ^4.0",
"symfony/config": "^3.4 || ^4.0",
"symfony/dependency-injection": "^3.4 || ^4.0",
"symfony/expression-language": "^3.4 || ^4.0",
"symfony/form": "^3.4 || ^4.0",
"symfony/framework-bundle": "^3.4 || ^4.0",
"symfony/http-foundation": "^3.4 || ^4.0",
"symfony/http-kernel": "^3.4 || ^4.0",
"symfony/options-resolver": "^3.4 || ^4.0",
"symfony/property-access": "^3.4 || ^4.0",
"symfony/routing": "^3.4 || ^4.0",
"symfony/twig-bundle": "^3.4 || ^4.0",
"twig/twig": "^2.0"
},
"conflict": {
"sebastian/environment": "<1.3.4",
"sebastian/exporter": "<2.0.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
"matthiasnoback/symfony-dependency-injection-test": "^1.0 || ^2.0",
"phpunit/phpunit": "^6.0",
"symfony/console": "^3.4 || ^4.0",
"symfony/phpunit-bridge": "^4.1",
"symfony/yaml": "^3.4 || ^4.0"
},
"suggest": {
"egeloen/form-extra-bundle": "Allows to load CKEditor asynchronously"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"FOS\\CKEditorBundle\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Eric GELOEN",
"email": "geloen.eric@gmail.com"
},
{
"name": "FriendsOfSymfony Community",
"homepage": "https://github.com/FriendsOfSymfony/FOSCKEditorBundle/graphs/contributors"
}
],
"description": "Provides a CKEditor integration for your Symfony project.",
"keywords": [
"CKEditor"
],
"time": "2019-05-19T09:10:15+00:00"
},
{
"name": "friendsofsymfony/jsrouting-bundle",
"version": "1.x-dev",
...
...
@@ -3377,7 +3455,8 @@
"minimum-stability": "dev",
"stability-flags": {
"symfony/symfony": 0,
"friendsofsymfony/user-bundle": 20
"friendsofsymfony/user-bundle": 20,
"friendsofsymfony/ckeditor-bundle": 20
},
"prefer-stable": false,
"prefer-lowest": false,
...
...
application/src/MagicWordBundle/Form/Type/GeneralParametersType.php
View file @
5521d86d
...
...
@@ -2,29 +2,31 @@
namespace
MagicWordBundle\Form\Type
;
use
FOS\CKEditorBundle\Form\Type\CKEditorType
;
use
Symfony\Bridge\Doctrine\Form\Type\EntityType
;
use
Symfony\Component\Form\AbstractType
;
use
Symfony\Component\Form\
FormBuilderInterfac
e
;
use
Symfony\Component\Form\
Extension\Core\Type\CheckboxTyp
e
;
use
Symfony\Component\Form\Extension\Core\Type\SubmitType
;
use
Symfony\Component\Form\Extension\Core\Type\TextareaType
;
use
Symfony\Component\Form\Extension\Core\Type\CheckboxType
;
use
Symfony\Component\Form\Extension\Core\Type\TextType
;
use
Symfony\
Bridge\Doctrine\Form\Type\EntityTyp
e
;
use
Symfony\
Component\Form\FormBuilderInterfac
e
;
class
GeneralParametersType
extends
AbstractType
{
public
function
buildForm
(
FormBuilderInterface
$builder
,
array
$options
)
{
$builder
->
add
(
'homeText'
,
Textarea
Type
::
class
,
array
(
'attr
'
=>
array
(
'
class'
=>
'form-control
'
),
'label'
=>
'homeText'
,
'required'
=>
false
,
)
);
$builder
->
add
(
'homeText'
,
CKEditor
Type
::
class
,
[
'config
'
=>
array
(
'
toolbar'
=>
'basic
'
),
'attr'
=>
array
(
'class'
=>
'form-control'
)
,
'label'
=>
'homeText'
,
]
);
$builder
->
add
(
'footer'
,
TextareaType
::
class
,
array
(
$builder
->
add
(
'footer'
,
CKEditorType
::
class
,
[
'config'
=>
array
(
'toolbar'
=>
'basic'
),
'attr'
=>
array
(
'class'
=>
'form-control'
),
'label'
=>
'footer'
,
'required'
=>
false
,
)
);
]
);
$builder
->
add
(
'piwikUrl'
,
TextType
::
class
,
array
(
'attr'
=>
array
(
'class'
=>
'form-control'
),
...
...
application/src/MagicWordBundle/Form/Type/ProfileType.php
View file @
5521d86d
...
...
@@ -2,22 +2,24 @@
namespace
MagicWordBundle\Form\Type
;
use
FOS\CKEditorBundle\Form\Type\CKEditorType
;
use
Symfony\Component\Form\AbstractType
;
use
Symfony\Component\Form\FormBuilderInterface
;
use
Symfony\Component\Form\Extension\Core\Type\SubmitType
;
use
Symfony\Component\Form\Extension\Core\Type\FileType
;
use
Symfony\Component\Form\Extension\Core\Type\SubmitType
;
use
Symfony\Component\Form\Extension\Core\Type\TextareaType
;
use
Symfony\Component\Form\Extension\Core\Type\TextType
;
use
Symfony\Component\Form\FormBuilderInterface
;
class
ProfileType
extends
AbstractType
{
public
function
buildForm
(
FormBuilderInterface
$builder
,
array
$options
)
{
$builder
->
add
(
'profileText'
,
TextareaType
::
class
,
array
(
$builder
->
add
(
'profileText'
,
CKEditorType
::
class
,
[
'config'
=>
array
(
'toolbar'
=>
'basic'
),
'attr'
=>
array
(
'class'
=>
'form-control'
),
'label'
=>
'profile_text'
,
'required'
=>
false
,
)
);
]
);
$builder
->
add
(
'profilePicFile'
,
FileType
::
class
,
array
(
'attr'
=>
array
(
'class'
=>
'form-control'
),
...
...
application/src/MagicWordBundle/Resources/views/Player/profile.html.twig
View file @
5521d86d
...
...
@@ -33,7 +33,7 @@
{%
if
user.profileText
%}
<h4>
{{
"profile_text"
|
trans
}}
</h4>
<i
class=
"fa fa-quote-left"
aria-hidden=
"true"
></i>
{{
user.profileText
}}
{{
user.profileText
|
raw
}}
<i
class=
"fa fa-quote-right"
aria-hidden=
"true"
></i>
<hr/>
{%
endif
%}
...
...
Write
Preview
Supports
Markdown
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