-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1044 from Vitaliy-1/i7264_rename_variables
pkp/pkp-lib#7264 Rename email template variables
- Loading branch information
Showing
25 changed files
with
1,608 additions
and
1,529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* @file classes/emailTemplate/DAO.inc.php | ||
* | ||
* Copyright (c) 2014-2021 Simon Fraser University | ||
* Copyright (c) 2000-2021 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class DAO | ||
* | ||
* @brief Read and write email templates to the database. | ||
*/ | ||
|
||
namespace APP\emailTemplate; | ||
|
||
class DAO extends \PKP\emailTemplate\DAO | ||
{ | ||
/** | ||
* Renames app-specific email template variables during installation | ||
*/ | ||
protected function variablesToRename(): array | ||
{ | ||
return [ | ||
'contextName' => 'pressName', | ||
'contextUrl' => 'pressUrl', | ||
]; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
classes/migration/upgrade/v3_4_0/I7264_UpdateEmailTemplates.inc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/migration/upgrade/v3_4_0/I7264_UpdateEmailTemplates.inc.php | ||
* | ||
* Copyright (c) 2014-2021 Simon Fraser University | ||
* Copyright (c) 2000-2021 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class I7264_UpdateEmailTemplates | ||
* @brief Describe upgrade/downgrade operations for DB table email_templates. | ||
*/ | ||
|
||
namespace APP\migration\upgrade\v3_4_0; | ||
|
||
class I7264_UpdateEmailTemplates extends \PKP\migration\upgrade\v3_4_0\I7264_UpdateEmailTemplates | ||
{ | ||
protected function oldNewVariablesMap(): array | ||
{ | ||
$oldNewVariablesMap = parent::oldNewVariablesMap(); | ||
array_walk_recursive($oldNewVariablesMap, function (&$newVariable, $oldVariable) { | ||
if ($newVariable === 'contextName') { | ||
$newVariable = 'pressName'; | ||
} elseif ($newVariable === 'contextUrl') { | ||
$newVariable = 'pressUrl'; | ||
} | ||
}); | ||
|
||
return $oldNewVariablesMap; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule pkp
updated
65 files
Oops, something went wrong.