Could you make 'Save' button text customizable please
M_Z - October 15, 2009 - 10:21
| Project: | DraggableViews |
| Version: | 6.x-3.3-beta2 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
Jump to:
Description
Maybe it would be nice for other users, too.
I think that a good place could be the configuration settings for 'Draggable Table'-style inside views administration area.

#1
Write a new module for customization issues.
In your custom_module.module file you simply write
<?phpfunction custom_module_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'draggableviews_view_draggabletable_form_{VIEW_NAME}_{DISPLAY_ID}') {
$form['submit']['#value'] = '{BUTTON_LABEL}';
}
}
?>
where you have to replace {VIEW_NAME} with the view-name, {DISPLAY_ID} with the display_id and {BUTTON_LABEL} with your custom button label.
Easy enough? :)
Greetings,
sevi
#2
Thank you for your instructions.
I know FAPI and I know how to change a form button value with it, but you can see in your own example that my hook_form_alter depends on two variables (VIEW_NAME and DISPLAY_ID). Each time I change one of them I have to adjust my hook_form_alter callback.
My idea was to put the 'Save' button text into the configuration settings where I can already find a lot of options in the 'Defaults: Style options: Draggable Table Settings' section. Then there is no need to adjust my customized button text if one of the above variables is changing.
But I can live with your suggestion. Thanks again.
I wanted to open another issue for a feature request, but after reading http://drupal.org/node/551522 I don't think that there is an easy solution: I use a draggable view as panel pane (with Panels 3). In the view I set AJAX to 'yes'. But as far as I can see there is no AJAX functionality when I click the draggable view 'Save' button. That means there is always a complete page request and not only a AJAX request which only updates my view pane, right?
Thank you in advance. Great module!
#3
You're right, that's actually a great idea. I don't have time at the moment but I put it on top of my todo list :)
Right. Such a ajax request sounds very useful too. Another line on my todo list.
Greetings,
sevi
#4
Just committed to 6--3 branch: #605206: Make Save-button text customizable
#5
Thank you very much!
And your description of this option ( '#description' => t('Make the workflow more intuitive for the user.')) is a good explanation of my intention with this feature request.
#6