Author: Jonathan.Wage
Date: 2010-02-18 03:58:58 +0100 (Thu, 18 Feb 2010)
New Revision: 28107

Modified:
   
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalEditorPlugin/lib/helper/SympalContentSlotEditorHelper.php
Log:
[1.4][sfSympalPlugin][1.0] Removing sfSympalContext instance from slot model


Modified: 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
 2010-02-18 02:49:02 UTC (rev 28106)
+++ 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
 2010-02-18 02:58:58 UTC (rev 28107)
@@ -149,30 +149,14 @@
   {
     if ($this->is_column)
     {
-      $value = $this->_contentRenderedFor->get($this->name);
+      return $this->_contentRenderedFor->get($this->name);
     }
     else
     {
-      $value = $this->getValue();
+      return $this->getValue();
     }
-
-    if (sfSympalContext::hasInstance() && 
sfSympalContext::getInstance()->shouldLoadFrontendEditor() && !$value)
-    {
-      $rawValue = __($this->getDefaultValue());
-    }
-    else
-    {
-      $rawValue = $value;
-    }
-
-    return $rawValue;
   }
 
-  public function getDefaultValue()
-  {
-    return '[Double click to enable inline edit mode.]';
-  }
-
   public function hasValue()
   {
     return trim(strip_tags($this->render()));

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalEditorPlugin/lib/helper/SympalContentSlotEditorHelper.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalEditorPlugin/lib/helper/SympalContentSlotEditorHelper.php
  2010-02-18 02:49:02 UTC (rev 28106)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalEditorPlugin/lib/helper/SympalContentSlotEditorHelper.php
  2010-02-18 02:58:58 UTC (rev 28107)
@@ -11,12 +11,18 @@
 
   $form = $slot->getEditForm();
 
+  $renderedValue = $slot->render();
+  if (!$renderedValue && 
sfSympalContext::getInstance()->shouldLoadFrontendEditor())
+  {
+    $renderedValue = __('[Double click to enable inline edit mode.]');
+  }
+
   return '
 <span title="'.__('[Double click to enable inline edit mode.]').'" 
id="sympal_content_slot_'.$slot->getId().'" class="sympal_content_slot">
   <input type="hidden" class="content_slot_id" value="'.$slot->getId().'" />
   <input type="hidden" class="content_id" 
value="'.$slot->getContentRenderedFor()->getId().'" />
   <span class="editor">'.get_partial('sympal_edit_slot/slot_editor', 
array('form' => $form, 'contentSlot' => $slot)).'</span>
-  <span class="value toggle_edit_mode">'.$slot->render().'</span>
+  <span class="value toggle_edit_mode">'.$renderedValue.'</span>
 </span>';
 }
 

-- 
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