Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <?php
  2. class SiteSpecificJS extends StudIPPlugin implements SystemPlugin
  3. {
  4. public function __construct()
  5. {
  6. parent::__construct();
  7.  
  8. NotificationCenter::addObserver($this, 'injectJS', 'NavigationDidActivateItem', '/course/main/details');
  9. }
  10.  
  11. public function injectJS()
  12. {
  13. static $injected = false;
  14. if ($injected === false) {
  15. PageLayout::addScript($this->getPluginURL() . '/assets/foo.js');
  16. $injected = true;
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement