def delOneSelFunc(meta, calledByVillageSide, dataURL, callBackArg,
                  searchFile = None):

    name = os.getenv("REMOTE_USER")
    if name == '' or name == 'guest':
        return ''
    
    deleteIconStr = """<IMG
SRC="/icons/trash.gif" BORDER=0 title="remove from selection"
onmouseover="this.style.cursor='pointer';"
onClick="delOneSel('%(objstr)s','%(selobj)s')">
"""
    requestIconStr = """<IMG
SRC="/icons/link.gif" BORDER=0 title="add to current selection"
onmouseover="this.style.cursor='pointer';" onClick="reqData('%s',this)">
"""

    editIconStr = """<A
href="%s"><IMG SRC="/icons/quill.gif" BORDER=0
title="edit object attributes"></A>
"""
    
    objID = meta['id']
    version = str(meta['version'])
    objstr = objID + '#' + version
    selobj = callBackArg
    dict = {}
    dict['objstr'] = objstr
    dict['selobj'] = selobj

    editIconStr = editIconStr % ("/cgi-bin/ShowObject.py?objstr=" +
                                 urllib.quote(objstr),)

    answer = (deleteIconStr % dict) + editIconStr + \
             (requestIconStr % (objstr,))

    versionIconStr = Browse.make_all_version_icon_str(meta, searchFile)

    return answer + versionIconStr
Ejemplo n.º 2
0
def cancelFunc(meta, calledByVillageSide, dataURL, searchFile=None):
    deleteIconStr = """
<IMG SRC="/icons/trash.gif" BORDER=0 
title="cancel this request" onmouseover="this.style.cursor='pointer';" 
onClick="deleteVilReq('%s')">
"""
    editIconStr = """<A
href="%s"><IMG SRC="/icons/quill.gif" BORDER=0
title="edit object attributes"></A>
"""

    objID = meta['id']
    version = str(meta['version'])
    objstr = objID + '#' + version
    logging.debug('cancelFunc: ' + objstr)

    editIconStr = editIconStr % ("/cgi-bin/ShowObject.py?objstr=" +
                                 urllib.quote(objstr),)

    versionIconStr = Browse.make_all_version_icon_str(meta, searchFile)

    return deleteIconStr % (objstr,) + editIconStr + versionIconStr