You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if the plugin didn't need you to patch htdocs/view/blocks.php. I think the reason it has this, is because the PluginBlocktype::get_instance_javascript() method only allows you to load up Javascript files that are stored within the blocktype's directory (e.g. htdocs/artefact/cloud/blocktype/box/js/...). But each of these blocktypes relies on the same couple of JS libraries, so reasonable these are stored at the artefact level (htdocs/artefact/cloud/lib...) instead of being duplicated under each blocktype.
I think I see a workaround for this, though. In looking through the implementation of PluginBlocktype, it seems that get_instance_javascript() can either mention files by name alone, in which case they must be located under the blocktype, or you can give a full URL to the file. Which means you might be able to work around this problem by making the cloud blocks use get_instance_javascript with the full URL to their needed JS libraries, calculated dynamically using $CFG->wwwroot.
I haven't had a chance to test this, though, so it still may not work. In which case, Mahara core might need a patch to improve the blocktype API to accommodate this situation.
The text was updated successfully, but these errors were encountered:
It would be great if the plugin didn't need you to patch htdocs/view/blocks.php. I think the reason it has this, is because the PluginBlocktype::get_instance_javascript() method only allows you to load up Javascript files that are stored within the blocktype's directory (e.g. htdocs/artefact/cloud/blocktype/box/js/...). But each of these blocktypes relies on the same couple of JS libraries, so reasonable these are stored at the artefact level (htdocs/artefact/cloud/lib...) instead of being duplicated under each blocktype.
I think I see a workaround for this, though. In looking through the implementation of PluginBlocktype, it seems that get_instance_javascript() can either mention files by name alone, in which case they must be located under the blocktype, or you can give a full URL to the file. Which means you might be able to work around this problem by making the cloud blocks use get_instance_javascript with the full URL to their needed JS libraries, calculated dynamically using $CFG->wwwroot.
I haven't had a chance to test this, though, so it still may not work. In which case, Mahara core might need a patch to improve the blocktype API to accommodate this situation.
The text was updated successfully, but these errors were encountered: