/**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($subclass = false)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
     $templateMgr->assign('pageHierachy', array(array(Request::url(null, null, 'announcements'), 'announcement.announcements')));
 }
示例#2
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($subclass = false)
 {
     parent::setupTemplate();
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_ADMIN, LOCALE_COMPONENT_OJS_ADMIN, LOCALE_COMPONENT_OJS_MANAGER);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('pageHierarchy', $subclass ? array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'admin'), 'admin.siteAdmin')) : array(array(Request::url(null, 'user'), 'navigation.user')));
 }
 function setupTemplate()
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $pageHierarchy = array(array(Request::url(null, 'referral', 'index'), 'plugins.generic.referral.referrals'));
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($subclass = false)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     if ($subclass) {
         $templateMgr->assign('pageHierarchy', array(array(Request::url('admin'), 'admin.siteAdmin')));
     }
 }
示例#5
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($request, $subclass = false)
 {
     parent::setupTemplate($request);
     $this->validate();
     $templateMgr =& TemplateManager::getManager($request);
     if ($subclass) {
         $templateMgr->assign('pageHierarchy', array(array('about', 'navigation.about')));
     }
 }
示例#6
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($subclass = false)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $journal =& Request::getJournal();
     Locale::requireComponents(array(LOCALE_COMPONENT_OJS_MANAGER, LOCALE_COMPONENT_PKP_MANAGER));
     if (!$journal || !$journal->getSetting('restrictSiteAccess')) {
         $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
     }
     $templateMgr->assign('pageHierarchy', array(array(Request::url(null, 'about'), 'about.aboutTheJournal')));
 }
 function setupTemplate($subclass = true)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     AppLocale::requireComponents(array(LOCALE_COMPONENT_PKP_ADMIN, LOCALE_COMPONENT_PKP_MANAGER));
     $pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'admin'), 'admin.siteAdmin'));
     if ($subclass) {
         $pageHierarchy[] = array(Request::url(null, 'translate'), 'plugins.generic.translator.name');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
     $templateMgr->assign('helpTopicId', 'plugins.generic.TranslatorPlugin');
 }
 /**
  * Setup common template variables.
  * @param $archive object optional
  * @param $isSubclass boolean optional
  */
 function setupTemplate(&$archive, $isSubclass = null)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $hierarchy = array();
     if ($isSubclass) {
         $hierarchy[] = array(Request::url('browse'), 'navigation.browse');
     }
     if ($archive) {
         $hierarchy[] = array(Request::url('browse', 'index', $archive->getArchiveId()), $archive->getTitle(), true);
     }
     $templateMgr->assign('pageHierarchy', $hierarchy);
 }
示例#9
0
 /**
  * Setup variables for the template
  * @param $request Request
  */
 function setupTemplate($request)
 {
     parent::setupTemplate($request);
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_APP_EDITOR);
     $templateMgr = TemplateManager::getManager($request);
     $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
     $stageId = $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE);
     $galley = $this->getAuthorizedContextObject(ASSOC_TYPE_GALLEY);
     // Assign the authorized submission.
     $templateMgr->assign('submission', $submission);
     $templateMgr->assign('stageId', $stageId);
     $templateMgr->assign('galley', $galley);
 }
示例#10
0
 function sendEmailERCMembers($send = false)
 {
     parent::setupTemplate();
     Locale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_OJS_AUTHOR, LOCALE_COMPONENT_OJS_MANAGER));
     import('classes.mail.MailTemplate');
     $email = new MailTemplate();
     if (Request::getUserVar('send') && !$email->hasErrors()) {
         HookRegistry::call('SendEmailHandler::sendEmailERCMembers', array(&$send));
         $email->send();
         $user =& Request::getUser();
         Request::redirect(null, null, 'section', $user->getSecretaryCommitteeId());
     } else {
         $sender =& Request::getUser();
         $journal =& Request::getJournal();
         $ercReviewersDao =& DAORegistry::getDAO('ErcReviewersDAO');
         $sectionDao =& DAORegistry::getDAO('SectionDAO');
         $ercId = $sender->getSecretaryCommitteeId();
         //Get ERC Members
         $reviewers = $ercReviewersDao->getReviewersBySectionId($journal->getId(), $ercId);
         //Get already added recipients
         $recipients =& $email->getRecipients();
         if (isset($recipients)) {
             $totalRecipients = count($recipients);
         } else {
             $totalRecipients = 0;
         }
         foreach ($reviewers as $reviewer) {
             // Check if new recipient is not already added
             $isNotInTheList = true;
             if (isset($recipients)) {
                 foreach ($recipients as $recipient) {
                     if ($recipient['email'] == $reviewer->getEmail()) {
                         $isNotInTheList = false;
                     }
                 }
             }
             //Add new recipients according the committee
             if ($sender->getId() != $reviewer->getId() && $isNotInTheList == true) {
                 $email->addRecipient($reviewer->getEmail(), $reviewer->getFullName());
                 $totalRecipients++;
             }
         }
         $templateMgr =& TemplateManager::getManager();
         $pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'sectionEditor'), 'user.role.sectionEditor'), array(Request::url(null, 'sectionEditor', 'section', $ercId), 'section.section'));
         $templateMgr->assign('pageHierarchy', $pageHierarchy);
         $email->displayEditForm(Request::url(null, null, 'sendEmailERCMembers', 'send'), null, 'email/email.tpl', array('totalRecipients' => $totalRecipients));
     }
 }
示例#11
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate()
 {
     parent::setupTemplate();
     Locale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_OJS_AUTHOR, LOCALE_COMPONENT_OJS_MANAGER));
     $templateMgr =& TemplateManager::getManager();
     $isEditor = Validation::isEditor();
     if (Request::getRequestedPage() == 'editor') {
         $templateMgr->assign('helpTopicId', 'editorial.editorsRole');
     } else {
         $templateMgr->assign('helpTopicId', 'editorial.sectionEditorsRole');
     }
     $roleSymbolic = $isEditor ? 'editor' : 'sectionEditor';
     $roleKey = $isEditor ? 'user.role.coordinator' : 'user.role.sectionEditor';
     $pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'user'), $roleKey), array(Request::url(null, $roleSymbolic, 'submissionsReport'), 'editor.reports.reportGenerator'));
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
示例#12
0
 /**
  * Setup common template variables.
  * @param $record object optional
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate(&$record, $subclass = false)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $hierarchy = array();
     if ($subclass) {
         $hierarchy[] = array(Request::url('browse'), 'navigation.browse');
     }
     if ($record) {
         $archiveDao =& DAORegistry::getDAO('ArchiveDAO');
         $archive =& $archiveDao->getArchive($record->getArchiveId(), false);
         $hierarchy[] = array(Request::url('browse', 'index', $archive->getArchiveId()), $archive->getTitle(), true);
     }
     $templateMgr->assign('pageHierarchy', $hierarchy);
     $templateMgr->assign('theseArchiveIds', array($archive->getArchiveId()));
 }
示例#13
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($subclass = true)
 {
     parent::setupTemplate();
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
     AppLocale::requireComponents(array(LOCALE_COMPONENT_OCS_MANAGER, LOCALE_COMPONENT_PKP_MANAGER));
     $pageHierarchy = array();
     if ($conference) {
         $pageHierarchy[] = array(Request::url(null, 'index', 'index'), $conference->getConferenceTitle(), true);
     }
     if ($schedConf) {
         $pageHierarchy[] = array(Request::url(null, null, 'index'), $schedConf->getSchedConfTitle(), true);
     }
     if ($subclass) {
         $pageHierarchy[] = array(Request::url(null, null, 'about'), 'about.aboutTheConference');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
示例#14
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($request, $subclass = false)
 {
     parent::setupTemplate($request);
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_APP_MANAGER, LOCALE_COMPONENT_PKP_ADMIN);
     $templateMgr =& TemplateManager::getManager($request);
     $pageHierarchy = array();
     $conference =& $request->getConference();
     $schedConf =& $request->getSchedConf();
     if ($schedConf) {
         $pageHierarchy[] = array($request->url(null, null, 'index'), $schedConf->getLocalizedName(), true);
     } elseif ($conference) {
         $pageHierarchy[] = array($request->url(null, 'index', 'index'), $conference->getLocalizedName(), true);
     }
     if ($subclass) {
         $pageHierarchy[] = array($request->url(null, null, 'user'), 'navigation.user');
         $pageHierarchy[] = array($request->url(null, 'index', 'manager'), 'manager.conferenceSiteManagement');
     } else {
         $pageHierarchy[] = array($request->url(null, null, 'user'), 'navigation.user');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
示例#15
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($subclass = false, $meetingId = 0, $parentPage = null, $showSidebar = true)
 {
     parent::setupTemplate();
     Locale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_OJS_AUTHOR, LOCALE_COMPONENT_OJS_MANAGER));
     $templateMgr =& TemplateManager::getManager();
     $isEditor = Validation::isEditor();
     if (Request::getRequestedPage() == 'editor') {
         $templateMgr->assign('helpTopicId', 'editorial.editorsRole');
     } else {
         $templateMgr->assign('helpTopicId', 'editorial.sectionEditorsRole');
     }
     $roleSymbolic = $isEditor ? 'editor' : 'sectionEditor';
     $roleKey = $isEditor ? 'user.role.editor' : 'user.role.sectionEditor';
     $pageHierarchy = $subclass ? array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, $roleSymbolic), $roleKey), array(Request::url(null, $roleSymbolic, 'meetings'), 'editor.meetings')) : array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, $roleSymbolic), $roleKey));
     if ($meetingId != 0) {
         $meetingDao =& DAORegistry::getDAO('MeetingDAO');
         $meeting =& $meetingDao->getMeetingById($meetingId);
         $publicId = $meeting->getPublicId();
         $pageHierarchy[] = array(Request::url(null, 'sectionEditor', 'viewMeeting', $meetingId), "#{$publicId}", true);
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
 function setupTemplate($request)
 {
     AppLocale::requireComponents(LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION);
     $linkParams = $this->_getLinkParams();
     $templateMgr = TemplateManager::getManager($request);
     // Preselect tab from keywords 'notes', 'notify', 'history'
     switch ($request->getUserVar('tab')) {
         case 'history':
             $templateMgr->assign('selectedTabIndex', 2);
             break;
         case 'notify':
             $userId = (int) $request->getUserVar('userId');
             if ($userId) {
                 $linkParams['userId'] = $userId;
                 // user validated in Listbuilder.
             }
             $templateMgr->assign('selectedTabIndex', 1);
             break;
             // notes is default
         // notes is default
         default:
             $templateMgr->assign('selectedTabIndex', 0);
             break;
     }
     $templateMgr->assign('linkParams', $linkParams);
     parent::setupTemplate($request);
 }
示例#17
0
 function setupTemplate()
 {
     parent::setupTemplate();
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_READER, LOCALE_COMPONENT_OJS_EDITOR);
 }
示例#18
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  * @param $version object The current version, if applicable
  * @param $context object The current context, if applicable
  * @param $search object The current search, if applicable
  */
 function setupTemplate($subclass = false, $version = null, $context = null, $search = null)
 {
     parent::setupTemplate();
     Locale::requireComponents(array(LOCALE_COMPONENT_PKP_READER, LOCALE_COMPONENT_OCS_MANAGER));
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     $templateMgr =& TemplateManager::getManager();
     $pageHierarchy = array();
     if ($schedConf) {
         $pageHierarchy[] = array(Request::url(null, null, 'index'), $schedConf->getFullTitle(), true);
     } elseif ($conference) {
         $pageHierarchy[] = array(Request::url(null, 'index', 'index'), $conference->getConferenceTitle(), true);
     }
     $pageHierarchy[] = array(Request::url(null, null, 'user'), 'navigation.user');
     $pageHierarchy[] = array(Request::url(null, null, 'manager'), 'manager.conferenceSiteManagement');
     if ($subclass) {
         $pageHierarchy[] = array(Request::url(null, null, 'rtadmin'), 'rt.readingTools');
     }
     if ($version) {
         $pageHierarchy[] = array(Request::url(null, null, 'rtadmin', 'versions'), 'rt.versions');
         $pageHierarchy[] = array(Request::url(null, null, 'rtadmin', 'editVersion', $version->getVersionId()), $version->getTitle(), true);
         if ($context) {
             $pageHierarchy[] = array(Request::url(null, null, 'rtadmin', 'contexts', $version->getVersionId()), 'rt.contexts');
             $pageHierarchy[] = array(Request::url(null, null, 'rtadmin', 'editContext', array($version->getVersionId(), $context->getContextId())), $context->getAbbrev(), true);
             if ($search) {
                 $pageHierarchy[] = array(Request::url(null, null, 'rtadmin', 'searches', array($version->getVersionId(), $context->getContextId())), 'rt.searches');
                 $pageHierarchy[] = array(Request::url(null, null, 'rtadmin', 'editSearch', array($version->getVersionId(), $context->getContextId(), $search->getSearchId())), $search->getTitle(), true);
             }
         }
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
 /**
  * Handle incoming requests/notifications
  */
 function handle($args)
 {
     $templateMgr =& TemplateManager::getManager();
     $journal =& Request::getJournal();
     if (!$journal) {
         return parent::handle($args);
     }
     // Just in case we need to contact someone
     import('classes.mail.MailTemplate');
     $contactName = $journal->getSetting('contactName');
     $contactEmail = $journal->getSetting('contactEmail');
     $mail = new MailTemplate('PAYPAL_INVESTIGATE_PAYMENT');
     $mail->setFrom($contactEmail, $contactName);
     $mail->addRecipient($contactEmail, $contactName);
     $paymentStatus = Request::getUserVar('payment_status');
     switch (array_shift($args)) {
         case 'ipn':
             // Build a confirmation transaction.
             $req = 'cmd=_notify-validate';
             if (get_magic_quotes_gpc()) {
                 foreach ($_POST as $key => $value) {
                     $req .= '&' . urlencode(stripslashes($key)) . '=' . urlencode(stripslashes($value));
                 }
             } else {
                 foreach ($_POST as $key => $value) {
                     $req .= '&' . urlencode($key) . '=' . urlencode($value);
                 }
             }
             // Create POST response
             $ch = curl_init();
             curl_setopt($ch, CURLOPT_URL, $this->getSetting($journal->getId(), 'paypalurl'));
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
             curl_setopt($ch, CURLOPT_POST, 1);
             curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'Content-Length: ' . strlen($req)));
             curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
             $ret = curl_exec($ch);
             $curlError = curl_error($ch);
             curl_close($ch);
             // Check the confirmation response and handle as necessary.
             if (strcmp($ret, 'VERIFIED') == 0) {
                 switch ($paymentStatus) {
                     case 'Completed':
                         $payPalDao =& DAORegistry::getDAO('PayPalDAO');
                         $transactionId = Request::getUserVar('txn_id');
                         if ($payPalDao->transactionExists($transactionId)) {
                             // A duplicate transaction was received; notify someone.
                             $mail->assignParams(array('journalName' => $journal->getLocalizedTitle(), 'postInfo' => print_r($_POST, true), 'additionalInfo' => "Duplicate transaction ID: {$transactionId}", 'serverVars' => print_r($_SERVER, true)));
                             $mail->send();
                             exit;
                         } else {
                             // New transaction succeeded. Record it.
                             $payPalDao->insertTransaction($transactionId, Request::getUserVar('txn_type'), Request::getUserVar('payer_email'), Request::getUserVar('receiver_email'), Request::getUserVar('item_number'), Request::getUserVar('payment_date'), Request::getUserVar('payer_id'), Request::getUserVar('receiver_id'));
                             $queuedPaymentId = Request::getUserVar('custom');
                             import('classes.payment.ojs.OJSPaymentManager');
                             $ojsPaymentManager =& OJSPaymentManager::getManager();
                             // Verify the cost and user details as per PayPal spec.
                             $queuedPayment =& $ojsPaymentManager->getQueuedPayment($queuedPaymentId);
                             if (!$queuedPayment) {
                                 // The queued payment entry is missing. Complain.
                                 $mail->assignParams(array('journalName' => $journal->getLocalizedTitle(), 'postInfo' => print_r($_POST, true), 'additionalInfo' => "Missing queued payment ID: {$queuedPaymentId}", 'serverVars' => print_r($_SERVER, true)));
                                 $mail->send();
                                 exit;
                             }
                             //NB: if/when paypal subscriptions are enabled, these checks will have to be adjusted
                             // because subscription prices may change over time
                             if (($queuedAmount = $queuedPayment->getAmount()) != ($grantedAmount = Request::getUserVar('mc_gross')) && $queuedAmount > 0 || ($queuedCurrency = $queuedPayment->getCurrencyCode()) != ($grantedCurrency = Request::getUserVar('mc_currency')) || ($grantedEmail = Request::getUserVar('receiver_email')) != ($queuedEmail = $this->getSetting($journal->getId(), 'selleraccount'))) {
                                 // The integrity checks for the transaction failed. Complain.
                                 $mail->assignParams(array('journalName' => $journal->getLocalizedTitle(), 'postInfo' => print_r($_POST, true), 'additionalInfo' => "Granted amount: {$grantedAmount}\n" . "Queued amount: {$queuedAmount}\n" . "Granted currency: {$grantedCurrency}\n" . "Queued currency: {$queuedCurrency}\n" . "Granted to PayPal account: {$grantedEmail}\n" . "Configured PayPal account: {$queuedEmail}", 'serverVars' => print_r($_SERVER, true)));
                                 $mail->send();
                                 exit;
                             }
                             // Update queued amount if amount set by user (e.g. donation)
                             if ($queuedAmount == 0 && $grantedAmount > 0) {
                                 $queuedPaymentDao =& DAORegistry::getDAO('QueuedPaymentDAO');
                                 $queuedPayment->setAmount($grantedAmount);
                                 $queuedPayment->setCurrencyCode($grantedCurrency);
                                 $queuedPaymentDao->updateQueuedPayment($queuedPaymentId, $queuedPayment);
                             }
                             // Fulfill the queued payment.
                             if ($ojsPaymentManager->fulfillQueuedPayment($queuedPayment, $this->getName())) {
                                 exit;
                             }
                             // If we're still here, it means the payment couldn't be fulfilled.
                             $mail->assignParams(array('journalName' => $journal->getLocalizedTitle(), 'postInfo' => print_r($_POST, true), 'additionalInfo' => "Queued payment ID {$queuedPaymentId} could not be fulfilled.", 'serverVars' => print_r($_SERVER, true)));
                             $mail->send();
                         }
                         exit;
                     case 'Pending':
                         // Ignore.
                         exit;
                     default:
                         // An unhandled payment status was received; notify someone.
                         $mail->assignParams(array('journalName' => $journal->getLocalizedTitle(), 'postInfo' => print_r($_POST, true), 'additionalInfo' => "Payment status: {$paymentStatus}", 'serverVars' => print_r($_SERVER, true)));
                         $mail->send();
                         exit;
                 }
             } else {
                 // An unknown confirmation response was received; notify someone.
                 $mail->assignParams(array('journalName' => $journal->getLocalizedTitle(), 'postInfo' => print_r($_POST, true), 'additionalInfo' => "Confirmation return: {$ret}\nCURL error: {$curlError}", 'serverVars' => print_r($_SERVER, true)));
                 $mail->send();
                 exit;
             }
             break;
         case 'cancel':
             Handler::setupTemplate();
             $templateMgr->assign(array('currentUrl' => Request::url(null, 'index'), 'pageTitle' => 'plugins.paymethod.paypal.purchase.cancelled.title', 'message' => 'plugins.paymethod.paypal.purchase.cancelled', 'backLink' => Request::getUserVar('ojsReturnUrl'), 'backLinkLabel' => 'common.continue'));
             $templateMgr->display('common/message.tpl');
             exit;
             break;
     }
     parent::handle($args);
     // Don't know what to do with it
 }
 /**
  * Setup common template variables.
  */
 function setupTemplate($request)
 {
     parent::setupTemplate($request);
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_PKP_GRID, LOCALE_COMPONENT_PKP_REVIEWER);
 }
 /**
  * @see PKPHandler::setupTemplate()
  */
 function setupTemplate($request)
 {
     parent::setupTemplate($request);
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_APP_MANAGER, LOCALE_COMPONENT_APP_SUBMISSION);
 }
