Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Current
- public function getPlugins($scope, $type, $plugin = NULL) {
- $plugin_type = $this->getPluginType($scope, $type);
- $definition = $plugin_type->get('definition');
- if (empty($definition)) {
- $definition = "plugin.definition";
- }
- if (!empty($plugin)) {
- return config("$definition.$scope.$type.$plugin");
- }
- return config_get_signed_file_storage_names_with_prefix("$definition.$scope.$type");
- }
- //Future?
- public function getPlugins($scope, $type, $plugin = NULL) {
- $plugin_type = $this->getPluginType($scope, $type);
- $definition = $plugin_type->get('definition');
- if (empty($definition)) {
- $definition = "plugin.definition";
- }
- $plugins = array();
- if (!empty($plugin)) {
- $plugins["$definition.$scope.$type.$plugin"] = config("$definition.$scope.$type.$plugin");
- }
- else {
- $definitions = config_get_signed_file_storage_names_with_prefix("$definition.$scope.$type");
- foreach ($definitions as $plugin) {
- $plugins[$plugin] = config($plugin);
- }
- }
- foreach ($plugins as $id => $plugin) {
- $child = $plugin->get('child');
- if (!empty($child)) {
- //hand waving hand off to factory which loads the class and calculates children and appends it into the plugins array.
- }
- }
- return $plugins;
- }
Advertisement
Add Comment
Please, Sign In to add comment