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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0
    • 1.8, 1.9, 2.0
    • General
    • None
    • MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
    • MOODLE_20_STABLE

      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.

            timhunt Tim Hunt
            urshunkler Urs Hunkler
            Nobody Nobody (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.