From 1463bdc4eee862eb663a53d2a2cabafc75b2c810 Mon Sep 17 00:00:00 2001 From: urs_hunkler Date: Sat, 10 Nov 2007 14:44:41 +0000 Subject: [PATCH] MDL-12093 :: function get_in_popup() added to weblib.php. It returns true if the page is opened in a popup window. * TODO Use a central function to create the popup calls allover Moodle and * TODO In the moment only works with resources and probably questions. --- lib/weblib.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/weblib.php b/lib/weblib.php index cfe80b4247b..d1299867b76 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -6651,5 +6651,21 @@ function fix_align_rtl($align) { } +/** + * Returns true if the page is displayed in a popup window. + * Gets the information from the URL parameter inpopup. + * + * @return boolean + * + * TODO Use a central function to create the popup calls allover Moodle and + * TODO In the moment only works with resources and probably questions. + */ +function get_in_popup() { + $inpopup = optional_param('inpopup', '', PARAM_BOOL); + + return ($inpopup); +} + + // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140: ?> \ No newline at end of file