;ň )äHEc@s¤dklZdkZdkZdklZdkTdklZlZdk l Z dk Z dk l Z dklZlZdkZdklZdkZd klZlZd klZd klZdkZd klZd „Zdeiefd„ƒYZ ee ƒdfd„ƒYZ!ee!ƒdfd„ƒYZ"ee"ƒdfd„ƒYZ#ee#ƒdfd„ƒYZ$ee$ƒde!e"e#e$fd„ƒYZ%dS((s nested_scopesN(sjoin(s*(squotesunquote(sClassSecurityInfo(sabsattr(sInitializeClasss REPLACEABLE(s SimpleItem(sflattensBLATHER(s PAGE_METATYPE(s bracketedexpr(s_cCsxt|dƒtgƒjot|d|ƒ|d/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys deepappendCssPersistentOutlinecBs tZdZdZdZeZRS(sŽ I am a persistent version of Outline. XXX do my mutators need to do more of this sort of thing ?: # do an attr assignment in case we ever cache this as a persistent object if childmap.has_key(parent): pchildren = childmap[parent] else: pchildren = [] if name not in pchildren: pchildren.append(name) childmap[parent] = pchildren or: self._p_changed = 1... sZwiki Outline Cachesoutline(s__name__s __module__s__doc__s meta_typesids REPLACEABLEs__replaceable__(((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysPersistentOutlineNs sParentsPropertycBswtZdZeƒZgZhdd<dd<dd/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysensureParentsPropertyIsList}s cCst|iƒSdS(sG Robust accessor returning a copy of our parents list. N(slistsselfsparents(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys getParentsscCs#t|ƒ}|iƒ||_dS(N(slistsparentsssortsself(sselfsparents((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys setParents“s  cCsE|o:|o||ij o|iƒ|ii|ƒqAndS(N(sparentsselfsparentssensureParentsPropertyIsListsappend(sselfsparent((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys addParent˜s cCsX|iƒy|ii|ƒWn3tj o'td||iƒ|ifƒnXdS(Ns*failed to remove %s from %s's parents (%s)(sselfsensureParentsPropertyIsListsparentssremovesparents ValueErrorsBLATHERsgetId(sselfsparent((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys removeParentĄs  csśˆiƒ}td„td„t‡d†|ƒƒƒ}ˆiƒ|jo|iˆiƒƒn|iƒ||jo8t dˆiƒ||fƒˆi |ƒˆi ƒndS(sW Ensure that this page's parents are all valid, and reindex if needed. cCs t|iƒS(N(sabsattrsxsTitle(sx((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysŽscCs|S(N(sx(sx((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysŻscs ˆi|ƒS(N(sselfs pageWithNamesx(sx(sself(s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys°ss$adjusting %s's parents from %s to %sN( sselfs getParentssparentssmapsfilterscleanedupparentsspageNamesremovessortsBLATHERs setParentss index_object(sselfscleanedupparentssparents((sselfs>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysensureValidParents¨s       ( s__name__s __module__s__doc__sClassSecurityInfossecuritysparentss _propertiessensureParentsPropertyIsLists getParentss setParentss addParents removeParentsensureValidParents(((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysParentsPropertyhs  $    sShowSubtopicsPropertycBs5tZdZeƒZd„Zd„Zed„ZRS(s: I determine when to display subtopics on a page. cKsRd}t|iƒ|dƒo+|i|ƒo||odSqNt|dƒot|i|ƒot|i|ƒodSqNt|i|ƒot||ƒodSqN|i ƒoŠy|i ƒi ƒSWqFy|i ƒi ƒi ƒSWq>t d|i ƒ|i ƒ fƒtt|dtƒdtƒdj Sq>XqFXqNdSndSdS( sÄ Decide in a complicated way if this page should display it's subtopics. First, if the folder has a show_subtopics property (can acquire) and it's false, we will never show subtopics. Otherwise look for a show_subtopics property - in REQUEST - on the current page - on our primary ancestor pages, all the way to the top, and return the first one we find. Otherwise return true. sshow_subtopicsisREQUESTs=DEBUG: error in subtopicsEnabled for %s, primaryParent is: %sszwiki_displaymodesminimaliN(spropsgetattrsselfsfolderskwshas_keyshasattrsREQUESTsaq_bases primaryParentssubtopicsEnableds getObjectsBLATHERsidsNone(sselfskwsprop((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyssubtopicsEnabledÇs, # !cCs.t|idƒ odSn|iodSdS(sŔ Get the status of the show_subtopics property on this page. no property: -1 ("default") true property: 1 ("always") false property: 0 ("never") sshow_subtopicsi˙˙˙˙iN(shasattrsselfsaq_basesshow_subtopics(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyssubtopicsPropertyStatusďscCsátd„|iƒ}|djo.d|jo|iddgd|ƒqÝnŽ|oEd|j o|idddd|ƒqÝ|iddd|ƒnBd|j o|idddd|ƒn|iddd|ƒd S( sw Set, clear or remove this page's show_subtopics property. Same values as getSubtopicsStatus. cCs|dS(Nsid(sx(sx((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyssi˙˙˙˙sshow_subtopicssidssREQUESTisbooleaniN( smapsselfs _propertiesspropssstatussmanage_delPropertiessREQUESTsmanage_addPropertysmanage_changeProperties(sselfsstatussREQUESTsprops((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyssetSubtopicsPropertyStatusús"    ( s__name__s __module__s__doc__sClassSecurityInfossecurityssubtopicsEnabledssubtopicsPropertyStatussNonessetSubtopicsPropertyStatus(((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysShowSubtopicsPropertyÁs   ( sOutlineManagercBsntZdZeƒZd„Zeieidƒd„Z e Z eiei dƒge e d„Z eiei dƒe d„Zd„Zd „Zd „Zd „Zeieid ƒd „Zeieidƒd„Zeieidƒd„Zeieidƒd„Zeieidƒd„Zeieidƒd„Zeieidƒd„Zeieidƒd„Zeieidƒe d„Zeieidƒd„Zeieid ƒd!„Zeieid"ƒe d#„Zeieid$ƒe d%„Zeieid&ƒe d'„Z d(„Z!d)„Z"d*„Z#d+„Z$e d,„Z%RS(-sť I manage and query a cached outline object for the wiki. When first accessed I create a PersistentOutline based on the parents properties and store it in the wiki folder. This can be queried more efficiently. old: KM: We could make this a persistent object and minimize recomputes. Put it in a standard place in the wiki's folder, or have the pages in a folder share an instance, but use a single persistent one which need not recompute all the relationship maps every time - just needs to compare all pages parents settings with the last noticed parents settings, and adjust the children, roots, and parents maps just for those that changed. cCsJt|iƒidƒ p|iƒi o|iƒn|iƒiSdS(s  Get the outline cache which holds details of the wiki's page hierarchy. We'll generate it if needed, ie if it's missing or if it's one of the older types which get lost during a folder rename or when moving pages to a new folder. This is called by any method which requires the outline cache, and also by upgrade() on each page view, to ensure that renaming or moving an old wiki just works without requiring the user to manually updateWikiOutline. soutlineN(shasattrsselfsfoldersaq_basesoutlinesupdateWikiOutline(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys wikiOutline,s +supdateWikiOutlinecCs.td|iƒiƒƒh}t|iƒidƒod|iƒiƒj o%|iƒii ƒ}|iƒ`nt|iƒidƒ o3|iƒi dt ƒƒ|iƒii |ƒnh}x4|iƒD]&}|iƒ|iƒ||iƒ/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysupdateWikiOutline?s 3  sreparentcsIˆiƒ}|o |g}n!t|ƒtjo |g}ntd„|ƒ}t‡d†|ƒ}td„|ƒ}td„|ƒ}g}x-|D]%}||j o|i |ƒq˜q˜Wˆi |ƒˆi ƒiˆiƒ|ƒˆiƒˆidˆiƒ||fd|ddƒ|tj o|ii|dƒnd S( sÎ Move this page under the named parent pages in the wiki outline. parent page names may be passed in several ways: - in the parents argument (a list or string of page names) - in the pagename argument (a single name) (this last is to support the page management form). Page names may be ids, or fuzzy, even partial. Any which do not resolve to an existing page or are duplicates will be ignored. cCs|S(N(sx(sx((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysscsˆi|ddƒS(Ns allow_partiali(sselfspageWithFuzzyNamesx(sx(sself(s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysscCs t|iƒS(N(sabsattrsxsTitle(sx((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys†ss %s was reparented from %s to %s.sREQUESTssubjects (reparented)sURL1N(sselfs getParentss oldparentsspagenamesparentsstypesListTypesfiltersmaps uniqueparentsspsappends setParentss wikiOutlinesreparentspageNames index_objectssendMailToEditSubscriberssREQUESTsNonesRESPONSEsredirect(sselfsparentssREQUESTspagenamesps uniqueparentss oldparents((sselfs>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysreparentjs0          sreordercCse||iƒj odSn|iƒi|iƒ|ƒ|tj o|ii |ddƒndS(s  Move child one place to the left among this page's children. Ordering is only stored in the wiki outline cache, and will be lost if the outline is completely regenerated. When invoked from the web, redirects to /backlinks. NsURL1s /backlinks( schildsselfschildrenAsLists wikiOutlinesreorderspageNamesREQUESTsNonesRESPONSEsredirect(sselfschildsREQUEST((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysreorder›s  cCs|iƒi|iƒƒSdS(sT Get the name of this page's primary (alphabetically first) parent. N(sselfs wikiOutlines firstParentspageName(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysprimaryParentNameŞscCs,|iƒ}|o|i|ƒSntSdS(s9 Return this page's primary parent page. N(sselfsprimaryParentNamesps pageWithNamesNone(sselfsp((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys primaryParent°s  cCs)|iƒ}|o|iƒSntSdS(s< Get the URL of this page's primary parent. N(sselfs primaryParentspspageUrlsNone(sselfsp((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysprimaryParentUrl¸s  cCs|iƒp |iƒSdS(s? Get the URL of whatever is "above" this page. N(sselfsprimaryParentUrlsdefaultPageUrl(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysupUrlŔss firstPagecCs|iƒiƒSdS(sB Get the name of the first page in the hierarchy. N(sselfs wikiOutlinesfirst(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys firstPageÇss firstPageUrlcCs2|i|iƒƒ}|o|iƒSntSdS(sA Get the URL of the first page in the hierarchy. N(sselfs pageWithNames firstPagespspageUrlsNone(sselfsp((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys firstPageUrlÎs slastPagecCs|iƒiƒSdS(sA Get the name of the last page in the hierarchy. N(sselfs wikiOutlineslast(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyslastPage×ss lastPageUrlcCs2|i|iƒƒ}|o|iƒSntSdS(s@ Get the URL of the last page in the hierarchy. N(sselfs pageWithNameslastPagespspageUrlsNone(sselfsp((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys lastPageUrlŢs snextPagecCs|iƒi|iƒƒSdS(s] Get the name of the next page in the hierarchy. XXX nextPageName ? N(sselfs wikiOutlinesnextspageName(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysnextPageçss nextPageUrlcCs2|i|iƒƒ}|o|iƒSntSdS(s@ Get the URL of the next page in the hierarchy. N(sselfs pageWithNamesnextPagespspageUrlsNone(sselfsp((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys nextPageUrlđs s previousPagecCs|iƒi|iƒƒSdS(sE Get the name of the previous page in the hierarchy. N(sselfs wikiOutlinespreviousspageName(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys previousPageůsspreviousPageUrlcCs2|i|iƒƒ}|o|iƒSntSdS(sD Get the URL of the previous page in the hierarchy. N(sselfs pageWithNames previousPagespspageUrlsNone(sselfsp((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyspreviousPageUrls sancestorsAsListcCs*yt|iƒƒd SWn gSnXdS(s˘ Return the names of all my ancestor pages as a flat list, eldest first. If there are multiple lines of ancestry, return only the first. i˙˙˙˙N(sflattensselfsancestorsNesting(sselfsREQUEST((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysancestorsAsList s ssiblingsAsListcCs|iƒi|iƒƒSdS(s} Return the names of other pages sharing my first parent. Siblings by my other parents are ignored. N(sselfs wikiOutlinessiblingsspageName(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyssiblingsAsListsschildrenAsListcCs|iƒi|iƒƒSdS(sL Return the list of names of my immediate children, if any. N(sselfs wikiOutlineschildrenspageName(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyschildrenAsListsschildrenIdsAsListcst‡d†ˆiƒƒSdS(sC Return all my children's page ids as a flat list. cstˆi|ƒiƒS(N(sabsattrsselfspageWithNameOrIdsxsid(sx(sself(s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys'sN(smapsselfschildrenAsList(sselfsREQUEST((sselfs>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyschildrenIdsAsList#s soffspringAsListcCs-t|iƒƒ}|i|iƒƒ|SdS(sU Return my offsprings' page names as a flat list, excluding my name. N(sflattensselfsoffspringNestingslistsremovespageName(sselfsREQUESTslist((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysoffspringAsList+ssoffspringIdsAsListcst‡d†ˆiƒƒSdS(s@ Return my offsprings' page ids as a flat list. cstˆi|ƒiƒS(N(sabsattrsselfspageWithNameOrIdsxsid(sx(sself(s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys8sN(smapsselfsoffspringAsList(sselfsREQUEST((sselfs>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysoffspringIdsAsList4s cCs|iƒi|iƒƒSdS(sF Return a nesting representing this page's ancestors. N(sselfs wikiOutlines ancestorsspageName(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysancestorsNesting@scCs|iƒi|iƒƒSdS(sS Return a nesting representing this page's ancestors and siblings. N(sselfs wikiOutlinesancestorsAndSiblingsspageName(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysancestorsAndSiblingsNestingFscCs|iƒi|iƒƒSdS(sS Return a nesting representing this page's ancestors and children. N(sselfs wikiOutlinesancestorsAndChildrenspageName(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysancestorsAndChildrenNestingLscCs|iƒi|iƒƒSdS(sE Return a nesting representing this page's children. N(sselfs wikiOutlineschildrenspageName(sself((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyschildrenNestingRscCs&|iƒi|iƒgd|ƒSdS(sH Return a nesting representing this page's descendants. sdepthN(sselfs wikiOutlines offspringspageNamesdepth(sselfsdepth((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysoffspringNestingXs(&s__name__s __module__s__doc__sClassSecurityInfossecuritys wikiOutlinesdeclareProtecteds PermissionssViewsupdateWikiOutlinesupdatecontentssReparentsNonesreparentsreordersprimaryParentNames primaryParentsprimaryParentUrlsupUrls firstPages firstPageUrlslastPages lastPageUrlsnextPages nextPageUrls previousPagespreviousPageUrlsancestorsAsListssiblingsAsListschildrenAsListschildrenIdsAsListsoffspringAsListsoffspringIdsAsListsancestorsNestingsancestorsAndSiblingsNestingsancestorsAndChildrenNestingschildrenNestingsoffspringNesting(((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysOutlineManagers^    (0                      sOutlineRenderingcBsytZdZeƒZeieidƒeed„Z ed„Z ed„Z eieidƒeddd„Z eieidƒedd „Z eieid ƒd „Zeieid ƒeeded „Zeieidƒed„Zeieidƒd„Zeieidƒedddeedd„Zeieidƒedeedd„Ze ZRS(si I present various parts of the wiki outline as HTML. Some code cleanup here would be nice. scontentsc Csć|iƒiƒ}g}g}|iƒ}xp|D]h}t|ƒt joBd}|i d||i |ƒt |ƒ||i|ƒfƒq1|i |ƒq1Wt|p|iƒpdƒ}|i|i|d|ƒ|d|ƒSdS(sN Show the entire page hierarchy, using the contentspage template. Includes all the branches in the wiki - from the possibly multiple roots - and all singletons, ie those without parents or children. The page named by here, or the current page, will be highlighted with "you are here". ss+%ssheresREQUESTN(sselfs wikiOutlinesnestings singletonsscombosswiki_urlsbaseurlsistypes StringTypes linktitlesappendscanonicalIdFromsquotesformatWikinamesunquotesheresreferringPageNames contentspages renderNestingsREQUEST( sselfsREQUESTsherescombossisbaseurlsnestings singletonss linktitle((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyscontentsjs < cCs| o |i}n| otSn|idtƒ}| otSntidti|iƒƒd|ƒ}|o|i dƒSntSdS(sR If the referrer was a page in this wiki, return its id, or None. s HTTP_REFERERs^s /?([^?#/]*)iN( sREQUESTsselfsNonesgetsreferrersresmatchsescapeswikiUrlsmsgroup(sselfsREQUESTsreferrersm((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysreferringPageIdŽs )cCsI|id|ƒ}|o(|i|ƒ}|o|iƒSqAntSdS(sT If the referrer was a page in this wiki, return its name, or None. sREQUESTN(sselfsreferringPageIdsREQUESTsids pageWithIdspspageNamesNone(sselfsREQUESTspsid((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysreferringPageNamešsscontextic Cs{|iƒ}|o|iƒ} nZ|iƒ} t| ƒdjp't| ƒdjot| dƒdjo| odSn|o|i dƒo|d|jo#|d}t | |ƒ} d}nd}|i | |d|d|ƒ}|djo9|igƒ|iƒ|i | |d|d|ƒ}n|iƒ}d||iƒif}|iƒo d |Sn d |Sd S( sˆ Return HTML showing this page's ancestors and siblings. XXX how can we use a page template for this ? macro ? iis spagesenlarge_currentssuppress_hyperlinks
s7%s contentss%s s%s N(sselfspageNamesheres with_siblingssancestorsAndSiblingsNestingsnestingsancestorsNestingslensenlarge_currentsREQUESTshas_keys deepappendssuppress_hyperlinks renderNestings hierarchys setParentss index_objects contentsUrls contentsurlsfolderstitles contentslinksusingPloneSkin( sselfsREQUESTs with_siblingssenlarge_currents contentsurlssuppress_hyperlinksheres hierarchys contentslinksnesting((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyscontextĽs4  E(           scontextXcCsë|o|iƒ}n |iƒ}|iƒ}|idƒo|d|j o#|d}t ||ƒ}d}nd}|i ||ƒ}t |ƒdjo-|igƒ|iƒ|i ||ƒ}nhd|iƒ<d|/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyscontextXÝs   !    schildrencCs,|iƒ}|o|i|ƒSndSdS(sD Return HTML showing my immediate children, if any. sN(sselfschildrenAsListschildrens renderNesting(sselfschildren((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pyschildrenţs  s offspringcCs2|iƒ}|i|id|ƒ|d|ƒSdS(s: Return HTML displaying all my offspring. sdepthssuppress_currentN(sselfspageNamesheres renderNestingsoffspringNestingsdepths exclude_self(sselfsREQUESTsinfos exclude_selfsdepthshere((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys offspring s s subtopicscKs_d}t|dtƒ}|o|id|ƒ o |}n|id|ƒ|||SdS(s Render my subtopics as a HTML fragment, using a template. Allows the template to be selected by subtopics_style folder property. If there is no property or the specified template does not exist, uses the built-in subtopics_outline. Some overlap with the show_subtopics property. Pass any arguments, like max depth, through to the template. soutlinessubtopics_styles subtopics_N( s DEFAULTSTYLEsgetattrsselfsNonesstyleshasSkinTemplatesgetSkinTemplatesREQUESTskw(sselfsREQUESTskwsstyles DEFAULTSTYLE((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys subtopicss  snavlinkscCsŢd}d}|iƒ|iƒf\}}|o!|id|dddƒ}n|}|o!|id|dddƒ}n|}|d||f7}|d |io!|id|i ƒddd ƒp|7}|Sd S( sT Return HTML for my next/previous/up links. XXX not used ? snoness[s]s access_keysPsNs]next: %s previous: %ss+ up: %ssUN( snonestsselfs previousPagesnextPagesprevsnexts renderLinksparentssprimaryParentName(sselfsnextsprevsnonest((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysnavlinks$s!!'s renderNestingsc sT‡‡‡‡d†} |o|dˆjodSn|tjo g}n|tjodg}d} nd} x˛|D]Ş} t | ƒt jot| dˆjo| o%|i d|| | dƒfƒnt | ƒdjoá| dˆjo| o|i dƒnx†| dD]z} t | ƒt joDˆi| gdˆdˆd ˆd |d |d |d |dƒ}q|i d|| | ƒfƒqW| dˆjo| o|i dƒqÔn|dcd7<| dˆjo| o|i d|ƒq#qy|i d|| | ƒfƒqyW| o|Sn|i dƒt|dƒSdS(sD Format a nesting structure as HTML unordered lists of wiki links. - nesting is the nesting to be formatted - here is the name of the page to highlight with "you are here", if any - if enlarge_current is true, here will be enlarged instead - if suppress_hyperlink is true, here will not be linked (backwards compatibility for old editforms) - if suppress_current is true, here will not be shown at all - did, got & indent are for recursion, callers should not use Do we need all this complicated code, can't we do it in the skin template ? I think so, except for two issues: for very large nestings the python version might be perceptibly quicker; and, it's easier to recurse with python. See also nestingAsRenderList. c s§ˆiƒ‰‡‡d†}ˆo |ˆjojˆo7ddˆˆi|ƒtdƒ|ˆi |ƒfSqŁdˆo|p ||ƒtdƒfSn ||ƒSdS(s8Render a link to page, suitable for contents or context.cs0ˆi|ƒ}dˆ||ˆi|ƒfSdS(Ns %s(sselfscanonicalIdFromspagesidswikiurlsformatWikiname(spagesid(swikiurlsself(s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys quicklinkXss#

%s

s5%sswhich pages link to this one ?s'%s <-- %s.s You are hereN( sselfswiki_urlswikiurls quicklinksherespagesenlarge_currentscanonicalIdFroms_sformatWikinamessuppress_hyperlink(spageswikiurls quicklink(ssuppress_hyperlinksselfsheresenlarge_current(swikiurls>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysrenderContentsLinkTs 7 ,issi˙˙˙˙s ...s%s s N(srenderContentsLinkssuppress_currentsnestingsheresdidsNonesgots recursingsnstypesListTypesappendsindentslensisselfs renderNestingsenlarge_currentssuppress_hyperlinksjoin( sselfsnestingsheresenlarge_currentssuppress_hyperlinkssuppress_currentsdidsgotsindentsisrenderContentsLinksns recursing((sselfsheresenlarge_currentssuppress_hyperlinks>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys renderNesting@sP    %  !! snestingAsRenderListc Csę|o|d|jogSn|tjo g}n|tjohdd contents ul
  • page ...
  • page ...
  • ultag
    istypes+is=!s=spagesdidsgotsindents s-i˙˙˙˙s.s/shrefsnameN(ssuppress_currentsnestingsheresdidsNonesgots recursingsnstypesListTypestsappendsstrslensisselfsnestingAsRenderListsindentswiki_urlswikiurlsgscanonicalIdFromsquote( sselfsnestingsheressuppress_currentsdidsgotsindentswikiurlsgsnsists recursing((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysnestingAsRenderListŸsN>   - /)) (s__name__s __module__s__doc__sClassSecurityInfossecuritysdeclareProtecteds PermissionssViewsNonescontentssreferringPageIdsreferringPageNamescontextscontextXschildrens offsprings subtopicssnavlinkss renderNestingsnestingAsRenderListsmap(((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysOutlineRenderingas.  $ 7    ^msPageOutlineSupportcBstZdZRS(sa I make a page aware of it's place within the overall wiki outline (page hierarchy). (s__name__s __module__s__doc__(((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pysPageOutlineSupports (&s __future__s nested_scopessstringsresjoinstypessurllibsquotesunquotes AccessControlsClassSecurityInfos Acquisitions App.CommonsabsattrsGlobalssInitializeClasss REPLACEABLEs PersistencesOFS.SimpleItems SimpleItems PermissionssUtilssflattensBLATHERsDefaultss PAGE_METATYPEsRegexpss bracketedexprsOutlinesI18ns_s deepappendsPersistentOutlinesParentsPropertysShowSubtopicsPropertysOutlineManagersOutlineRenderingsPageOutlineSupport(sunquotes PAGE_METATYPEs bracketedexprsflattens PersistencesstringsParentsPropertysShowSubtopicsPropertysresOutlineRenderings AcquisitionsabsattrsPersistentOutlines Permissionss deepappendsOutlines nested_scopessquotesClassSecurityInfosPageOutlineSupportsInitializeClasss SimpleItems_sBLATHERsjoins REPLACEABLEsOutlineManager((s>/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/OutlineSupport.pys?.s<              V S ˙H ˙Ž