本文整理汇总了PHP中DataObjectGridCellProvider::getTemplateVarsFromRowColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP DataObjectGridCellProvider::getTemplateVarsFromRowColumn方法的具体用法?PHP DataObjectGridCellProvider::getTemplateVarsFromRowColumn怎么用?PHP DataObjectGridCellProvider::getTemplateVarsFromRowColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataObjectGridCellProvider
的用法示例。
在下文中一共展示了DataObjectGridCellProvider::getTemplateVarsFromRowColumn方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTemplateVarsFromRowColumn
/**
* Extracts variables for a given column from a data element
* so that they may be assigned to template before rendering.
* @param $row GridRow
* @param $column GridColumn
* @return array
*/
function getTemplateVarsFromRowColumn($row, $column)
{
$data = $row->getData();
if (is_a($data, 'Representation')) {
switch ($column->getId()) {
case 'indent':
return array();
case 'name':
$remoteURL = $data->getRemoteURL();
if ($remoteURL) {
return array('label' => '<a href="' . htmlspecialchars($remoteURL) . '" target="_blank">' . htmlspecialchars($data->getLocalizedName()) . '</a>');
}
return array('label' => htmlspecialchars($data->getLocalizedName()));
case 'isComplete':
return array('status' => $data->getIsApproved() ? 'completed' : 'new');
}
} else {
assert(is_array($data) && isset($data['submissionFile']));
$proofFile = $data['submissionFile'];
switch ($column->getId()) {
case 'name':
import('lib.pkp.controllers.grid.files.FileNameGridColumn');
$fileNameGridColumn = new FileNameGridColumn(true, WORKFLOW_STAGE_ID_PRODUCTION);
return $fileNameGridColumn->getTemplateVarsFromRow($row);
case 'isComplete':
return array('status' => $proofFile->getViewable() ? 'completed' : 'new');
}
}
return parent::getTemplateVarsFromRowColumn($row, $column);
}
示例2: getTemplateVarsFromRowColumn
/**
* Extracts variables for a given column from a data element
* so that they may be assigned to template before rendering.
* @param $row GridRow
* @param $column GridColumn
* @return array
*/
function getTemplateVarsFromRowColumn($row, $column)
{
$element = $row->getData();
$columnId = $column->getId();
assert(is_a($element, 'DataObject') && !empty($columnId));
$headNote = $element->getHeadNote();
$user = $headNote ? $headNote->getUser() : null;
$notes = $element->getReplies(null, NOTE_ORDER_ID, SORT_DIRECTION_DESC);
switch ($columnId) {
case 'replies':
return array('label' => max(0, $notes->getCount() - 1));
case 'from':
return array('label' => ($user ? $user->getUsername() : '—') . '<br />' . ($headNote ? date('M/d', strtotime($headNote->getDateCreated())) : ''));
case 'lastReply':
$latestReply = $notes->next();
if ($latestReply && $latestReply->getId() != $headNote->getId()) {
$repliedUser = $latestReply->getUser();
return array('label' => ($repliedUser ? $repliedUser->getUsername() : '—') . '<br />' . date('M/d', strtotime($latestReply->getDateCreated())));
} else {
return array('label' => '-');
}
case 'closed':
return array('selected' => $element->getIsClosed(), 'disabled' => !$this->_canManage);
}
return parent::getTemplateVarsFromRowColumn($row, $column);
}
示例3: getTemplateVarsFromRowColumn
/**
* @see GridCellProvider::getTemplateVarsFromRowColumn()
*/
function getTemplateVarsFromRowColumn(&$row, $column)
{
$templateVars = parent::getTemplateVarsFromRowColumn($row, $column);
$element =& $row->getData();
assert(is_a($element, 'Citation'));
$templateVars['isApproved'] = $element->getCitationState() == CITATION_APPROVED ? true : false;
$templateVars['isCurrentItem'] = $row->getIsCurrentItem();
$templateVars['citationSeq'] = $element->getSeq();
return $templateVars;
}
示例4: getTemplateVarsFromRowColumn
/**
* Extracts variables for a given column from a data element
* so that they may be assigned to template before rendering.
* @param $row GridRow
* @param $column GridColumn
* @return array
*/
function getTemplateVarsFromRowColumn($row, $column)
{
$element = $row->getData();
$columnId = $column->getId();
assert(is_a($element, 'DataObject') && !empty($columnId));
$user = $element->getUser();
switch ($columnId) {
case 'from':
return array('label' => ($user ? $user->getUsername() : '—') . '<br />' . date('M d', strtotime($element->getDateCreated())));
}
return parent::getTemplateVarsFromRowColumn($row, $column);
}
示例5: getTemplateVarsFromRowColumn
/**
* @copydoc GridCellProvider::getTemplateVarsFromRowColumn()
*/
function getTemplateVarsFromRowColumn($row, $column)
{
$element = $row->getData();
$columnId = $column->getId();
assert(is_a($element, 'DataObject') && !empty($columnId));
switch ($columnId) {
case 'label':
return array('label' => $element->getRemoteUrl() == '' && $element->getFileId() ? '' : $element->getLabel());
break;
default:
assert(false);
}
return parent::getTemplateVarsFromRowColumn($row, $column);
}
示例6: getTemplateVarsFromRowColumn
/**
* Extracts variables for a given column from a data element
* so that they may be assigned to template before rendering.
* @param $row GridRow
* @param $column GridColumn
* @return array
*/
function getTemplateVarsFromRowColumn($row, $column)
{
$element = $row->getData();
$columnId = $column->getId();
assert(is_a($element, 'DataObject') && !empty($columnId));
switch ($columnId) {
case 'name':
return array('label' => $element->getFullName());
case 'role':
return array('label' => $element->getLocalizedUserGroupName());
case 'email':
return parent::getTemplateVarsFromRowColumn($row, $column);
case 'principalContact':
return array('isPrincipalContact' => $element->getPrimaryContact());
case 'includeInBrowse':
return array('includeInBrowse' => $element->getIncludeInBrowse());
}
}
示例7: getTemplateVarsFromRowColumn
/**
* Extracts variables for a given column from a data element
* so that they may be assigned to template before rendering.
* @param $row GridRow
* @param $column GridColumn
* @return array
*/
function getTemplateVarsFromRowColumn(&$row, $column)
{
$element =& $row->getData();
$columnId = $column->getId();
assert(is_a($element, 'DataObject') && !empty($columnId));
switch ($columnId) {
case 'name':
if ($this->getCellState($row, $column) != 'linkReview') {
return array('label' => $element->getReviewerFullName());
}
case is_numeric($columnId):
case 'reviewer':
return array('status' => $this->getCellState($row, $column));
}
return parent::getTemplateVarsFromRowColumn($row, $column);
}
示例8: getTemplateVarsFromRowColumn
/**
* Extracts variables for a given column from a data element
* so that they may be assigned to template before rendering.
* @param $row GridRow
* @param $column GridColumn
* @return array
*/
function getTemplateVarsFromRowColumn($row, $column)
{
$element = $row->getData();
$columnId = $column->getId();
assert(is_a($element, 'DataObject') && !empty($columnId));
switch ($columnId) {
case 'name':
return array('label' => $element->getReviewerFullName());
case 'considered':
return array('label' => $this->_getStatusText($this->getCellState($row, $column), $row));
case 'actions':
// Only attach actions to this column. See self::getCellActions()
return array('label' => '');
}
return parent::getTemplateVarsFromRowColumn($row, $column);
}
示例9: getTemplateVarsFromRowColumn
/**
* Extracts variables for a given column from a data element
* so that they may be assigned to template before rendering.
* @param $row GridRow
* @param $column GridColumn
* @return array
*/
function getTemplateVarsFromRowColumn($row, $column)
{
$element = $row->getData();
$columnId = $column->getId();
assert(is_a($element, 'DataObject') && !empty($columnId));
switch ($columnId) {
case 'name':
return array('label' => $element->getReviewerFullName());
case 'considered':
return array('status' => $this->getCellState($row, $column));
}
return parent::getTemplateVarsFromRowColumn($row, $column);
}