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

weblib fuction to make a collapable area of the user interface, linked to a user_preference to record the state

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.0
    • JavaScript
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      Three new functions:

      print_collapsible_box($contents, $classes, $id, $caption, $userpref = '', $icon = '', $return=false);
      print_collapsible_box_start($classes, $id, $caption, $userpref = false, $return=false);
      print_collapsible_box_end($return=false);

      The HTML they generate will look like

      <div id="$id" class="$classes"><div id="$id_inner">
      <div id="$id_caption" title="Click to expand or collapse">$caption <img id= alt="" ... /></div>
      $contents
      </div></div>

      If the optional $userpref argument is used, that user_preference will be used to store the user's preferred state of the box (1 = initially collapsed). If you don't want the state persisted, then instead passing true or false can be used to set the inital state of the box.

      The image will be either a right arrow or a down arrow, to indicate the state.

      If JavaScript is off, then the region will always be expanded.

      Attachments

        Activity

          People

            timhunt Tim Hunt
            timhunt Tim Hunt
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10