本文整理汇总了PHP中String::html2text方法的典型用法代码示例。如果您正苦于以下问题:PHP String::html2text方法的具体用法?PHP String::html2text怎么用?PHP String::html2text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类String
的用法示例。
在下文中一共展示了String::html2text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toXml
/**
* @see OAIMetadataFormat#toXml
*/
function toXml(&$record, $format = null)
{
$article = $record->getData('article');
$journal = $record->getData('journal');
$templateMgr = TemplateManager::getManager();
$templateMgr->assign(array('journal' => $journal, 'article' => $article, 'issue' => $record->getData('issue'), 'section' => $record->getData('section')));
$subjects = array_merge_recursive($this->stripAssocArray((array) $article->getDiscipline(null)), $this->stripAssocArray((array) $article->getSubject(null)), $this->stripAssocArray((array) $article->getSubjectClass(null)));
$templateMgr->assign(array('subject' => isset($subjects[$journal->getPrimaryLocale()]) ? $subjects[$journal->getPrimaryLocale()] : '', 'abstract' => String::html2text($article->getAbstract($article->getLocale())), 'language' => AppLocale::get3LetterIsoFromLocale($article->getLocale())));
return $templateMgr->fetch(dirname(__FILE__) . '/record.tpl');
}
示例2: assignParams
function assignParams($paramArray = array())
{
$submission = $this->submission;
$application = PKPApplication::getApplication();
$request = $application->getRequest();
$paramArray['submissionTitle'] = strip_tags($submission->getLocalizedTitle());
$paramArray['submissionId'] = $submission->getId();
$paramArray['submissionAbstract'] = String::html2text($submission->getLocalizedAbstract());
$paramArray['authorString'] = strip_tags($submission->getAuthorString());
parent::assignParams($paramArray);
}
示例3: assignParams
function assignParams($paramArray = array())
{
$article =& $this->article;
$journal = isset($this->journal) ? $this->journal : Request::getJournal();
$paramArray['articleTitle'] = strip_tags($article->getLocalizedTitle());
$paramArray['articleId'] = $article->getId();
$paramArray['journalName'] = strip_tags($journal->getLocalizedTitle());
$paramArray['sectionName'] = strip_tags($article->getSectionTitle());
$paramArray['articleAbstract'] = String::html2text($article->getLocalizedAbstract());
$paramArray['authorString'] = strip_tags($article->getAuthorString());
parent::assignParams($paramArray);
}
示例4: assignParams
function assignParams($paramArray = array())
{
$monograph =& $this->monograph;
$press = isset($this->press) ? $this->press : Request::getPress();
$paramArray['monographTitle'] = strip_tags($monograph->getLocalizedTitle());
$paramArray['monographId'] = $monograph->getId();
$paramArray['pressName'] = strip_tags($press->getLocalizedName());
$paramArray['seriesName'] = strip_tags($monograph->getSeriesTitle());
$paramArray['monographAbstract'] = String::html2text($monograph->getLocalizedAbstract());
$paramArray['authorString'] = strip_tags($monograph->getAuthorString());
parent::assignParams($paramArray);
}
示例5: assignParams
function assignParams($paramArray = array())
{
$paper =& $this->paper;
$conference = isset($this->conference) ? $this->conference : Request::getConference();
$schedConf = isset($this->schedConf) ? $this->schedConf : Request::getSchedConf();
$paramArray['paperId'] = $paper->getId();
$paramArray['paperTitle'] = strip_tags($paper->getLocalizedTitle());
$paramArray['conferenceName'] = strip_tags($conference->getConferenceTitle());
$paramArray['schedConfName'] = strip_tags($schedConf->getLocalizedTitle());
$paramArray['trackName'] = strip_tags($paper->getTrackTitle());
$paramArray['paperAbstract'] = String::html2text($paper->getLocalizedAbstract());
$paramArray['authorString'] = strip_tags($paper->getAuthorString());
parent::assignParams($paramArray);
}
示例6: assignParams
function assignParams($paramArray = array())
{
$article =& $this->article;
$journal = isset($this->journal) ? $this->journal : Request::getJournal();
$sectionDao =& DAORegistry::getDAO('SectionDAO');
$section =& $sectionDao->getSection($this->sectionDecision->getSectionId());
$abstract =& $article->getLocalizedAbstract();
$paramArray['articleTitle'] = strip_tags($abstract->getScientificTitle());
$paramArray['articleId'] = $article->getProposalId();
$paramArray['journalName'] = strip_tags($journal->getLocalizedTitle());
$paramArray['sectionName'] = strip_tags($section->getLocalizedTitle());
$paramArray['articleBackground'] = String::html2text($abstract->getBackground());
$paramArray['articleObjectives'] = String::html2text($abstract->getObjectives());
$paramArray['articleStudyMethods'] = String::html2text($abstract->getStudyMethods());
$paramArray['articleExpectedOutcomes'] = String::html2text($abstract->getExpectedOutcomes());
$paramArray['authorString'] = strip_tags($article->getAuthorString());
parent::assignParams($paramArray);
}
示例7: requestBookForReview
/**
* Author requests a book for review.
*/
function requestBookForReview($args = array(), $request)
{
$this->setupTemplate($request);
if (empty($args)) {
$request->redirect(null, 'user');
}
$bfrPlugin = PluginRegistry::getPlugin('generic', BOOKS_FOR_REVIEW_PLUGIN_NAME);
$journal = $request->getJournal();
$journalId = $journal->getId();
$bookId = (int) $args[0];
$bfrDao = DAORegistry::getDAO('BookForReviewDAO');
// Ensure book for review is for this journal
if ($bfrDao->getBookForReviewJournalId($bookId) == $journalId) {
import('lib.pkp.classes.mail.MailTemplate');
$email = new MailTemplate('BFR_BOOK_REQUESTED');
$send = $request->getUserVar('send');
// Author has filled out mail form or decided to skip email
if ($send && !$email->hasErrors()) {
// Update book for review as requested
$book = $bfrDao->getBookForReview($bookId);
$status = $book->getStatus();
$bfrPlugin->import('classes.BookForReview');
// Ensure book for review is avaliable
if ($status == BFR_STATUS_AVAILABLE) {
$user = $request->getUser();
$userId = $user->getId();
$book->setStatus(BFR_STATUS_REQUESTED);
$book->setUserId($userId);
$book->setDateRequested(date('Y-m-d H:i:s', time()));
$bfrDao->updateObject($book);
$email->send();
import('classes.notification.NotificationManager');
$notificationManager = new NotificationManager();
$notificationManager->createTrivialNotification($userId, NOTIFICATION_TYPE_BOOK_REQUESTED);
}
$request->redirect(null, 'author', 'booksForReview');
// Display mail form for author
} else {
if (!$request->getUserVar('continued')) {
$book = $bfrDao->getBookForReview($bookId);
$status = $book->getStatus();
$bfrPlugin->import('classes.BookForReview');
// Ensure book for review is avaliable
if ($status == BFR_STATUS_AVAILABLE) {
$user = $request->getUser();
$userId = $user->getId();
$editorFullName = $book->getEditorFullName();
$editorEmail = $book->getEditorEmail();
$paramArray = array('editorName' => strip_tags($editorFullName), 'bookForReviewTitle' => '"' . strip_tags($book->getLocalizedTitle()) . '"', 'authorContactSignature' => String::html2text($user->getContactSignature()));
$email->addRecipient($editorEmail, $editorFullName);
$email->assignParams($paramArray);
}
$returnUrl = $request->url(null, 'author', 'requestBookForReview', $bookId);
$email->displayEditForm($returnUrl);
}
}
}
$request->redirect(null, 'booksForReview');
}
示例8: assert
/**
* Create a content item element.
*
* @param $author Author
* @param $objectLocalePrecedence array
*
* @return XMLNode|DOMImplementation
*/
function &_contributorElement(&$author, $objectLocalePrecedence)
{
$contributorElement =& XMLCustomWriter::createElement($this->getDoc(), 'Contributor');
// Sequence number
$seq = $author->getSequence();
assert(!empty($seq));
XMLCustomWriter::createChildWithText($this->getDoc(), $contributorElement, 'SequenceNumber', $seq);
// Contributor role (mandatory)
XMLCustomWriter::createChildWithText($this->getDoc(), $contributorElement, 'ContributorRole', O4DOI_CONTRIBUTOR_ROLE_ACTUAL_AUTHOR);
// Person name (mandatory)
$personName = $author->getFullName();
assert(!empty($personName));
XMLCustomWriter::createChildWithText($this->getDoc(), $contributorElement, 'PersonName', $personName);
// Inverted person name
$invertedPersonName = $author->getFullName(true);
assert(!empty($invertedPersonName));
XMLCustomWriter::createChildWithText($this->getDoc(), $contributorElement, 'PersonNameInverted', $invertedPersonName);
// Affiliation
$affiliation = $this->getPrimaryTranslation($author->getAffiliation(null), $objectLocalePrecedence);
if (!empty($affiliation)) {
$affiliationElement = XMLCustomWriter::createElement($this->getDoc(), 'ProfessionalAffiliation');
XMLCustomWriter::createChildWithText($this->getDoc(), $affiliationElement, 'Affiliation', $affiliation);
XMLCustomWriter::appendChild($contributorElement, $affiliationElement);
}
// Biographical note
$bioNote = $this->getPrimaryTranslation($author->getBiography(null), $objectLocalePrecedence);
if (!empty($bioNote)) {
XMLCustomWriter::createChildWithText($this->getDoc(), $contributorElement, 'BiographicalNote', String::html2text($bioNote));
}
return $contributorElement;
}
示例9: email
/**
* Email the comment.
* @param $recipients array of recipients (email address => name)
*/
function email($recipients)
{
import('mail.PaperMailTemplate');
$email = new PaperMailTemplate($this->paper, 'SUBMISSION_COMMENT');
foreach ($recipients as $emailAddress => $name) {
$email->addRecipient($emailAddress, $name);
$email->setSubject(strip_tags($this->paper->getLocalizedTitle()));
$paramArray = array('name' => $name, 'commentName' => $this->user->getFullName(), 'comments' => String::html2text($this->getData('comments')));
$email->assignParams($paramArray);
$email->send();
$email->clearRecipients();
}
}
示例10: _displayEmailForm
/**
* Display email form for the editor
* @param $email MailTemplate
* @param $objectForReview ObjectForReview
* @param $user User
* @param $returnUrl string
* @param $action string
* @param $request PKPRequest
*/
function _displayEmailForm($email, $objectForReview, $user, $returnUrl, $action, $request)
{
if (!$request->getUserVar('continued')) {
$userFullName = $user->getFullName();
$userEmail = $user->getEmail();
$userMailingAddress = $user->getMailingAddress();
$userCountryCode = $user->getCountry();
if (empty($userMailingAddress)) {
$userMailingAddress = __('plugins.generic.objectsForReview.editor.noMailingAddress');
} else {
$countryDao =& DAORegistry::getDAO('CountryDAO');
$countries =& $countryDao->getCountries();
$userCountry = $countries[$userCountryCode];
$userMailingAddress .= "\n" . $userCountry;
}
$editor =& $objectForReview->getEditor();
$editorFullName = $editor->getFullName();
$editorEmail = $editor->getEmail();
$editorContactSignature = $editor->getContactSignature();
if ($action == 'OFR_OBJECT_ASSIGNED') {
$ofrPlugin =& $this->_getObjectsForReviewPlugin();
$journal =& $request->getJournal();
$dueWeeks = $ofrPlugin->getSetting($journal->getId(), 'dueWeeks');
$dueDateTimestamp = time() + $dueWeeks * 7 * 24 * 60 * 60;
$paramArray = array('authorName' => strip_tags($userFullName), 'authorMailingAddress' => String::html2text($userMailingAddress), 'objectForReviewTitle' => '"' . strip_tags($objectForReview->getTitle()) . '"', 'objectForReviewDueDate' => date('l, F j, Y', $dueDateTimestamp), 'userProfileUrl' => $request->url(null, 'user', 'profile'), 'submissionUrl' => $request->url(null, 'author', 'submit'), 'editorialContactSignature' => String::html2text($editorContactSignature));
} elseif ($action == 'OFR_OBJECT_DENIED') {
$paramArray = array('authorName' => strip_tags($userFullName), 'objectForReviewTitle' => '"' . strip_tags($objectForReview->getTitle()) . '"', 'submissionUrl' => $request->url(null, 'author', 'submit'), 'editorialContactSignature' => String::html2text($editorContactSignature));
} elseif ($action == 'OFR_OBJECT_MAILED') {
$paramArray = array('authorName' => strip_tags($userFullName), 'authorMailingAddress' => String::html2text($userMailingAddress), 'objectForReviewTitle' => '"' . strip_tags($objectForReview->getTitle()) . '"', 'submissionUrl' => $request->url(null, 'author', 'submit'), 'editorialContactSignature' => String::html2text($editorContactSignature));
} elseif ($action == 'OFR_REVIEWER_REMOVED') {
$paramArray = array('authorName' => strip_tags($userFullName), 'objectForReviewTitle' => '"' . strip_tags($objectForReview->getTitle()) . '"', 'editorialContactSignature' => String::html2text($editorContactSignature));
}
$email->addRecipient($userEmail, $userFullName);
$email->setReplyTo($editorEmail, $editorFullName);
$email->assignParams($paramArray);
}
$email->displayEditForm($returnUrl);
}
示例11: blindCcReviewsToReviewers
/**
* Blind CC the reviews to reviewers.
* @param $article object
* @param $send boolean
* @param $inhibitExistingEmail boolean
* @return boolean true iff ready for redirect
*/
function blindCcReviewsToReviewers($article, $send = false, $inhibitExistingEmail = false)
{
$commentDao =& DAORegistry::getDAO('ArticleCommentDAO');
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$journal =& Request::getJournal();
$comments =& $commentDao->getArticleComments($article->getId(), COMMENT_TYPE_EDITOR_DECISION);
$reviewAssignments =& $reviewAssignmentDao->getBySubmissionId($article->getId(), $article->getCurrentRound());
$commentsText = "";
foreach ($comments as $comment) {
$commentsText .= String::html2text($comment->getComments()) . "\n\n";
}
$user =& Request::getUser();
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($article, 'SUBMISSION_DECISION_REVIEWERS', null, null, null, true, true);
if ($send && !$email->hasErrors() && !$inhibitExistingEmail) {
HookRegistry::call('SectionEditorAction::blindCcReviewsToReviewers', array(&$article, &$reviewAssignments, &$email));
$email->send();
return true;
} else {
if ($inhibitExistingEmail || !Request::getUserVar('continued')) {
$email->clearRecipients();
foreach ($reviewAssignments as $reviewAssignment) {
if ($reviewAssignment->getDateCompleted() != null && !$reviewAssignment->getCancelled()) {
$reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
if (isset($reviewer)) {
$email->addBcc($reviewer->getEmail(), $reviewer->getFullName());
}
}
}
$paramArray = array('comments' => $commentsText, 'editorialContactSignature' => $user->getContactSignature());
$email->assignParams($paramArray);
}
$email->displayEditForm(Request::url(null, null, 'blindCcReviewsToReviewers'), array('articleId' => $article->getId()));
return false;
}
}
示例12: bccEditorDecisionCommentToReviewers
/**
* Blind CC the editor decision email to reviewers.
* @param $article object
* @param $send boolean
* @return boolean true iff ready for redirect
*/
function bccEditorDecisionCommentToReviewers($article, $send, $request)
{
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($article, 'SUBMISSION_DECISION_REVIEWERS');
if ($send && !$email->hasErrors()) {
HookRegistry::call('SectionEditorAction::bccEditorDecisionCommentToReviewers', array(&$article, &$reviewAssignments, &$email));
$email->send($request);
return true;
} else {
if (!$request->getUserVar('continued')) {
$userDao =& DAORegistry::getDAO('UserDAO');
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewAssignments =& $reviewAssignmentDao->getBySubmissionId($article->getId(), $article->getCurrentRound());
$email->clearRecipients();
foreach ($reviewAssignments as $reviewAssignment) {
if ($reviewAssignment->getDateCompleted() != null && !$reviewAssignment->getCancelled()) {
$reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
if (isset($reviewer)) {
$email->addBcc($reviewer->getEmail(), $reviewer->getFullName());
}
}
}
$commentsText = "";
if ($article->getMostRecentEditorDecisionComment()) {
$comment = $article->getMostRecentEditorDecisionComment();
$commentsText = String::html2text($comment->getComments()) . "\n\n";
}
$user =& $request->getUser();
$paramArray = array('comments' => $commentsText, 'editorialContactSignature' => $user->getContactSignature());
$email->assignParams($paramArray);
}
$email->displayEditForm($request->url(null, null, 'bccEditorDecisionCommentToReviewers', 'send'), array('articleId' => $article->getId()));
return false;
}
}
示例13: createMetadataPackage
/**
* Create deposit package of article metadata.
* @param $article Article
* @return DataversePackager
*/
function createMetadataPackage($article)
{
$journalDao =& DAORegistry::getDAO('JournalDAO');
$journal =& $journalDao->getById($article->getJournalId());
$package = new DataversePackager();
// Add article metadata, in language of article locale
$package->addMetadata('title', $article->getTitle($article->getLocale()));
// If study description not provided, use article abstract
$package->addMetadata('description', $article->getData('studyDescription', $article->getLocale()) ? $article->getData('studyDescription', $article->getLocale()) : String::html2text($article->getAbstract($article->getLocale())));
foreach ($article->getAuthors() as $author) {
$package->addMetadata('creator', $author->getFullName(true), array('affiliation' => $this->_formatAffiliation($author, $article->getLocale())));
}
// Article metadata: fields with multiple values
$pattern = '/\\s*' . DATAVERSE_PLUGIN_SUBJECT_SEPARATOR . '\\s*/';
foreach (String::regexp_split($pattern, $article->getCoverageGeo($article->getLocale())) as $coverage) {
if ($coverage) {
$package->addMetadata('coverage', $coverage);
}
}
// Article metadata: filter subject(s) to prevent repeated values in dataset subject field
$subjects = array();
foreach (String::regexp_split($pattern, $article->getDiscipline($article->getLocale())) as $subject) {
if ($subject) {
$subjects[String::strtolower($subject)] = $subject;
}
}
foreach (String::regexp_split($pattern, $article->getSubjectClass($article->getLocale())) as $subject) {
if ($subject) {
$subjects[String::strtolower($subject)] = $subject;
}
}
foreach (String::regexp_split($pattern, $article->getSubject($article->getLocale())) as $subject) {
if ($subject) {
$subjects[String::strtolower($subject)] = $subject;
}
}
// Article metadata: filter contributors(s) to prevent repeated values in dataset contributor field
$contributors = array();
foreach (String::regexp_split($pattern, $article->getSponsor($article->getLocale())) as $contributor) {
if ($contributor) {
$contributors[String::strtolower($contributor)] = $contributor;
}
}
// Published article metadata
$pubIdAttributes = array();
if ($article->getStatus() == STATUS_PUBLISHED) {
// publication date
$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($article->getId(), $article->getJournalId());
$datePublished = $publishedArticle->getDatePublished();
if (!$datePublished) {
// If article has no pub date, use issue pub date
$issueDao =& DAORegistry::getDAO('IssueDAO');
$issue =& $issueDao->getIssueByArticleId($article->getId(), $article->getJournalId());
$datePublished = $issue->getDatePublished();
}
$package->addMetadata('date', strftime('%Y-%m-%d', strtotime($datePublished)));
// isReferencedBy: add persistent URL to citation using specified pubid plugin
$pubIdPlugin =& PluginRegistry::getPlugin('pubIds', $this->getSetting($article->getJournalId(), 'pubIdPlugin'));
if ($pubIdPlugin && $pubIdPlugin->getEnabled()) {
$pubIdAttributes['agency'] = $pubIdPlugin->getDisplayName();
$pubIdAttributes['IDNo'] = $article->getPubId($pubIdPlugin->getPubIdType());
$pubIdAttributes['holdingsURI'] = $pubIdPlugin->getResolvingUrl($article->getJournalId(), $pubIdAttributes['IDNo']);
}
// If no pubIdP plugin selected or enabled, provide OJS URL
if (!array_key_exists('holdingsURI', $pubIdAttributes)) {
$pubIdAttributes['holdingsURI'] = Request::url($journal->getPath(), 'article', 'view', array($article->getId()));
}
// Add copyright notice.
if ($article->getCopyrightYear() && $article->getCopyrightHolder($article->getLocale())) {
AppLocale::requireComponents(LOCALE_COMPONENT_APPLICATION_COMMON);
$package->addMetadata('rights', __('submission.copyrightStatement', array('copyrightYear' => $article->getCopyrightYear(), 'copyrightHolder' => $article->getCopyrightHolder($article->getLocale()))));
}
}
// Journal metadata
$package->addMetadata('publisher', $journal->getSetting('publisherInstitution'));
$package->addMetadata('isReferencedBy', String::html2text($this->getCitation($article)), $pubIdAttributes);
// Suppfile metadata
$suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
$dvFileDao =& DAORegistry::getDAO('DataverseFileDAO');
$dvFiles =& $dvFileDao->getDataverseFilesBySubmissionId($article->getId());
// Filter type field to prevent repeated values in dataset 'Kind of data' field
$suppFileTypes = array();
foreach ($dvFiles as $dvFile) {
$suppFile =& $suppFileDao->getSuppFile($dvFile->getSuppFileId(), $article->getId());
if ($suppFile) {
// Split & filter subjects and/or contributors that may be repeated in article metadata
foreach (String::regexp_split($pattern, $suppFile->getSubject($article->getLocale())) as $subject) {
$subjects[String::strtolower($subject)] = $subject;
}
foreach (String::regexp_split($pattern, $suppFile->getSponsor($article->getLocale())) as $contributor) {
if ($contributor) {
$contributors[String::strtolower($contributor)] = $contributor;
}
}
//.........这里部分代码省略.........
示例14: extract
/**
* @see DOIExportDom::generate()
*/
function &generate(&$object)
{
$falseVar = false;
// Declare variables that will contain publication objects.
$journal = $this->getJournal();
$issue = null;
/* @var $issue Issue */
$article = null;
/* @var $article PublishedArticle */
$galley = null;
/* @var $galley ArticleGalley */
$articlesByIssue = null;
$galleysByArticle = null;
// Retrieve required publication objects (depends on the object to be exported).
$pubObjects =& $this->retrievePublicationObjects($object);
extract($pubObjects);
// Identify an object implementing a SubmissionFile (if any).
$submissionFile = $galley;
// Identify the object locale.
$objectLocalePrecedence = $this->getObjectLocalePrecedence($article, $galley);
// The publisher is required.
$publisher = $this->getPublisher($objectLocalePrecedence);
// The publication date is required.
$publicationDate = is_a($article, 'PublishedArticle') ? $article->getDatePublished() : null;
if (empty($publicationDate)) {
$publicationDate = $issue->getDatePublished();
}
assert(!empty($publicationDate));
// Create the XML document and its root element.
$doc =& $this->getDoc();
$rootElement =& $this->rootElement();
XMLCustomWriter::appendChild($doc, $rootElement);
// DOI (mandatory)
if (($identifierElement =& $this->_identifierElement($object)) === false) {
return false;
}
XMLCustomWriter::appendChild($rootElement, $identifierElement);
// Creators (mandatory)
XMLCustomWriter::appendChild($rootElement, $this->_creatorsElement($object, $objectLocalePrecedence, $publisher));
// Title (mandatory)
XMLCustomWriter::appendChild($rootElement, $this->_titlesElement($object, $objectLocalePrecedence));
// Publisher (mandatory)
XMLCustomWriter::createChildWithText($this->getDoc(), $rootElement, 'publisher', $publisher);
// Publication Year (mandatory)
XMLCustomWriter::createChildWithText($this->getDoc(), $rootElement, 'publicationYear', date('Y', strtotime($publicationDate)));
// Subjects
if (!empty($article)) {
$this->_appendNonMandatoryChild($rootElement, $this->_subjectsElement($article, $objectLocalePrecedence));
}
// Dates
XMLCustomWriter::appendChild($rootElement, $this->_datesElement($issue, $article, $submissionFile, $publicationDate));
// Language
XMLCustomWriter::createChildWithText($this->getDoc(), $rootElement, 'language', AppLocale::get3LetterIsoFromLocale($objectLocalePrecedence[0]));
// Resource Type
$resourceTypeElement =& $this->_resourceTypeElement($object);
XMLCustomWriter::appendChild($rootElement, $resourceTypeElement);
// Alternate Identifiers
$this->_appendNonMandatoryChild($rootElement, $this->_alternateIdentifiersElement($object, $issue, $article, $submissionFile));
// Related Identifiers
$this->_appendNonMandatoryChild($rootElement, $this->_relatedIdentifiersElement($object, $articlesByIssue, $galleysByArticle, $issue, $article));
// Sizes
$sizesElement =& $this->_sizesElement($object, $article);
if ($sizesElement) {
XMLCustomWriter::appendChild($rootElement, $sizesElement);
}
// Formats
if (!empty($submissionFile)) {
XMLCustomWriter::appendChild($rootElement, $this->_formatsElement($submissionFile));
}
// Rights
$rights = $this->getPrimaryTranslation($journal->getSetting('copyrightNotice', null), $objectLocalePrecedence);
if (!empty($rights)) {
XMLCustomWriter::createChildWithText($this->getDoc(), $rootElement, 'rights', String::html2text($rights));
}
// Descriptions
$descriptionsElement =& $this->_descriptionsElement($issue, $article, $objectLocalePrecedence, $articlesByIssue);
if ($descriptionsElement) {
XMLCustomWriter::appendChild($rootElement, $descriptionsElement);
}
return $doc;
}
示例15: contact
/**
* Auto-fill the DOAJ form.
* @param $journal object
*/
function contact($journal, $send = false)
{
$request = $this->getRequest();
$user = $request->getUser();
$issn = $journal->getSetting('printIssn');
$paramArray = array('name' => $user->getFullName(), 'email' => $user->getEmail(), 'title' => $journal->getLocalizedName(), 'description' => String::html2text($journal->getLocalizedSetting('focusScopeDesc')), 'url' => $request->url($journal->getPath()), 'charging' => $journal->getSetting('submissionFee') > 0 ? 'Y' : 'N', 'issn' => $issn, 'eissn' => $journal->getSetting('onlineIssn'), 'pub' => $journal->getSetting('publisherInstitution'), 'language' => AppLocale::getLocale(), 'keywords' => $journal->getLocalizedSetting('searchKeywords'), 'contact_person' => $journal->getSetting('contactName'), 'contact_email' => $journal->getSetting('contactEmail'));
$url = 'http://www.doaj.org/doaj?func=suggest&owner=1';
foreach ($paramArray as $name => $value) {
$url .= '&' . urlencode($name) . '=' . urlencode($value);
}
$request->redirectUrl($url);
}