示例#1
0
文件: template.php 项目: Joanl/ding
function dynamo_panels_default_style_render_panel($display, $panel_id, $panes, $settings)
{
    $output = '';
    $print_separator = FALSE;
    foreach ($panes as $pane_id => $content) {
        // Add the separator if we've already displayed a pane.
        if ($print_separator) {
            // $output .= '<div class="panel-separator"></div>';
        }
        $output .= $text = panels_render_pane($content, $display->content[$pane_id], $display);
        // If we displayed a pane, this will become true; if not, it will become
        // false.
        $print_separator = (bool) $text;
    }
    return $output;
}
 /**
  * Render a single panel region.
  *
  * Primarily just a passthrough to the panel region rendering callback
  * specified by the style plugin that is attached to the current panel region.
  *
  * @param $region_name
  *   The ID of the panel region being rendered
  * @param $panes
  *   An array of panes that are assigned to the panel that's being rendered.
  *
  * @return
  *   The rendered HTML for the passed-in panel region.
  */
 function render_region($region_name, $panes)
 {
     list($style, $style_settings) = panels_get_panel_style_and_settings($this->display->panel_settings, $region_name);
     $callback = 'render panel';
     // Retrieve the pid (can be a panel page id, a mini panel id, etc.), this
     // might be used (or even necessary) for some panel display styles.
     $owner_id = 0;
     if (isset($this->display->owner) && is_object($this->display->owner) && isset($this->display->owner->id)) {
         $owner_id = $this->display->owner->id;
     }
     // Check to see if we're actually running a current style plugin even though
     // we're in the legacy renderer
     if (version_compare($style['version'], 2.0, '>=')) {
         // We are, so pre-render the content as the current version expects
         foreach ($panes as $pane_id => $pane) {
             $content = panels_render_pane($pane, $this->display->content[$pane_id], $this->display);
             if ($content) {
                 $panes[$pane_id] = $content;
             } else {
                 unset($panes[$pane_id]);
             }
         }
         // And set the callback to the new key
         $callback = 'render region';
     }
     return theme($style[$callback], $this->display, $owner_id, $panes, $style_settings, $region_name, $style);
 }