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

controllers/grid/files/proof/ApprovedProofFilesGridCellProvider.inc.php

00001 <?php
00002 
00015 import('lib.pkp.classes.controllers.grid.DataObjectGridCellProvider');
00016 
00017 class ApprovedProofFilesGridCellProvider extends DataObjectGridCellProvider {
00019    var $currency;
00020 
00024    function ApprovedProofFilesGridCellProvider($currency) {
00025       $this->currency = $currency;
00026       parent::DataObjectGridCellProvider();
00027    }
00028 
00029    //
00030    // Template methods from GridCellProvider
00031    //
00039    function getTemplateVarsFromRowColumn(&$row, $column) {
00040       switch ($column->getId()) {
00041          case 'name':
00042             $approvedProofFile =& $row->getData();
00043             return array('label' => $approvedProofFile->getLocalizedName());
00044          case 'approved':
00045             $approvedProofFile =& $row->getData();
00046             return array('status' => $approvedProofFile->getViewable()?'completed':'new');
00047          case 'price':
00048             $approvedProofFile =& $row->getData();
00049             $price = $approvedProofFile->getDirectSalesPrice();
00050             if ($price === null) $label = __('payment.directSales.notAvailable');
00051             elseif ($price == '0') $label = __('payment.directSales.openAccess');
00052             else $label = __('payment.directSales.amount', array('amount' => $price, 'currency' => $this->currency));
00053 
00054             return array('label' => $label);
00055          default:
00056             assert(false);
00057       }
00058    }
00059 }
00060 
00061 ?>

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