Skip to content

Commit

Permalink
#7432 Allow breaks in editorial contact signature variable (#9103)
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher authored Jun 27, 2023
1 parent f146a6d commit 5cad3a1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions classes/core/PKPApplication.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ public static function getMetadataFields() {

/* TextArea insert tag variable types used to change their display when selected */
define('INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT', 'PLAIN_TEXT');
define('INSERT_TAG_VARIABLE_TYPE_SAFE_HTML', 'SAFE_HTML');

// To expose LISTBUILDER_SOURCE_TYPE_... constants via JS
import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
Expand Down
1 change: 1 addition & 0 deletions classes/template/PKPTemplateManager.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ function setupBackendPage() {
'WORKFLOW_STAGE_ID_EDITING',
'WORKFLOW_STAGE_ID_PRODUCTION',
'INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT',
'INSERT_TAG_VARIABLE_TYPE_SAFE_HTML',
'ROLE_ID_MANAGER',
'ROLE_ID_SITE_ADMIN',
'ROLE_ID_AUTHOR',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function _sendReviewMailToAuthor($submission, $emailKey, $request) {
'submissionUrl' => $dispatcher->url($request, ROUTE_PAGE, null, 'authorDashboard', 'submission', $submission->getId()),
'contextName' => htmlspecialchars($context->getLocalizedName()),
'authorName' => htmlspecialchars($submission->getAuthorString()),
'editorialContactSignature' => $user->getContactSignature(),
'editorialContactSignature' => strip_tags($user->getContactSignature(), "<br>"),
]);
if (!$email->send($request)) {
import('classes.notification.NotificationManager');
Expand Down Expand Up @@ -357,7 +357,7 @@ function _getAllowedVariables($request) {
function _getAllowedVariablesType() {
return [
'contextName' => INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT,
'editorialContactSignature' => INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT,
'editorialContactSignature' => INSERT_TAG_VARIABLE_TYPE_SAFE_HTML,
'submissionTitle' => INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT,
'authorName' => INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT,
];
Expand Down
2 changes: 2 additions & 0 deletions js/classes/TinyMCEHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
variableType = variableTypes[variableSymbolic];
if (variableType == $.pkp.cons.INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT) {
return $('<div/>').append($('<span/>').text(variableName));
} else if (variableType == $.pkp.cons.INSERT_TAG_VARIABLE_TYPE_SAFE_HTML) {
return $('<div/>').append($('<span/>').append(variableName));
}
}

Expand Down
3 changes: 2 additions & 1 deletion tools/closure-externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ $.pkp.cons = {
LISTBUILDER_OPTGROUP_LABEL: 0,
ORDER_CATEGORY_GRID_CATEGORIES_ROWS_ONLY: 0,
UPLOAD_MAX_FILESIZE: 0,
INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT: 0
INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT: 0,
INSERT_TAG_VARIABLE_TYPE_SAFE_HTML: 0
};

/**
Expand Down

0 comments on commit 5cad3a1

Please sign in to comment.