moodle-format_onetopic icon indicating copy to clipboard operation
moodle-format_onetopic copied to clipboard

Child tabs should move with parent tab

Open Jarvil opened this issue 7 years ago • 5 comments

Hello,

at the moment any child tabs remains in the same position (under same parent topic location) if you move the parent tab with "Tabs edition utilities" and "Move current topic"

In my opinion child tabs should move with parent tabs because it requires lots of work to move every child tab manually if you have 20 of them.

Jarvil avatar Nov 29 '17 10:11 Jarvil

I managed to do this in a rather hacky way:

  • copy and hack moodle/course/lib.php functions move_section_to and reorder_sections
  • copy and hack moodle/course/view.php (which calls the above functions)
  • replace relevant references to moodle/course/view.php with references to hacked copy

I'm not sure it's desirable, since it may be difficult to maintain as Moodle changes, and I'm not sure there's any better way to do it, since nested sections aren't a standard part of Moodle. However for interest, code for this can (at the time of writing) be found in my (unfinished and buggy) course format: https://github.com/james-cnz/moodle-format_multisection

james-cnz avatar Jan 07 '19 03:01 james-cnz

Hi David,

Would you be interested in the topic options move left / move right being changed so it moves child tabs with parent tabs? I've had this code in my format for a while now, and it seems to work well, and so far I haven't had any issues with needing to change it because of Moodle changes.

EDIT: It would involve more changes to the section menu, and the code for remembering parent sections, so I'd probably wait until you've accepted or rejected the current pull requests before adding this one.

james-cnz avatar May 29 '23 10:05 james-cnz

@davidherney

Urpokarhu1 avatar May 29 '23 10:05 Urpokarhu1

We're running OneTopic vers 4.1.05(PiedrasTeherán) 2022081609 under Moodle Version 4.1.6+ (Build: 20231027). I've found that duplicating Topic "A" in OneTopic causes A's child topics (A.1, A.2, etc.) to then belong to the new cloned topic, "B". This seems because OneTopic specifies child topics as belonging to "the previous topic", instead of to the actual name of a particular topic. When cloning sections in my course (e.g. Duplicate), this seems very weird, and I cannot see how I would move the child sections back under their original parent. Has someone got a solution?

ejohnlove avatar Dec 01 '23 23:12 ejohnlove

It seems like the "Move Left" and "Move Right" edit functions can be used if child sections get "slid" into a different parent topic after one duplicates a Topic. That is not an intuitive solution.

Dear developer, could you please make it so that child topics are "bound" to their parent topics, instead of being able to slide around into potential orphanhood?

> We're running OneTopic vers 4.1.05(PiedrasTeherán) 2022081609 under Moodle Version 4.1.6+ (Build: 20231027). I've found that duplicating Topic "A" in OneTopic causes A's child topics (A.1, A.2, etc.) to then belong to the new cloned topic, "B". This seems because OneTopic specifies child topics as belonging to "the previous topic", instead of to the actual name of a particular topic. When cloning sections in my course (e.g. Duplicate), this seems very weird, and I cannot see how I would move the child sections back under their original parent. Has someone got a solution?

ejohnlove avatar Dec 01 '23 23:12 ejohnlove