Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12093

It is not possible to change the page layout in popup windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8, 1.9, 2.0
    • Fix Version/s: 2.0
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Situation:
      I had several times the need to change the page design in popup windows.

      Problem:
      There is no way to determine if a page is loaded in a popup window. (As far as I know).

      Solution after a longer chat Eloy proposed:
      A function in weblib.php

      /**

      • 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 is_in_popup() {
        $inpopup = optional_param('inpopup', '', PARAM_BOOL);

      return ($inpopup);
      }

      In the theme header and footer you can then get the status with
      <?php $inpopup = is_in_popup(); ?>
      and add a class to body or the "page" div or write a different header or footer when in a popup window.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  24/Nov/10