Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
ApprovedProofFilesGridCellProvider.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.DataObjectGridCellProvider');
17 
20  var $currency;
21 
26  $this->currency = $currency;
27  parent::DataObjectGridCellProvider();
28  }
29 
30  //
31  // Template methods from GridCellProvider
32  //
40  function getTemplateVarsFromRowColumn($row, $column) {
41  switch ($column->getId()) {
42  case 'name':
43  $approvedProofFile =& $row->getData();
44  return array('label' => $approvedProofFile->getLocalizedName());
45  case 'approved':
46  $approvedProofFile =& $row->getData();
47  return array('status' => $approvedProofFile->getViewable()?'completed':'new');
48  case 'price':
49  $approvedProofFile =& $row->getData();
50  if ($approvedProofFile->getSalesType() == null) {
51  return array('label' => __('payment.directSales.notSet'));
52  }
53  $price = $approvedProofFile->getDirectSalesPrice();
54  if ($price === null) $label = __('payment.directSales.notAvailable');
55  elseif ($price == '0') $label = __('payment.directSales.openAccess');
56  else $label = __('payment.directSales.amount', array('amount' => $price, 'currency' => $this->currency));
57 
58  return array('label' => $label);
59  default:
60  assert(false);
61  }
62  }
63 }
64 
65 ?>
Base class for a cell provider that can retrieve simple labels from DataObjects. If you need more com...
Cell provider to retrieve the approved proof files grid data.