Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-tool_lifecycle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-tool_lifecycle
Commits
0de7e0ff
Unverified
Commit
0de7e0ff
authored
8 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Added a placeholder for link and link-html in email templates
parent
de6456f1
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
step/email/lib.php
+11
-2
11 additions, 2 deletions
step/email/lib.php
step/interactionlib.php
+1
-0
1 addition, 0 deletions
step/interactionlib.php
step/lib.php
+10
-0
10 additions, 0 deletions
step/lib.php
with
22 additions
and
2 deletions
step/email/lib.php
+
11
−
2
View file @
0de7e0ff
...
...
@@ -107,7 +107,7 @@ class email extends libbase {
array
(
'instanceid'
=>
$step
->
id
,
'touser'
=>
$user
->
id
));
$parsedsettings
=
$this
->
replace_placeholders
(
$settings
,
$user
);
$parsedsettings
=
$this
->
replace_placeholders
(
$settings
,
$user
,
$step
->
id
);
$subject
=
$parsedsettings
[
'subject'
];
$content
=
$parsedsettings
[
'content'
];
...
...
@@ -129,7 +129,8 @@ class email extends libbase {
* @param mixed $user user object
* @return string[] array of mail text.
*/
private
function
replace_placeholders
(
$strings
,
$user
)
{
private
function
replace_placeholders
(
$strings
,
$user
,
$stepid
)
{
global
$CFG
;
$patterns
=
array
();
$replacements
=
array
();
...
...
@@ -140,6 +141,14 @@ class email extends libbase {
$patterns
[]
=
'##lastname##'
;
$replacements
[]
=
$user
->
lastname
;
$url
=
$CFG
->
wwwroot
.
'/'
.
$this
->
get_interaction_link
(
$stepid
)
->
out
();
$patterns
[]
=
'##link##'
;
$replacements
[]
=
$url
;
$patterns
[]
=
'##link-html##'
;
$replacements
[]
=
\html_writer
::
link
(
$url
,
$url
);
return
str_ireplace
(
$patterns
,
$replacements
,
$strings
);
}
...
...
This diff is collapsed.
Click to expand it.
step/interactionlib.php
+
1
−
0
View file @
0de7e0ff
...
...
@@ -72,4 +72,5 @@ abstract class interactionlibbase {
* @param string $action action string
*/
public
abstract
function
handle_interaction
(
$process
,
$step
,
$action
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
step/lib.php
+
10
−
0
View file @
0de7e0ff
...
...
@@ -105,6 +105,16 @@ abstract class libbase {
public
function
extend_add_instance_form_definition_after_data
(
$mform
,
$settings
)
{
}
/**
* Generates the link to the interaction table of the respective step
* @param int $stepid id of the step
* @return \moodle_url
*/
public
function
get_interaction_link
(
$stepid
)
{
return
new
\moodle_url
(
'admin/tool/cleanupcourses/view.php'
,
array
(
'stepid'
=>
$stepid
));
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment