• Main Page
  • Modules
  • Classes
  • Files
  • File List

controllers/grid/catalogEntry/PublicationFormatGridRow.inc.php

00001 <?php
00002 
00015 import('lib.pkp.classes.controllers.grid.GridRow');
00016 
00017 class PublicationFormatGridRow extends GridRow {
00019    var $_monograph;
00020 
00024    function PublicationFormatGridRow(&$monograph) {
00025       $this->_monograph =& $monograph;
00026       parent::GridRow();
00027    }
00028 
00029    //
00030    // Overridden methods from GridRow
00031    //
00036    function initialize(&$request) {
00037       // Do the default initialization
00038       parent::initialize($request);
00039 
00040       // Retrieve the monograph from the request
00041       $monograph =& $this->getMonograph();
00042 
00043       // Is this a new row or an existing row?
00044       $publicationFormat = $this->_data;
00045       if ($publicationFormat && is_numeric($publicationFormat->getId())) {
00046 
00047          $router =& $request->getRouter();
00048          $actionArgs = array(
00049             'monographId' => $monograph->getId(),
00050             'publicationFormatId' => $publicationFormat->getId()
00051          );
00052 
00053          // Add row-level actions
00054          import('lib.pkp.classes.linkAction.request.AjaxModal');
00055          $this->addAction(
00056             new LinkAction(
00057                'editFormat',
00058                new AjaxModal(
00059                   $router->url($request, null, null, 'editFormat', null, $actionArgs),
00060                   __('grid.action.edit'),
00061                   'modal_edit'
00062                ),
00063                __('grid.action.edit'),
00064                'edit'
00065             )
00066          );
00067 
00068          import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
00069          $this->addAction(
00070             new LinkAction(
00071                'deleteFormat',
00072                new RemoteActionConfirmationModal(
00073                   __('common.confirmDelete'),
00074                   __('common.delete'),
00075                   $router->url($request, null, null, 'deleteFormat', null, $actionArgs),
00076                   'modal_delete'
00077                ),
00078                __('grid.action.delete'),
00079                'delete'
00080             )
00081          );
00082       }
00083    }
00084 
00089    function &getMonograph() {
00090       return $this->_monograph;
00091    }
00092 }
00093 ?>

Generated on Mon Sep 17 2012 13:58:55 for Open Monograph Press by  doxygen 1.7.1