| 1 |
<?php |
<?php |
| 2 |
// $Id: admin.inc,v 1.154.2.10 2009/11/20 21:15:46 merlinofchaos Exp $ |
// $Id: admin.inc,v 1.154.2.11 2009/11/20 22:04:18 merlinofchaos Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file admin.inc |
* @file admin.inc |
| 5 |
* Provides the Views' administrative interface. |
* Provides the Views' administrative interface. |
| 2354 |
$form_state['handler']->options_submit($form['options'], $form_state); |
$form_state['handler']->options_submit($form['options'], $form_state); |
| 2355 |
$item = $form_state['handler']->options; |
$item = $form_state['handler']->options; |
| 2356 |
|
|
| 2357 |
// Unset a button |
// Create a new handler and unpack the options from the form onto it. We |
| 2358 |
unset($form_state['values']['options']['expose_button']); |
// can use that for storage. |
| 2359 |
|
$handler = views_get_handler($item['table'], $item['field'], $form_state['type']); |
| 2360 |
// Store the data we're given. |
|
| 2361 |
foreach ($form_state['values']['options'] as $key => $value) { |
// This unpacks only options that are in the definition, ensuring random |
| 2362 |
$item[$key] = $value; |
// extra stuff on the form is not sent through. |
| 2363 |
} |
$handler->unpack_options($handler->options, $form_state['values']['options'], NULL, FALSE); |
| 2364 |
|
$handler->options['id'] = $item['id']; |
| 2365 |
|
$handler->options['table'] = $item['table']; |
| 2366 |
|
$handler->options['field'] = $item['field']; |
| 2367 |
|
|
| 2368 |
// Store the item back on the view |
// Store the item back on the view |
| 2369 |
$form_state['view']->set_item($form_state['display_id'], $form_state['type'], $form_state['id'], $item); |
$form_state['view']->set_item($form_state['display_id'], $form_state['type'], $form_state['id'], $handler->options); |
| 2370 |
|
|
| 2371 |
if ($form_state['handler'] && $form_state['handler']->needs_style_plugin()) { |
if ($form_state['handler'] && $form_state['handler']->needs_style_plugin()) { |
| 2372 |
views_ui_add_form_to_stack('change-style', $form_state['view'], $form_state['display_id'], array($form_state['type'], $form_state['id']), TRUE); |
views_ui_add_form_to_stack('change-style', $form_state['view'], $form_state['display_id'], array($form_state['type'], $form_state['id']), TRUE); |