Conjunto de cambios 2efe680 en sipes para modules_contrib/ctools/includes/plugins.inc


Ignorar:
Fecha y hora:
26/05/2016 18:16:05 (hace 8 años)
Autor:
José Gregorio Puentes <jpuentes@…>
Branches:
stable, version-3.0
Children:
dafc8d8
Parents:
49072ea
Mensaje:

se actualizo el modulo

Fichero:
1 editado

Leyenda

No modificado
Añadido
Eliminado
  • modules_contrib/ctools/includes/plugins.inc

    r177a560 r2efe680  
    11<?php
    2 // $Id: plugins.inc,v 1.18.2.30 2010/08/25 20:22:22 merlinofchaos Exp $
    32
    43/**
     
    277276
    278277/**
     278 * Reset all static caches that affect the result of ctools_get_plugins().
     279 */
     280function ctools_get_plugins_reset() {
     281  ctools_static_reset('ctools_plugin_load_includes');
     282  ctools_static_reset('ctools_plugin_api_info');
     283}
     284
     285/**
    279286 * Load plugins from a directory.
    280287 *
     
    290297  // Keep a static array so we don't hit drupal_system_listing more than necessary.
    291298  $all_files = &ctools_static(__FUNCTION__, array());
     299
     300  // store static of plugin arrays for reference because they can't be reincluded.
     301  static $plugin_arrays = array();
    292302
    293303  // If we're being asked for all plugins of a type, skip any caching
     
    339349        // Parse a hook.
    340350        $plugin = NULL; // ensure that we don't have something leftover from earlier.
    341         include_once './' . $file->filename;
    342         // .inc files have a special format for the hook identifier.
    343         // For example, 'foo.inc' in the module 'mogul' using the plugin
    344         // whose hook is named 'borg_type' should have a function named (deep breath)
    345         // mogul_foo_borg_type()
    346 
    347         // If, however, the .inc file set the quasi-global $plugin array, we
    348         // can use that and not even call a function. Set the $identifier
    349         // appropriately and ctools_plugin_process() will handle it.
    350         $identifier = isset($plugin) ? $plugin : $module . '_' . $file->name;
     351
     352        if (isset($plugin_arrays[$file->filename])) {
     353          $identifier = $plugin_arrays[$file->filename];
     354        }
     355        else {
     356
     357          require_once './' . $file->filename;
     358          // .inc files have a special format for the hook identifier.
     359          // For example, 'foo.inc' in the module 'mogul' using the plugin
     360          // whose hook is named 'borg_type' should have a function named (deep breath)
     361          // mogul_foo_borg_type()
     362
     363          // If, however, the .inc file set the quasi-global $plugin array, we
     364          // can use that and not even call a function. Set the $identifier
     365          // appropriately and ctools_plugin_process() will handle it.
     366          if (isset($plugin)) {
     367            $plugin_arrays[$file->filename] = $plugin;
     368            $identifier = $plugin;
     369          }
     370          else {
     371            $identifier = $module . '_' . $file->name;
     372          }
     373        }
    351374        $result = ctools_plugin_process($info, $module, $identifier, dirname($file->filename), basename($file->filename), $file->name);
    352375      }
Nota: Vea TracChangeset para ayuda en el uso del visor de conjuntos de cambios.