EclipseGc

Untitled

Feb 20th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.34 KB | None | 0 0
  1. //Current
  2.  
  3. public function getPlugins($scope, $type, $plugin = NULL) {
  4.     $plugin_type = $this->getPluginType($scope, $type);
  5.     $definition = $plugin_type->get('definition');
  6.     if (empty($definition)) {
  7.       $definition = "plugin.definition";
  8.     }
  9.     if (!empty($plugin)) {
  10.       return config("$definition.$scope.$type.$plugin");
  11.     }
  12.     return config_get_signed_file_storage_names_with_prefix("$definition.$scope.$type");
  13.   }
  14.  
  15. //Future?
  16.  
  17. public function getPlugins($scope, $type, $plugin = NULL) {
  18.     $plugin_type = $this->getPluginType($scope, $type);
  19.     $definition = $plugin_type->get('definition');
  20.     if (empty($definition)) {
  21.       $definition = "plugin.definition";
  22.     }
  23.     $plugins = array();
  24.     if (!empty($plugin)) {
  25.       $plugins["$definition.$scope.$type.$plugin"] = config("$definition.$scope.$type.$plugin");
  26.     }
  27.     else {
  28.       $definitions = config_get_signed_file_storage_names_with_prefix("$definition.$scope.$type");
  29.       foreach ($definitions as $plugin) {
  30.         $plugins[$plugin] = config($plugin);
  31.       }
  32.     }
  33.     foreach ($plugins as $id => $plugin) {
  34.       $child = $plugin->get('child');
  35.       if (!empty($child)) {
  36.         //hand waving hand off to factory which loads the class and calculates children and appends it into the plugins array.
  37.       }
  38.     }
  39.     return $plugins;
  40.   }
Advertisement
Add Comment
Please, Sign In to add comment