Revision 6e9292aa
Added by Assos Assos over 9 years ago
drupal7/sites/all/modules/ds/includes/ds.field_ui.inc | ||
---|---|---|
770 | 770 |
$record->settings['layout_link_attribute'] = $form_state['values']['additional_settings']['region_wrapper']['layout_link_attribute']; |
771 | 771 |
$record->settings['layout_link_custom'] = $form_state['values']['additional_settings']['region_wrapper']['layout_link_custom']; |
772 | 772 |
|
773 |
// Additional settings |
|
774 |
if (isset($form_state['values']['additional_settings']['preview']['info']['settings']['disable_css'])) { |
|
775 |
$record->settings['layout_disable_css'] = $form_state['values']['additional_settings']['preview']['info']['settings']['disable_css']; |
|
776 |
} |
|
777 |
|
|
773 | 778 |
$record->settings = $record->settings; |
774 | 779 |
|
775 | 780 |
// Let other modules alter the layout settings. |
... | ... | |
1895 | 1900 |
} |
1896 | 1901 |
|
1897 | 1902 |
ksort($suggestions_array); |
1898 |
$suggestions = '<ul><li>' . implode('.tpl.php</li><li>', $suggestions_array) . '.tpl.php</li></ul>'; |
|
1903 |
$suggestions .= '<ul><li>' . implode('.tpl.php</li><li>', $suggestions_array) . '.tpl.php</li></ul>';
|
|
1899 | 1904 |
} |
1900 | 1905 |
else { |
1901 | 1906 |
$suggestions = ''; |
... | ... | |
1916 | 1921 |
$form['additional_settings']['ds_layouts']['preview'] ['image'] = array( |
1917 | 1922 |
'#markup' => '<div class="ds-layout-preview-image"><img src="' . base_path() . $image . '"/></div>', |
1918 | 1923 |
); |
1919 |
$form['additional_settings']['ds_layouts']['preview'] ['suggestions'] = array( |
|
1920 |
'#markup' => '<div class="ds-layout-preview-suggestion"><p>' . $selected . '</p><p>' . t('!suggestions', array('!suggestions' => strtr($suggestions, '_', '-'))) . '</p></div>', |
|
1924 |
$form['additional_settings']['ds_layouts']['preview']['info'] = array( |
|
1925 |
'#type' => 'container', |
|
1926 |
'#attributes' => array( |
|
1927 |
'class' => array('ds-layout-preview-suggestion'), |
|
1928 |
), |
|
1929 |
); |
|
1930 |
$form['additional_settings']['ds_layouts']['preview']['info']['suggestions'] = array( |
|
1931 |
'#markup' => '<p>' . $selected . '</p><p>' . t('!suggestions', array('!suggestions' => strtr($suggestions, '_', '-'))) . '</p>', |
|
1921 | 1932 |
); |
1933 |
|
|
1934 |
if (!empty($chosen_layout['css'])) { |
|
1935 |
$disable_css = FALSE; |
|
1936 |
if (isset($layout->settings['layout_disable_css'])) { |
|
1937 |
$disable_css = $layout->settings['layout_disable_css']; |
|
1938 |
} |
|
1939 |
if (isset($form_state['values']) && $disable_css !== $form_state['values']['additional_settings']['ds_layouts']['preview']['info']['settings']['disable_css']) { |
|
1940 |
$disable_css = $form_state['values']['additional_settings']['ds_layouts']['preview']['info']['settings']['disable_css']; |
|
1941 |
} |
|
1942 |
|
|
1943 |
$form['additional_settings']['ds_layouts']['preview']['info']['settings']['disable_css'] = array( |
|
1944 |
'#type' => 'checkbox', |
|
1945 |
'#title' => t('Disable layout CSS styles'), |
|
1946 |
'#default_value' => $disable_css, |
|
1947 |
); |
|
1948 |
} |
|
1922 | 1949 |
} |
1923 | 1950 |
|
1924 | 1951 |
if (isset($form_state['values']['additional_settings']['layout']) && (!isset($layout->layout) || $form_state['values']['additional_settings']['layout'] != $layout->layout)) { |
... | ... | |
1976 | 2003 |
* Form submission handler for _ds_field_ui_table_layouts_preview(). |
1977 | 2004 |
*/ |
1978 | 2005 |
function ds_field_ui_change_layout_submit($form, &$form_state) { |
2006 |
$values = $form_state['values']; |
|
2007 |
if (isset($values['additional_settings']['preview']['info']['settings']['disable_css'])) { |
|
2008 |
$disable_css = $values['additional_settings']['preview']['info']['settings']['disable_css']; |
|
2009 |
} |
|
2010 |
else { |
|
2011 |
$disable_css = FALSE; |
|
2012 |
} |
|
2013 |
|
|
2014 |
$record = db_select('ds_layout_settings') |
|
2015 |
->fields('ds_layout_settings') |
|
2016 |
->condition('entity_type', $values['ds_entity_type']) |
|
2017 |
->condition('bundle', $values['ds_bundle']) |
|
2018 |
->condition('view_mode', $values['ds_view_mode']) |
|
2019 |
->execute() |
|
2020 |
->fetchObject(); |
|
2021 |
|
|
2022 |
$record->settings = unserialize($record->settings); |
|
2023 |
$record->settings['layout_disable_css'] = $disable_css; |
|
2024 |
|
|
2025 |
drupal_write_record('ds_layout_settings', $record, array('id')); |
|
2026 |
|
|
1979 | 2027 |
unset($_GET['destination']); |
1980 | 2028 |
global $base_url; |
1981 |
$url = $base_url . '/' . $form_state['values']['layout_changed_url'];
|
|
2029 |
$url = $base_url . '/' . $values['layout_changed_url'];
|
|
1982 | 2030 |
$form_state['redirect'] = $url; |
1983 | 2031 |
} |
1984 | 2032 |
|
Also available in: Unified diff
Weekly update of contrib modules