Révision 136a805a
Ajouté par Assos Assos il y a plus de 7 ans
drupal7/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php | ||
---|---|---|
151 | 151 |
*/ |
152 | 152 |
var $suffix = ''; |
153 | 153 |
|
154 |
/** |
|
155 |
* Boolean flag indicating whether to render the layout even if all rendered |
|
156 |
* regions are blank. If FALSE, the layout renders as an empty string (without |
|
157 |
* prefix or suffix) if not in administrative mode. |
|
158 |
* |
|
159 |
* @var bool |
|
160 |
*/ |
|
161 |
var $show_empty_layout = TRUE; |
|
162 |
|
|
154 | 163 |
/** |
155 | 164 |
* Receive and store the display object to be rendered. |
156 | 165 |
* |
... | ... | |
176 | 185 |
} |
177 | 186 |
} |
178 | 187 |
|
188 |
/** |
|
189 |
* Get the Panels storage oparation for a given renderer AJAX method. |
|
190 |
* |
|
191 |
* @param string $method |
|
192 |
* The method name. |
|
193 |
* |
|
194 |
* @return string |
|
195 |
* The Panels storage op. |
|
196 |
*/ |
|
197 |
function get_panels_storage_op_for_ajax($method) { |
|
198 |
return 'read'; |
|
199 |
} |
|
200 |
|
|
179 | 201 |
/** |
180 | 202 |
* Prepare the attached display for rendering. |
181 | 203 |
* |
... | ... | |
396 | 418 |
$theme = $this->plugins['layout']['theme']; |
397 | 419 |
} |
398 | 420 |
|
421 |
// Determine whether to render layout. |
|
422 |
$show = TRUE; |
|
423 |
if (!$this->show_empty_layout && !$this->admin) { |
|
424 |
$show = FALSE; |
|
425 |
// Render layout if any region is not empty. |
|
426 |
foreach ($this->rendered['regions'] as $region) { |
|
427 |
if (is_string($region) && $region !== '') { |
|
428 |
$show = TRUE; |
|
429 |
break; |
|
430 |
} |
|
431 |
} |
|
432 |
} |
|
433 |
if (!$show) { |
|
434 |
return; |
|
435 |
} |
|
436 |
|
|
399 | 437 |
$this->rendered['layout'] = theme($theme, array('css_id' => check_plain($this->display->css_id), 'content' => $this->rendered['regions'], 'settings' => $this->display->layout_settings, 'display' => $this->display, 'layout' => $this->plugins['layout'], 'renderer' => $this)); |
400 | 438 |
return $this->prefix . $this->rendered['layout'] . $this->suffix; |
401 | 439 |
} |
... | ... | |
474 | 512 |
* The array of rendered panes, keyed on pane pid. |
475 | 513 |
*/ |
476 | 514 |
function render_panes() { |
515 |
drupal_alter('panels_prerender_panes', $this); |
|
477 | 516 |
ctools_include('content'); |
478 | 517 |
|
479 | 518 |
// First, render all the panes into little boxes. |
... | ... | |
581 | 620 |
if (!empty($content)) { |
582 | 621 |
// Pass long the css_id that is usually available. |
583 | 622 |
if (!empty($pane->css['css_id'])) { |
584 |
$content->css_id = check_plain($pane->css['css_id']); |
|
623 |
$id = ctools_context_keyword_substitute($pane->css['css_id'], array(), $this->display->context); |
|
624 |
$content->css_id = drupal_html_id($id); |
|
585 | 625 |
} |
586 | 626 |
|
587 | 627 |
// Pass long the css_class that is usually available. |
588 | 628 |
if (!empty($pane->css['css_class'])) { |
589 |
$content->css_class = check_plain($pane->css['css_class']); |
|
629 |
$class = ctools_context_keyword_substitute($pane->css['css_class'], array(), $this->display->context, array('css safe' => TRUE)); |
|
630 |
$content->css_class = check_plain(drupal_strtolower($class)); |
|
590 | 631 |
} |
591 | 632 |
} |
592 | 633 |
|
... | ... | |
601 | 642 |
* An array of rendered panel regions, keyed on the region name. |
602 | 643 |
*/ |
603 | 644 |
function render_regions() { |
645 |
drupal_alter('panels_prerender_regions', $this); |
|
604 | 646 |
$this->rendered['regions'] = array(); |
605 | 647 |
|
606 | 648 |
// Loop through all panel regions, put all panes that belong to the current |
Formats disponibles : Unified diff
Weekly update of contrib modules