MDL-64820 portfolio: add url return for portfolio_add_button to_html

This commit is contained in:
Ryan Wyllie
2019-03-22 09:24:04 +08:00
parent cba111b376
commit 72a3d05b7e
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -200,3 +200,9 @@ define('PORTFOLIO_ADD_TEXT_LINK', 4);
* this replaces the old portfolio_fake_add_url function
*/
define('PORTFOLIO_ADD_FAKE_URL', 5);
/**
* PORTFOLIO_ADD_MOODULE_URL - hacky way to turn the button class into a moodle_url to redirect to
* this replaces the old portfolio_fake_add_url function
*/
define('PORTFOLIO_ADD_MOODLE_URL', 6);
+5
View File
@@ -327,6 +327,11 @@ class portfolio_add_button {
return;
}
}
// If we just want a moodle_url to redirect to, do it now.
if ($format == PORTFOLIO_ADD_MOODLE_URL) {
return $url;
}
// if we just want a url to redirect to, do it now
if ($format == PORTFOLIO_ADD_FAKE_URL) {
return $url->out(false);