2014-04-04 19:27:10 +00:00
|
|
|
<?php
|
|
|
|
|
2016-01-26 14:31:53 +00:00
|
|
|
namespace Lychee\Modules;
|
2014-04-04 19:27:10 +00:00
|
|
|
|
2016-01-19 10:45:41 +00:00
|
|
|
abstract class Module {
|
2014-04-04 19:27:10 +00:00
|
|
|
|
|
|
|
protected function plugins($name, $location, $args) {
|
|
|
|
|
2016-01-24 21:14:20 +00:00
|
|
|
self::dependencies(isset($name, $location, $args));
|
2014-04-04 19:27:10 +00:00
|
|
|
|
|
|
|
# Parse
|
|
|
|
$location = ($location===0 ? 'before' : 'after');
|
|
|
|
|
|
|
|
# Call plugins
|
2016-01-24 21:14:20 +00:00
|
|
|
Plugins::get()->activate($name . ":" . $location, $args);
|
2014-04-04 19:27:10 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-01-19 10:45:41 +00:00
|
|
|
final public static function dependencies($available = false) {
|
2014-04-19 19:07:36 +00:00
|
|
|
|
2014-04-26 15:00:31 +00:00
|
|
|
if ($available===false) exit('Error: Can not execute function. Missing parameters or variables.');
|
2014-04-19 19:07:36 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-04-28 08:17:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|