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

controllers/grid/users/chapter/ChapterGridCategoryRowCellProvider.inc.php

00001 <?php
00002 
00015 import('lib.pkp.classes.controllers.grid.GridCellProvider');
00016 
00017 class ChapterGridCategoryRowCellProvider extends GridCellProvider {
00018 
00019    var $_readOnly;
00020 
00024    function ChapterGridCategoryRowCellProvider() {
00025       parent::GridCellProvider();
00026    }
00027 
00031    function getCellActions($request, &$row, &$column) {
00032       if ($column->getId() == 'name' && !$row->isReadOnly()) {
00033          $chapter =& $row->getData();
00034          $monograph =& $row->getMonograph();
00035 
00036          $router =& $request->getRouter();
00037          $actionArgs = array(
00038             'monographId' => $monograph->getId(),
00039             'chapterId' => $chapter->getId()
00040          );
00041 
00042          return array(new LinkAction(
00043                'editChapter',
00044                new AjaxModal(
00045                   $router->url($request, null, null, 'editChapter', null, $actionArgs),
00046                   __('submission.chapter.editChapter'),
00047                   'modal_edit'
00048                ),
00049                $chapter->getLocalizedTitle()
00050             )
00051          );
00052       }
00053    }
00054 
00058    function getTemplateVarsFromRowColumn(&$row, $column) {
00059       // If row is not read only, the cell will contains a link
00060       // action. See getCellActions() above.
00061       if ($column->getId() == 'name' && $row->isReadOnly()) {
00062          $chapter =& $row->getData();
00063          $label = $chapter->getLocalizedTitle();
00064       } else {
00065          $label = '';
00066       }
00067 
00068       return array('label' => $label);
00069    }
00070 }
00071 
00072 ?>

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