Source (Text):
userName = context.REQUEST.AUTHENTICATED_USER.getUserName()
linkFolder = 'MyBookmarks'
newLink = None
userFolder = None
if userName=='Anonymous':
return 'go away'
if hasattr(context.Members, userName):
userFolder=getattr(context.Members, userName)
if hasattr(userFolder, linkFolder):
linkFolder=getattr(userFolder, linkFolder)
else:
newFolder=userFolder.invokeFactory('Folder', linkFolder)
if hasattr(userFolder, linkFolder):
linkFolder=getattr(userFolder, linkFolder)
else:
return 'couldnt get the folder I created?, use the source Luke'
else:
return context.REQUEST.RESPONSE.redirect('login_form')
linkFolder.invokeFactory(type_name, id)
if hasattr(linkFolder, id):
newLink = getattr(linkFolder, id)
newLink.edit(remote_url)
newLink.editMetadata(title=title,
description=body_stx)
else:
return str(id)+' not found in runyaga.myBookmarks'
if 'Reviewer' in context.REQUEST.AUTHENTICATED_USER.getRoles():
context.portal_workflow.doActionFor(newLink, 'publish')
else:
context.portal_workflow.doActionFor(newLink, 'submit')
closeWindowHTML = '''<html><head><body onLoad="javascript:parent.close()"></body></head></html>;'''
return closeWindowHTML
"""
drag this link to your Links bar in I.E.
<a href="javascript:function stripIllegals(url) {var retVal = '';for (x=0;x<url.length;x++){if ( (url.charCodeAt(x) >=97 && url.charCodeAt(x) <=122) ||(url.charCodeAt(x) >=62 && url.charCodeAt(x) <=90) ) {retVal+=url.charAt(x);}}return retVal;}Q='';if(top.frames.length==0)Q=this.document.selection.createRange().text;void(btw=window.open('http://yoursite.com/Members/createZClip?type_name=Link&body_stx='+escape(Q)+'&remote_url='+escape(location.href)+'&title='+escape(this.document.title)+'&id='+stripIllegals(escape(this.document.title)),'zURLform','scrollbars=no,width=485,height=315,left=75,top=175,status=yes'));btw.focus();">ZClip! hook</a>
"""
|