Moodle
  1. Moodle
  2. MDL-8109

Flexible column positons - you may rearange the layout-table columns

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.3, 1.9
    • Component/s: Themes
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      Flexible column positions - you may rearrange the layout-table columns with an array in your theme config.php.

      $THEME->layouttable = array('left', 'right', 'middle');

      Attached a short theme comparison between standard and a new theme sketch with clear visual content / sideblock differentiation to show new theme layout possibilities. And this flexibility brings another advantage - you can place the right column to the left when you want to work with a 2-column layout and get this way the edit buttons to the left. These edit buttons sticking to the right side reduced flexibility.

      I'll commit the changes to index.php, course/topics/form.php. The layouttable setting is optional, the routine checks for the variable and sets the array to the Moodle standard column order when no values are set. I didn't change the column writing parts. I surrounded them with a foreach loop and a switch statement. For the moment all changes have starting and ending comments. And I attach a theme "standard1" for checking and testing.

      Petr or Martin, could you please have a look if the code can be optimized? Thanks.

      Rearanging the admin page columns and the other course formats may be done when the code is ok.

        Gliffy Diagrams

        1. flexible_columns.swf
          298 kB
          Urs Hunkler
        2. standard1.tar.gz
          64 kB
          Urs Hunkler

          Activity

          Hide
          Urs Hunkler added a comment -

          a standard theme / differerent column layout comparison

          Show
          Urs Hunkler added a comment - a standard theme / differerent column layout comparison
          Hide
          Martin Dougiamas added a comment -

          Looks fine. +1

          Show
          Martin Dougiamas added a comment - Looks fine. +1
          Hide
          Urs Hunkler added a comment -

          I added the neccessary code to all course formats, the index.php and admin/pagelib.php.

          Show
          Urs Hunkler added a comment - I added the neccessary code to all course formats, the index.php and admin/pagelib.php.
          Hide
          Urs Hunkler added a comment -

          I colsed the wrong Item. Still working on this one.

          Show
          Urs Hunkler added a comment - I colsed the wrong Item. Still working on this one.
          Hide
          Urs Hunkler added a comment -

          In index.php, the course/format.php and admin/settings.php I have implemented the code for the flexible column positions.

          The external admin pages are build with admin_externalpage_print_header() and admin_externalpage_print_footer(). Within these functions the switch to decide which column needs to be build can't be used. I don't know where the functions are called.

          I need help!

          A second parameter may help??? Or we need a compleatly different approach???

          Show
          Urs Hunkler added a comment - In index.php, the course/format.php and admin/settings.php I have implemented the code for the flexible column positions. The external admin pages are build with admin_externalpage_print_header() and admin_externalpage_print_footer(). Within these functions the switch to decide which column needs to be build can't be used. I don't know where the functions are called. I need help! A second parameter may help??? Or we need a compleatly different approach???
          Hide
          Urs Hunkler added a comment -

          Martin, sorry. Moving the issue from version to version without answering my question won't bring a solution. If nobody knows the solution or can check I might better close the issue because it can't be solved.

          Show
          Urs Hunkler added a comment - Martin, sorry. Moving the issue from version to version without answering my question won't bring a solution. If nobody knows the solution or can check I might better close the issue because it can't be solved.
          Hide
          Martin Dougiamas added a comment -

          The moving is automatic when a release is made (all left-over 1.8.2 stuff got bumped to 1.8.3).

          I'm not sure what the question is.... why can't $THEME->layouttable be used in admin_externalpage_print_header/footer in the same way as it's done for the main index.php for example?

          Show
          Martin Dougiamas added a comment - The moving is automatic when a release is made (all left-over 1.8.2 stuff got bumped to 1.8.3). I'm not sure what the question is.... why can't $THEME->layouttable be used in admin_externalpage_print_header/footer in the same way as it's done for the main index.php for example?
          Hide
          Urs Hunkler added a comment -

          The external admin pages split the page construction into admin_externalpage_print_header() and admin_externalpage_print_footer(). The trick was to split the column array to get any columns before middle-column and any columns after middle-column.

          Show
          Urs Hunkler added a comment - The external admin pages split the page construction into admin_externalpage_print_header() and admin_externalpage_print_footer(). The trick was to split the column array to get any columns before middle-column and any columns after middle-column.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: