Ejemplo n.º 1
0
def show_node(req):
    """ opens administration window with content """

    p = req.path[1:].split("/")
    style = req.params.get("style", "")
    user = users.getUserFromRequest(req)

    v = {}
    v["user"] = user
    v["guestuser"] = config.get("user.guestuser")
    v["version"] = mediatum_version
    v["content"] = show_content(req, p[0])
    v["navigation"] = adminNavigation()
    v["breadcrumbs"] = getMenuItemID(v["navigation"], req.path[1:])
    v["spc"] = list()

    spc = list()
    v["spc"].append(Menu("sub_header_frontend", "/"))
    v["spc"].append(Menu("sub_header_edit", "/edit"))
    if user.isWorkflowEditor():
        v["spc"].append(Menu("sub_header_workflow", "../publish"))
    v["spc"].append(Menu("sub_header_logout", "/logout"))
    v["hashelp"] = help.getHelpPath(
        ['admin', 'modules', req.path.split('/')[1]])

    if len(p) > 0:
        if style == "":
            req.writeTAL("web/admin/frame.html", v, macro="frame")
        else:
            req.write(v["content"])
Ejemplo n.º 2
0
def handletabs(req, ids, tabs):
    user = users.getUserFromRequest(req)
    language = lang(req)

    n = tree.getNode(ids[0])
    if n.type.startswith("workflow"):
        n = tree.getRoot()

    menu = filterMenu(getEditMenuString(n.getContentType()), user)

    spc = [Menu("sub_header_frontend", "../", target="_parent")]
    if user.isAdmin():
        spc.append(
            Menu("sub_header_administration", "../admin", target="_parent"))

    if user.isWorkflowEditor():
        spc.append(Menu("sub_header_workflow", "../publish", target="_parent"))

    spc.append(Menu("sub_header_logout", "../logout", target="_parent"))

    # a html snippet may be inserted in the editor header
    help_link = tree.getRoot('collections').get('system.editor.help.link.' + language).strip()
    ctx = {
            "user": user,
            "ids": ids,
            "idstr": ",".join(ids),
            "menu": menu,
            "hashelp": help.getHelpPath(['edit', 'modules', req.params.get('tab') or tabs]),
            "breadcrumbs": getBreadcrumbs(menu, req.params.get("tab", tabs)),
            "spc": spc,
            "system_editor_help_link": help_link,
            }
    return req.getTAL("web/edit/edit.html", ctx, macro="edit_tabs")
Ejemplo n.º 3
0
def handletabs(req, ids, tabs):
    user = users.getUserFromRequest(req)
    language = lang(req)

    n = tree.getNode(ids[0])
    if n.type.startswith("workflow"):
        n = tree.getRoot()

    menu = filterMenu(getEditMenuString(n.getContentType()), user)

    spc = [Menu("sub_header_frontend", "../", target="_parent")]
    if user.isAdmin():
        spc.append(Menu("sub_header_administration", "../admin", target="_parent"))

    if user.isWorkflowEditor():
        spc.append(Menu("sub_header_workflow", "../publish", target="_parent"))

    spc.append(Menu("sub_header_logout", "../logout", target="_parent"))

    # a html snippet may be inserted in the editor header
    help_link = tree.getRoot("collections").get("system.editor.help.link." + language).strip()
    ctx = {
        "user": user,
        "ids": ids,
        "idstr": ",".join(ids),
        "menu": menu,
        "hashelp": help.getHelpPath(["edit", "modules", req.params.get("tab") or tabs]),
        "breadcrumbs": getBreadcrumbs(menu, req.params.get("tab", tabs)),
        "spc": spc,
        "system_editor_help_link": help_link,
    }
    return req.getTAL("web/edit/edit.html", ctx, macro="edit_tabs")
Ejemplo n.º 4
0
def show_node(req):
    """ opens administration window with content """

    p = req.path[1:].split("/")
    style = req.params.get("style", "")
    user = users.getUserFromRequest(req)

    v = {}
    v["user"] = user
    v["guestuser"] = config.get("user.guestuser")
    v["version"] = mediatum_version
    v["content"] = show_content(req, p[0])
    v["navigation"] = adminNavigation()
    v["breadcrumbs"] = getMenuItemID(v["navigation"], req.path[1:])
    v["spc"] = list()

    spc = list()
    v["spc"].append(Menu("sub_header_frontend", "/"))
    v["spc"].append(Menu("sub_header_edit", "/edit"))
    if user.isWorkflowEditor():
        v["spc"].append(Menu("sub_header_workflow", "../publish"))
    v["spc"].append(Menu("sub_header_logout", "/logout"))
    v["hashelp"] = help.getHelpPath(['admin', 'modules', req.path.split('/')[1]])

    if len(p) > 0:
        if style == "":
            req.writeTAL("web/admin/frame.html", v, macro="frame")
        else:
            req.write(v["content"])