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
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

sevi - October 15, 2009 - 21:27
Status:active» by design

Write a new module for customization issues.

In your custom_module.module file you simply write

<?php
function 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

M_Z - October 16, 2009 - 21:12

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

sevi - October 26, 2009 - 22:33

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.

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 :)

That means there is always a complete page request and not only a AJAX request which only updates my view pane, right?

Right. Such a ajax request sounds very useful too. Another line on my todo list.

Greetings,
sevi

#4

sevi - October 31, 2009 - 13:18

Just committed to 6--3 branch: #605206: Make Save-button text customizable

#5

M_Z - November 5, 2009 - 08:55

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

sevi - December 7, 2009 - 13:42
Status:by design» fixed
 
 

Drupal is a registered trademark of Dries Buytaert.