M.cfg.wwwroot + '/blocks/course_overview/change_visibility.php',
//step 2 : do something to re render the template now the course visibility have change (any way to change only the line? how it's done, look like it will change the full block)
//should look something like that I think, but I have no idea how I'm supposed to get the "new_data" ...
After becoming crazy many times reading/trying, i finally made another step after looking more carefully the html code...
When i call my php file with ajax, to get this value and then get the instance of this object :
$block_instanceid = required_param('block_instanceid', PARAM_INT);
(it's so easy when it's written but it took me so long to write this 3 lines -_- )
This allow me to call function get_content()
It's "working", but it doesn't look like the normal code like in the docs (seems a bit hacky i don't like it)
Looking more closely the code of get_content(), it's seems i need to change just the end of the function to get the return I need.
I tried to make another function and change the end of get_content like this :
$renderer = $this->page->get_renderer('block_course_overview');
$main = new block_course_overview\output\main($config, $tabs, $isediting, $tab, $sortorder, $favourites);
Then I call it like this in my php ajax_script :
The problem is $test contain all the good values expect all the links , which are all empty..
I tried to look values in process_tab, it's look ok, but if I look in export_for_template it's not.
If anyone have any idea of what happens, thanks to say me because i don't have any :'(
(If it's not clear, I actually updated the github fork )
Which moodle version are you using? Which theme?
Be careful with course_overview block. I think it will be removed from core in 3.7 (but maybe I am wrong).
It is clearly possible to add that "show/hide" function in myoverview block, even if it's a little more tricky with 3.6 than with 3.5.
So if you want to implement that in myoverview rather than course_overview, come back to me (in French if you like ) and I'll give you hints
I'm using Moodle 3.5 with theme adaptable.
If I have understand well, they have already removed it from the core (that's why now it's a plugin), and it probably going to stop working in 3.7
The problem is our users really don't like the "new" (introduced in 3.3 ?) myoverview so we kept the "old" one while we can and we will change when it's will no longer work.
To make it really clean, I should have try to change more code and i don't have enough time for it now (and this code is probably going to garbage in something like 1 or 2 year, so it's not worth to spend more time on this just to go around an "hacky" step (a working one actually))