![]() |
|
sfPropelSlotBehaviorPlugin - 0.1.12Propel Slot Behavior |
|
Some of the plugins offer one-click modules to easily add complete features to your symfony applications
![]() |
DescriptionThis plugin implements a propel behavior which permits to add slots to a propel object. Slots are additionnal fields added to the object depending of his type (template, class, etc.) stored in a extra table (sf_slots). Some tools (widget, methods, etc.) help to manage it. Categories |
| Name | |
|---|---|
|
|
moc.naeco-moc <<ta>> niavlys |
This plugin implements a propel behavior which permits to add slots to a propel object. Slots are additionnal fields added to the object depending of his type (template, class, etc.) stored in a extra table (sf_slots). Some tools (widget, methods, etc.) help to manage it.
This plugin is mainly used by sfDynamicCMS plugin.
| Version | License | API | Released |
|---|---|---|---|
| 0.1.12alpha | MIT license | 0.1.12alpha | 18/11/2008 |
| Version | License | API | Released |
|---|---|---|---|
| 0.1.12alpha | MIT license | 0.1.12alpha | 18/11/2008 |
| Version | License | API | Released |
|---|---|---|---|
| 0.1.12alpha | MIT license | 0.1.12alpha | 18/11/2008 |
| 0.1.11alpha | MIT license | 0.1.11alpha | 12/11/2008 |
| 0.1.10alpha | MIT license | 0.1.10alpha | 29/10/2008 |
| 0.1.9alpha | MIT license | 0.1.9alpha | 28/10/2008 |
| 0.1.8alpha | MIT license | 0.1.8alpha | 22/10/2008 |
| 0.1.7alpha | MIT license | 0.1.7alpha | 17/10/2008 |
| 0.1.6alpha | MIT license | 0.1.6alpha | 30/06/2008 |
| 0.1.5alpha | MIT license | 0.1.5alpha | 13/06/2008 |
| 0.1.4alpha | MIT license | 0.1.4alpha | 06/06/2008 |
| 0.1.3alpha | MIT license | 0.1.3alpha | 28/05/2008 |
| 0.1.2alpha | MIT license | 0.1.2alpha | 28/05/2008 |
| 0.1.1alpha | MIT license | 0.1.1alpha | 27/05/2008 |
Copyright (c) 2007-2008 Sylvain Papet
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.
php symfony plugin:install sfPropelSlotBehaviorPlugin --release=0.1.12
php symfony plugin:install sfPropelSlotBehaviorPlugin --release=0.1.12
php symfony plugin-install http://plugins.symfony-project.org/sfPropelSlotBehaviorPlugin
Go to the repository: http://svn.symfony-project.com/plugins/sfPropelSlotBehaviorPlugin
This plugin implements a behavior that permits to manage template and slots for different models.
Slots are additional data linked to an object depends of his template.
The plugin include an interface to edit, save & retrieve the value from slots. It also include tools to load templates & slots configuration.
Slots can be define for different models (like page, product, mailing, ...) Slots can be multilingual.
Install the plugin
symfony plugin-install http://plugins.symfony-project.com/sfPropelSlotBehaviorPlugin
Add new "template" fields to model(s) of your schema.yml
Enable Propel behavior support in propel.ini:
propel.builder.AddBehaviors = true
If you have to enable the behavior support, rebuild your model:
symfony propel-build-model
Enable the behavior for one of your Propel model:
<?php // lib/model/Page.php class Page { } $columns_map = array('pk' => PagePeer::ID, 'template' => PagePeer::TEMPLATE); sfPropelBehavior::add('Page', array('sfPropelSlotBehavior' => array('columns' => $columns_map)));
The column map is used by the behavior to know which columns hold information it needs :
Configuration permits to define templates and slots for different models.
First, each models can be listed in "sfPropelSlot" section, it is not compulsory but it will simplify plugin use. When using this plugin with sfDynamicCMS Plugin, you don't need to configure plugin.
Each model have its own templates and slots configuration, then you must specify the section where each model slots & templates are setup. Optionnaly you can define a default model.
For each model configuration: * You can define default slot options by slot type * you have to list available templates for the model, each template must have a title and optionally slots * you must define all slots used by templates, each slots must have a title and a type and optionally options and parameters
example:
sfPropelSlot:
default_model: Page
models:
Page: myCMS
myCMS:
default_slot_options:
RichText:
params: tinymce_options=height:250,width:600,language:"en",theme:"advanced",theme_advanced_disable:"flash,image,paste",plugins:"contextmenu,paste",theme_advanced_buttons1_add:"hr",theme_advanced_buttons3:"cut,copy,pastetext,pasteword,separator,formatselect,fontsizeselect,forecolor"
File:
params: include_remove=true
templates:
intro_template:
title: "Intro page"
slots: []
home_template:
title: "Homepage"
slots: [text]
page1_template:
title: "Page model 1"
slots: [image, doc_file](text,)
page2_template:
title: "Page model 2"
slots: [date, products_ads](column1,)
contact_template:
title: "Contact"
slots: [email](text_contact,)
slots:
text:
title: "Text"
type: Text
i18n: true
params : size=100x10
column1:
title: "Text - 1st column"
type: Text
help: Don't use "CTRL+V" keystroke but "paste" icons.
date:
title: "Publication date"
type: Date
products_ads:
title: "Products"
type: Double_list
params: related_class=Products retrieve_method=doSelectPublished
doc_file:
title: "Documentation"
type: File
upload_dir: doc_pdf
help: "Download a pdf file"
email:
title: "E-mail address"
type: Input
params: size=40
See example located in data directory of the plugin.
Options and params are the same than object_input_tag
Options and params are the same than object_textarea_tag
Options and parameters are the same than object_textarea_tag "rich" option is true by default and there is some default tinymce_options Parameters : * rich (default : true) * tinymce_options (default : )
2 way to use it : * With a related class like object_select_tag, you have to define "related_class" option and maybe "peer_method" and "text_method" * With a related class & method to retrieve available options : you have to define "related_class" AND "options_method" options
Options and params are the same than object_checkbox_tag Options : * default_value (optionnal)
Options and params are the same than object_admin_input_file_tag :
params: include_link=my_directory include_remove=true
upload_dir: my_directory
include_link is equal to upload_dir by default
Options and params are the same than object_input_date_tag
Options: * related_class (required) * retrieve_method (default : doSelect) * size (default : doSelect) * unassociated_label (default : "Unassociated") * associated_label (default : "Associated")
The behavior implement the following methods:
This plugin will probably used for next versions of sfDynamicCMS Plugin. If you want to help and improve it, please contact Sylvain Papet (my firstname @ com-ocean.com).
I encourage every one to contribute to this plugin or even lead it.

