Révision e4c061ad
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/panels/plugins/display_renderers/panels_renderer_editor.class.php | ||
---|---|---|
161 | 161 |
if ($buttons) { |
162 | 162 |
$output .= '<span class="buttons">' . $buttons . '</span>'; |
163 | 163 |
} |
164 |
$output .= '<span class="text">' . $title . '</span>'; |
|
164 |
$output .= '<span class="text" title="' . check_plain($title) . '">' . $title . '</span>';
|
|
165 | 165 |
$output .= '</div>'; // grabber |
166 | 166 |
|
167 | 167 |
$output .= '<div class="panel-pane-collapsible">'; |
... | ... | |
467 | 467 |
drupal_alter('get_pane_links', $links, $pane, $content_type); |
468 | 468 |
|
469 | 469 |
$dropdown_links = $links['top']; |
470 |
foreach (array( |
|
471 |
'style' => 'Style', |
|
472 |
'visibility' => 'Visibility rules', |
|
473 |
'lock' => 'Locking', |
|
474 |
'cache' => 'Caching' |
|
475 |
) as $category => $label) { |
|
476 |
$dropdown_links[] = array( |
|
477 |
'title' => '<hr />', |
|
478 |
'html' => TRUE, |
|
479 |
); |
|
480 |
$dropdown_links[] = array( |
|
481 |
'title' => '<span class="dropdown-header">' . t($label) . '</span>' . theme_links(array('links' => $links[$category], 'attributes' => array(), 'heading' => array())), |
|
482 |
'html' => TRUE, |
|
483 |
'attributes' => array('class' => array('panels-sub-menu')), |
|
484 |
); |
|
470 |
$category_labels = array( |
|
471 |
'style' => 'Style', |
|
472 |
'visibility' => 'Visibility rules', |
|
473 |
'lock' => 'Locking', |
|
474 |
'cache' => 'Caching', |
|
475 |
); |
|
476 |
foreach ($category_labels as $category => $label) { |
|
477 |
if (array_key_exists($category, $links)) { |
|
478 |
$dropdown_links[] = array( |
|
479 |
'title' => '<hr />', |
|
480 |
'html' => TRUE, |
|
481 |
); |
|
482 |
$dropdown_links[] = array( |
|
483 |
'title' => '<span class="dropdown-header">' . t($label) . '</span>' . theme_links(array('links' => $links[$category], 'attributes' => array(), 'heading' => array())), |
|
484 |
'html' => TRUE, |
|
485 |
'attributes' => array('class' => array('panels-sub-menu')), |
|
486 |
); |
|
487 |
} |
|
485 | 488 |
} |
486 | 489 |
|
487 | 490 |
$dropdown_links[] = array( |
... | ... | |
944 | 947 |
ctools_include('content'); |
945 | 948 |
$pane = &$this->display->content[$pid]; |
946 | 949 |
$style = isset($pane->style['style']) ? $pane->style['style'] : 'default'; |
947 |
$subtype = ctools_content_get_subtype($pane->type, $pane->subtype); |
|
948 |
$title = t('Pane style for "!pane"', array('!pane' => $subtype['title'])); |
|
950 |
$title = ctools_content_admin_title($pane->type, $pane->subtype, $pane->configuration, $this->display->context); |
|
951 |
if (!$title) { |
|
952 |
$title = $pane->type; |
|
953 |
} |
|
954 |
$title = t('Pane style for "!title"', array('!title' => $title)); |
|
949 | 955 |
break; |
950 | 956 |
|
951 | 957 |
default: |
... | ... | |
1160 | 1166 |
unset($this->cache->style); |
1161 | 1167 |
} |
1162 | 1168 |
|
1169 |
if (!empty($form_state['cancel'])) { |
|
1170 |
// The cache must be saved prior to dismissing the modal. |
|
1171 |
panels_edit_cache_set($this->cache); |
|
1172 |
$this->commands[] = ctools_modal_command_dismiss(); |
|
1173 |
return; |
|
1174 |
} |
|
1175 |
|
|
1163 | 1176 |
// Copy settings from form state back into the cache. |
1164 | 1177 |
if(!empty($form_state['values']['settings'])) { |
1165 |
$this->cache->display->content[$pid]->style['settings'] = $form_state['values']['settings']; |
|
1178 |
if ($type == 'pane') { |
|
1179 |
$this->cache->display->content[$pid]->style['settings'] = $form_state['values']['settings']; |
|
1180 |
} |
|
1181 |
else if($type == 'region') { |
|
1182 |
$this->cache->display->panel_settings['style_settings'][$pid] = $form_state['values']['settings']; |
|
1183 |
} |
|
1166 | 1184 |
} |
1167 | 1185 |
|
1168 | 1186 |
panels_edit_cache_set($this->cache); |
... | ... | |
1697 | 1715 |
'#value' => t('Save'), |
1698 | 1716 |
); |
1699 | 1717 |
|
1718 |
|
|
1719 |
// Need a cancel button since the style cache can persist and impact the wrong |
|
1720 |
// pane (or region, or display). |
|
1721 |
$form['cancel_style'] = array( |
|
1722 |
'#type' => 'submit', |
|
1723 |
'#value' => t('Cancel'), |
|
1724 |
'#submit' => array('panels_edit_style_settings_form_cancel'), |
|
1725 |
); |
|
1726 |
|
|
1700 | 1727 |
return $form; |
1701 | 1728 |
} |
1702 | 1729 |
|
1730 |
/** |
|
1731 |
* Cancel style settings form. |
|
1732 |
* |
|
1733 |
* Clears the editing cache to prevent styles being applied to incorrect regions |
|
1734 |
* or panes. |
|
1735 |
*/ |
|
1736 |
function panels_edit_style_settings_form_cancel($form, &$form_state) { |
|
1737 |
$form_state['cancel'] = TRUE; |
|
1738 |
} |
|
1739 |
|
|
1703 | 1740 |
/** |
1704 | 1741 |
* Validate style settings. |
1705 | 1742 |
*/ |
Formats disponibles : Unified diff
Weekly update of contrib modules