Module.php 658 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. ###
  3. # @name Module
  4. # @author Tobias Reich
  5. # @copyright 2014 by Tobias Reich
  6. ###
  7. if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
  8. class Module {
  9. protected $plugins = null;
  10. protected function plugins($name, $location, $args) {
  11. if (!isset($this->plugins, $name, $location, $args)) return false;
  12. # Parse
  13. $location = ($location===0 ? 'before' : 'after');
  14. # Call plugins
  15. $this->plugins->activate($name . ":" . $location, $args);
  16. return true;
  17. }
  18. protected function dependencies($available = false) {
  19. if ($available===false) exit('Error: Can not execute function. Missing parameters and variables.');
  20. }
  21. }