示例#22
0
 function setupTemplate(&$plugin, $subclass = true)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->register_function('plugin_url', array($plugin, 'smartyPluginUrl'));
     $pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'manager'), 'user.role.manager'));
     if ($subclass) {
         $path = array($plugin->getCategory(), $plugin->getName(), 'index');
         $pageHierarchy[] = array(Request::url(null, null, null, $path), 'plugins.generic.customLocale.name');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
     $templateMgr->assign('helpTopicId', 'plugins.generic.CustomLocalePlugin');
 }
示例#23
0
 /**
  * Setup common template variables.
  * @param $request Request
  */
 function setupTemplate($request)
 {
     parent::setupTemplate($request);
     AppLocale::requireComponents(LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION);
     // Get steps information.
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign('steps', $this->_getStepsNumberAndLocaleKeys());
 }
示例#24
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($subclass = false, $paperId = 0, $parentPage = null)
 {
     parent::setupTemplate();
     AppLocale::requireComponents(array(LOCALE_COMPONENT_OCS_AUTHOR, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_OCS_DIRECTOR, LOCALE_COMPONENT_OCS_MANAGER));
     $templateMgr =& TemplateManager::getManager();
     $pageHierarchy = $subclass ? array(array(Request::url(null, null, 'user'), 'navigation.user'), array(Request::url(null, null, 'author'), 'user.role.author'), array(Request::url(null, null, 'author'), 'paper.submissions')) : array(array(Request::url(null, null, 'user'), 'navigation.user'), array(Request::url(null, null, 'author'), 'user.role.author'));
     import('submission.trackDirector.TrackDirectorAction');
     $submissionCrumb = TrackDirectorAction::submissionBreadcrumb($paperId, $parentPage, 'author');
     if (isset($submissionCrumb)) {
         $pageHierarchy = array_merge($pageHierarchy, $submissionCrumb);
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
     // ----------------------
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $user = Request::getUser();
     $isConferenceManager = false;
     $isDirector = false;
     $isTrackDirector = false;
     $isAuthor = false;
     if (isset($user)) {
         $roles =& $roleDao->getRolesByUserId($user->getId(), $conference->getId(), $schedConf->getId());
         foreach ($roles as $role) {
             $roleId = $role->_data['roleId'];
             //echo $roleId . "|";
             if (intval($roleId) === 4096) {
                 $isConferenceManager = true;
             } else {
                 if (intval($roleId) === 256) {
                     $isDirector = true;
                 } else {
                     if (intval($roleId) === 128) {
                         $isTrackDirector = true;
                     } else {
                         if (intval($roleId) === 64) {
                             $isAuthor = true;
                         }
                     }
                 }
             }
         }
     }
     //$roles =& $roleDao->getRolesByUserId($user->getId(), $conference->getId());
     //print_r($roles);
     $templateMgr->assign('isConferenceManager', $isConferenceManager);
     $templateMgr->assign('$isDirector', $isDirector);
     $templateMgr->assign('$isTrackDirector', $isTrackDirector);
     $templateMgr->assign('$isAuthor', $isAuthor);
     // -------------------------
     $templateMgr->assign("conferenceUrl", Request::url(null, 'index'));
     $templateMgr->assign("schedConfUrl", Request::url(null, $conference->getSetting('path')));
     $templateMgr->assign("conferenceId", $conference->getId());
     $templateMgr->assign("schedConfId", $schedConf->getId());
     // -------------------------
 }
示例#25
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($subclass = false)
 {
     parent::setupTemplate();
     AppLocale::requireComponents(array(LOCALE_COMPONENT_OCS_AUTHOR, LOCALE_COMPONENT_OCS_DIRECTOR, LOCALE_COMPONENT_OCS_MANAGER));
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     $templateMgr =& TemplateManager::getManager();
     $pageHierarchy = array();
     if ($schedConf) {
         $pageHierarchy[] = array(Request::url(null, null, 'index'), $schedConf->getFullTitle(), true);
         //$pageHierarchy[] = array(Request::url(null, null, 'index'), AppLocale::Translate('navigation.home'), true);
     } elseif ($conference) {
         $pageHierarchy[] = array(Request::url(null, 'index', 'index'), $conference->getConferenceTitle(), true);
         //$pageHierarchy[] = array(Request::url(null, 'index', 'index'), AppLocale::Translate('navigation.home'), true);
     }
     if ($subclass) {
         $pageHierarchy[] = array(Request::url(null, null, 'user'), 'navigation.user');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
示例#26
0
 /**
  * Setup common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  */
 function setupTemplate($subclass = false)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('pageHierachy', array(array(Request::url(null, 'theses'), 'plugins.generic.thesis.theses')));
 }
示例#27
0
 /**
  * Setup common template variables.
  * @param $request PKPRequest
  * @param $subclass boolean set to true if caller is below this handler in the hierarchy
  * @param $op string Current operation (for breadcrumb construction)
  */
 function setupTemplate($request, $subclass = false, $op = 'index')
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('helpTopicId', 'user.searchAndBrowse');
     $opMap = array('index' => 'navigation.search', 'categories' => 'navigation.categories');
     $templateMgr->assign('pageHierarchy', $subclass ? array(array($request->url(null, 'search', $op), $opMap[$op])) : array());
     $journal =& $request->getJournal();
     if (!$journal || !$journal->getSetting('restrictSiteAccess')) {
         $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
     }
 }
示例#28
0
 /**
  * Set up common template variables.
  * @param $subclass boolean set to true if caller is below this handler in the heirarchy
  */
 function setupTemplate($subclass = false)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'));
     if ($subclass) {
         $pageHierarchy[] = array(Request::url(null, 'counter'), 'plugins.generic.counter');
     }
     $templateMgr->assign_by_ref('pageHierarchy', $pageHierarchy);
 }
