You are here

class mlpanels_renderer_standard in Multilingual Panels 7

Extends standard renderer, allow Multilingual configs.

Hierarchy

Expanded class hierarchy of mlpanels_renderer_standard

2 string references to 'mlpanels_renderer_standard'
mlpanels.module in ./mlpanels.module
Multilingual panels.
mlpanels_renderer_standard.inc in plugins/display_renderers/mlpanels_renderer_standard.inc

File

plugins/display_renderers/mlpanels_renderer_standard.class.php, line 10
Class replacement for standard renderer.

View source
class mlpanels_renderer_standard extends panels_renderer_standard {

  /**
   * Render pane replacement.
   *
   * Parse multilingual config and choose apropriate for current language.
   */
  function render_pane(&$pane) {
    global $language;

    // Check if we should skip pane translation.
    if (_mlpanels_pane_skip($pane->type, $pane->subtype)) {

      // Pass to default renderer.
      return parent::render_pane($pane);
    }

    // Prepare language dependent config.
    if (!empty($pane->configuration['mlpanels'])) {
      $ml_config = $pane->configuration['mlpanels'];
      $ml_config[LANGUAGE_NONE] = $pane->configuration;
      unset($ml_config[LANGUAGE_NONE]['mlpanels']);
    }
    else {
      $ml_config[LANGUAGE_NONE] = $pane->configuration;
    }

    // Set pane config to render.
    $pane->configuration = !empty($ml_config[$language->language]) ? $ml_config[$language->language] : $ml_config[LANGUAGE_NONE];

    // Pass to default renderer.
    return parent::render_pane($pane);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
mlpanels_renderer_standard::render_pane function Render pane replacement. Overrides panels_renderer_standard::render_pane
panels_renderer_standard::$admin property TRUE if this renderer is rendering in administrative mode which will allow layouts to have extra functionality. 1
panels_renderer_standard::$display property The fully-loaded Panels display object that is to be rendered. "Fully loaded" is defined as: 1. Having been produced by panels_load_displays(), whether or this page request or at some time in the past and the object was exported. 2. Having…
panels_renderer_standard::$meta_location property Where to add standard meta information. There are three possibilities:
panels_renderer_standard::$plugin property The plugin that defines this handler.
panels_renderer_standard::$plugins property An associative array of loaded plugins. Used primarily as a central location for storing plugins that require additional loading beyond reading the plugin definition, which is already statically cached by ctools_get_plugins(). An example is layout…
panels_renderer_standard::$prefix property Include rendered HTML prior to the layout.
panels_renderer_standard::$prepared property A multilevel array of data prepared for rendering. The first level of the array indicates the type of prepared data. The standard renderer populates and uses two top-level keys, 'panes' and 'regions':
panels_renderer_standard::$prep_run property Boolean state variable, indicating whether or not the prepare() method has been run.
panels_renderer_standard::$rendered property A multilevel array of rendered data. The first level of the array indicates the type of rendered data, typically with up to three keys: 'layout', 'regions', and 'panes'. The relevant rendered data is stored as the value…
panels_renderer_standard::$show_empty_layout property Boolean flag indicating whether to render the layout even if all rendered regions are blank. If FALSE, the layout renders as an empty string (without prefix or suffix) if not in administrative mode.
panels_renderer_standard::$suffix property Include rendered HTML after the layout.
panels_renderer_standard::add_css function Add CSS information to the renderer.
panels_renderer_standard::add_meta function Attach out-of-band page metadata (e.g., CSS and JS). 1
panels_renderer_standard::get_panels_storage_op_for_ajax function Get the Panels storage oparation for a given renderer AJAX method. 1
panels_renderer_standard::init function Receive and store the display object to be rendered.
panels_renderer_standard::prepare function Prepare the attached display for rendering. 1
panels_renderer_standard::prepare_panes function Prepare the list of panes to be rendered, accounting for visibility/access settings and rendering order. 1
panels_renderer_standard::prepare_regions function Prepare the list of regions to be rendered.
panels_renderer_standard::render function Build inner content, then hand off to layout-specified theme function for final render step. 1
panels_renderer_standard::render_layout function Perform display/layout-level render operations.
panels_renderer_standard::render_panes function Render all prepared panes, first by dispatching to their plugin's render callback, then handing that output off to the pane's style plugin. 1
panels_renderer_standard::render_pane_content function Render the interior contents of a single pane. 1
panels_renderer_standard::render_region function Render a single panel region. 1
panels_renderer_standard::render_regions function Render all prepared regions, placing already-rendered panes into their appropriate positions therein. 1