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

CLONE -Patch to allow a center position for Moodle blocks

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.7
    • 2.0
    • Usability
    • None
    • MOODLE_19_STABLE
    • MOODLE_20_STABLE
    • Easy

    Description

      With this pacth the blocks can be moved to the center column over the sections area.
      Using the same arrow icons on edit mode, if you move left a block that is currently at the right position then it will move to the center position.

      Few modifications needed:

      • /index.php
        /// aartiles: Added a center blocks position
        if (blocks_have_content($pageblocks, BLOCK_POS_CENTER) || $editing) { blocks_print_group($PAGE, $pageblocks, BLOCK_POS_CENTER); }
      • /lib/blocklib.php
        //aartiles: New block position BLOCK_POS_CENTER
        define('BLOCK_POS_CENTER', 'c');
      • /lib/pagelib.php
        //aartiles: Added new block position BLOCK_POS_CENTER
        function blocks_get_positions() { return array(BLOCK_POS_LEFT, BLOCK_POS_RIGHT, BLOCK_POS_CENTER); }

      //aartiles: Changes done for complain with a center blocks position
      function blocks_move_position(&$instance, $move) {
      if($instance->position == BLOCK_POS_LEFT && $move == BLOCK_MOVE_RIGHT)

      { return BLOCK_POS_CENTER; } else if($instance->position == BLOCK_POS_CENTER && $move == BLOCK_MOVE_RIGHT) { return BLOCK_POS_RIGHT; } else if ($instance->position == BLOCK_POS_CENTER && $move == BLOCK_MOVE_LEFT) { return BLOCK_POS_LEFT; } else if ($instance->position == BLOCK_POS_RIGHT && $move == BLOCK_MOVE_LEFT) { return BLOCK_POS_CENTER; }

      return $instance->position;
      }

      Attachments

        1. 1.9.7 center blocks.zip
          31 kB
        2. 1.9.8 patch.zip
          32 kB
        3. centerblocks.patch
          10 kB

        Issue Links

          Activity

            People

              dougiamas Martin Dougiamas
              cboomf luke bridges
              Nobody Nobody
              Huong Nguyen, Barbara Ramiro, Bas Brands, Mathew May
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                24/Nov/10