Révision 5a7e6170
Ajouté par Florent Torregrosa il y a environ 10 ans
drupal7/sites/all/modules/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php | ||
---|---|---|
134 | 134 |
return "<div id=\"panels-ipe-paneid-{$pane->pid}\" class=\"panels-ipe-portlet-wrapper panels-ipe-portlet-marker\">" . $output . "</div>"; |
135 | 135 |
} |
136 | 136 |
|
137 |
function prepare_panes($panes) { |
|
138 |
// Set to admin mode just for this to ensure all panes are represented. |
|
139 |
$this->admin = TRUE; |
|
140 |
$panes = parent::prepare_panes($panes); |
|
141 |
$this->admin = FALSE; |
|
142 |
} |
|
143 |
|
|
137 | 144 |
function render_pane_content(&$pane) { |
138 |
$content = parent::render_pane_content($pane); |
|
145 |
if (!empty($pane->shown) && panels_pane_access($pane, $this->display)) { |
|
146 |
$content = parent::render_pane_content($pane); |
|
147 |
} |
|
139 | 148 |
// Ensure that empty panes have some content. |
140 | 149 |
if (empty($content) || empty($content->content)) { |
150 |
if (empty($content)) { |
|
151 |
$content = new stdClass(); |
|
152 |
} |
|
153 |
|
|
141 | 154 |
// Get the administrative title. |
142 | 155 |
$content_type = ctools_get_content_type($pane->type); |
143 | 156 |
$title = ctools_content_admin_title($content_type, $pane->subtype, $pane->configuration, $this->display->context); |
144 | 157 |
|
145 |
$content->content = t('Placeholder for empty "@title"', array('@title' => $title));
|
|
158 |
$content->content = t('Placeholder for empty or inaccessible "@title"', array('@title' => html_entity_decode($title, ENT_QUOTES)));
|
|
146 | 159 |
// Add these to prevent notices. |
147 | 160 |
$content->type = 'panels_ipe'; |
148 | 161 |
$content->subtype = 'panels_ipe'; |
... | ... | |
227 | 240 |
$_POST['ajax_html_ids'] = array(); |
228 | 241 |
|
229 | 242 |
$form_state = array( |
243 |
'renderer' => $this, |
|
230 | 244 |
'display' => &$this->display, |
231 | 245 |
'content_types' => $this->cache->content_types, |
232 | 246 |
'rerender' => FALSE, |
... | ... | |
244 | 258 |
'command' => 'initIPE', |
245 | 259 |
'key' => $this->clean_key, |
246 | 260 |
'data' => drupal_render($output), |
247 |
'lockPath' => $this->get_url('unlock_ipe'),
|
|
261 |
'lockPath' => url($this->get_url('unlock_ipe')),
|
|
248 | 262 |
); |
249 | 263 |
return; |
250 | 264 |
} |
... | ... | |
315 | 329 |
$this->commands[] = array( |
316 | 330 |
'command' => 'IPEsetLockState', |
317 | 331 |
'key' => $this->clean_key, |
318 |
'lockPath' => $this->get_url('unlock_ipe'),
|
|
332 |
'lockPath' => url($this->get_url('unlock_ipe')),
|
|
319 | 333 |
); |
320 | 334 |
} |
321 | 335 |
|
... | ... | |
344 | 358 |
if (!empty($form_state['clicked_button']['#save-display'])) { |
345 | 359 |
// Saved. Save the cache. |
346 | 360 |
panels_edit_cache_save($this->cache); |
347 |
$this->display->skip_cache; |
|
361 |
$this->display->skip_cache = TRUE;
|
|
348 | 362 |
|
349 | 363 |
// Since the layout changed, we have to update these things in the |
350 | 364 |
// renderer in order to get the right settings. |
... | ... | |
391 | 405 |
$pane = $this->display->content[$pid]; |
392 | 406 |
} |
393 | 407 |
|
394 |
$this->commands[] = ajax_command_prepend("#panels-ipe-regionid-{$pane->panel} div.panels-ipe-sort-container", $this->render_pane($pane)); |
|
408 |
$this->commands[] = array( |
|
409 |
'command' => 'insertNewPane', |
|
410 |
'regionId' => $pane->panel, |
|
411 |
'renderedPane' => $this->render_pane($pane), |
|
412 |
); |
|
395 | 413 |
$this->commands[] = ajax_command_changed("#panels-ipe-display-{$this->clean_key}"); |
414 |
$this->commands[] = array( |
|
415 |
'command' => 'addNewPane', |
|
416 |
'key' => $this->clean_key, |
|
417 |
); |
|
396 | 418 |
} |
397 | 419 |
} |
398 | 420 |
|
... | ... | |
430 | 452 |
'#type' => 'submit', |
431 | 453 |
'#value' => t('Save'), |
432 | 454 |
'#id' => 'panels-ipe-save', |
455 |
'#attributes' => array('class' => array('panels-ipe-save')), |
|
433 | 456 |
'#submit' => array('panels_edit_display_form_submit'), |
434 | 457 |
'#save-display' => TRUE, |
435 | 458 |
); |
436 | 459 |
$form['buttons']['cancel'] = array( |
437 | 460 |
'#type' => 'submit', |
438 | 461 |
'#id' => 'panels-ipe-cancel', |
462 |
'#attributes' => array('class' => array('panels-ipe-cancel')), |
|
439 | 463 |
'#value' => t('Cancel'), |
440 | 464 |
); |
441 | 465 |
return $form; |
Formats disponibles : Unified diff
Update :