-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from Th3Mouk/master
[UPT] CKEditor dependency to ~3.0
- Loading branch information
Showing
6 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\FormatterBundle\Twig\Extension; | ||
|
||
use Ivory\CKEditorBundle\Templating\CKEditorHelper; | ||
|
||
/** | ||
* @author Marodon Jérémy <marodon.jeremy@gmail.com> | ||
*/ | ||
class CKEditorExtension extends \Twig_Extension | ||
{ | ||
/** | ||
* @var CKEditorHelper | ||
*/ | ||
private $helper; | ||
|
||
/** | ||
* Creates a CKEditor extension bridge for BC. | ||
* | ||
* @param CKEditorHelper $helper The CKEditor helper. | ||
*/ | ||
public function __construct(CKEditorHelper $helper) | ||
{ | ||
$this->helper = $helper; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getFunctions() | ||
{ | ||
$options = array('is_safe' => array('html')); | ||
|
||
return array( | ||
new \Twig_SimpleFunction('ckeditor_replace', array($this, 'renderReplace'), $options), | ||
); | ||
} | ||
|
||
/** | ||
* @param string $identifier The identifier. | ||
* @param array $config The config. | ||
* | ||
* @return string The rendered replace. | ||
*/ | ||
public function renderReplace($identifier, array $config) | ||
{ | ||
@trigger_error('The ckeditor_replace twig function is now deprecated | ||
and will be removed in 3.0. Use ckeditor_widget instead.', E_USER_DEPRECATED); | ||
|
||
return $this->helper->renderWidget($identifier, $config); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getName() | ||
{ | ||
return 'ck_editor'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
UPGRADE FROM 2.3 to 2.4 | ||
======================= | ||
|
||
Update [IvoryCKEditorBundle](https://github.com/egeloen/IvoryCKEditorBundle) to version 3.x. | ||
|
||
The old ```{{ ckeditor_replace() }}``` twig function has been replaced by ```{{ckeditor_widget() }}```. | ||
|
||
[BC] is kept due to a CKEditorExtension, which bridge the old tag ```{{ckeditor_replace() }}``` | ||
to the new helper method `renderWidget`. | ||
|
||
This introduce the new `inline` option of CKEditor plugin. | ||
|
||
All related changes are available here [IvoryCKEditorUPGRADE] | ||
(https://github.com/egeloen/IvoryCKEditorBundle/blob/master/UPGRADE.md#25-to-30) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters