Author: sevein
Date: Sat Oct 30 05:33:34 2010
New Revision: 8708

Log:
Use $resource->id, cosmetic changes.

Modified:
   trunk/apps/qubit/modules/user/actions/editAction.class.php

Modified: trunk/apps/qubit/modules/user/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/user/actions/editAction.class.php  Sat Oct 30 
05:08:03 2010        (r8707)
+++ trunk/apps/qubit/modules/user/actions/editAction.class.php  Sat Oct 30 
05:33:34 2010        (r8708)
@@ -46,7 +46,7 @@
     // HACK: because $this->user->getAclPermissions() is erroneously calling
     // QubitObject::getaclPermissionsById()
     $this->permissions = null;
-    if (isset($request->id))
+    if (isset($this->resource->id))
     {
       $permissions = QubitUser::getaclPermissionsById($this->resource->id, 
array('self' => $this))->orderBy('constants')->orderBy('object_id');
 
@@ -67,16 +67,16 @@
     switch ($name)
     {
       case 'username':
-        $this->form->setDefault($name, $this->resource[$name]);
-        $this->form->setValidator($name, new 
sfValidatorString(array('required' => true)));
-        $this->form->setWidget($name, new sfWidgetFormInput);
+        $this->form->setDefault('username', $this->resource->username);
+        $this->form->setValidator('username', new 
sfValidatorString(array('required' => true)));
+        $this->form->setWidget('username', new sfWidgetFormInput);
 
         break;
 
       case 'email':
-        $this->form->setDefault($name, $this->resource[$name]);
-        $this->form->setValidator($name, new sfValidatorEmail(array('required' 
=> true)));
-        $this->form->setWidget($name, new sfWidgetFormInput);
+        $this->form->setDefault('email', $this->resource->email);
+        $this->form->setValidator('email', new 
sfValidatorEmail(array('required' => true)));
+        $this->form->setWidget('email', new sfWidgetFormInput);
 
         break;
 
@@ -106,9 +106,9 @@
           $choices[$item->id] = $item->getName(array('cultureFallback' => 
true));
         }
 
-        $this->form->setDefault($name, $values);
-        $this->form->setValidator($name, new sfValidatorPass);
-        $this->form->setWidget($name, new sfWidgetFormSelect(array('choices' 
=> $choices, 'multiple' => true)));
+        $this->form->setDefault('groups', $values);
+        $this->form->setValidator('groups', new sfValidatorPass);
+        $this->form->setWidget('groups', new 
sfWidgetFormSelect(array('choices' => $choices, 'multiple' => true)));
 
         break;
 
@@ -136,9 +136,9 @@
           $defaults = $permission->getConstants(array('name' => 'languages'));
         }
 
-        $this->form->setDefault($name, $defaults);
-        $this->form->setValidator($name, new sfValidatorPass);
-        $this->form->setWidget($name, new sfWidgetFormSelect(array('choices'  
=> $choices, 'multiple' => true)));
+        $this->form->setDefault('translate', $defaults);
+        $this->form->setValidator('translate', new sfValidatorPass);
+        $this->form->setWidget('translate', new 
sfWidgetFormSelect(array('choices'  => $choices, 'multiple' => true)));
 
         break;
     }

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" 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/qubit-commits?hl=en.

Reply via email to