示例#29
0
 /**
  * Given a scheduled conference, set up the template with all the
  * required variables for schedConf/view.tpl to function properly.
  * @param $schedConf object The scheduled conference to display
  * 	the cover page will be displayed. Otherwise table of contents
  * 	will be displayed.
  */
 function setupTemplate(&$conference, &$schedConf)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     AppLocale::requireComponents(array(LOCALE_COMPONENT_OCS_MANAGER));
     // Ensure the user is entitled to view the scheduled conference...
     if (isset($schedConf) && ($conference->getEnabled() || (Validation::isDirector($conference->getId()) || Validation::isConferenceManager($conference->getId())))) {
         // Assign header and content for home page
         $templateMgr->assign('displayPageHeaderTitle', $conference->getPageHeaderTitle(true));
         $templateMgr->assign('displayPageHeaderLogo', $conference->getPageHeaderLogo(true));
         $templateMgr->assign('displayPageHeaderTitleAltText', $conference->getLocalizedSetting('homeHeaderTitleImageAltText'));
         $templateMgr->assign('displayPageHeaderLogoAltText', $conference->getLocalizedSetting('homeHeaderLogoImageAltText'));
         $templateMgr->assign_by_ref('schedConf', $schedConf);
         $templateMgr->assign('additionalHomeContent', $conference->getLocalizedSetting('additionalHomeContent'));
     } else {
         Request::redirect(null, 'index');
     }
     if ($styleFileName = $schedConf->getStyleFileName()) {
         import('file.PublicFileManager');
         $publicFileManager = new PublicFileManager();
         $templateMgr->addStyleSheet(Request::getBaseUrl() . '/' . $publicFileManager->getConferenceFilesPath($conference->getId()) . '/' . $styleFileName);
     }
     $this->checkRole($conference, $schedConf);
     $templateMgr->assign("conferenceUrl", Request::url(null, 'index'));
     $templateMgr->assign("conferenceId", $conference->getId());
     $templateMgr->assign("schedConfId", $schedConf->getId());
     $templateMgr->assign("schedConfUrl", Request::url(null, $conference->getSetting('path')));
     $templateMgr->assign("conferencePath", $conference->getSetting('path'));
 }
 /**
  * @copydoc PKPHandler::setupTemplate()
  */
 function setupTemplate($request)
 {
     parent::setupTemplate($request);
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign('userRoles', $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES));
 }