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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8, 1.9, 2.0
    • 2.0
    • General
    • None
    • MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
    • 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

              timhunt Tim Hunt
              urshunkler Urs Hunkler
              Nobody Nobody
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                24/Nov/10