diff --git a/lib/portfolio/constants.php b/lib/portfolio/constants.php index 04e59656c53..0b620143a53 100644 --- a/lib/portfolio/constants.php +++ b/lib/portfolio/constants.php @@ -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); diff --git a/lib/portfoliolib.php b/lib/portfoliolib.php index 68fcf860f0a..37d5efeb570 100644 --- a/lib/portfoliolib.php +++ b/lib/portfoliolib.php @@ -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);