Page MenuHomec4science

yourbaskets.py
No OneTemporary

File Metadata

Created
Sat, Nov 9, 20:58

yourbaskets.py

## $Id$
## Personal features - your baskets.
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002 CERN.
##
## The CDSware is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## The CDSware is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDSware; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## read config variables:
#include "config.wml"
#include "configbis.wml"
<protect>## $Id$ </protect>
<protect>## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.</protect>
"""Web Baskets features."""
## fill config variables:
pylibdir = "<LIBDIR>/python"
try:
import sys
import time
import zlib
import urllib
sys.path.append('%s' % pylibdir)
from cdsware.config import *
from cdsware.webpage import page
from cdsware import webbasket
webbasket = reload( webbasket )
from cdsware.dbquery import run_sql
from cdsware.webuser import getUid, create_user_infobox
from mod_python import apache
except ImportError, e:
print "Error: %s" % e
import sys
sys.exit(1)
imagesurl = "%s/img" % webdir
## rest of the Python code goes below
### CALLABLE INTERFACE
def index(req):
req.err_headers_out.add("Location", "%s/yourbaskets.py/display?%s" % (weburl, req.args))
raise apache.SERVER_RETURN, apache.HTTP_MOVED_PERMANENTLY
def display(req, action="", title="Your Baskets", delete_alerts="", confirm_action="", id_basket=0, bname="", newname="", newbname="", mark=[], to_basket="", copy_move="", idup="", ordup="", iddown="", orddown=""):
uid = getUid(req)
if action=="DELETE":
title="Delete basket"
return page(title, webbasket.perform_display(uid, action, delete_alerts, confirm_action, id_basket, bname, newname, newbname, mark, to_basket, copy_move, idup, ordup, iddown, orddown),
"""&gt; <a class="navtrail" href="%s/youraccount.py/display">Your Account</a> &gt;""" % weburl,
"", "CDS Personalize, Display baskets", "CDS, personalize", create_user_infobox(uid), "")
def display_public(req, id_basket=0, name="", action="", to_basket="", mark=[], newname=""):
title = "Display basket"
uid = getUid(req)
return page(title, webbasket.perform_display_public(uid, id_basket, name, action, to_basket, mark, newname),
"""&gt; <a class="navtrail" href="%s/youraccount.py/display">Your Account</a> &gt;""" % weburl,
"", "CDS Personalize, Display baskets", "CDS, personalize", create_user_infobox(uid), "")

Event Timeline