Am sorry for this is my first post so bear with me:
When you enable modal dialog on add, edit or view of a table a view, it will cause the add, edit and view forms to appear in a modal dialog.
By default the header caption and button caption when using modal dialog Add, edit and view are Add,Edit and View respectively.
LOGIC: the addlink,editlink,viewlink phrase is used to determine the DEFAULT header title and button captions of the modal dialogs respectively
IN page_load EVENT of the List page of the desired table or view PUT
NOTE: This alone will change the Header Title and the Button Caption on the respective modal dialog
// Page Load event
function Page_Load() {
//echo "Page Load";
$GLOBALS["Language"]->SetPhrase("addlink","Add Dialog Title");
$GLOBALS["Language"]->SetPhrase("editlink","Edit Dialog Title");
$GLOBALS["Language"]->SetPhrase("viewlink","View Dialog Title");
}
Now if you want to customize ONLY the button caption on the modal dialog Add
LOGIC: If you inspect the add link on the list page you will find a parameter passed in javascript called caption:'Add' during onclick of the buttons. This is what is used as the button caption on the modal dialog respectively, what we do is edit the html of the button link before it is drawn
FOR ADD LINK PUT IN Page_Render OR Page_DataRendering of the List page of the desired table or view PUT
// Page Render event
function Page_Render() {
//echo "Page Render";
$addlink = $GLOBALS["Language"]->Phrase("addlink",TRUE); //ask for ONLY THE TEXT VALUE of the phrase
$this->OtherOptions["addedit"]->Items["add"]->Body = str_replace("caption:'$addlink'","caption:'Add Button Caption'", $this->OtherOptions["addedit"]->Items["add"]->Body);
}
Now if you want to customize the ONLY the button caption on the modal dialog Edit
LOGIC: If you inspect the edit link for a given record on the list page you will find a parameter passed in javascript called caption:'Edit' during onclick of the buttons. This is what is used as the button caption on the modal dialog respectively, what we do is edit the html of the button link before it is drawn
FOR EDIT IN ListOptions_Rendered of the List page of the desired table or view, SINCE IT IS DRAWN DIFFERENT FOR EVERY RECORD PUT
// ListOptions Rendered event
function ListOptions_Rendered() {
// Example:
//$this->ListOptions->Items["new"]->Body = "xxx";
$editlink = $GLOBALS["Language"]->Phrase("editlink",TRUE); //ask for ONLY THE TEXT VALUE of the phrase
$this->ListOptions->Items["edit"]->Body = str_replace("caption:'$editlink'","caption:'Edit Button Caption'", $this->ListOptions->Items["edit"]->Body);
}
EXTRA NOTES:
For non modal add, edit and view forms, you only need to set phrases (add,addbtn) (edit,savebtn) (view) in the page_load event of the add,edit and view pages respectively.
You can also use this method to customise ONLY the hover text on those links.
You can get even more creative if you use var_dump() during any event, this can allow you to inspect how php maker is planing to setup anything and you can see which properties you need to tweak to get your needs