00001 <?php
00002
00015 import('lib.pkp.classes.controllers.grid.GridRow');
00016
00017 class CategoryGridRow extends GridRow {
00021 function CategoryGridRow() {
00022 parent::GridRow();
00023 }
00024
00025
00026
00027
00031 function initialize(&$request) {
00032 parent::initialize($request);
00033
00034 $rowData =& $this->getData();
00035 assert($rowData != null);
00036
00037 $rowId = $this->getId();
00038
00039
00040 if (!empty($rowId) && is_numeric($rowId)) {
00041 $actionArgs = array_merge(
00042 $this->getRequestArgs(),
00043 array('categoryId' => $rowData->getId())
00044 );
00045 $router =& $request->getRouter();
00046
00047 $this->addAction(new LinkAction(
00048 'editCategory',
00049 new AjaxModal(
00050 $router->url($request, null, null, 'editCategory', null, $actionArgs),
00051 __('grid.category.edit')
00052 ),
00053 __('grid.action.edit'),
00054 'edit'
00055 ));
00056
00057 import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
00058 $confirmationModal = new RemoteActionConfirmationModal(
00059 __('grid.category.removeText'),
00060 null,
00061 $router->url($request, null, null, 'deleteCategory', null, $actionArgs)
00062 );
00063 $removeCategoryLinkAction = new LinkAction(
00064 'removeCategory',
00065 $confirmationModal,
00066 __('grid.action.remove'),
00067 'delete'
00068 );
00069 $this->addAction($removeCategoryLinkAction);
00070 }
00071 }
00072 }
00073
00074 ?>