Author: jablko
Date: Tue Sep 15 10:38:50 2009
New Revision: 3307

Log:
Add delete confirmation pages, like revision 2960

Added:
   trunk/apps/qubit/modules/actor/templates/deleteSuccess.php
      - copied, changed from r3297, 
trunk/apps/qubit/modules/informationobject/templates/deleteSuccess.php
   trunk/apps/qubit/modules/repository/templates/deleteSuccess.php
      - copied, changed from r3297, 
trunk/apps/qubit/modules/informationobject/templates/deleteSuccess.php
Modified:
   trunk/apps/qubit/modules/actor/actions/deleteAction.class.php
   trunk/apps/qubit/modules/actor/config/view.yml
   trunk/apps/qubit/modules/repository/actions/deleteAction.class.php
   trunk/apps/qubit/modules/repository/config/view.yml

Modified: trunk/apps/qubit/modules/actor/actions/deleteAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/actor/actions/deleteAction.class.php       Tue Sep 
15 10:26:19 2009        (r3306)
+++ trunk/apps/qubit/modules/actor/actions/deleteAction.class.php       Tue Sep 
15 10:38:50 2009        (r3307)
@@ -21,16 +21,18 @@
 {
   public function execute($request)
   {
-    $actor = QubitActor::getById($request->id);
+    $this->actor = QubitActor::getById($request->id);
 
-    if (!isset($actor))
+    if (!isset($this->actor))
     {
       $this->forward404();
     }
 
+    $this->form = new sfForm;
+
     if ($request->isMethod('delete'))
     {
-      foreach ($actor->events as $event)
+      foreach ($this->actor->events as $event)
       {
         if (isset($event->informationObject) && isset($event->type))
         {
@@ -44,7 +46,7 @@
         }
       }
 
-      $actor->delete();
+      $this->actor->delete();
 
       return $this->redirect(array('module' => 'actor', 'action' => 'list'));
     }

Modified: trunk/apps/qubit/modules/actor/config/view.yml
==============================================================================
--- trunk/apps/qubit/modules/actor/config/view.yml      Tue Sep 15 10:26:19 
2009        (r3306)
+++ trunk/apps/qubit/modules/actor/config/view.yml      Tue Sep 15 10:38:50 
2009        (r3307)
@@ -1,3 +1,10 @@
+deleteSuccess:
+  components:
+    sidebar: []
+    BrowseBox: []
+    MainMenu: []
+    SearchBox: []
+
 editContactInformationSuccess:
   components:
     sidebar: []

Copied and modified: trunk/apps/qubit/modules/actor/templates/deleteSuccess.php 
(from r3297, 
trunk/apps/qubit/modules/informationobject/templates/deleteSuccess.php)
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/deleteSuccess.php      
Mon Sep 14 18:32:10 2009        (r3297, copy source)
+++ trunk/apps/qubit/modules/actor/templates/deleteSuccess.php  Tue Sep 15 
10:38:50 2009        (r3307)
@@ -1,16 +1,8 @@
-<h1><?php echo __('Are you sure you want to delete %1%?', array('%1%' => 
render_title($informationObject))) ?></h1>
+<h1><?php echo __('Are you sure you want to delete %1%?', array('%1%' => 
render_title($actor))) ?></h1>
 
-<?php if (0 < count($informationObject->descendants)): ?>
-  <ul>
-    <?php foreach ($informationObject->descendants as $descendant): ?>
-      <li><?php echo link_to(render_title($descendant), array('module' => 
'informationobject', 'action' => 'show', 'id' => $descendant->id)) ?></li>
-    <?php endforeach; ?>
-  </ul>
-<?php endif; ?>
-
-<?php echo $form->renderFormTag(url_for(array('module' => 'informationobject', 
'action' => 'delete', 'id' => $informationObject->id)), array('method' => 
'delete')) ?>
+<?php echo $form->renderFormTag(url_for(array('module' => 'actor', 'action' => 
'delete', 'id' => $actor->id)), array('method' => 'delete')) ?>
   <ul class="actions">
-    <li><?php echo link_to(__('Cancel'), array('module' => 
'informationobject', 'action' => 'show', 'id' => $informationObject->id)) 
?></li>
+    <li><?php echo link_to(__('Cancel'), array('module' => 'actor', 'action' 
=> 'show', 'id' => $actor->id)) ?></li>
     <li><?php echo submit_tag(__('Confirm')) ?></li>
   </ul>
 </form>

Modified: trunk/apps/qubit/modules/repository/actions/deleteAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/repository/actions/deleteAction.class.php  Tue Sep 
15 10:26:19 2009        (r3306)
+++ trunk/apps/qubit/modules/repository/actions/deleteAction.class.php  Tue Sep 
15 10:38:50 2009        (r3307)
@@ -21,23 +21,25 @@
 {
   public function execute($request)
   {
-    $repository = QubitRepository::getById($request->id);
+    $this->repository = QubitRepository::getById($request->id);
 
-    if (!isset($repository))
+    if (!isset($this->repository))
     {
       $this->forward404();
     }
 
+    $this->form = new sfForm;
+
     if ($request->isMethod('delete'))
     {
-      foreach ($repository->informationObjects as $informationObject)
+      foreach ($this->repository->informationObjects as $informationObject)
       {
         unset($informationObject->repository);
 
         $informationObject->save();
       }
 
-      $repository->delete();
+      $this->repository->delete();
 
       return $this->redirect(array('module' => 'repository', 'action' => 
'list'));
     }

Modified: trunk/apps/qubit/modules/repository/config/view.yml
==============================================================================
--- trunk/apps/qubit/modules/repository/config/view.yml Tue Sep 15 10:26:19 
2009        (r3306)
+++ trunk/apps/qubit/modules/repository/config/view.yml Tue Sep 15 10:38:50 
2009        (r3307)
@@ -1,3 +1,10 @@
+deleteSuccess:
+  components:
+    sidebar: []
+    BrowseBox: []
+    MainMenu: []
+    SearchBox: []
+
 editIsdiahSuccess:
   javascripts: [/sfDrupalPlugin/vendor/drupal/misc/collapse, 
/sfDrupalPlugin/vendor/drupal/misc/textarea, multiDelete, multiInstanceSelect, 
multiInstanceInput]
 

Copied and modified: 
trunk/apps/qubit/modules/repository/templates/deleteSuccess.php (from r3297, 
trunk/apps/qubit/modules/informationobject/templates/deleteSuccess.php)
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/deleteSuccess.php      
Mon Sep 14 18:32:10 2009        (r3297, copy source)
+++ trunk/apps/qubit/modules/repository/templates/deleteSuccess.php     Tue Sep 
15 10:38:50 2009        (r3307)
@@ -1,16 +1,8 @@
-<h1><?php echo __('Are you sure you want to delete %1%?', array('%1%' => 
render_title($informationObject))) ?></h1>
+<h1><?php echo __('Are you sure you want to delete %1%?', array('%1%' => 
render_title($repository))) ?></h1>
 
-<?php if (0 < count($informationObject->descendants)): ?>
-  <ul>
-    <?php foreach ($informationObject->descendants as $descendant): ?>
-      <li><?php echo link_to(render_title($descendant), array('module' => 
'informationobject', 'action' => 'show', 'id' => $descendant->id)) ?></li>
-    <?php endforeach; ?>
-  </ul>
-<?php endif; ?>
-
-<?php echo $form->renderFormTag(url_for(array('module' => 'informationobject', 
'action' => 'delete', 'id' => $informationObject->id)), array('method' => 
'delete')) ?>
+<?php echo $form->renderFormTag(url_for(array('module' => 'repository', 
'action' => 'delete', 'id' => $repository->id)), array('method' => 'delete')) ?>
   <ul class="actions">
-    <li><?php echo link_to(__('Cancel'), array('module' => 
'informationobject', 'action' => 'show', 'id' => $informationObject->id)) 
?></li>
+    <li><?php echo link_to(__('Cancel'), array('module' => 'repository', 
'action' => 'show', 'id' => $repository->id)) ?></li>
     <li><?php echo submit_tag(__('Confirm')) ?></li>
   </ul>
 </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.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to