Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class SiteSpecificJS extends StudIPPlugin implements SystemPlugin
- {
- public function __construct()
- {
- parent::__construct();
- NotificationCenter::addObserver($this, 'injectJS', 'NavigationDidActivateItem', '/course/main/details');
- }
- public function injectJS()
- {
- static $injected = false;
- if ($injected === false) {
- PageLayout::addScript($this->getPluginURL() . '/assets/foo.js');
- $injected = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement