[Mpuls-commits] r874 - wasko/branches/2.0/waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jan 26 12:48:38 CET 2010


Author: torsten
Date: 2010-01-26 12:48:37 +0100 (Tue, 26 Jan 2010)
New Revision: 874

Modified:
   wasko/branches/2.0/waskaweb/lib/navigation.py
Log:
* waskaweb/lib/navigation.py (get_pagename): New. Moved from lib.helpers getFormularName.


Modified: wasko/branches/2.0/waskaweb/lib/navigation.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/navigation.py	2010-01-26 11:36:32 UTC (rev 873)
+++ wasko/branches/2.0/waskaweb/lib/navigation.py	2010-01-26 11:48:37 UTC (rev 874)
@@ -76,6 +76,15 @@
     except:
         log.error('Tried to remove %s from %s' % (ti.key, session['navigation.openfolders']))
 
+def get_pagename(page_id):
+    '''Returns the name of the page identified by page_id'''
+    navigation = session.get('navigation.tree')
+    try:
+        ti = navigation.getTreeItem(page_id)
+        return "Akte: %s" % ti.description
+    except:
+        log.error('Can not find name for page %s' % page_id)
+
 class TreeItem:
 
     def __init__(self, name, description, children = None, parent = None):



More information about the Mpuls-commits mailing list