/** * Return string containing the contents of the HTML file. * This function performs any necessary filtering, like image URL replacement. * @param $baseImageUrl string base URL for image references * @return string */ function getHTMLContents() { import('file.ArticleFileManager'); $fileManager =& new ArticleFileManager($this->getArticleId()); $contents = $fileManager->readFile($this->getFileId()); $journal =& Request::getJournal(); // Replace media file references $images =& $this->getImageFiles(); foreach ($images as $image) { $imageUrl = Request::url(null, 'article', 'viewFile', array($this->getArticleId(), $this->getBestGalleyId($journal), $image->getFileId())); $pattern = preg_quote(rawurlencode($image->getOriginalFileName())); $contents = preg_replace('/([Ss][Rr][Cc]|[Hh][Rr][Ee][Ff]|[Dd][Aa][Tt][Aa])\\s*=\\s*"([^"]*' . $pattern . ')"/', '\\1="' . $imageUrl . '"', $contents); // Replacement for Flowplayer $contents = preg_replace('/[Uu][Rr][Ll]\\s*\\:\\s*\'(' . $pattern . ')\'/', 'url:\'' . $imageUrl . '\'', $contents); // Replacement for other players (ested with odeo; yahoo and google player won't work w/ OJS URLs, might work for others) $contents = preg_replace('/[Uu][Rr][Ll]=([^"]*' . $pattern . ')/', 'url=' . $imageUrl, $contents); } // Perform replacement for ojs://... URLs $contents = String::regexp_replace_callback('/(<[^<>]*")[Oo][Jj][Ss]:\\/\\/([^"]+)("[^<>]*>)/', array(&$this, '_handleOjsUrl'), $contents); // Perform variable replacement for journal, issue, site info $issueDao =& DAORegistry::getDAO('IssueDAO'); $issue =& $issueDao->getIssueByArticleId($this->getArticleId()); $journal =& Request::getJournal(); $site =& Request::getSite(); $paramArray = array('issueTitle' => $issue ? $issue->getIssueIdentification() : Locale::translate('editor.article.scheduleForPublication.toBeAssigned'), 'journalTitle' => $journal->getJournalTitle(), 'siteTitle' => $site->getSiteTitle(), 'currentUrl' => Request::getRequestUrl()); foreach ($paramArray as $key => $value) { $contents = str_replace('{$' . $key . '}', $value, $contents); } return $contents; }
/** * @see OAI#OAI */ function ArchiveOAI($config) { parent::OAI($config); $this->site =& Request::getSite(); $this->dao = DAORegistry::getDAO('OAIDAO'); $this->dao->setOAI($this); }
/** * Display about index page. */ function index() { $this->validate(); $this->setupTemplate(); $templateMgr =& TemplateManager::getManager(); $pressDao =& DAORegistry::getDAO('PressDAO'); $pressPath = Request::getRequestedPressPath(); if ($pressPath != 'index' && $pressDao->pressExistsByPath($pressPath)) { $press =& Request::getPress(); $pressSettingsDao =& DAORegistry::getDAO('PressSettingsDAO'); $templateMgr->assign_by_ref('pressSettings', $pressSettingsDao->getPressSettings($press->getId())); $customAboutItems =& $pressSettingsDao->getSetting($press->getId(), 'customAboutItems'); if (isset($customAboutItems[Locale::getLocale()])) { $templateMgr->assign('customAboutItems', $customAboutItems[Locale::getLocale()]); } elseif (isset($customAboutItems[Locale::getPrimaryLocale()])) { $templateMgr->assign('customAboutItems', $customAboutItems[Locale::getPrimaryLocale()]); } $groupDao =& DAORegistry::getDAO('GroupDAO'); $groups =& $groupDao->getGroups(ASSOC_TYPE_PRESS, GROUP_CONTEXT_PEOPLE); $seriesDao =& DAORegistry::getDAO('SeriesDAO'); $series =& $seriesDao->getByPressId($press->getId()); $templateMgr->assign('seriesCount', $series->GetCount()); $templateMgr->assign_by_ref('peopleGroups', $groups); $templateMgr->assign('helpTopicId', 'user.about'); $templateMgr->display('about/index.tpl'); } else { $site =& Request::getSite(); $about = $site->getLocalizedAbout(); $templateMgr->assign('about', $about); $presses =& $pressDao->getEnabledPresses(); //Enabled Added $templateMgr->assign_by_ref('presses', $presses); $templateMgr->display('about/site.tpl'); } }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); $site =& Request::getSite(); $templateMgr->assign('minPasswordLength', $site->getMinPasswordLength()); parent::display(); }
/** * Constructor. */ function UserForm($userId = null) { parent::Form('controllers/grid/users/user/form/userForm.tpl'); $this->userId = isset($userId) ? (int) $userId : null; $site =& Request::getSite(); // Validation checks for this form if ($userId == null) { $this->addCheck(new FormValidator($this, 'username', 'required', 'user.profile.form.usernameRequired')); $this->addCheck(new FormValidatorCustom($this, 'username', 'required', 'user.register.form.usernameExists', array(DAORegistry::getDAO('UserDAO'), 'userExistsByUsername'), array($this->userId, true), true)); $this->addCheck(new FormValidatorAlphaNum($this, 'username', 'required', 'user.register.form.usernameAlphaNumeric')); if (!Config::getVar('security', 'implicit_auth')) { $this->addCheck(new FormValidator($this, 'password', 'required', 'user.profile.form.passwordRequired')); $this->addCheck(new FormValidatorLength($this, 'password', 'required', 'user.register.form.passwordLengthTooShort', '>=', $site->getMinPasswordLength())); $this->addCheck(new FormValidatorCustom($this, 'password', 'required', 'user.register.form.passwordsDoNotMatch', create_function('$password,$form', 'return $password == $form->getData(\'password2\');'), array(&$this))); } } else { $this->addCheck(new FormValidatorLength($this, 'password', 'optional', 'user.register.form.passwordLengthTooShort', '>=', $site->getMinPasswordLength())); $this->addCheck(new FormValidatorCustom($this, 'password', 'optional', 'user.register.form.passwordsDoNotMatch', create_function('$password,$form', 'return $password == $form->getData(\'password2\');'), array(&$this))); } $this->addCheck(new FormValidator($this, 'firstName', 'required', 'user.profile.form.firstNameRequired')); $this->addCheck(new FormValidator($this, 'lastName', 'required', 'user.profile.form.lastNameRequired')); $this->addCheck(new FormValidatorUrl($this, 'userUrl', 'optional', 'user.profile.form.urlInvalid')); $this->addCheck(new FormValidatorEmail($this, 'email', 'required', 'user.profile.form.emailRequired')); $this->addCheck(new FormValidatorCustom($this, 'email', 'required', 'user.register.form.emailExists', array(DAORegistry::getDAO('UserDAO'), 'userExistsByEmail'), array($this->userId, true), true)); $this->addCheck(new FormValidatorPost($this)); }
/** * Assigns values to e-mail parameters. * @param $paramArray array * @return void */ function assignParams($paramArray = array()) { // Add commonly-used variables to the list $site =& Request::getSite(); $paramArray['principalContactSignature'] = $site->getLocalizedSetting('contactName'); return parent::assignParams($paramArray); }
/** * Become a given role. */ function become($args) { parent::validate(true, true); $user =& Request::getUser(); if (!$user) { Request::redirect(null, null, 'index'); } switch (array_shift($args)) { case 'submitter': $roleId = ROLE_ID_SUBMITTER; $setting = 'enableSubmit'; $deniedKey = 'user.noRoles.enableSubmitClosed'; break; default: Request::redirect('index'); } $site =& Request::getSite(); if ($site->getSetting($setting)) { $role = new Role(); $role->setRoleId($roleId); $role->setUserId($user->getId()); $roleDao =& DAORegistry::getDAO('RoleDAO'); $roleDao->insertRole($role); Request::redirectUrl(Request::getUserVar('source')); } else { $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('message', $deniedKey); return $templateMgr->display('common/message.tpl'); } }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); $user =& Request::getUser(); $schedConf =& Request::getSchedConf(); $site =& Request::getSite(); $registrationOptionDao =& DAORegistry::getDAO('RegistrationOptionDAO'); $registrationOptions =& $registrationOptionDao->getRegistrationOptionsBySchedConfId($schedConf->getId()); $templateMgr->assign_by_ref('registrationOptions', $registrationOptions); $templateMgr->assign('registrationTypeId', $this->typeId); $templateMgr->assign('userLoggedIn', $user ? true : false); $templateMgr->assign('requestUri', $_SERVER['REQUEST_URI']); if ($user) { $templateMgr->assign('userFullName', $user->getFullName()); } if ($this->captchaEnabled) { import('captcha.CaptchaManager'); $captchaManager = new CaptchaManager(); $captcha =& $captchaManager->createCaptcha(); if ($captcha) { $templateMgr->assign('captchaEnabled', $this->captchaEnabled); $this->setData('captchaId', $captcha->getId()); } } $countryDao =& DAORegistry::getDAO('CountryDAO'); $countries =& $countryDao->getCountries(); $templateMgr->assign_by_ref('countries', $countries); $registrationTypeDao =& DAORegistry::getDAO('RegistrationTypeDAO'); $registrationOptionCosts = $registrationTypeDao->getRegistrationOptionCosts($this->typeId); $templateMgr->assign('registrationOptionCosts', $registrationOptionCosts); $registrationType =& $registrationTypeDao->getRegistrationType($this->typeId); $templateMgr->assign_by_ref('registrationType', $registrationType); if (is_object($registrationType)) { if ($registrationType->getCost() > 0) { $templateMgr->assign('message', 'schedConf.registration.alreadyRegisteredAndPaid'); } else { $templateMgr->assign('message', 'schedConf.registration.alreadyRegisteredNoPaid'); } $applicationFormDefault = $registrationType->getLocalizedData("applicationForm"); $templateMgr->assign('applicationFormDefault', $applicationFormDefault); $applicationForm = $applicationFormDefault; $templateMgr->assign('surveyConfig', $registrationType->getLocalizedData("survey")); } $registrationDao =& DAORegistry::getDAO('RegistrationDAO'); if ($user && ($registrationId = $registrationDao->getRegistrationIdByUser($user->getId(), $schedConf->getId()))) { $templateMgr->assign('isRegistered', true); $registration =& $registrationDao->getRegistration($registrationId); $templateMgr->assign('specialRequests', $registration->getSpecialRequests()); $applicationForm = $registration->getData("applicationForm"); if (is_null($registration->getData("applicationForm"))) { $applicationForm = $applicationFormDefault; } $templateMgr->assign('survey', $registration->getData("survey")); } $templateMgr->assign('applicationForm', $applicationForm); $templateMgr->assign('minPasswordLength', $site->getMinPasswordLength()); $templateMgr->assign_by_ref('user', $user); parent::display(); }
/** * Display contact page. */ function contact() { $this->validate(); $this->setupTemplate(true); $site =& Request::getSite(); $templateMgr =& TemplateManager::getManager(); $templateMgr->display('about/contact.tpl'); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); $site =& Request::getSite(); $templateMgr->assign('availableLocales', $site->getSupportedLocaleNames()); $templateMgr->assign('helpTopicId', 'journal.managementPages.languages'); parent::display(); }
/** * Constructor. */ function MeetingAttendanceReportForm(&$request) { parent::Form('sectionEditor/reports/meetingAttendance.tpl'); $site =& Request::getSite(); $user =& Request::getUser(); // Validation checks for this form $this->addCheck(new FormValidatorPost($this)); $this->addCheck(new FormValidator($this, 'ercMembers', 'required', 'editor.reports.ercMemberRequired')); }
/** * @copydoc OAI::OAI() */ function JournalOAI($config) { parent::OAI($config); $this->site = Request::getSite(); $this->journal = Request::getJournal(); $this->journalId = isset($this->journal) ? $this->journal->getId() : null; $this->dao = DAORegistry::getDAO('OAIDAO'); $this->dao->setOAI($this); }
/** * @see OAI#OAI */ function ConferenceOAI($config) { parent::OAI($config); $this->site =& Request::getSite(); $this->conference =& Request::getConference(); $this->conferenceId = isset($this->conference) ? $this->conference->getId() : null; $this->dao =& DAORegistry::getDAO('OAIDAO'); $this->dao->setOAI($this); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); $site =& Request::getSite(); if ($this->_confirmHash) { $templateMgr->assign('confirmHash', $this->_confirmHash); } $templateMgr->assign('minPasswordLength', $site->getMinPasswordLength()); parent::display(); }
/** * If no journal is selected, display list of journals. * Otherwise, display the index page for the selected journal. * @param $args array * @param $request Request */ function index($args, &$request) { $this->validate(); $this->setupTemplate(); $router =& $request->getRouter(); $templateMgr =& TemplateManager::getManager(); $journalDao =& DAORegistry::getDAO('JournalDAO'); $journalPath = $router->getRequestedContextPath($request); $templateMgr->assign('helpTopicId', 'user.home'); $journal =& $router->getContext($request); if ($journal) { // Assign header and content for home page $templateMgr->assign('displayPageHeaderTitle', $journal->getLocalizedPageHeaderTitle(true)); $templateMgr->assign('displayPageHeaderLogo', $journal->getLocalizedPageHeaderLogo(true)); $templateMgr->assign('displayPageHeaderTitleAltText', $journal->getLocalizedSetting('homeHeaderTitleImageAltText')); $templateMgr->assign('displayPageHeaderLogoAltText', $journal->getLocalizedSetting('homeHeaderLogoImageAltText')); $templateMgr->assign('additionalHomeContent', $journal->getLocalizedSetting('additionalHomeContent')); $templateMgr->assign('homepageImage', $journal->getLocalizedSetting('homepageImage')); $templateMgr->assign('homepageImageAltText', $journal->getLocalizedSetting('homepageImageAltText')); $templateMgr->assign('journalDescription', $journal->getLocalizedSetting('description')); $displayCurrentIssue = $journal->getSetting('displayCurrentIssue'); $issueDao =& DAORegistry::getDAO('IssueDAO'); $issue =& $issueDao->getCurrentIssue($journal->getId(), true); if ($displayCurrentIssue && isset($issue)) { import('pages.issue.IssueHandler'); // The current issue TOC/cover page should be displayed below the custom home page. IssueHandler::setupIssueTemplate($issue); } // Display creative commons logo/licence if enabled $templateMgr->assign('displayCreativeCommons', $journal->getSetting('includeCreativeCommons')); $enableAnnouncements = $journal->getSetting('enableAnnouncements'); if ($enableAnnouncements) { $enableAnnouncementsHomepage = $journal->getSetting('enableAnnouncementsHomepage'); if ($enableAnnouncementsHomepage) { $numAnnouncementsHomepage = $journal->getSetting('numAnnouncementsHomepage'); $announcementDao =& DAORegistry::getDAO('AnnouncementDAO'); $announcements =& $announcementDao->getNumAnnouncementsNotExpiredByAssocId(ASSOC_TYPE_JOURNAL, $journal->getId(), $numAnnouncementsHomepage); $templateMgr->assign('announcements', $announcements); $templateMgr->assign('enableAnnouncementsHomepage', $enableAnnouncementsHomepage); } } $templateMgr->display('index/journal.tpl'); } else { $site =& Request::getSite(); if ($site->getRedirect() && ($journal = $journalDao->getJournal($site->getRedirect())) != null) { $request->redirect($journal->getPath()); } $templateMgr->assign('intro', $site->getLocalizedIntro()); $templateMgr->assign('journalFilesPath', $request->getBaseUrl() . '/' . Config::getVar('files', 'public_files_dir') . '/journals/'); $journals =& $journalDao->getEnabledJournals(); $templateMgr->assign_by_ref('journals', $journals); $templateMgr->setCacheability(CACHEABILITY_PUBLIC); $templateMgr->display('index/site.tpl'); } }
/** * Helper Function - set mail from address * @param MailTemplate $mail */ function _setMailFrom(&$mail) { $site =& Request::getSite(); $journal =& Request::getJournal(); // Set the sender based on the current context if ($journal && $journal->getSetting('supportEmail')) { $mail->setFrom($journal->getSetting('supportEmail'), $journal->getSetting('supportName')); } else { $mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName()); } }
/** * Display the form. */ function display() { import('file.PublicFileManager'); $site =& Request::getSite(); $schedConf =& Request::getSchedConf(); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('helpTopicId', 'conference.currentConferences.program'); $templateMgr->assign('publicSchedConfFilesDir', Request::getBaseUrl() . '/' . PublicFileManager::getSchedConfFilesPath($schedConf->getId())); $templateMgr->assign('programFile', $schedConf->getSetting('programFile')); parent::display(); }
/** * Display the form. */ function display() { import('classes.file.PublicFileManager'); $publicFileManager = new PublicFileManager(); $schedConf =& Request::getSchedConf(); $templateMgr =& TemplateManager::getManager(); $site =& Request::getSite(); $templateMgr->assign('helpTopicId', 'conference.currentConferences.accommodation'); $templateMgr->assign('publicSchedConfFilesDir', Request::getBaseUrl() . '/' . $publicFileManager->getSchedConfFilesPath($schedConf->getId())); $templateMgr->assign('accommodationFiles', $schedConf->getSetting('accommodationFiles')); parent::display(); }
/** * Constructor. */ function SetMeetingForm(&$request) { parent::Form('sectionEditor/meetings/setMeeting.tpl'); $site =& Request::getSite(); $user =& Request::getUser(); // Validation checks for this form $this->addCheck(new FormValidatorPost($this)); $this->addCheck(new FormValidator($this, 'meetingDate', 'required', 'editor.meeting.form.meetingDateRequired')); $this->addCheck(new FormValidator($this, 'meetingLength', 'required', 'editor.meeting.form.meetingLengthRequired')); $this->addCheck(new FormValidator($this, 'investigator', 'required', 'editor.meeting.form.meetingInvestigatorRequired')); $this->addCheck(new FormValidator($this, 'selectedSectionDecisions', 'required', 'editor.meeting.form.selectAtleastOneProposal')); }
/** * Helper Function - set mail from address * @param MailTemplate $mail */ function _setMailFrom(&$mail) { $site =& Request::getSite(); $conference =& Request::getConference(); $schedConf =& Request::getSchedConf(); // Set the sender to one of three different settings, based on context if ($schedConf && $schedConf->getSetting('supportEmail')) { $mail->setFrom($schedConf->getSetting('supportEmail'), $schedConf->getSetting('supportName')); } elseif ($conference && $conference->getSetting('contactEmail')) { $mail->setFrom($conference->getSetting('contactEmail'), $conference->getSetting('contactName')); } else { $mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName()); } }
/** * Save settings. */ function execute() { $plugin =& $this->plugin; $journalId = $this->journalId; $site =& Request::getSite(); $locales = $site->getSupportedLocales(); foreach ($locales as $index => $locale) { $plugin->updateSetting($journalId, 'cookiesAlertText' . $locale, $this->getData('cookiesAlertText' . $locale), 'string'); $plugin->updateSetting($journalId, 'cookiesAlertButton' . $locale, $this->getData('cookiesAlertButton' . $locale), 'string'); } $plugin->updateSetting($journalId, 'cookiesAlertStyleBd', $this->getData('cookiesAlertStyleBd'), 'string'); $plugin->updateSetting($journalId, 'cookiesAlertStyleBgwrapper', $this->getData('cookiesAlertStyleBgwrapper'), 'string'); $plugin->updateSetting($journalId, 'cookiesAlertStyleBgbutton', $this->getData('cookiesAlertStyleBgbutton'), 'string'); }
/** * Get the HTML contents for this block. */ function getContents(&$templateMgr) { $templateMgr->assign('isPostRequest', Request::isPost()); if (!defined('SESSION_DISABLE_INIT')) { $site =& Request::getSite(); $locales =& $site->getSupportedLocaleNames(); } else { $locales =& Locale::getAllLocales(); $templateMgr->assign('languageToggleNoUser', true); } if (isset($locales) && count($locales) > 1) { $templateMgr->assign('enableLanguageToggle', true); $templateMgr->assign('languageToggleLocales', $locales); } return parent::getContents($templateMgr); }
/** * Static function to send an email to a mailing list user regarding signup or a lost password * @param $email string * @param $password string the user's password * @param $template string The mail template to use */ function sendMailingListEmail($email, $password, $template) { import('mail.MailTemplate'); $conference = Request::getConference(); $site = Request::getSite(); $params = array('password' => $password, 'siteTitle' => $conference->getConferenceTitle(), 'unsubscribeLink' => Request::url(null, null, 'notification', 'unsubscribeMailList')); if ($template == 'NOTIFICATION_MAILLIST_WELCOME') { $keyHash = md5($password); $confirmLink = Request::url(null, null, 'notification', 'confirmMailListSubscription', array($keyHash, $email)); $params["confirmLink"] = $confirmLink; } $mail = new MailTemplate($template); $mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName()); $mail->assignParams($params); $mail->addRecipient($email); $mail->send(); }
/** * Save the selected choice of version. */ function selectVersion($args) { $this->validate(); $archiveId = (int) array_shift($args); $versionId = Request::getUserVar('versionId'); $archiveDao =& DAORegistry::getDAO('ArchiveDAO'); $archive =& $archiveDao->getArchive($archiveId, false); $rtDao =& DAORegistry::getDAO('RTDAO'); $version = $rtDao->getVersion($versionId, $archive ? $archive->getArchiveId() : null); if ($archive) { $archive->updateSetting('rtVersionId', $version ? $version->getVersionId() : null); } else { $site =& Request::getSite(); $site->updateSetting('rtVersionId', $version ? $version->getVersionId() : null); } Request::redirect('rtadmin', 'index', $archiveId); }
/** * Change the locale for the current user. * @param $args array first parameter is the new locale */ function setLocale($args) { $setLocale = isset($args[0]) ? $args[0] : null; $site =& Request::getSite(); if (Locale::isLocaleValid($setLocale) && in_array($setLocale, $site->getSupportedLocales())) { $session =& Request::getSession(); $session->setSessionVar('currentLocale', $setLocale); } if (isset($_SERVER['HTTP_REFERER'])) { Request::redirectUrl($_SERVER['HTTP_REFERER']); } $source = Request::getUserVar('source'); if (isset($source) && !empty($source)) { Request::redirectUrl(Request::getProtocol() . '://' . Request::getServerHost() . $source, false); } Request::redirect('index'); }
/** * Log the request. * This follows a convoluted execution path in order to obtain the * page title *after* the template has been displayed, even though * the hook is called before execution. */ function logRequest($hookName, $args) { $templateManager =& $args[0]; $template =& $args[1]; $site =& Request::getSite(); $journal =& Request::getJournal(); $session =& Request::getSession(); if (!$journal) { return false; } /* NOTE: Project COUNTER has a list of robots on their site unfortunately not in a very accessible format: http://www.projectcounter.org/r3/r3_K.doc */ if (Request::isBot()) { return false; } // TODO: consider the effect of LOCKSS on COUNTER recording switch ($template) { case 'article/article.tpl': case 'article/interstitial.tpl': case 'article/pdfInterstitial.tpl': // Log the request as an article view. $article = $templateManager->get_template_vars('article'); $galley = $templateManager->get_template_vars('galley'); // If no galley exists, this is an abstract // view -- don't include it. (FIXME?) if (!$galley) { return false; } $lastRequestGap = time() - $session->getSessionVar('lastRequest'); // if last request was less than 10 seconds ago then return without recording this view if ($lastRequestGap < 10) { return false; } // if last request was less than 30 seconds ago AND is PDF then return without recording this view if ($galley->isPdfGalley() && $lastRequestGap < 30) { return false; } $session->setSessionVar('lastRequest', time()); $counterReportDao =& DAORegistry::getDAO('CounterReportDAO'); $counterReportDao->incrementCount($article->getJournalId(), (int) strftime('%Y'), (int) strftime('%m'), $galley->isPdfGalley(), $galley->isHTMLGalley()); break; } return false; }
/** * Display add/edit page. */ function editArchive($args = array()) { $archiveId = null; if (is_array($args) && !empty($args)) { $archiveId = (int) array_shift($args); } $this->validate($archiveId); $this->setupTemplate(true); $site =& Request::getSite(); if (!$site->getSetting('enableSubmit')) { Request::redirect('index'); } import('admin.form.ArchiveForm'); $archiveForm = new ArchiveForm($archiveId); $archiveForm->initData(); $archiveForm->display(); }
/** * Display about index page. */ function index() { $this->validate(); $this->setupTemplate(false); $templateMgr =& TemplateManager::getManager(); $conferenceDao =& DAORegistry::getDAO('ConferenceDAO'); $schedConfDao =& DAORegistry::getDAO('SchedConfDAO'); $conferencePath = Request::getRequestedConferencePath(); if ($conferencePath != 'index' && $conferenceDao->conferenceExistsByPath($conferencePath)) { $schedConf =& Request::getSchedConf(); $conference =& Request::getConference(); if ($schedConf) { $templateMgr->assign('showAboutSchedConf', true); $settings = $schedConf->getSettings(); } else { $templateMgr->assign('showAboutSchedConf', false); $settings = $conference->getSettings(); $templateMgr->assign_by_ref('currentSchedConfs', $schedConfDao->getCurrentSchedConfs($conference->getId())); } $customAboutItems = $conference->getSetting('customAboutItems'); foreach (AboutHandler::getPublicStatisticsNames() as $name) { if (isset($settings[$name])) { $templateMgr->assign('publicStatisticsEnabled', true); break; } } if (isset($customAboutItems[AppLocale::getLocale()])) { $templateMgr->assign('customAboutItems', $customAboutItems[AppLocale::getLocale()]); } elseif (isset($customAboutItems[AppLocale::getPrimaryLocale()])) { $templateMgr->assign('customAboutItems', $customAboutItems[AppLocale::getPrimaryLocale()]); } $templateMgr->assign('helpTopicId', 'user.about'); $templateMgr->assign_by_ref('conferenceSettings', $settings); $templateMgr->display('about/index.tpl'); } else { $site =& Request::getSite(); $about = $site->getLocalizedAbout(); $templateMgr->assign('about', $about); $conferences =& $conferenceDao->getEnabledConferences(); //Enabled Added $templateMgr->assign_by_ref('conferences', $conferences); $templateMgr->display('about/site.tpl'); } }
/** * Display about index page. */ function index() { $this->validate(); $this->setupTemplate(); $templateMgr =& TemplateManager::getManager(); $journalDao =& DAORegistry::getDAO('JournalDAO'); $journalPath = Request::getRequestedJournalPath(); if ($journalPath != 'index' && $journalDao->journalExistsByPath($journalPath)) { $journal =& Request::getJournal(); $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO'); $templateMgr->assign_by_ref('journalSettings', $journalSettingsDao->getJournalSettings($journal->getId())); $customAboutItems =& $journalSettingsDao->getSetting($journal->getId(), 'customAboutItems'); if (isset($customAboutItems[AppLocale::getLocale()])) { $templateMgr->assign('customAboutItems', $customAboutItems[AppLocale::getLocale()]); } elseif (isset($customAboutItems[AppLocale::getPrimaryLocale()])) { $templateMgr->assign('customAboutItems', $customAboutItems[AppLocale::getPrimaryLocale()]); } foreach ($this->getPublicStatisticsNames() as $name) { if ($journal->getSetting($name)) { $templateMgr->assign('publicStatisticsEnabled', true); break; } } // Hide membership if the payment method is not configured import('classes.payment.ojs.OJSPaymentManager'); $paymentManager =& OJSPaymentManager::getManager(); $templateMgr->assign('paymentConfigured', $paymentManager->isConfigured()); $groupDao =& DAORegistry::getDAO('GroupDAO'); $groups =& $groupDao->getGroups(ASSOC_TYPE_JOURNAL, $journal->getId(), GROUP_CONTEXT_PEOPLE); $templateMgr->assign_by_ref('peopleGroups', $groups); $templateMgr->assign('helpTopicId', 'user.about'); $templateMgr->display('about/index.tpl'); } else { $site =& Request::getSite(); $about = $site->getLocalizedAbout(); $templateMgr->assign('about', $about); $journals =& $journalDao->getEnabledJournals(); //Enabled Added $templateMgr->assign_by_ref('journals', $journals); $templateMgr->display('about/site.tpl'); } }
/** * Validate and save changes to site settings. */ function saveSettings() { parent::validate(); parent::setupTemplate(true); $site =& Request::getSite(); import('admin.form.SiteSettingsForm'); $settingsForm =& new SiteSettingsForm(); $settingsForm->readInputData(); if (Request::getUserVar('uploadSiteStyleSheet')) { if (!$settingsForm->uploadSiteStyleSheet()) { $settingsForm->addError('siteStyleSheet', Locale::translate('admin.settings.siteStyleSheetInvalid')); } } elseif (Request::getUserVar('deleteSiteStyleSheet')) { $publicFileManager =& new PublicFileManager(); $publicFileManager->removeSiteFile($site->getSiteStyleFilename()); } elseif (Request::getUserVar('uploadPageHeaderTitleImage')) { if (!$settingsForm->uploadPageHeaderTitleImage($settingsForm->getFormLocale())) { $settingsForm->addError('pageHeaderTitleImage', Locale::translate('admin.settings.homeHeaderImageInvalid')); } } elseif (Request::getUserVar('deletePageHeaderTitleImage')) { $publicFileManager =& new PublicFileManager(); $setting = $site->getData('pageHeaderTitleImage'); $formLocale = $settingsForm->getFormLocale(); if (isset($setting[$formLocale])) { $publicFileManager->removeSiteFile($setting[$formLocale]['uploadName']); unset($setting[$formLocale]); $site->setData('pageHeaderTitleImage', $setting); $siteSettingsDao =& DAORegistry::getDAO('SiteSettingsDAO'); $siteSettingsDao->deleteSetting('pageHeaderTitleImage', $formLocale); // Refresh site header $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('displayPageHeaderTitle', $site->getSitePageHeaderTitle()); } } elseif ($settingsForm->validate()) { $settingsForm->execute(); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign(array('currentUrl' => Request::url(null, null, 'settings'), 'pageTitle' => 'admin.siteSettings', 'message' => 'common.changesSaved', 'backLink' => Request::url(null, Request::getRequestedPage()), 'backLinkLabel' => 'admin.siteAdmin')); $templateMgr->display('common/message.tpl'); exit; } $settingsForm->display(); }