Author: Jonathan.Wage
Date: 2010-01-17 04:32:46 +0100 (Sun, 17 Jan 2010)
New Revision: 26751

Modified:
   plugins/sfSympalPlugin/trunk/config/app.yml
   
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
Log:
[1.4][sfSympalPlugin][1.0] Allowing custom form and form_renderer for content 
slot types


Modified: plugins/sfSympalPlugin/trunk/config/app.yml
===================================================================
--- plugins/sfSympalPlugin/trunk/config/app.yml 2010-01-17 03:00:31 UTC (rev 
26750)
+++ plugins/sfSympalPlugin/trunk/config/app.yml 2010-01-17 03:32:46 UTC (rev 
26751)
@@ -153,18 +153,27 @@
     content_slot_types:
       #MySlotType:
       #  label: Label of My Slot Type
+      #  form: MySlotForm (defaults to sfSympalInlineEditContentSlotForm)
       #  widget_class: MySlotTypeWidget (defaults to 
sfWidgetFormSympalMySlotType)
       #  widget_options: []
       #  validator_class: MySlotTypeValidator (defaults to 
sfValidatorFormSympalMySlotType)
       #  validator_options: []
       Text:
         label: Single Line of Text
+        form: sfSympalInlineEditContentSlotForm
+        form_renderer: sympal_edit_slot/slot_editor_renderer
       RawHtml:
         label: Raw HTML
+        form: sfSympalInlineEditContentSlotForm
+        form_renderer: sympal_edit_slot/slot_editor_renderer
       Markdown:
         label: Markdown Editor
+        form: sfSympalInlineEditContentSlotForm
+        form_renderer: sympal_edit_slot/slot_editor_renderer
       TinyMCE:
         label: TinyMCE Rich Text Editor
+        form: sfSympalInlineEditContentSlotForm
+        form_renderer: sympal_edit_slot/slot_editor_renderer
         widget_options:
           config: 'onchange_callback: "sympalTinyMCETriggerSave", 
handle_event_callback : "sympalHandleTinyMCEEvent"'
 

Modified: 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
 2010-01-17 03:00:31 UTC (rev 26750)
+++ 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
 2010-01-17 03:32:46 UTC (rev 26751)
@@ -26,7 +26,8 @@
 
   public function getSlotEditFormRenderer()
   {
-    return sfSympalConfig::get('inline_editing', 'default_form_renderer', 
'sympal_edit_slot/slot_editor_renderer');
+    $contentSlotTypes = sfSympalConfig::get('content_slot_types');
+    return isset($contentSlotTypes[$this->type]['form_renderer']) ? 
$contentSlotTypes[$this->type]['form_renderer'] : 
sfSympalConfig::get('inline_editing', 'default_form_renderer', 
'sympal_edit_slot/slot_editor_renderer');
   }
 
   public function getEditForm()
@@ -35,7 +36,8 @@
     {
       return $this->_getContentSlotColumnForm();
     } else {
-      $className = sfSympalConfig::get('inline_editing', 'default_slot_form', 
'sfSympalInlineEditContentSlotForm');
+      $contentSlotTypes = sfSympalConfig::get('content_slot_types');
+      $className = isset($contentSlotTypes[$this->type]['form']) ? 
$contentSlotTypes[$this->type]['form'] : sfSympalConfig::get('inline_editing', 
'default_slot_form', 'sfSympalInlineEditContentSlotForm');
       return new $className($this);
     }
   }

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.


Reply via email to