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