Skip to content

Commit

Permalink
*5568* Added String::html2text method
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Jul 19, 2010
1 parent 05d5cff commit edc0199
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
20 changes: 7 additions & 13 deletions classes/submission/sectionEditor/SectionEditorAction.inc.php
Expand Up @@ -250,7 +250,7 @@ function notifyReviewer($sectionEditorSubmission, $reviewId, $send = false) {
'reviewerUsername' => $reviewer->getUsername(),
'reviewerPassword' => $reviewer->getPassword(),
'editorialContactSignature' => $user->getContactSignature(),
'reviewGuidelines' => String::html2utf(strip_tags($journal->getLocalizedSetting('reviewGuidelines'))),
'reviewGuidelines' => String::html2text($journal->getLocalizedSetting('reviewGuidelines')),
'submissionReviewUrl' => $submissionUrl,
'abstractTermIfEnabled' => ($sectionEditorSubmission->getLocalizedAbstract() == ''?'':Locale::translate('article.abstract')),
'passwordResetUrl' => Request::url(null, 'login', 'resetPassword', $reviewer->getUsername(), array('confirm' => Validation::generatePasswordResetHash($reviewer->getId())))
Expand Down Expand Up @@ -1972,13 +1972,7 @@ function emailEditorDecisionComment($sectionEditorSubmission, $send) {
if (is_array($articleComments)) {
foreach ($articleComments as $comment) {
// If the comment is viewable by the author, then add the comment.
if ($comment->getViewable()) {
$body .= String::html2utf(
strip_tags(
str_replace(array('<p>', '<br>', '<br/>'), array("\n", "\n", "\n"), $comment->getComments())
)
) . "\n\n";
}
if ($comment->getViewable()) $body .= String::html2text($comment->getComments()) . "\n\n";
}
}
$body .= "------------------------------------------------------\n\n";
Expand All @@ -1993,22 +1987,22 @@ function emailEditorDecisionComment($sectionEditorSubmission, $send) {
$body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getId()]))) . "\n\n";
}
foreach ($reviewFormElements as $reviewFormElement) if ($reviewFormElement->getIncluded()) {
$body .= strip_tags(String::html2utf($reviewFormElement->getLocalizedQuestion())) . ": \n";
$body .= String::html2text($reviewFormElement->getLocalizedQuestion()) . ": \n";
$reviewFormResponse = $reviewFormResponseDao->getReviewFormResponse($reviewId, $reviewFormElement->getId());

if ($reviewFormResponse) {
$possibleResponses = $reviewFormElement->getLocalizedPossibleResponses();
if (in_array($reviewFormElement->getElementType(), $reviewFormElement->getMultipleResponsesElementTypes())) {
if ($reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_CHECKBOXES) {
foreach ($reviewFormResponse->getValue() as $value) {
$body .= "\t" . String::html2utf(strip_tags($possibleResponses[$value-1]['content'])) . "\n";
$body .= "\t" . String::html2text($possibleResponses[$value-1]['content']) . "\n";
}
} else {
$body .= "\t" . String::html2utf(strip_tags($possibleResponses[$reviewFormResponse->getValue()-1]['content'])) . "\n";
$body .= "\t" . String::html2text($possibleResponses[$reviewFormResponse->getValue()-1]['content']) . "\n";
}
$body .= "\n";
} else {
$body .= "\t" . String::html2utf(strip_tags($reviewFormResponse->getValue())) . "\n\n";
$body .= "\t" . String::html2text($reviewFormResponse->getValue()) . "\n\n";
}
}
}
Expand Down Expand Up @@ -2045,7 +2039,7 @@ function blindCcReviewsToReviewers($article, $send = false, $inhibitExistingEmai

$commentsText = "";
foreach ($comments as $comment) {
$commentsText .= String::html2utf(strip_tags($comment->getComments())) . "\n\n";
$commentsText .= String::html2text($comment->getComments()) . "\n\n";
}

$user =& Request::getUser();
Expand Down

0 comments on commit edc0199

Please sign in to comment.