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


PHP GridCellProvider类代码示例

本文整理汇总了PHP中GridCellProvider的典型用法代码示例。如果您正苦于以下问题:PHP GridCellProvider类的具体用法?PHP GridCellProvider怎么用?PHP GridCellProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了GridCellProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTemplateVarsFromRowColumn

 /**
  * This implementation assumes a simple data element array that
  * has column ids as keys.
  * @see GridCellProvider::getTemplateVarsFromRowColumn()
  * @param $row GridRow
  * @param $column GridColumn
  * @return array
  */
 function getTemplateVarsFromRowColumn($row, $column)
 {
     $file = $row->getData();
     $columnId = $column->getId();
     assert(is_a($file, 'SubmissionFile') && !empty($columnId));
     switch ($columnId) {
         case 'name':
             return array('labelKey' => $file->getFileId(), 'label' => '<span class="label before_actions">' . $file->getFileId() . '-' . $file->getRevision() . '</span>' . htmlspecialchars($file->getFileLabel()));
     }
     return parent::getTemplateVarsFromRowColumn($row, $column);
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:19,代码来源:FileListbuilderGridCellProvider.inc.php

示例2: getCellActions

 /**
  * @see GridCellProvider::getCellActions()
  */
 function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
 {
     switch ($column->getId()) {
         case 'active':
             $element = $row->getData();
             /* @var $element DataObject */
             $router = $request->getRouter();
             import('lib.pkp.classes.linkAction.LinkAction');
             if ($element->getActive()) {
                 return array(new LinkAction('deactivateReviewForm', new RemoteActionConfirmationModal(__('manager.reviewForms.confirmDeactivate'), null, $router->url($request, null, 'grid.settings.reviewForms.ReviewFormGridHandler', 'deactivateReviewForm', null, array('reviewFormKey' => $element->getId())))));
             } else {
                 return array(new LinkAction('activateReviewForm', new RemoteActionConfirmationModal(__('manager.reviewForms.confirmActivate'), null, $router->url($request, null, 'grid.settings.reviewForms.ReviewFormGridHandler', 'activateReviewForm', null, array('reviewFormKey' => $element->getId())))));
             }
     }
     return parent::getCellActions($request, $row, $column, $position);
 }
开发者ID:selwyntcy,项目名称:pkp-lib,代码行数:19,代码来源:ReviewFormGridCellProvider.inc.php

示例3: render

 /**
  * @see GridCellProvider::render()
  */
 function render($request, $row, $column)
 {
     // Default category rows will only have the first column
     // as label columns.
     if ($column->hasFlag('firstColumn')) {
         // Store the current column template.
         $template = $column->getTemplate();
         // Reset to the default column template.
         $column->setTemplate('controllers/grid/gridCell.tpl');
         // Render the cell.
         $renderedCell = parent::render($request, $row, $column);
         // Restore the original column template.
         $column->setTemplate($template);
         return $renderedCell;
     } else {
         return '';
     }
 }
开发者ID:doana,项目名称:pkp-lib,代码行数:21,代码来源:GridCategoryRowCellProvider.inc.php

示例4: getCellActions

 /**
  * @copydoc GridCellProvider::getCellActions()
  */
 function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
 {
     $submissionFile = $row->getData();
     assert(is_a($submissionFile, 'SubmissionFile'));
     switch ($column->getId()) {
         case 'name':
             import('lib.pkp.controllers.grid.files.FileNameGridColumn');
             $fileNameColumn = new FileNameGridColumn(true, WORKFLOW_STAGE_ID_PRODUCTION, true);
             // Set the row data as expected in FileNameGridColumn object.
             $rowData = array('submissionFile' => $submissionFile);
             $row->setData($rowData);
             $actions = $fileNameColumn->getCellActions($request, $row);
             // Back the row data as expected by the signoff grid.
             $row->setData($submissionFile);
             return $actions;
         case 'approved':
             return array($this->_getApprovedCellAction($request, $submissionFile, $this->getCellState($row, $column)));
     }
     return parent::getCellActions($request, $row, $column, $position);
 }
开发者ID:mczirfusz,项目名称:pkp-lib,代码行数:23,代码来源:SignoffFilesGridCellProvider.inc.php

示例5: getCellActions

 /**
  * @copydoc GridCellProvider::getCellActions()
  */
 function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
 {
     switch ($column->getId()) {
         case 'enabled':
             $plugin = $row->getData();
             /* @var $plugin Plugin */
             $requestArgs = array_merge(array('plugin' => $plugin->getName()), $row->getRequestArgs());
             switch (true) {
                 case $plugin->getEnabled() && $plugin->getCanDisable():
                     // Create an action to disable the plugin
                     import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
                     return array(new LinkAction('disable', new RemoteActionConfirmationModal($request->getSession(), __('grid.plugin.disable'), __('common.disable'), $request->url(null, null, 'disable', null, $requestArgs)), __('manager.plugins.disable'), null));
                     break;
                 case !$plugin->getEnabled() && $plugin->getCanEnable():
                     // Create an action to enable the plugin
                     import('lib.pkp.classes.linkAction.request.AjaxAction');
                     return array(new LinkAction('enable', new AjaxAction($request->url(null, null, 'enable', null, $requestArgs)), __('manager.plugins.enable'), null));
                     break;
             }
     }
     return parent::getCellActions($request, $row, $column, $position);
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:25,代码来源:PluginGridCellProvider.inc.php

示例6: FilterGridCellProvider

 /**
  * Constructor
  */
 function FilterGridCellProvider()
 {
     parent::GridCellProvider();
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:7,代码来源:FilterGridCellProvider.inc.php

示例7: ColumnBasedGridCellProvider

 /**
  * Constructor
  */
 function ColumnBasedGridCellProvider()
 {
     parent::GridCellProvider();
 }
开发者ID:mczirfusz,项目名称:pkp-lib,代码行数:7,代码来源:ColumnBasedGridCellProvider.inc.php

示例8: getCellActions

 /**
  * @copydoc GridCellProvider::getCellActions()
  */
 function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
 {
     if ($column->getId() == 'enabled') {
         $plugin = $row->getData();
         /* @var $plugin Plugin */
         $router = $request->getRouter();
         $managementVerbs = $plugin->getManagementVerbs();
         if (!is_null($managementVerbs)) {
             foreach ($managementVerbs as $verb) {
                 list($verbName, $verbLocalizedName) = $verb;
                 $actionArgs = array_merge(array('plugin' => $plugin->getName(), 'verb' => $verbName), $row->getRequestArgs());
                 $actionRequest = null;
                 $defaultUrl = $router->url($request, null, null, 'plugin', null, $actionArgs);
                 if ($verbName === 'enable') {
                     import('lib.pkp.classes.linkAction.request.AjaxAction');
                     $actionRequest = new AjaxAction($defaultUrl);
                 } else {
                     if ($verbName === 'disable') {
                         import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
                         $actionRequest = new RemoteActionConfirmationModal(__('grid.plugin.disable'), __('common.disable'), $defaultUrl);
                     }
                 }
                 if ($actionRequest) {
                     $linkAction = new LinkAction($verbName, $actionRequest, $verbLocalizedName, null);
                     return array($linkAction);
                 }
             }
         }
         // Plugin can't be disabled or don't have
         // management verbs for that.
         return array();
     }
     return parent::getCellActions($request, $row, $column, $position);
 }
开发者ID:doana,项目名称:pkp-lib,代码行数:37,代码来源:PluginGridCellProvider.inc.php

示例9: UserListbuilderGridCellProvider

 /**
  * Constructor
  */
 function UserListbuilderGridCellProvider()
 {
     parent::GridCellProvider();
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:7,代码来源:UserListbuilderGridCellProvider.inc.php

示例10: MastheadGridCellProvider

 /**
  * Constructor
  */
 function MastheadGridCellProvider()
 {
     parent::GridCellProvider();
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:7,代码来源:MastheadGridCellProvider.inc.php

示例11: IssueGalleyGridCellProvider

 /**
  * Constructor
  */
 function IssueGalleyGridCellProvider()
 {
     parent::GridCellProvider();
 }
开发者ID:bkroll,项目名称:ojs,代码行数:7,代码来源:IssueGalleyGridCellProvider.inc.php

示例12: DateGridCellProvider

 /**
  * Constructor
  * @param $dataProvider DataProvider The object to wrap
  * @param $format string See strftime
  */
 function DateGridCellProvider($dataProvider, $format)
 {
     parent::GridCellProvider();
     $this->_dataProvider = $dataProvider;
     $this->_format = $format;
 }
开发者ID:doana,项目名称:pkp-lib,代码行数:11,代码来源:DateGridCellProvider.inc.php

示例13: getCellActions

 /**
  * Get cell actions associated with this row/column combination
  * Adds a link to the file if there is an uploaded file present
  * @param $row GridRow
  * @param $column GridColumn
  * @return array an array of LegacyLinkAction instances
  */
 function getCellActions(&$request, &$row, &$column, $position = GRID_ACTION_POSITION_DEFAULT)
 {
     if ($column->getId() == 'name') {
         $signoff =& $row->getData();
         $submissionFileDao =& DAORegistry::getDAO('SubmissionFileDAO');
         /* @var $submissionFileDao SubmissionFileDAO */
         if ($signoff->getFileId()) {
             $monographFile =& $submissionFileDao->getLatestRevision($signoff->getFileId());
             $fileId = $signoff->getFileId();
             $router =& $request->getRouter();
             $actionArgs = array('gridId' => $row->getGridId(), 'monographId' => $monographFile->getMonographId(), 'fileId' => $fileId);
             $userGroupDao =& DAORegistry::getDAO('UserGroupDAO');
             $userDao =& DAORegistry::getDAO('UserDAO');
             $userGroup =& $userGroupDao->getById($signoff->getUserGroupId());
             $user =& $userDao->getUser($signoff->getUserId());
             $label = $user->getFullName() . " (" . $userGroup->getLocalizedName() . ") - " . $monographFile->getLocalizedName();
             $action = new LegacyLinkAction('downloadFile', LINK_ACTION_MODE_LINK, LINK_ACTION_TYPE_NOTHING, $router->url($request, null, null, 'downloadFile', null, $actionArgs), null, $label);
             return array($action);
         } else {
             $fileId = $monographFile = null;
             return null;
         }
     }
     return parent::getCellActions($request, $row, $column, $position);
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:32,代码来源:CopyeditingFilesGridCellProvider.inc.php

示例14: getCellActions

 /**
  * Get cell actions associated with this row/column combination
  * @param $row GridRow
  * @param $column GridColumn
  * @return array an array of LinkAction instances
  */
 function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
 {
     $element = $row->getData();
     switch ($column->getId()) {
         case 'name':
             $router = $request->getRouter();
             return array(new LinkAction('moreInformation', new AjaxModal($router->url($request, null, null, 'viewPlugin', null, array('rowId' => $row->getId() + 1)), $element->getLocalizedName(), 'modal_information', true), $element->getLocalizedName(), 'details'));
     }
     return parent::getCellActions($request, $row, $column, $position);
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:16,代码来源:PluginGalleryGridCellProvider.inc.php

示例15: getCellActions

 /**
  * Get cell actions associated with this row/column combination
  * @param $row GridRow
  * @param $column GridColumn
  * @return array an array of LinkAction instances
  */
 function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
 {
     $staticPage = $row->getData();
     switch ($column->getId()) {
         case 'path':
             $dispatcher = $request->getDispatcher();
             return array(new LinkAction('details', new RedirectAction($dispatcher->url($request, ROUTE_PAGE, null) . '/' . $staticPage->getPath(), 'staticPage'), $staticPage->getPath()));
         default:
             return parent::getCellActions($request, $row, $column, $position);
     }
 }
开发者ID:sdp-uab,项目名称:staticPages,代码行数:17,代码来源:StaticPageGridCellProvider.inc.php


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