; )HEc@sdZdklZdkZdkZdkZdkZdkZdkZdkZdkl Z l Z l Z l Z l Z lZlZdklZdklZlZdkZdklZdklZlZdklZd klZd kl Z d k!l!Z!d k"l#Z#d k$l%Z%l&Z&dk'l(Z(l)Z)l*Z*ddZ+ddZ,ddZ-ddZ.dZ/dZ0dZ1dZ2dZ3dZ4hZ5xcddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0gD]Z6e+e6e5e6e>e?e=d+e=d<d?i@d>ZAeAe=d@sN(sosspathssplitsabspaths__file__sTHISDIRsjoinsdirsnamesfilepathsdatasmtimesopensfpsreadsgetmtimesFilesfilesbobobase_modification_timesNonesclose(snamesdirsfpsfilepathsdatasTHISDIRsfilesmtime((smtimes5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pysloadFiles "  cCs#t|dtdddfjSdS(Ns meta_types Page TemplatesFilesystem Page TemplatesPage Template (File)(sgetattrsobjsNone(sobj((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pysisPageTemplatescCs,t|dtddddddfjSdS(Ns meta_types DTML MethodsFilesystem DTML MethodsDTML Method (File)s DTML DocumentsFilesystem DTML DocumentsDTML Document (File)(sgetattrsobjsNone(sobj((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys isDtmlMethodscCst|p t|SdS(N(sisPageTemplatesobjs isDtmlMethod(sobj((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys isTemplatescCst|dtdfjSdS(Ns meta_typesFile(sgetattrsobjsNone(sobj((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pysisFilescCst|dttfjSdS(Ns meta_type(sgetattrsobjsNones PAGE_METATYPE(sobj((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys isZwikiPagescCsd||fSdS(Ns
%s
%s(serrorstext(stextserror((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys addErrorToss badtemplates backlinkss contentspagesdeniedsdiffformseditforms recentchangess searchwikishelppages subscribeforms useroptionsswikipages accesskeyss commentformscontentsheadshierarchylinksslinkss maintemplates pageheaderspagemanagementforms siteheaders testtemplates RecentChangess SearchPages UserOptionsssubtopics_outlinessubtopics_boardsstylesheet.csss stylesheets HelpPage.stxsHelpPages ratingformcCs| oRgi}tiD]3}t|to|ti |i qq~n.x*t D]"}ti |i |i qaWtSdS(s Return a dictionary of all the latest macros from our PageTemplateFiles. This is called for each access to here/macros (MACROS) N(sselfsappends_[1]s TEMPLATESsvaluessts isinstancesPageTemplateFilesMACROSsupdates pt_macrossPAGETEMPLATEIDSsidsgetSkinTemplate(sselfs_[1]stsid((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys getmacrossR s linkpanelsnavpanelsnulls!
sfaviconslogolinks pagelinkss pagenameands wikilinkss SkinViewscBstZdZeZeieidedZ eieidedZ eiei deeeedZ eieiddZ eid eed Zeieid ed Zeieid dZeieideeeddZeieidedZeieidedZeZeieidedZeieiddZeieidedZeieidedZeieidedZRS( s? This mixin defines the main Zwiki UI views as methods. These view methods usually just call a built-in template of the same name, which may be overridden by a similarly-named template in the ZODB (a page template, a dtml method, sometimes a File..) A few methods don't use a template at all. s backlinkscCs|id||SdS(sD Render the backlinks form (template-customizable). s backlinksN(sselfsgetSkinTemplatesREQUEST(sselfsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys backlinksBss contentspagecCs&|id||d|d|SdS(s~ Render the contents view (template-customizable). hierarchy and singletons parameters are required. s contentspages hierarchys singletonsN(sselfsgetSkinTemplatesREQUESTs hierarchys singletons(sselfs hierarchys singletonssREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys contentspageIss createformcCs|i| o|itdSn|ido$|id||p||Sn!|i ||p||ddSdS(s Render the create form (template-customizable). This usually just calls editform; it is protected by a different permission and also allows an alternate pagename argument to support the page management form (XXX temporary). It may also be customized by a createform skin template, in which case page creation and page editing forms are different. s]Sorry, this wiki doesn't allow anonymous edits. Please configure a username in options first.s createformsactionsCreateN( sselfscheckSufficientIdsREQUESTsdenieds_shasSkinTemplatesgetSkinTemplatespagespagenamestextseditform(sselfsREQUESTspagestextspagename((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys createformTs $s davLockDialogc CsLtd}td|dd|tdtdfd|idSd S( sH web page displayed in webDAV lock conflict situations. sPage is lockedstitlesmessagesa %s

%s

%s sJ This page has a webDAV lock. Someone is probably editing it with an external editor. You'll need to wait until they've finished and then try again. If you've just made some changes, you may want to back up and copy your version of the text for reference. s0To discard your changes and try again, click OK.sactions /editformN(s_stitlestrs MessageDialogsselfspageUrl(sselfstitlestr((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys davLockDialogjs   sdeniedcCs |id||d|SdS(sA Render the denied form (template-customizable). sdeniedsreasonN(sselfsgetSkinTemplatesREQUESTsreason(sselfsreasonsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pysdeniedssdiffformcCs&|id||d|d|SdS(ss Render the diff form (template-customizable). revA and difftext parameters are required. sdiffformsrevAsdifftextN(sselfsgetSkinTemplatesREQUESTsrevAsdifftext(sselfsrevAsdifftextsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pysdiffformsseditConflictDialogcCstd}td|dd|tdtdtdtdtd td td td td f d|idSdS(sA web page displayed in edit conflict situations. s Edit conflictstitlesmessages %s

%s. %s:

  1. %s
  2. %s
  3. %s
  4. %s
  5. %s.
%s,

%s. s7Someone else has saved this page while you were editings To resolve the conflict, do thiss Click your browser's back buttons'Copy your recent edits to the clipboards#Click your browser's refresh buttons>Paste in your edits again, being mindful of the latest changessClick the Change button againsors1To discard your changes and start again, click OKsactions /editformN(s_stitlestrs MessageDialogsselfspageUrl(sselfstitlestr((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pyseditConflictDialogs   ^seditformsChangec Cs|i| o|itdSn| p||ijot|do |io|i Sn|t jo|i}|i }n=|i |o|i |i }nd}|pd}|id||d|d|d|d |d |iSd S( s Render the edit form (template-customizable). This is usually called by createform also, and can handle both editing and creating. The form's textarea contents may be specified. s]Sorry, this wiki doesn't allow anonymous edits. Please configure a username in options first.s wl_isLockedsCreatesseditformspagestextsactionsidsoldidN(sselfscheckSufficientIdsREQUESTsdenieds_spagespageNameshasattrs wl_isLockeds davLockDialogsNonesreadstexts pageWithNamesactionsgetSkinTemplatesid(sselfsREQUESTspagestextsaction((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pyseditforms$8   s recentchangescCs|id||SdS(sH Render the recentchanges form (template-customizable). s recentchangesN(sselfsgetSkinTemplatesREQUEST(sselfsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys recentchangesss searchwikicCs|id||SdS(sE Render the searchwiki form (template-customizable). s searchwikiN(sselfsgetSkinTemplatesREQUEST(sselfsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys searchwikisshelppagecCs|id||SdS(sC Render the helppage form (template-customizable). shelppageN(sselfsgetSkinTemplatesREQUEST(sselfsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pyshelppagessshowAccessKeyscCstdSdS(sG Show the access keys supported by the built-in skins. s} Access keys can be accessed in mozilla-based browsers by pressing alt- IE users: must also press enter Mac users: command- Opera users: shift-escape- These won't work here, back up to the previous page to try them out. 0 show these access key assignments wiki functions: f show front page c show wiki contents r show wiki recent changes show discussion page t show issue tracker i show wiki index o show wiki options (preferences) h show help page s go to search field page functions: + (in a plone/cmf site with skin switching set up) use zwiki's plone/cmf skin - (in a plone/cmf site with skin switching set up) use zwiki's standard skin v view page m mail subscription b show backlinks (links to this page) d show diffs (page edit history) y show full history (in ZMI) e edit this page x edit with an external editor print this page (and subtopics) q view page source (quick-view) wipe and regenerate this page's render cache go to subtopics go to comments (messages) go to page author's home page, if possible n next page p previous page u up to parent page in edit form: s save changes p preview when viewing diffs: n next edit p previous edit N(s_(sself((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pysshowAccessKeysss stylesheetcCs|o|iiddnt|idt|idtd}t|p t |o|i |||SnD|o)|i }|iidt |n|i||iSdS(s6 Return the style sheet used by the other templates. Template-customizable. Unlike the other skin methods, this one can be overridden by either a 'stylesheet' or a 'stylesheet.css' template - this is a little annoying. Also the template in this case is usually a File (but can also be a page template or dtml method for a dynamic stylesheet). When a File is used the Last-modified header is set to help caching. (Also, all pages use a single stylesheet url - DEFAULTPAGE/stylesheet). s Content-Typestext/csss stylesheetsstylesheet.csss Last-ModifiedN(sREQUESTsRESPONSEs setHeadersgetattrsselfsfolders TEMPLATESsformsisPageTemplates isDtmlMethods__of__sbobobase_modification_timesmodifieds rfc1123_dates index_html(sselfsREQUESTsformsmodified((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys stylesheet7s   s subscribeformcCs|id||SdS(sL Render the mail subscription form (template-customizable). s subscribeformN(sselfsgetSkinTemplatesREQUEST(sselfsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys subscribeformUss useroptionscCs|id||SdS(sF Render the useroptions form (template-customizable). s useroptionsN(sselfsgetSkinTemplatesREQUEST(sselfsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys useroptions\s(s__name__s __module__s__doc__sClassSecurityInfossecuritysdeclareProtecteds PermissionssViewsNones backlinkss contentspagesAdds createforms davLockDialogs declarePublicsdeniedsdiffformseditConflictDialogsEditseditforms recentchangess searchwikis searchpageshelppagesshowAccessKeyss stylesheets subscribeforms useroptions(((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys SkinViews6sB        &*    5  s SkinUtilscBstZdZeZeedZedZ e Z ei e i dedZeedZdZdZei e i ddZRS( s This mixin provides utilities for our views, so that they can work in any kind of configuration - default or customized, standard or cmf/plone, old or new templates.. icCs|SdS(N(sself(sselfsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pyswikipage_templatessgetmaintemplatecCsB|io|idjo|idSn|idSdS(s Return the standard Zwiki or CMF/Plone main template, unevaluated. This fetches the appropriate main template depending on whether we are in or out of cmf/plone (and in the latter case, whether the user has selected standard or plone skin mode). We point the 'main_template' computed attribute at this method, which allows our templates to use here/main_template and always be appropriately skinned. splones main_templates maintemplateN(sselfsinCMFs displayModesgetSkinTemplate(sselfsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pysgetmaintemplates  c Cst|i|dt|i|dt|i|t}t| oti|td}n|i |ii |SdS(si Get the named skin template from the ZODB or filesystem. This will find either a Page Template or DTML Method with the specified name. We look first for a template with this name in the ZODB acquisition context, trying the .pt, .dtml or no suffix in that order. Then we look in skins/zwiki on the filesystem. If no matching template can be found, we return a generic error template. For convenient skin development, we return the template wrapped in the current page's context (so here will be the page, container will be the folder, etc). This is basically duplicating the CMF skin mechanism, but in a way that works everywhere, and with some extra error-handling to help skin customizers. Still evolving, it will all shake out in the end. s.pts.dtmls badtemplateN( sgetattrsselfsfoldersnamesNonesobjs isTemplates TEMPLATESsgets__of__(sselfsnamesobj((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pysgetSkinTemplatescCs|i|tdjSdS(sV Does the named skin template exist in the aq context or filesystem ? s badtemplateN(sselfsgetSkinTemplatesnames TEMPLATES(sselfsname((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pyshasSkinTemplatess addSkinTocKs]t|dt}t|dp |ido|Sn |id||d||SdS(sE Add the main wiki page skin to some body text, unless 'bare' is set. XXX used only for the main page view. Perhaps a wikipage view method should replace it ? Well for now this is called by the page type render methods, which lets them say whether the skin is applied or not. sREQUESTsbareswikipagesbodyN( sgetattrsselfsNonesREQUESTshasattrskwshas_keysbodysgetSkinTemplate(sselfsbodyskwsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys addSkinTos  (s__name__s __module__s__doc__sClassSecurityInfossecuritysComputedAttributes getmacrossmacrossNoneswikipage_templateswikipage_macrossdeclareProtecteds PermissionssViewsgetmaintemplates main_templatesgetSkinTemplateshasSkinTemplates addSkinTo(((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys SkinUtilsfs      sSkinSwitchingUtilscBstZdZeZeieidedZ eieiddZ e Z eieidedZ eieidedZ eieid d ZRS( s This mixin provides methods for switching between alternate skins (or between display modes within a single zope skin). ssetskincCs5|ddfjo|idn|iddS(s When in a CMF/Plone site, switch between standard and plonish UI. The user's preferred skin mode is stored in a zwiki_displaymode cookie. This was once used to change the appearance of the non-plone standard skin (full/simple/minimal); later it acquired the ability to switch between CMF skins in CMF/plone; now it just selects the zwiki or plone appearance in CMF/plone, by setting a cookie for getmaintemplate(). splonescmfszwikiN(sskinsselfssetDisplayMode(sselfsskin((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pyssetskins ssetDisplayModecCsd|i}|i}|id|ddd|idi|i|id|iddS( sr Save the user's choice of skin mode as a cookie. For 1 year, should they be permanent ? szwiki_displaymodespaths/sexpiresims came_fromsURL1N( sselfsREQUESTsRESPONSEs setCookiesmodesZopeTimesrfc822sredirectsget(sselfsmodesREQUESTsRESPONSE((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pyssetDisplayModes   s displayModecCsb|p|i}|iodpd}|idt}|ddgj o |}n|SdS(s: Find out the user's preferred skin mode. sploneszwikiszwiki_displaymodeN(sREQUESTsselfsinCMFs defaultmodesgetsNonesm(sselfsREQUESTsms defaultmode((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys displayModes susingPloneSkincCs!|io|idjSdS(s Convenience utility for templates: are we using plone skin ? Ie, are we using the plone display mode of zwiki's standard skin. sploneN(sselfsinCMFs displayMode(sselfsREQUEST((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pysusingPloneSkin ss setCMFSkincs|i odSn|iii|iii}d}|| odSn|i}t |d odSn||i d<|i |i|ii|iddS(sK Change the user's CMF/Plone skin preference, if possible. Ncsi||jSdS(N(s portal_skinss getSkinPathss(ss(s portal_skins(s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pyshasSkinss setPropertiess portal_skinsURL1(sselfsinCMFs portal_urlsgetPortalObjects portal_skinssportal_membershipshasSkinsskinsgetAuthenticatedMembersmembershasattrsREQUESTsforms setPropertiessupdateSkinCookiesRESPONSEsredirectsget(sselfsREQUESTsskinsmembers portal_skinssportal_membershipshasSkin((s portal_skinss5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys setCMFSkins     (s__name__s __module__s__doc__sClassSecurityInfossecuritysdeclareProtecteds PermissionssViewsNonessetskinssetDisplayModes setSkinModes displayModesusingPloneSkins setCMFSkin(((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pysSkinSwitchingUtilss      s PageViewscBstZRS(N(s__name__s __module__(((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys PageViews+s(Fs__doc__s __future__s nested_scopessosssyssresstringstimesmathssplitsjoinsfindslowersrfindsatoisstrips App.Commons rfc1123_dates AccessControlsgetSecurityManagersClassSecurityInfos Permissionss OFS.ImagesFilesGlobalssInitializeClasss MessageDialogs'Products.PageTemplates.PageTemplateFilesPageTemplateFiles'Products.PageTemplates.ZopePageTemplatesZopePageTemplates"Products.PageTemplates.ExpressionssSecureModuleImportersComputedAttributesDefaultss PAGE_METATYPEsUtilssBLATHERsformattedTracebacksI18ns_sDTMLFilesHTMLFilesloadPageTemplatesloadDtmlMethodsloadStylesheetsloadFilesisPageTemplates isDtmlMethods isTemplatesisFiles isZwikiPages addErrorTos TEMPLATESstsappends_[1]skeyss isinstancesPAGETEMPLATEIDSsextendsMACROSs getmacrossNones pt_macross nullmacros SkinViewss SkinUtilssSkinSwitchingUtilss PageViews(4s PAGE_METATYPEsformattedTracebacksloadDtmlMethods rfc1123_dates isDtmlMethods SkinUtilssisFilesstripsfinds SkinViewssisPageTemplates TEMPLATESs_[1]sMACROSs addErrorTos isTemplatestsresPageTemplateFilesloadFilesloadPageTemplates isZwikiPagesHTMLFilesmathssplits nullmacros PageViewssstrings nested_scopessloadStylesheetsClassSecurityInfosInitializeClasssDTMLFilessyss getmacrossatoisSkinSwitchingUtilssZopePageTemplates MessageDialogs_sBLATHERslowersjoinsgetSecurityManagersrfindsPAGETEMPLATEIDSsSecureModuleImportersComputedAttributesFilestimes Permissionssos((s5/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/Views.pys?hsp 6 1              L E       - j T