File:  [Repository] / ECHO_content / Attic / ECHO_Nav.pyc
Revision 1.5: download - view: text, annotated - select for diffs - revision graph
Tue Mar 16 10:20:58 2004 UTC (20 years, 3 months ago) by dwinter
Branches: MAIN
CVS tags: HEAD
new

    1: ;
    2: Q@c@s%dklZdklZdklZdklZdkZdk	Z	dk
    3: lZdkZ
dklZdkZdefdYZd	Zed
    4: ZdefdYZd
ZdklZddeeeedZdefdYZdZedZdZdZdS((sFolder(s
    5: SimpleItem(sPageTemplateFile(sPageTemplateN(sZopePageTemplate(spackage_homesECHO_sqlElementcBstZdZdZdZdZeihdd<dd<fZdZd	Z	d
    6: Z
    7: dZedZ
d
ZdZRS(s"Erzeuge navigation aus sql-abfragesECHO_sqlElementsc		Csf||_||_||_||_|djo
||_n
    8: ||_||_||_||_	dS(sinitsN(
    9: sidsselfstitlesquerysfieldssearchFieldsbaseUrlsweightscontent_typescontent(	sselfsidstitlesquerysfieldssearchFieldsbaseUrlsweightscontent_type((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys__init__s				

			slabelsMain ConfigsactionschangeECHO_sqlElementFormcCs y|iSWn|iSnXdS(N(sselfssearchFieldsfield(sself((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysgetSearchField&scCs#t|do|iSndSdS(s
   10: get weightsweightiN(shasattrsselfsweight(sself((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys	getWeight,scCs#t|do|iSndSdS(s
   11: get weightscontent_typeiN(shasattrsselfscontent_type(sself((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysgetContent_type3scCs tdi|}|SdS(schanges3Products/ECHO_content/zpt/changeECHO_sqlElement.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pyschangeECHO_sqlElementForm<sc		Csa||_||_||_||_||_||_||_|t	j	o|i
   12: dndS(schangesmanage_mainN(stitlesselfsquerysfieldssearchFieldsbaseUrlsweightscontent_typesRESPONSEsNonesredirect(	sselfstitlesquerysfieldssearchFieldsbaseUrlsweightscontent_typesRESPONSE((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pyschangeECHO_sqlElementBs							
cCs|id|iSdS(Nsvar(sselfssearchsquery(sself((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pyssearchQueryOsc	Cs|i}|ogSnng}x`|D]X}yH|it||i|it	i
   13: tt||ifWq)q)Xq)W|SdS(s'ausgabe der treffer list fr navigationN(
sselfssearchQuerysrecordssretsrecordsappendsgetattrsfieldsbaseUrlsurllibsquotesstrsgetSearchField(sselfsrecordsrecordssret((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys
   14: getNavListRsH(s__name__s
   15: __module__s__doc__s	meta_typesbaseUrls__init__s
   16: SimpleItemsmanage_optionssgetSearchFields	getWeightsgetContent_typeschangeECHO_sqlElementFormsNoneschangeECHO_sqlElementssearchQuerys
   17: getNavList(((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysECHO_sqlElements	"					
	cCs tdi|}|SdS(sForm for addings0Products/ECHO_content/zpt/AddECHO_sqlElement.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysmanage_addECHO_sqlElementFormbsc
   18: 
   19: CsM|i|t|||||||||	tj	o|	i
dndS(sAdd an ECHO_sqlelementsmanage_mainN(sselfs
   20: _setObjectsidsECHO_sqlElementstitlesquerysfieldssearchFieldsbaseUrlsweightscontent_typesRESPONSEsNonesredirect(
   21: sselfsidstitlesquerysfieldssearchFieldsbaseUrlsweightscontent_typesRESPONSE((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysmanage_addECHO_sqlElementgs+
sECHO_pageTemplatecBs{tZdZdZeiieedZ	e
   22: ihdd<dd<fZdZe
dZd	Zd
   23: ZRS(spageTemplate ObjektsECHO_pageTemplates"html/ECHO_pageTemplateDefault.htmlslabelsWeight and Typesactions!changeECHO_pageTemplateWeightFormcCs tdi|}|SdS(schanges;Products/ECHO_content/zpt/ChangeECHO_pageTemplateWeight.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys!changeECHO_pageTemplateWeightFormzscCs4||_||_|tj	o|idndS(schangesmanage_mainN(sweightsselfscontent_typesRESPONSEsNonesredirect(sselfsweightscontent_typesRESPONSE((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pyschangeECHO_pageTemplateWeights
   24: 		
cCs#t|do|iSndSdS(s
   25: get weightsweightiN(shasattrsselfsweight(sself((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys	getWeightscCs#t|do|iSndSdS(s
   26: get weightsweightiN(shasattrsselfsweight(sself((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysgetContent_Types(s__name__s
   27: __module__s__doc__s	meta_typesosspathsjoinspackage_homesglobalss_default_content_fnsZopePageTemplatesmanage_optionss!changeECHO_pageTemplateWeightFormsNoneschangeECHO_pageTemplateWeights	getWeightsgetContent_Type(((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysECHO_pageTemplateos	"		cCs tdi|}|SdS(sForm for addings2Products/ECHO_content/zpt/AddECHO_pageTemplate.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysmanage_addECHO_pageTemplateForms(squoteic
Cst|}|tjoh|i|t||t||}t
   28: |d|t
   29: |d||o|i|n|Sn|iid}t|dt}
   30: |
   31: tjp|iot|}	nt|||
   32: id}	|i||	t||}t
   33: |d|y|i}Wntj
   34: o|d}nX|djod|t|f}n|ii|dd	Sd
   35: S(s/Add a Page Template with optional file content.sweightscontent_typesfilesheaderssURL1s Add and Edit s%s/%ss/manage_mainsN(sstrsidsREQUESTsNonesselfs
   36: _setObjectsECHO_pageTemplatestextsgetattrsobssetattrsweightscontent_typestitlespt_setTitlesformsgetsfilesheaderssfilenameszptsDestinationURLsusAttributeErrorssubmitsquotesRESPONSEsredirect(
sselfsidsweightscontent_typestitlestextsREQUESTssubmitsobszptsheaderssusfile((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysmanage_addECHO_pageTemplates4

sECHO_navigationcBstZdZdZdddddddgZd	Zeihd
   37: d<dd
<fZdZe	dZ
   38: dZdZe	e	dZ
ddZdZe	ddZdZdZdZdZdZRS(sNavigations ElementsECHO_NavigationsImageCollectionIFramesECHO_collectionsECHO_pageTemplatesZSQLExtendFoldersECHO_sqlElements
ECHO_resourcesECHO_externalLinkcCs||_||_||_dS(sinitN(sidsselfstitlespathToHierarchy(sselfsidstitlespathToHierarchy((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys__init__s		slabelsMain ConfigsactionsECHO_navigationConfigFormcCs tdi|}|SdS(s
   39: configForms3Products/ECHO_content/zpt/ChangeECHO_navigation.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysECHO_navigationConfigFormscCs4||_||_|tj	o|idndS(sconfigsmanage_mainN(stitlesselfspathToHierarchysRESPONSEsNonesredirect(sselfstitlespathToHierarchysRESPONSE((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysECHO_navigationConfigs
   40: 		
cCsh}x|iiD]}t||}t|doh|i|i	joQ|djo*|i||d|f||i<qt
|f||i<qqqW|SdS(Ns	meta_typei(snavsobjs__dict__skeyssgetattrsxshasattrs	meta_typesselfsdisplayedMetaTypessdepthsgetCollssgetIdsNone(sselfsobjsdepthskeyssnavsx((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysgetCollss
*"cCs|id}tidd|}d|}t|}h}|}x|i	i
   41: D]}t||}t
|don|i|ijoW|djo0|i|t|d|f||i<qt|f||i<qqTqTW|SdS(sAuslesen des Hierarchiebuamesis/s.sself.aq_parents	meta_typeiN(sselfspathToHierarchystempsressubsevalsobjtempsnavsobjs__dict__skeyssgetattrsxshasattrs	meta_typesdisplayedMetaTypessdepthsgetCollssintsgetIdsNone(sselfsdepthsobjstempskeyssobjtempsnavsx((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys
createNavHashs 

   42: 
   43: 
0"cCs+g}|o|}d}n|}|o|id}ti	dd|}d|}t
   44: |}|}	x|D]}t|	|}	qqWt|	do
|	i}qd}nx.|D]&}y||d}WqgSqXqWdG|GHx5|i|d|D]}||d	id
   45: jo||d	idjo>x||d	iD]!}
   46: |i|
   47: d|
   48: d	fqMWqt||d	doL||d	id
   49: jo||d	i}d
G|GHq||d	i}n||d	i}|i|t|i||d	ifqqW|SdS(sErzeuge Navigations Elementsweightis/s.sself.aq_parents	sortfieldsHELLsfieldissECHO_sqlElementslabels	HAS LABELN(slistNavsstartshashstemps	sortFieldsselfspathToHierarchystempObjsressubsevalsobjtempsobjsxsgetattrshasattrs	sortfields
   50: tempSortedstitles	meta_types
   51: getNavListszsappendslabels
   52: createPathsabsolute_url(sselfshashsstarts	sortFieldstempObjstempslabelsxslistNavsobjszsobjtemp((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysbarFromHashsR
   53: 

   54: 

   55: 	#
8
   56: sweightcCsg}dG|GHx`|iD]R}t||d|ot||d|}nd}|i||fqW|i	t
   57: gi}|D]}||dq~SdS(NsSORTii(slssfieldshashskeyssxshasattrsgetattrsweightsappendssorts
   58: sortWeights_[1](sselfshashsfieldsweights_[1]slssx((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys
   59: tempSortedZs	

cCstid|d}|oBtidd|id}d|id|jodSq_nti|d|idodSndSd	S(
   60: s test is path is already selecteds\?(.*)is s%20is?sQUERY_STRINGsURLN(	sressearchsitemsfoundssubsgroupstempsselfsREQUEST(sselfsitemstempsfound((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysisSelectedPathnss
   61: horizontalc
Cs7|djod}d}d}d}nd}d}d}d	}|o
   62: |}n&|}x|D]}
   63: ||
   64: d
   65: }q`Wx|i
   66: |D]}	||
   67: di}t|i||	di}|id|j|id|d
jBo||d||}q||d||f|}qW||}|SdS(sGenerate Buttonss
   68: horizontals<table><tr>s<td>s</td>s
</tr></table>s<table>s<tr><td>s
   69: </td></tr>s</table>iisURLs/index_htmls[%s]s[<a href='%s'>%s</a>]N(sorientationshtmlsstartTagsendTagsendHtmlsstartshashstempsxsselfs
   70: tempSortedskeystitlesdescriptions
   71: createPathsabsolute_urlsurlsREQUEST(
sselfshashsstartsorientationstempsendTagsurlsendHtmlshtmlskeysxsstartTagsdescription((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysbuttonsFromHash}s2

   72: 
   73: #) 
   74: cCsId}dG|iGHy|i|id}Wn
d}nX|SdS(sprint main navigation barssNAVBARiN(skeyssselfsgetIdsbuttonsFromHashs
createNavHash(sselfskeys((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys
   75: mainNavBars
   76: cCs5d}dG|iGH|i|id}|SdS(sprint main navigation barss
   77: NAVELEMENTiN(skeyssselfsgetIdsbarFromHashs
createNavHash(sselfskeys((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysmainNavElementss
   78: cCsp|id}|id}ti|id|}|i	d}|dg}|i|d|}|SdS(sZweite OrdnungisURLss/sstartN(sselfs
createNavHashshashsREQUESTs
   79: actual_urlsressubsabsolute_urlsult_tempssplitssplittedsstartsbarFromHashskeys(sselfsult_tempshashsstartskeysssplitteds
   80: actual_url((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pyssecondNavElementss

cCst|i|}|id}ti|id|}|i
   81: d}|d|d!}|i
|d|}|SdS(sn-te OrdnungsURLss/iisstartN(sselfs
createNavHashsordershashsREQUESTs
   82: actual_urlsressubsabsolute_urlsult_tempssplitssplittedsstartsbarFromHashskeys(sselfsordersult_tempshashsstartskeysssplitteds
   83: actual_url((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysnavElementss
cCsv|id}|id}ti|id|}|i	d}|dg}|i|d|dd}|SdS(	sZweite OrdnungisURLss/sstartsorientationsverticalN(sselfs
createNavHashshashsREQUESTs
   84: actual_urlsressubsabsolute_urlsult_tempssplitssplittedsstartsbuttonsFromHashskeys(sselfsult_tempshashsstartskeysssplitteds
   85: actual_url((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pyssecondNavBars

(s__name__s
   86: __module__s__doc__s	meta_typesdisplayedMetaTypess__init__sFoldersmanage_optionssECHO_navigationConfigFormsNonesECHO_navigationConfigsgetCollss
createNavHashsbarFromHashs
   87: tempSortedsisSelectedPathsbuttonsFromHashs
   88: mainNavBarsmainNavElementsssecondNavElementssnavElementsssecondNavBar(((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysECHO_navigations$	"			
	!B	'		
		cCs tdi|}|SdS(sForm for addings0Products/ECHO_content/zpt/AddECHO_navigation.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysmanage_addECHO_navigationFormscCs>|i|t||||tj	o|idndS(sAdd an ECHO_rootsmanage_mainN(	sselfs
   89: _setObjectsidsECHO_navigationstitlespathToHierarchysRESPONSEsNonesredirect(sselfsidstitlespathToHierarchysRESPONSE((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pysmanage_addECHO_navigation
s
cCsg|id}|id}x*|D]"}|d|jo|d=q%q%W|dti|dSdS(Ns/i(surl1ssplitstemp1surl2stemp2stestsstringsjoin(surl1surl2stemp2stemp1stest((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys
   90: createPathscCst|d|dSdS(Ni(scmpsxsy(sxsy((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys
   91: sortWeight"s(s
   92: OFS.FoldersFoldersOFS.SimpleItems
   93: SimpleItems'Products.PageTemplates.PageTemplateFilesPageTemplateFiles#Products.PageTemplates.PageTemplatesPageTemplatesresstrings'Products.PageTemplates.ZopePageTemplatesZopePageTemplatesos.pathsossGlobalsspackage_homesurllibsECHO_sqlElementsmanage_addECHO_sqlElementFormsNonesmanage_addECHO_sqlElementsECHO_pageTemplatesmanage_addECHO_pageTemplateFormsquotesmanage_addECHO_pageTemplatesECHO_navigationsmanage_addECHO_navigationFormsmanage_addECHO_navigations
   94: createPaths
   95: sortWeight(s
   96: createPathsmanage_addECHO_navigationFormsZopePageTemplatesmanage_addECHO_sqlElementFormsFoldersECHO_navigationsECHO_pageTemplatesurllibsPageTemplatesresPageTemplateFilesmanage_addECHO_navigationsECHO_sqlElementsmanage_addECHO_pageTemplateFormsstringsmanage_addECHO_sqlElementsquotes
   97: SimpleItemsmanage_addECHO_pageTemplates
   98: sortWeightsosspackage_home((sP/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/ECHO_content/ECHO_Nav.pys?s,



		
	
	S	0	
%=			

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>