Author: jaimesuez
Date: 2010-04-15 20:15:46 +0200 (Thu, 15 Apr 2010)
New Revision: 29165

Added:
   plugins/sfReadOnlyWidgetsPlugin/lib/sfReadOnlyWidgetsPluginHelper.class.php
Log:
agregado helper que falto


Added: 
plugins/sfReadOnlyWidgetsPlugin/lib/sfReadOnlyWidgetsPluginHelper.class.php
===================================================================
--- plugins/sfReadOnlyWidgetsPlugin/lib/sfReadOnlyWidgetsPluginHelper.class.php 
                        (rev 0)
+++ plugins/sfReadOnlyWidgetsPlugin/lib/sfReadOnlyWidgetsPluginHelper.class.php 
2010-04-15 18:15:46 UTC (rev 29165)
@@ -0,0 +1,46 @@
+<?php
+/* 
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of sfReadOnlyWidgetsPluginclass
+ *
+ * @author jaime
+ */
+class sfReadOnlyWidgetsPluginHelper
+{
+
+  public static function isDeactivated($form, $credentials = false)
+  {
+    if($credentials == "never")
+    {
+      return true;
+    }
+    elseif($credentials != false)
+    {
+      if(sfContext::getInstance()->getUser()->hasCredential($credentials))
+      {
+        return false;
+      }
+      else
+      {
+        return true;
+      }
+    }
+    else
+    {
+      if (!$form->isNew())
+      {
+        return true;
+      }
+      else
+      {
+        return false;
+      }
+    }
+  }
+
+}
+

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