Author: jablko
Date: Tue Oct 26 08:56:28 2010
New Revision: 8502

Log:
Use $route->resource

Modified:
   trunk/apps/qubit/modules/staticpage/actions/deleteAction.class.php
   trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php
   trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php

Modified: trunk/apps/qubit/modules/staticpage/actions/deleteAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/actions/deleteAction.class.php  Tue Oct 
26 08:22:21 2010        (r8501)
+++ trunk/apps/qubit/modules/staticpage/actions/deleteAction.class.php  Tue Oct 
26 08:56:28 2010        (r8502)
@@ -23,12 +23,7 @@
   {
     $this->form = new sfForm;
 
-    $this->resource = QubitStaticPage::getById($request->id);
-
-    if (!isset($this->resource))
-    {
-      $this->forward404();
-    }
+    $this->resource = $this->getRoute()->resource;
 
     // Check user authorization
     if ($this->resource->isProtected())
@@ -36,8 +31,6 @@
       QubitAcl::forwardUnauthorized();
     }
 
-    $request->setAttribute('staticPage', $this->resource);
-
     if ($request->isMethod('delete'))
     {
       $this->resource->delete();

Modified: trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php   Tue Oct 
26 08:22:21 2010        (r8501)
+++ trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php   Tue Oct 
26 08:56:28 2010        (r8502)
@@ -21,11 +21,7 @@
 {
   public function execute($request)
   {
-    $criteria = new Criteria;
-    $criteria->add(QubitStaticPage::PERMALINK, $request->permalink);
-
-    $this->resource = QubitStaticPage::getOne($criteria);
-
+    $this->resource = $this->getRoute()->resource;
     if (!$this->resource instanceof QubitStaticPage)
     {
       $this->forward404();

Modified: trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php      Tue Oct 
26 08:22:21 2010        (r8501)
+++ trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php      Tue Oct 
26 08:56:28 2010        (r8502)
@@ -6,7 +6,7 @@
     <?php echo render_value($resource->getContent(array('cultureFallback' => 
true))) ?>
   </div>
 
-  <?php if (SecurityCheck::HasPermission($sf_user, array('module' => 
'staticpage', 'action' => 'update'))): ?>
+  <?php if (SecurityCheck::hasPermission($sf_user, array('module' => 
'staticpage', 'action' => 'update'))): ?>
     <div class="actions section">
 
       <h2 class="element-invisible"><?php echo __('Actions') ?></h2>

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