Changing a form function to block_configure function
I have a form function today:
That I use to allow administrators to customize content and settings for an online tool. Once changes have been made to the form, they can be saved, which I do today using a form submit function using db_update and the fields method for assigning values. As you can see the values are assigned based on passing $form_state into the function.
$price_update = db_update ('fielddata')
'title' => $form_state['values']['price_title'],
'desc' => $form_state['values']['price_description'],
'value' => $form_state['values']['price_value'],
'minvalue' => $form_state['values']['price_minvalue'],
'maxvalue' => $form_state['values']['price_maxvalue'],
These two functions work perfectly well as implemented and the data gets saved to the proper table correctly.
Now, I'd like to convert these two functions to block_configuration and block_save functions, respectively so that they can be accessed in the block configuration area. In reviewing the examples module, it looks like the correct functions are as follows:
When I've implemented this in my code, wrapping the function around the previously working code, the block_configure function works as it is supposed to. The form is accessible when accessing the configuration settings for the block and retrieves settings data from the database as it should. What is not working is the block_save function.
As I know that I was pulling data from $form_state previously and my existing code references it, I'm pretty sure I need to find the proper way to pass that information into the block_save function. But I'm not sure how to do that.
I'd appreciate any help from anybody that has accomplished such a conversion or who has experience working with the block_configure and block_save hooks.