1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- function _ctools_registry_files_alter(&$files, $indexed_modules) {
- ctools_include('plugins');
-
- $modules = array();
- foreach ($indexed_modules as $module_object) {
- $modules[$module_object->name] = $module_object;
- }
- $all_type_info = ctools_plugin_get_plugin_type_info(TRUE);
- foreach ($all_type_info as $module => $plugin_types) {
- foreach ($plugin_types as $plugin_type_name => $plugin_type_info) {
- if (empty($plugin_type_info['classes'])) {
-
- continue;
- }
-
- $plugins = ctools_get_plugins($module, $plugin_type_name);
- foreach ($plugins as $plugin_name => $plugin_definition) {
- foreach ($plugin_type_info['classes'] as $class_key) {
- if (empty($plugin_definition[$class_key])) {
-
- continue;
- }
- if (is_string($plugin_definition[$class_key])) {
-
-
-
- $path = $plugin_definition['path'] . '/' . $plugin_definition[$class_key] . '.class.php';
- }
- else {
-
-
- $class = $plugin_definition[$class_key]['class'];
-
-
- $filename = isset($plugin_definition[$class_key]['file']) ? $plugin_definition[$class_key]['file'] : $class . '.class.php';
- $base_path = isset($plugin_definition[$class_key]['path']) ? $plugin_definition[$class_key]['path'] : $plugin_definition['path'];
- $path = "$base_path/$filename";
- }
- if (file_exists($path)) {
-
- $files[$path] = array('module' => $plugin_definition['module'], 'weight' => $modules[$plugin_definition['module']]->weight);
- }
- else {
-
- $args = array(
- '@plugin' => $plugin_definition['name'],
- '@owner' => $module,
- '@type' => $plugin_type_name,
- '@file' => $path,
- '@class' => $class_key,
- );
- watchdog('ctools', 'Plugin @plugin of plugin type @owner:@type points to nonexistent file @file for class handler @class.', $args);
- }
- }
- }
- }
- }
- }
|