To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Show
Ignore:
Timestamp:
04/30/10 15:13:53 (2 years ago)
Author:
dordille
Message:

rescoped aBlogAdmin body class to a-blog-admin for compatibility with aEventAdmin

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostropheBlogPlugin/trunk/data/generator/sfDoctrineModule/aBlogAdmin/parts/batchAction.php

    r501 r1108  
    4444  } 
    4545 
    46   protected function executeBatchDelete(sfWebRequest $request) 
     46  protected function batchAction($action, sfWebRequest $request) 
    4747  { 
    48     // TBB: use collection delete rather than a delete query. This ensures 
    49     // that the object's delete() method is called, which provides 
    50     // for checking userHasPrivileges() 
    51      
    5248    $ids = $request->getParameter('ids'); 
    5349 
     
    6056    try 
    6157    { 
    62       $items->delete(); 
     58      $items->$action(); 
    6359    } catch (Exception $e) 
    6460    { 
    6561      $error = true; 
    6662    } 
     63    return $error; 
     64  } 
     65 
     66  protected function executeBatchDelete(sfWebRequest $request) 
     67  { 
     68    $error = $this->batchAction('delete', $request); 
    6769     
    68     if (($count == count($ids)) && (!$error)) 
     70    if (($count == count($request->getParameter('ids'))) && (!$error)) 
    6971    { 
    7072      $this->getUser()->setFlash('notice', 'The selected items have been deleted successfully.'); 
     
    7779    $this->redirect('@<?php echo $this->getUrlForAction('list') ?>'); 
    7880  } 
     81 
     82 
     83  protected function executeBatchPublish(sfWebRequest $request) 
     84  { 
     85    $error = $this->batchAction('publish', $request); 
     86 
     87    if (($count == count($request->getParameter('ids'))) && (!$error)) 
     88    { 
     89      $this->getUser()->setFlash('notice', 'The selected items have been published successfully.'); 
     90    } 
     91    else 
     92    { 
     93      $this->getUser()->setFlash('error', 'An error occurred while publishing the selected items.'); 
     94    } 
     95 
     96    $this->redirect('@<?php echo $this->getUrlForAction('list') ?>'); 
     97  } 
     98 
     99  protected function executeBatchUnpublish(sfWebRequest $request) 
     100  { 
     101    $error = $this->batchAction('unpublish', $request); 
     102 
     103    if (($count == count($request->getParameter('ids'))) && (!$error)) 
     104    { 
     105      $this->getUser()->setFlash('notice', 'The selected items have been unpublished successfully.'); 
     106    } 
     107    else 
     108    { 
     109      $this->getUser()->setFlash('error', 'An error occurred while unpublishing the selected items.'); 
     110    } 
     111 
     112    $this->redirect('@<?php echo $this->getUrlForAction('list') ?>'); 
     113  }