getAll(true); while ($thisJournal = $journals->next()) { if ($thisJournal->getSetting('publishingMode') == PUBLISHING_MODE_SUBSCRIPTION && $thisJournal->getSetting('enableOpenAccessNotification')) { $templateMgr->assign('displayOpenAccessNotification', true); } } parent::display($request); } /** * Save profile settings. */ function execute($request) { $user = $request->getUser(); $journalDao = DAORegistry::getDAO('JournalDAO'); $openAccessNotify = $request->getUserVar('openAccessNotify'); $userSettingsDao = DAORegistry::getDAO('UserSettingsDAO'); $journals = $journalDao->getAll(true); while ($thisJournal = $journals->next()) { if ($thisJournal->getSetting('publishingMode') == PUBLISHING_MODE_SUBSCRIPTION && $thisJournal->getSetting('enableOpenAccessNotification')) { $currentlyReceives = $user->getSetting('openAccessNotification', $thisJournal->getId()); $shouldReceive = !empty($openAccessNotify) && in_array($thisJournal->getId(), $openAccessNotify); if ($currentlyReceives != $shouldReceive) { $userSettingsDao->updateSetting($user->getId(), 'openAccessNotification', $shouldReceive, 'bool', $thisJournal->getId()); } } } parent::execute($request); } } ?>