Of course, it’s possible to have a single call. For instance, for 3 buttons:
procedure ProcedureAll(text, text2, text3: String);
begin
SetUiProp(“Toolbar1BHome”, “Caption”,text);
SetUiProp(“Toolbar1bprint”, “Caption”,text2);
// and so on
end;
Then in PHP: exo_runhescriptcom ("UserMain.ProcedureAll|$button1|$button2|$button3");
heexternal:// should do its job if you give a correct URL… Try to inspect the HTML code output by your PHP page using the Chromium Developer Tools: verify that the <a href=“heexternal://<?php echo $row[‘supporturl’];?>”><?php echo $row[‘supporttext’];?></a></p>
is correctly output.
Yes, I understand how to use the heexternal and php. Asking this:
Is it possible to also link the button to url and have open in users default browser using hescripting?
Have the button working with custom text, now like to link it to external site and open in users default browser. The question is can this be done in hescript?
This you should be able to create it when you setup action for your button.
First create an hescript procedure, and then configure your button action using hescript to choose the one you just created:
Hescript:
procedure LoadURL;
begin
ExecuteHTMLScript(“loadurl()”, “JavaScript”);
end;
In your principal .php page add the following
<?php
$url = “your url”;
?>
Then add this javascript:
<script>
function loadurl() {
window.location=“heexternal://<?php echo $url; ?>”
}
</script>
Can you show how do you write the javascript function concerned ?
Also, try to copy paste, before to use it in your script, in notepad the code I have showed you and then, in notepad, replace the double quote if necessary. Then copy the code from notepad and paste it in your script.
And don’t forget to use https and not http for your url !
Added Hescript:
procedure LoadURL;
begin
ExecuteHTMLScript("loadurl()", "JavaScript");
end;
At the very top of my page (before everything else):
<?php
$url = "http://google.com";
?>
In my header:
function loadurl() {
window.location="heexternal://<?php echo $url; ?>"
}
Had to remove the scrip tags as forum now forbids and shows 403 error popup, but the opening and closing tags are in place.
Not sure how https for URL would help to solve the undefined loadurl() issue, but tried it to be sure and no change. Still get the loadurl() undefined error when clicking the toolbar button.
EDIT UPDATE: As usual, my problem your code works fine… Somehow the function loadurl() in script got converted to function loadUrl(). Guessing plugin for my notepad++ auto assumed I want the capital U. Sorry for the hassle and thank you very much @Gilmichel !
@gdgsupport Is it a security risk to allow script tags wrapped in the preformatted feature? Only way to prevent foreign characters best I can tell.
Anyway, got it working as described above. Use notepad++ and one of the plugins converted function loadUrl() to function loadUrl() (notice the capital U). All good and appreciate your help much.