US: 1-941-4621-069
  
Cyprus: 3-572-2052-781

Go Back   ISPsystem.com Forums > Modifications / Add-ons > Scripting / API


Reply
 
Thread Tools
Old 04-28-2015, 08:49 PM   #1
Junior Member
 
Join Date: Jan 2015
Posts: 28
mduh is on a distinguished road
Default 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
mduh is offline   Reply With Quote
Old 04-29-2015, 08:39 AM   #2
Junior Member
 
Join Date: Feb 2015
Posts: 3
jeremy is on a distinguished road
Default

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>
jeremy is offline   Reply With Quote
Old 04-29-2015, 08:42 AM   #3
Junior Member
 
Join Date: Jan 2015
Posts: 28
mduh is on a distinguished road
Default

Thanks,

It works perfect.
mduh is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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