Author: sevein
Date: Fri Oct 29 03:33:36 2010
New Revision: 8647

Log:
Use $resource.

Modified:
   trunk/apps/qubit/modules/user/actions/deleteAction.class.php
   trunk/apps/qubit/modules/user/templates/deleteSuccess.php

Modified: trunk/apps/qubit/modules/user/actions/deleteAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/user/actions/deleteAction.class.php        Fri Oct 
29 00:01:58 2010        (r8646)
+++ trunk/apps/qubit/modules/user/actions/deleteAction.class.php        Fri Oct 
29 03:33:36 2010        (r8647)
@@ -23,18 +23,11 @@
   {
     $this->form = new sfForm;
 
-    $this->user = QubitUser::getById($request->id);
-
-    // Check that user exists
-    $this->forward404Unless($this->user);
-
-    // TODO: Check ACL authorization
-
-    $request->setAttribute('user', $this->user);
+    $this->resource = $this->getRoute()->resource;
 
     if ($request->isMethod('delete'))
     {
-      $this->user->delete();
+      $this->resource->delete();
 
       $this->redirect(array('module' => 'user', 'action' => 'list'));
     }

Modified: trunk/apps/qubit/modules/user/templates/deleteSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/user/templates/deleteSuccess.php   Fri Oct 29 
00:01:58 2010        (r8646)
+++ trunk/apps/qubit/modules/user/templates/deleteSuccess.php   Fri Oct 29 
03:33:36 2010        (r8647)
@@ -1,15 +1,18 @@
-<h1><?php echo __('Are you sure you want to delete user %1%?', array('%1%' => 
$user->username)) ?></h1>
+<h1><?php echo __('Are you sure you want to delete user %1%?', array('%1%' => 
$resource->username)) ?></h1>
 
-<?php echo $form->renderFormTag(url_for(array($user, 'module' => 'user', 
'action' => 'delete')), array('method' => 'delete')) ?>
+<?php echo $form->renderFormTag(url_for(array($resource, 'module' => 'user', 
'action' => 'delete')), array('method' => 'delete')) ?>
 
   <div class="actions section">
+
     <h2 class="element-invisible"><?php echo __('Actions') ?></h2>
+
     <div class="content">
       <ul class="clearfix links">
-        <li><?php echo link_to(__('Cancel'), array($user, 'module' => 'user')) 
?></li>
+        <li><?php echo link_to(__('Cancel'), array($resource, 'module' => 
'user')) ?></li>
         <li><input class="form-submit" type="submit" value="<?php echo 
__('Confirm') ?>"/></li>
       </ul>
     </div>
+
   </div>
 
 </form>

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