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

Ability to add an item into any place in the admin tree

    Details

    • Testing Instructions:
      Hide

      Testing difficulty: trivial

      $ phpunit lib/tests/admintree_test.php

      Make sure the Administration block (also known as the Settings block in stable versions) still works (branches can expand etc) and there is not developer debugging warning related to this change displayed.

      Show
      Testing difficulty: trivial $ phpunit lib/tests/admintree_test.php Make sure the Administration block (also known as the Settings block in stable versions) still works (branches can expand etc) and there is not developer debugging warning related to this change displayed.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38497-admintree-beforesibling

      Description

      Currently, the parentable_part_of_admin_tree::add() method appends the new part as the last child of the given destination. Therefore, the order of items in the admin tree is given exclusively by the order of $ADMIN->add() calls. It would be really nice if, for example, plugins had an option to add their nodes anywhere into the tree.

      My particular use case that led me to implement this was that I am working on a new admin tool and I want it appearing just below the Site administration > Plugins > Plugins overview (not as a child but as a sibling). But because the core already put other nodes there (Activities, Blocks, ...), my admin tool has got no way to inject itself there.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            mudrd8mz David Mudrak added a comment -

            Petr Skoda, you are mentioned as the maintainer of the admin tree in the code. Can you please peer-review this? Please see commit messages as well. TIA.

            Show
            mudrd8mz David Mudrak added a comment - Petr Skoda , you are mentioned as the maintainer of the admin tree in the code. Can you please peer-review this? Please see commit messages as well. TIA.
            Hide
            skodak Petr Skoda added a comment -

            +1

            Show
            skodak Petr Skoda added a comment - +1
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated, thanks!

            (amazing all those wrong uses you found)

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (amazing all those wrong uses you found)
            Hide
            andyjdavis Andrew Davis added a comment -

            I've raised MDL-38563 which may be caused by this issue.

            Show
            andyjdavis Andrew Davis added a comment - I've raised MDL-38563 which may be caused by this issue.
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            All Looks good to me.
            Tests passed.
            Didn't see any debug warnings or notices.
            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - All Looks good to me. Tests passed. Didn't see any debug warnings or notices. Thanks
            Hide
            damyon Damyon Wiese added a comment -

            This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads).

            Thanks for your contributions!

            Show
            damyon Damyon Wiese added a comment - This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads). Thanks for your contributions!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13