ISPsystem.com Forums

ISPsystem.com Forums (http://forum.ispsystem.com//index.php)
-   Scripting / API (http://forum.ispsystem.com//forumdisplay.php?f=13)
-   -   dashboard plugin: url open (http://forum.ispsystem.com//showthread.php?t=2460)

mduh 04-28-2015 08:49 PM

dashboard plugin: url open
 
Hello,

I have a dashboard plugin that displays tutorial links. If the user click the link, I would like to open tutorial url.

Dashboard code:
Code:

       
<metadata name="dashboard.resources" type="infolist">
        <rowdata>
                <rowgroup name="tutorials">
                        <row name="tutorial_1" type="link"/>
                        <row name="tutorial_2" type="link"/>
                </rowgroup>
        </rowdata>
</metadata>

What is the way to open url once the user click selected link?

I tried following plugin code but it does not work:

Code:

..
elem = "<?xml version='1.0'?><doc><url>http://example.com</url></doc>"
print answer.redirect(elem)
..

Could you please point me to documentation or example what is best way to redirect user to custom url?

Thanks,
-Maciej

jeremy 04-29-2015 08:39 AM

Hello!
This dashboard block doesn't support external links. You can make link to manager function, which redirect to external link.

Link to manager function for your example will be looks like this:
<doc><tutorial_1 func="MGRFUNC">LINK LABEL</tutorial_1></doc>

Your manager function(plugin) should return redirect:
<doc><ok type="blank">http://example.com</ok></doc>

mduh 04-29-2015 08:42 AM

Thanks,

It works perfect.


All times are GMT +2. The time now is 03:12 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.