Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Change the text on the "Save" button

 

 


gversion
User

Dec 23, 2011, 11:10 AM

Post #1 of 6 (899 views)
Shortcut
Change the text on the "Save" button Can't Post

Hello,

I would like to change the default text from "Save" to "Save & Exit" on the create listing page.

I think this is clearer than just "Save" as I am using the Add Apply Button plug-in, which I have renamed to "Save & Continue Editing".

Can you please tell me where I can find the code for the "Save" button?

<input class='button' type='submit' name='_action=save' value='Save' />

Thank you for your help.

Regards,
Greg


Jason
Staff / Moderator


Dec 23, 2011, 11:33 AM

Post #2 of 6 (898 views)
Shortcut
Re: [gversion] Change the text on the "Save" button [In reply to] Can't Post

Hi Greg,

Sure, if you open up cmsAdmin/lib/menus/default/edit.php, you'll find this code around line 60 (v2.13)


Code
$buttonsRight .= "<input class='button' type='submit' name='_action=save' value='" .t('Save'). "' />\n";


Just change t('Save') to t('Save & Exit').

Note: this change will be overwritten if you upgrade your copy of CMS Builder.

hope this helps
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


gversion
User

Dec 23, 2011, 11:58 AM

Post #3 of 6 (897 views)
Shortcut
Re: [Jason] Change the text on the "Save" button [In reply to] Can't Post

Hi Jason,

That's excellent! Thanks for your help.

Regards,
Greg


gversion
User

May 11, 2012, 3:40 AM

Post #4 of 6 (115 views)
Shortcut
Re: [gversion] Change the text on the "Save" button [In reply to] Can't Post

Hi Jason,

Would it be possible to build a plug-in that would let me define the text for a button on a certain section editor?

So, for example in one section editor I will have the button text display "Save" and on another section editor (where I can compose/send emails) I would change the "Save" text be "Send".

If a plug0in can achieve this then could you please point me in the right direction as I'd like to try and take on this challenge myself.

Thank you,
Greg


Jason
Staff / Moderator


May 11, 2012, 9:14 AM

Post #5 of 6 (110 views)
Shortcut
Re: [gversion] Change the text on the "Save" button [In reply to] Can't Post

Hi Greg,

You can use the plugin filter "edit_buttonsRight" to accomplish this.

If you open up cmsAdmin/lib/menus/default/edit.php you'll see this block of code:


Code
<?php 
$buttonsRight = '';
$buttonsRight .= "<input class='button' type='submit' name='_action=save' value='" .t('Save'). "' />\n";
if ($previewUrl) {
$buttonsRight .= "<input class='button' type='button' name='preview' value='" .t('Preview'). "' onclick=\"editPreview();\" />\n";
}
$buttonsRight .= "<input class='button' type='button' name='cancel' value='" .t('Cancel'). "' onclick=\"editCancel();\" />\n";
$buttonsRight = applyFilters('edit_buttonsRight', $buttonsRight, $tableName, $GLOBALS['RECORD']);
echo $buttonsRight;
?>


This is the code that creates the buttons seen on the edit page. Just before the html string is echoed to the screen, it passes it's value to the any plugin that uses the edit_buttonsRight filter. So you can create a plugin using this filter that edits this HTML string and returns a new value.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


gversion
User

May 11, 2012, 9:16 AM

Post #6 of 6 (109 views)
Shortcut
Re: [Jason] Change the text on the "Save" button [In reply to] Can't Post

Hi Jason,

That's a great help, thanks very much.

Regards,
Greg