Révision 08475715
Ajouté par Assos Assos il y a plus de 7 ans
drupal7/sites/all/modules/panels/plugins/task_handlers/panel_context.inc | ||
---|---|---|
219 | 219 |
* for the handler and pla |
220 | 220 |
*/ |
221 | 221 |
function &panels_panel_context_get_display(&$handler) { |
222 |
if (isset($handler->conf['display'])) { |
|
223 |
return $handler->conf['display']; |
|
224 |
} |
|
225 |
|
|
226 |
if (isset($handler->conf['did'])) { |
|
227 |
$handler->conf['display'] = panels_load_display($handler->conf['did']); |
|
222 |
if (!isset($handler->conf['display'])) { |
|
223 |
if (isset($handler->conf['did'])) { |
|
224 |
$handler->conf['display'] = panels_load_display($handler->conf['did']); |
|
225 |
} |
|
228 | 226 |
|
229 |
// Check for a valid display. If no valid display can be loaded, something
|
|
230 |
// is wrong and we'll create a new one. |
|
231 |
if (!empty($handler->conf['display'])) {
|
|
232 |
return $handler->conf['display'];
|
|
227 |
// Check for again for a valid display. If no valid display could be loaded,
|
|
228 |
// something is wrong and we'll create a new one.
|
|
229 |
if (empty($handler->conf['display'])) { |
|
230 |
$handler->conf['display'] = panels_new_display();
|
|
233 | 231 |
} |
234 | 232 |
} |
235 | 233 |
|
236 |
$handler->conf['display'] = panels_new_display(); |
|
234 |
$display =& $handler->conf['display']; |
|
235 |
$display->storage_type = 'page_manager'; |
|
236 |
$display->storage_id = !empty($handler->name) ? $handler->name : 'new'; |
|
237 | 237 |
|
238 |
return $handler->conf['display'];
|
|
238 |
return $display;
|
|
239 | 239 |
} |
240 | 240 |
|
241 | 241 |
/** |
... | ... | |
371 | 371 |
ctools_include('css'); |
372 | 372 |
ctools_css_clear('panel_context:' . $handler->name); |
373 | 373 |
|
374 |
if (isset($page->conf['temp_layout'])) {
|
|
375 |
unset($page->conf['temp_layout']);
|
|
374 |
if (isset($handler->conf['temp_layout'])) {
|
|
375 |
unset($handler->conf['temp_layout']);
|
|
376 | 376 |
} |
377 | 377 |
} |
378 | 378 |
|
... | ... | |
586 | 586 |
|
587 | 587 |
$form_state['display'] = &panels_panel_context_get_display($form_state['handler']); |
588 | 588 |
|
589 |
// Grab the storage_type and storage_id and inject it into the display. |
|
590 |
if (empty($form_state['display']->storage_type)) { |
|
591 |
if (!isset($form_state[$form_state['task_id']]->storage_type)) { |
|
592 |
watchdog('panels', "Unable to find the storage type for specified storage. Read 'Upgrading task handlers' in CHANGELOG.txt", array(), WATCHDOG_ERROR); |
|
593 |
$form_state['display']->storage_type = 'unknown'; |
|
594 |
} |
|
595 |
else { |
|
596 |
$form_state['display']->storage_type = $form_state[$form_state['task_id']]->storage_type; |
|
597 |
} |
|
598 |
// When adding variants, we don't know the handler id yet. In that case, |
|
599 |
// Mark it as new. We'll assign it later. |
|
600 |
$form_state['display']->storage_id = !empty($form_state['handler_id']) ? $form_state['handler_id'] : 'new'; |
|
601 |
} |
|
602 | 589 |
// Tell the Panels form not to display buttons. |
603 | 590 |
$form_state['no buttons'] = TRUE; |
604 | 591 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules