Author: jablko
Date: Mon Oct 25 10:03:34 2010
New Revision: 8466

Log:
Use $route->resource

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

Modified: trunk/apps/qubit/modules/term/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/editAction.class.php  Mon Oct 25 
09:57:12 2010        (r8465)
+++ trunk/apps/qubit/modules/term/actions/editAction.class.php  Mon Oct 25 
10:03:34 2010        (r8466)
@@ -68,6 +68,12 @@
     }
     else
     {
+      // Check authorization to create term
+      if (!QubitAcl::check($this->resource, 'create', array('taxonomyId' => 
$request->taxonomyId)))
+      {
+        QubitAcl::forwardUnauthorized();
+      }
+
       if (isset($request->parent) && 0 < strlen($request->parent))
       {
         $params = 
$this->context->routing->parse(Qubit::pathInfo($request->parent));
@@ -82,12 +88,6 @@
       {
         $this->resource->taxonomyId = $request->taxonomyId;
       }
-
-      // Check authorization to create term
-      if (!QubitAcl::check($this->resource, 'create', array('taxonomyId' => 
$request->taxonomyId)))
-      {
-        QubitAcl::forwardUnauthorized();
-      }
     }
   }
 
@@ -270,9 +270,14 @@
 
       case 'parent':
       case 'taxonomy':
-        $params = 
$this->context->routing->parse(Qubit::pathInfo($this->form->getValue($field->getName())));
-        $fieldId = (isset($params['id']) && 0 < strlen($params['id'])) ? 
$params['id'] : null;
-        $this->resource[$field->getName().'Id'] = $fieldId;
+        unset($this->resource[$name]);
+
+        $value = $this->form->getValue($field->getName());
+        if (isset($value))
+        {
+          $params = $this->context->routing->parse(Qubit::pathInfo($value));
+          $this->resource[$field->getName()] = $params['_sf_route']->resource;
+        }
 
         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