You are here

function mlpanels_ctools_plugin_pre_alter in Multilingual Panels 7

Implements hook _ctools_plugin_pre_alter().

Change editor renderer to multilingual, renderer has backward compability and will pass any action if display does not have ML standard renderer.

File

./mlpanels.module, line 84
Multilingual panels.

Code

function mlpanels_ctools_plugin_pre_alter(&$plugin, &$info) {

  // Override a function defined by the plugin.
  if ($plugin['name'] == 'editor' && $plugin['plugin type'] == 'display_renderers') {

    // Save original plugin.
    variable_set('mlpanels_ctools_plugin_editor', $plugin);

    // Preload all necessary files.
    if ($plugin['renderer'] != 'panels_renderer_standard') {
      require_once $plugin['path'] . '/' . 'panels_renderer_standard.class.php';
    }
    require_once $plugin['path'] . '/' . $plugin['renderer'] . '.class.php';

    // Order plugin to use our class.
    if (class_exists('panels_renderer_editor')) {
      $plugin['renderer'] = MLPANELS_RENDERER_EDITOR_CLASS;
    }
  }
}