/** * @copydoc GridHandler::getRowDataElement */ protected function getRowDataElement($request, &$rowId) { // fallback on the parent if a rowId is found if (!empty($rowId)) { return parent::getRowDataElement($request, $rowId); } // Otherwise return from the newRowId // FIXME: Validate user ID? $newRowId = $this->getNewRowId($request); $userId = (int) $newRowId['name']; $userDao = DAORegistry::getDAO('UserDAO'); return $userDao->getById($userId); }
/** * @copydoc GridHandler::getRowDataElement */ protected function getRowDataElement($request, &$rowId) { // fallback on the parent if a rowId is found if (!empty($rowId)) { return parent::getRowDataElement($request, $rowId); } // Otherwise return from the $newRowId $rowData = $this->getNewRowId($request); $categoryDao = DAORegistry::getDAO('CategoryDAO'); $category = $categoryDao->getEntryDao()->newDataObject(); $category->setName($rowData['name'], null); // Localized return $category; }
/** * @copydoc GridHandler::getRowDataElement */ protected function getRowDataElement($request, &$rowId) { // fallback on the parent if a rowId is found if (!empty($rowId)) { return parent::getRowDataElement($request, $rowId); } // Otherwise return from the $newRowId $newRowId = $this->getNewRowId($request); $userGroupId = $newRowId['name']; $userGroupDao = DAORegistry::getDAO('UserGroupDAO'); $context = $this->getContext(); return $userGroupDao->getById($userGroupId, $context->getId()); }
/** * @copydoc GridHandler::getRowDataElement */ function getRowDataElement($request, &$rowId) { // fallback on the parent if a rowId is found if (!empty($rowId)) { return parent::getRowDataElement($request, $rowId); } $id = 0; // Otherwise return from the newRowId $authorId = $this->getNewRowId($request); // this is an array: Example: $authorId['name'] => 25 if (isset($authorId['name'])) { $id = (int) $authorId['name']; } $authorDao = DAORegistry::getDAO('AuthorDAO'); $monograph = $this->getMonograph(); return $authorDao->getById($id, $monograph->getId()); }
/** * @copydoc GridHandler::getRowDataElement() */ protected function getRowDataElement($request, &$rowId) { // fallback on the parent if a rowId is found if (!empty($rowId)) { return parent::getRowDataElement($request, $rowId); } // Otherwise return from the newRowId $newRowId = $this->getNewRowId($request); $fileId = (int) $newRowId['name']; $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION); $submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO'); /* @var $submissionFileDao SubmissionFileDAO */ import('lib.pkp.classes.submission.SubmissionFile'); // Bring in const $submissionFiles = $submissionFileDao->getLatestRevisions($submission->getId(), $this->getFileStage()); foreach ($submissionFiles as $submissionFile) { if ($submissionFile->getFileId() == $fileId) { return $submissionFile; } } return null; }
/** * @copydoc GridHandler::getRowDataElement */ function getRowDataElement($request, &$rowId) { // fallback on the parent if a rowId is found if (!empty($rowId)) { return parent::getRowDataElement($request, $rowId); } // Otherwise return from the $newRowId $newRowId = $this->getNewRowId($request); $categoryId = $newRowId['name']; $categoryDao = DAORegistry::getDAO('CategoryDAO'); $press = $request->getPress(); $category = $categoryDao->getById($categoryId, $press->getId()); return $category; }
/** * @copydoc GridHandler::getRowDataElement */ function getRowDataElement($request, &$rowId) { // fallback on the parent if a rowId is found if (!empty($rowId)) { return parent::getRowDataElement($request, $rowId); } // A new row is being bounced back to the user. // Supply a new ID from the specified key. $newRowId = $request->getUserVar('newRowId'); $rowId = $newRowId['key']; // Send the value specified back to the user for formatting. return $newRowId['value']; }