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

controllers/grid/content/announcements/AnnouncementTypeGridCellProvider.inc.php

00001 <?php
00002 
00015 import('lib.pkp.classes.controllers.grid.GridCellProvider');
00016 
00017 class AnnouncementTypeGridCellProvider extends GridCellProvider {
00018 
00022    function AnnouncementTypeGridCellProvider() {
00023       parent::GridCellProvider();
00024    }
00025 
00029    function getCellActions(&$request, &$row, &$column, $position = GRID_ACTION_POSITION_DEFAULT) {
00030       if ($column->getId() == 'name') {
00031          $announcementType =& $row->getData();
00032          $label = $announcementType->getLocalizedTypeName();
00033 
00034          $router =& $request->getRouter();
00035          $actionArgs = array('announcementTypeId' => $row->getId());
00036 
00037          import('lib.pkp.classes.linkAction.request.AjaxModal');
00038          $moreInformationAction = new LinkAction(
00039                'edit',
00040                new AjaxModal(
00041                   $router->url($request, null, null, 'editAnnouncementType', null, $actionArgs),
00042                   __('grid.action.edit'),
00043                   null,
00044                   true),
00045                $label);
00046 
00047          return array($moreInformationAction);
00048       }
00049 
00050       return parent::getCellActions($request, $row, $column, $position);
00051    }
00052 
00060    function getTemplateVarsFromRowColumn(&$row, &$column) {
00061       $announcementType =& $row->getData();
00062       $columnId = $column->getId();
00063       assert(is_a($announcementType, 'AnnouncementType') && !empty($columnId));
00064 
00065       switch ($columnId) {
00066          case 'title':
00067             return array('label' => $announcementType->getLocalizedName());
00068             break;
00069          default:
00070             break;
00071       }
00072 
00073       return parent::getTemplateVarsFromRowColumn($row, $column);
00074    }
00075 }
00076 
00077 ?>

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