sfDoctrineEditableComponentPlugin
0.2.0alpha
for sf 1.2 and Doctrine
MIT
Important update: plugin has moved to github, but svn reposiroty is still synchronized.
This plugin allows to set up edit-in-place i18n-ready components (plain or html/wysiwyg) using some cool libs like jQuery, facebox, CKEditor and the Doctrine ORM for persistence.
Developers
License
Copyright (c) 2009 Nicolas Perriault
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
sfDoctrineEditableComponent plugin
WARNING: This plugin is currently in a very pre-alpha state, do not use in production.
This plugin allows to set up edit-in-place components (plain or wysiwyg), typically to enable content administration directly from the a frontend application.
The plugin uses some cool libs like jQuery, jEditable, jWysiwyg and the Doctrine ORM for persistence. Rich HTML content can be filtered in order to avoid XSS attacks using HTMLPurifier.
Installation
Using the native plugin installation system of Symfony:
$ php symfony plugin:install sfDoctrineEditableComponentPlugin
Using SVN:
$ svn co http://svn.symfony-project.com/plugins/sfDoctrineEditableComponentPlugin plugins/
Adds the sfEditableComponentAdminFilter filter in your application's filter.yml file:
sfEditableComponentAdmin:
class: sfEditableComponentAdminFilter
Then, you're ready to run the following tasks:
$ php symfony cache:clear
$ php symfony doctrine:build-all
You must also enable the sfEditableComponent module in the settings.yml file of your application:
all:
.settings:
enabled_modules: [default, sfEditableComponent]
Last, don't forget to publish the assets used by the plugin:
$ php symfony plugin:publish-assets
Usage
You can call editable components whithin any template, even if they don't exist yet in the database, this way:
<?php include_component('sfEditableComponent', 'show', array('name' => 'content1')) ?>
<?php include_component('sfEditableComponent', 'show', array('name' => 'content2')) ?>
Custom configuration
You can configure the plugin in your app.yml file, in the namespace. You can look at the app.yml file bundled with the plugin, which contains all plugin's default value.
Here are the main options available:
admin_credential: the name of the required credential for edit editable component
controls.OK: The label of the submit button in update form
controls.Cancel: The label of the cancel button in update form
css_class_name: The name of the css classname to use for editable content divs
default_content.html: The default content to fill an editable HTML component with
default_content.plain: The default content to fill an editable plan text component with
update_error: The error to display if the edition of an editable component fails
License
This plugin is licensed under the terms of the MIT license.
About the author
This plugin has been created and is currently maintened by Nicolas Perriault (nperriault at gmail dot com).
References
- jQuery
- jEditable plugin
- jWysiwyg
- HTMLPurifier