Thanks for the help on this, really helped me figure it out. Now i'm having trouble getting my onclick to execute. It's just popping up the action dialog and doesn't seem to be doing anything with this block...
I had a mc.LogDebug("test") at the top of this block just to see if that ever happened and it didn't...I'm wondering if it's some type of issue with the properties I've given the items...
Code:
<onclick lang="python"><![CDATA[
list = mc.GetActiveWindow().GetList(100)
listitems = list.GetItems()
listitem = listitems[list.GetFocusedItem()]
params = mc.Parameters()
params["link"] = str(listitem.GetPath())
params["isLocal"] = str(listitem.GetProperty("isLocal"))
linktype = params["link"].split('://')
if (linktype[0] == "rss"):
servers.doRootBrowse(httpPrefix(params["link"]), params["isLocal"])
elif (linktype[0] == "browse"):
servers.doRootBrowse(httpPrefix(params["link"]), params["isLocal"])
elif (linktype[0] == "folder"):
servers.doFolderBrowse(httpPrefix(params["link"]))
else:
myTracker.trackEvent("Event", "Play", listitem.GetProperty("event"))
mc.GetPlayer().Play(listitem)
]]></onclick>
I'm only setting a few properties for the items as this is a menu to then execute another Get request to build a new list of items...
Code:
item = mc.ListItem(mc.ListItem.MEDIA_UNKNOWN)
item.SetProperty("isLocal", "false")
item.SetPath(rssPrefix(str(ramp.externaluri.contents[0])))
item.SetLabel(str(ramp.endpointname.contents[0]))
item.SetThumbnail('server_thumb.png')
Any thoughts on that would be great...
Bookmarks