Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
SubmissionInfoCenterLinkAction.inc.php
1 <?php
2 
16 import('lib.pkp.classes.linkAction.LinkAction');
17 
19 
27  function SubmissionInfoCenterLinkAction($request, $submissionId, $linkKey = 'informationCenter.editorialHistory') {
28  // Instantiate the information center modal.
29 
30  $submissionDao = Application::getSubmissionDAO();
31  $submission = $submissionDao->getById($submissionId);
32 
33  $primaryAuthor = $submission->getPrimaryAuthor();
34  if (!isset($primaryAuthor)) {
35  $authors = $submission->getAuthors();
36  if (sizeof($authors) > 0) {
37  $primaryAuthor = $authors[0];
38  }
39  }
40 
41  $title = (isset($primaryAuthor)) ? implode(', ', array($primaryAuthor->getLastName(), $submission->getLocalizedTitle())) : $submission->getLocalizedTitle();
42 
43  $dispatcher = $request->getDispatcher();
44  import('lib.pkp.classes.linkAction.request.AjaxModal');
45  $ajaxModal = new AjaxModal(
46  $dispatcher->url(
47  $request, ROUTE_COMPONENT, null,
48  'informationCenter.SubmissionInformationCenterHandler',
49  'viewInformationCenter',
50  null,
51  array('submissionId' => $submissionId)
52  ),
53  $title,
54  'modal_information'
55  );
56 
57  // Configure the link action.
58  parent::LinkAction(
59  'editorialHistory', $ajaxModal,
60  __($linkKey), 'more_info'
61  );
62  }
63 }
64 
65 ?>
A modal that retrieves its content from via AJAX.
static getSubmissionDAO()
An action to open up the information center for a submission.
SubmissionInfoCenterLinkAction($request, $submissionId, $linkKey= 'informationCenter.editorialHistory')
Base class defining an action that can be performed by the user in the user interface.