当前位置: 首页>>代码示例>>PHP>>正文


PHP DataObjectGridCellProvider::getTemplateVarsFromRowColumn方法代码示例

本文整理汇总了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);
 }
开发者ID:selwyntcy,项目名称:pkp-lib,代码行数:37,代码来源:RepresentationsGridCellProvider.inc.php

示例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() : '&mdash;') . '<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() : '&mdash;') . '<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);
 }
开发者ID:primoz-svetek,项目名称:pkp-lib,代码行数:33,代码来源:QueriesGridCellProvider.inc.php

示例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;
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:13,代码来源:PKPCitationGridCellProvider.inc.php

示例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() : '&mdash;') . '<br />' . date('M d', strtotime($element->getDateCreated())));
     }
     return parent::getTemplateVarsFromRowColumn($row, $column);
 }
开发者ID:mczirfusz,项目名称:pkp-lib,代码行数:19,代码来源:QueryNotesGridCellProvider.inc.php

示例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);
 }
开发者ID:selwyntcy,项目名称:ojs,代码行数:17,代码来源:ArticleGalleyGridCellProvider.inc.php

示例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());
     }
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:25,代码来源:PKPAuthorGridCellProvider.inc.php

示例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);
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:23,代码来源:ReviewerGridCellProvider.inc.php

示例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);
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:23,代码来源:ReviewerGridCellProvider.inc.php

示例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);
 }
开发者ID:mczirfusz,项目名称:pkp-lib,代码行数:20,代码来源:ReviewerGridCellProvider.inc.php


注:本文中的DataObjectGridCellProvider::getTemplateVarsFromRowColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。