From: Maurits v. R. <svn...@pl...> - 2011-12-29 13:44:59
|
Repository: Plone Branch: refs/heads/4.0 Date: 2011-12-21T03:49:44-08:00 Author: Maurits van Rees (mauritsvanrees) <ma...@va...> Commit: https://github.com/plone/Plone/commit/5c83b4d946b444ff2ee888da66cc30a37fb0bf94 Add missing files from svn.plone.org for branch 4.0. Files changed: A Products/CMFPlone/browser/sitemap.py A Products/CMFPlone/events.py A Products/CMFPlone/exportimport/__init__.py A Products/CMFPlone/exportimport/tests/__init__.py A Products/CMFPlone/interfaces/breadcrumbs.py A Products/CMFPlone/interfaces/controlpanel.py A Products/CMFPlone/interfaces/events.py A Products/CMFPlone/interfaces/factory.py A Products/CMFPlone/interfaces/installable.py A Products/CMFPlone/interfaces/interface.py A Products/CMFPlone/interfaces/properties.py A Products/CMFPlone/interfaces/workflow.py A Products/CMFPlone/log.py A Products/CMFPlone/profiles/default/kssregistry.xml A Products/CMFPlone/profiles/default/plone-final.txt A Products/CMFPlone/profiles/testfixture/metadata.xml A Products/CMFPlone/skins/cmf_legacy/TitleOrId.py A Products/CMFPlone/skins/plone_content/author.cpt.metadata A Products/CMFPlone/skins/plone_content/document_view.pt.metadata A Products/CMFPlone/skins/plone_content/event_view.pt.metadata A Products/CMFPlone/skins/plone_content/file_view.pt.metadata A Products/CMFPlone/skins/plone_content/folder_listing.pt.metadata A Products/CMFPlone/skins/plone_content/folder_summary_view.pt.metadata A Products/CMFPlone/skins/plone_content/folder_tabular_view.pt.metadata A Products/CMFPlone/skins/plone_content/image_view.pt.metadata A Products/CMFPlone/skins/plone_content/link_view.pt.metadata A Products/CMFPlone/skins/plone_content/newsitem_view.pt.metadata A Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js A Products/CMFPlone/skins/plone_ecmascript/unittestUtilities.js A Products/CMFPlone/skins/plone_form_scripts/change_ownership.cpy A Products/CMFPlone/skins/plone_form_scripts/change_ownership.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/content_status_modify.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/delete_confirmation.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/disableSyndication.cpy A Products/CMFPlone/skins/plone_form_scripts/disableSyndication.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/discussion_reply.cpy A Products/CMFPlone/skins/plone_form_scripts/document_edit.cpy A Products/CMFPlone/skins/plone_form_scripts/document_edit.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/editSynProperties.cpy A Products/CMFPlone/skins/plone_form_scripts/editSynProperties.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/enableSyndication.cpy A Products/CMFPlone/skins/plone_form_scripts/enableSyndication.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/event_edit.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/file_edit.cpy A Products/CMFPlone/skins/plone_form_scripts/file_edit.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/image_edit.cpy A Products/CMFPlone/skins/plone_form_scripts/image_edit.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/link_edit.cpy A Products/CMFPlone/skins/plone_form_scripts/link_edit.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/newsitem_edit.cpy A Products/CMFPlone/skins/plone_form_scripts/newsitem_edit.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/portrait_delete.cpy A Products/CMFPlone/skins/plone_form_scripts/saveDefaultPage.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/selectViewTemplate.cpy A Products/CMFPlone/skins/plone_form_scripts/selectViewTemplate.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/send_feedback_site.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/sendto.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/setConstrainTypes.cpy A Products/CMFPlone/skins/plone_form_scripts/setConstrainTypes.cpy.metadata A Products/CMFPlone/skins/plone_form_scripts/validate_content_status_modify.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_document_edit.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_emailaddr.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_event_edit.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_file_edit.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_folder_rename.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_image_edit.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_link_edit.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_newsitem_edit.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_start_end_date.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_synPropertiesForm.vpy A Products/CMFPlone/skins/plone_form_scripts/validate_title.vpy A Products/CMFPlone/skins/plone_forms/content_status_history.cpt.metadata A Products/CMFPlone/skins/plone_forms/delete_confirmation_page.cpt.metadata A Products/CMFPlone/skins/plone_forms/discussion_reply_form.cpt.metadata A Products/CMFPlone/skins/plone_forms/discussion_reply_preview.pt.metadata A Products/CMFPlone/skins/plone_forms/folder_constraintypes_form.cpt.metadata A Products/CMFPlone/skins/plone_forms/folder_rename_form.cpt.metadata A Products/CMFPlone/skins/plone_forms/member_search_form.pt.metadata A Products/CMFPlone/skins/plone_forms/member_search_results.pt.metadata A Products/CMFPlone/skins/plone_forms/ownership_form.cpt.metadata A Products/CMFPlone/skins/plone_forms/search.pt.metadata A Products/CMFPlone/skins/plone_forms/search_form.pt.metadata A Products/CMFPlone/skins/plone_forms/select_default_page.cpt.metadata A Products/CMFPlone/skins/plone_forms/select_default_view.cpt.metadata A Products/CMFPlone/skins/plone_forms/sendto_form.cpt.metadata A Products/CMFPlone/skins/plone_forms/synPropertiesForm.cpt.metadata A Products/CMFPlone/skins/plone_forms/undo_form.pt.metadata A Products/CMFPlone/skins/plone_images/logo.jpg A Products/CMFPlone/skins/plone_images/logo.jpg.metadata A Products/CMFPlone/skins/plone_kss/plone_experimental.kss A Products/CMFPlone/skins/plone_login/failsafe_login_form.cpt.metadata A Products/CMFPlone/skins/plone_login/insufficient_privileges.pt.metadata A Products/CMFPlone/skins/plone_login/logged_in.cpy.metadata A Products/CMFPlone/skins/plone_login/logged_out.cpt.metadata A Products/CMFPlone/skins/plone_login/login_change_password.cpy A Products/CMFPlone/skins/plone_login/login_change_password.cpy.metadata A Products/CMFPlone/skins/plone_login/login_failed.cpt.metadata A Products/CMFPlone/skins/plone_login/login_form.cpt.metadata A Products/CMFPlone/skins/plone_login/login_form_validate.vpy.metadata A Products/CMFPlone/skins/plone_login/login_initial.cpy A Products/CMFPlone/skins/plone_login/login_initial.cpy.metadata A Products/CMFPlone/skins/plone_login/login_next.cpy.metadata A Products/CMFPlone/skins/plone_login/login_password.cpt.metadata A Products/CMFPlone/skins/plone_login/login_password_validate.vpy A Products/CMFPlone/skins/plone_login/login_success.pt.metadata A Products/CMFPlone/skins/plone_login/logout.cpy A Products/CMFPlone/skins/plone_login/registered.pt.metadata A Products/CMFPlone/skins/plone_login/require_login.py A Products/CMFPlone/skins/plone_prefs/password_form.pt.metadata A Products/CMFPlone/skins/plone_prefs/plone_control_panel.pt.metadata A Products/CMFPlone/skins/plone_prefs/plone_memberprefs_panel.pt.metadata A Products/CMFPlone/skins/plone_prefs/prefs_error_log_form.pt.metadata A Products/CMFPlone/skins/plone_prefs/prefs_error_log_setProperties.py A Products/CMFPlone/skins/plone_prefs/prefs_error_log_showEntry.pt.metadata A Products/CMFPlone/skins/plone_prefs/prefs_group_details.pt.metadata A Products/CMFPlone/skins/plone_prefs/prefs_install_product_readme.pt.metadata A Products/CMFPlone/skins/plone_prefs/prefs_installed_product_overview.pt.metadata A Products/CMFPlone/skins/plone_prefs/prefs_main_template.pt.metadata A Products/CMFPlone/skins/plone_prefs/prefs_portrait_delete.py A Products/CMFPlone/skins/plone_prefs/prefs_valid_search_restriction.py A Products/CMFPlone/skins/plone_scripts/add_ext_editor.py A Products/CMFPlone/skins/plone_scripts/browserDefault.py A Products/CMFPlone/skins/plone_scripts/canSelectDefaultPage.py A Products/CMFPlone/skins/plone_scripts/check_id.py.metadata A Products/CMFPlone/skins/plone_scripts/createObject.cpy.metadata A Products/CMFPlone/skins/plone_scripts/deleteDiscussion.py A Products/CMFPlone/skins/plone_scripts/displayContentsTab.py A Products/CMFPlone/skins/plone_scripts/folder_copy.cpy.metadata A Products/CMFPlone/skins/plone_scripts/folder_cut.cpy.metadata A Products/CMFPlone/skins/plone_scripts/folder_delete.cpy.metadata A Products/CMFPlone/skins/plone_scripts/folder_moveitem.py A Products/CMFPlone/skins/plone_scripts/folder_paste.cpy.metadata A Products/CMFPlone/skins/plone_scripts/folder_position.cpy A Products/CMFPlone/skins/plone_scripts/folder_position.cpy.metadata A Products/CMFPlone/skins/plone_scripts/folder_publish.cpy A Products/CMFPlone/skins/plone_scripts/folder_publish.cpy.metadata A Products/CMFPlone/skins/plone_scripts/folder_rename.cpy.metadata A Products/CMFPlone/skins/plone_scripts/generateUniqueId.py A Products/CMFPlone/skins/plone_scripts/getAllowedTypes.py A Products/CMFPlone/skins/plone_scripts/getGlobalPortalRoles.py A Products/CMFPlone/skins/plone_scripts/getPortalTypeList.py.metadata A Products/CMFPlone/skins/plone_scripts/getPortalTypes.py A Products/CMFPlone/skins/plone_scripts/isTranslatable.py A Products/CMFPlone/skins/plone_scripts/my_worklist.py A Products/CMFPlone/skins/plone_scripts/object_copy.cpy A Products/CMFPlone/skins/plone_scripts/object_copy.cpy.metadata A Products/CMFPlone/skins/plone_scripts/object_cut.cpy A Products/CMFPlone/skins/plone_scripts/object_cut.cpy.metadata A Products/CMFPlone/skins/plone_scripts/object_delete.cpy.metadata A Products/CMFPlone/skins/plone_scripts/object_paste.cpy.metadata A Products/CMFPlone/skins/plone_scripts/plone_log.py A Products/CMFPlone/skins/plone_scripts/pretty_title_or_id.py A Products/CMFPlone/skins/plone_scripts/raiseUnauthorized.py A Products/CMFPlone/skins/plone_scripts/redirectToReferrer.py A Products/CMFPlone/skins/plone_scripts/returnNone.py A Products/CMFPlone/skins/plone_scripts/reverseList.py A Products/CMFPlone/skins/plone_scripts/rssAllowed.py A Products/CMFPlone/skins/plone_scripts/setAuthCookie.py A Products/CMFPlone/skins/plone_scripts/show_id.py A Products/CMFPlone/skins/plone_scripts/sortObjects.py A Products/CMFPlone/skins/plone_scripts/sort_modified_ascending.py A Products/CMFPlone/skins/plone_scripts/spamProtect.py A Products/CMFPlone/skins/plone_scripts/undo.py A Products/CMFPlone/skins/plone_scripts/unique.py A Products/CMFPlone/skins/plone_templates/RSS.pt.metadata A Products/CMFPlone/skins/plone_templates/contact-info.cpt.metadata A Products/CMFPlone/skins/plone_templates/default_error_message.pt.metadata A Products/CMFPlone/skins/plone_templates/index_html.pt.metadata A Products/CMFPlone/skins/plone_templates/recently_modified.pt.metadata A Products/CMFPlone/skins/plone_templates/recently_published.pt.metadata A Products/CMFPlone/skins/plone_templates/robots.txt A Products/CMFPlone/skins/plone_templates/rss_template.pt.metadata A Products/CMFPlone/skins/plone_templates/search_rss.pt.metadata A Products/CMFPlone/skins/plone_templates/sitemap.pt.metadata A Products/CMFPlone/skins/plone_templates/standard_error_message.py A Products/CMFPlone/tests/__init__.py A Products/CMFPlone/tests/testCutPasteSecurity.py A Products/CMFPlone/tests/testDisplayContentsTab.py A Products/CMFPlone/tests/testPloneTestCase.py A Products/CMFPlone/tests/testSyndicationTool.py A Products/CMFPlone/tests/timeBreadCrumbs.py A Products/CMFPlone/unicodeconflictresolver.py A Products/CMFPlone/www/addConfigletForm.pt A Products/CMFPlone/www/catalogAdvanced.dtml A Products/CMFPlone/www/portal_factory_docs.stx M Products/CMFPlone/exportimport/controlpanel.py M Products/CMFPlone/skins/plone_3rdParty/jscalendar/calendar-setup.js M Products/CMFPlone/skins/plone_3rdParty/jscalendar/calendar.js M Products/CMFPlone/skins/plone_3rdParty/jscalendar/index.html M Products/CMFPlone/skins/plone_3rdParty/jscalendar/reference.html M Products/CMFPlone/tests/dummy.py M Products/__init__.py diff --git a/Products/CMFPlone/browser/sitemap.py b/Products/CMFPlone/browser/sitemap.py new file mode 100644 index 0000000..1ed90d6 --- /dev/null +++ b/Products/CMFPlone/browser/sitemap.py @@ -0,0 +1,24 @@ +from Acquisition import aq_inner +from zope.component import getMultiAdapter +from zope.interface import implements + +from Products.CMFCore.utils import getToolByName +from Products.Five import BrowserView + +from Products.CMFPlone.browser.interfaces import ISitemapView + + +class SitemapView(BrowserView): + implements(ISitemapView) + + def createSiteMap(self): + context = aq_inner(self.context) + view = getMultiAdapter((context, self.request), + name='sitemap_builder_view') + data = view.siteMap() + properties = getToolByName(context, 'portal_properties') + navtree_properties = getattr(properties, 'navtree_properties') + bottomLevel = navtree_properties.getProperty('bottomLevel', 0) + # XXX: The recursion should probably be done in python code + return context.portlet_navtree_macro(children=data.get('children',[]), + level=1, bottomLevel=bottomLevel) diff --git a/Products/CMFPlone/events.py b/Products/CMFPlone/events.py new file mode 100644 index 0000000..7857691 --- /dev/null +++ b/Products/CMFPlone/events.py @@ -0,0 +1,9 @@ +from zope.interface import implements +from zope.component.interfaces import ObjectEvent + +from interfaces import ISiteManagerCreatedEvent + +class SiteManagerCreatedEvent(ObjectEvent): + + implements(ISiteManagerCreatedEvent) + diff --git a/Products/CMFPlone/exportimport/__init__.py b/Products/CMFPlone/exportimport/__init__.py new file mode 100644 index 0000000..c9d620a --- /dev/null +++ b/Products/CMFPlone/exportimport/__init__.py @@ -0,0 +1 @@ +"""exportimport package""" diff --git a/Products/CMFPlone/exportimport/controlpanel.py b/Products/CMFPlone/exportimport/controlpanel.py index 4f329fa..0bf80be 100644 --- a/Products/CMFPlone/exportimport/controlpanel.py +++ b/Products/CMFPlone/exportimport/controlpanel.py @@ -12,7 +12,7 @@ ############################################################################## """ Plone control panel tool node adapters. -$Id$ +$Id: controlpanel.py 37814 2010-07-15 14:23:55Z hannosch $ """ from zope.i18nmessageid import Message diff --git a/Products/CMFPlone/exportimport/tests/__init__.py b/Products/CMFPlone/exportimport/tests/__init__.py new file mode 100644 index 0000000..983bbca --- /dev/null +++ b/Products/CMFPlone/exportimport/tests/__init__.py @@ -0,0 +1 @@ +"""exportimport tests package""" diff --git a/Products/CMFPlone/interfaces/breadcrumbs.py b/Products/CMFPlone/interfaces/breadcrumbs.py new file mode 100644 index 0000000..05cd2a9 --- /dev/null +++ b/Products/CMFPlone/interfaces/breadcrumbs.py @@ -0,0 +1,6 @@ +from zope.interface import Interface + +class IHideFromBreadcrumbs(Interface): + """Marker for content which should not appear in the breadcrumbs. + """ + diff --git a/Products/CMFPlone/interfaces/controlpanel.py b/Products/CMFPlone/interfaces/controlpanel.py new file mode 100644 index 0000000..5acf4f8 --- /dev/null +++ b/Products/CMFPlone/interfaces/controlpanel.py @@ -0,0 +1,34 @@ +from basetool import IPloneBaseTool + +class IControlPanel(IPloneBaseTool): + """ Interface for the ControlPanel """ + + def registerConfiglet( id + , name + , action + , condition='' + , permission='' + , category='Plone' + , visible=1 + , appId=None + , imageUrl=None + , description='' + , REQUEST=None + ): + """ Registration of a Configlet """ + + def unregisterConfiglet(id): + """ unregister Configlet """ + + def unregisterApplication(appId): + """ unregister Application with all configlets """ + + def getGroupIds(): + """ list of the group ids """ + + def getGroups(): + """ list of groups as dicts with id and title """ + + def enumConfiglets(group=None): + """ lists the Configlets of a group, returns them as dicts by + calling .getAction() on each of them """ diff --git a/Products/CMFPlone/interfaces/events.py b/Products/CMFPlone/interfaces/events.py new file mode 100644 index 0000000..a050002 --- /dev/null +++ b/Products/CMFPlone/interfaces/events.py @@ -0,0 +1,5 @@ +from zope.component.interfaces import IObjectEvent + +class ISiteManagerCreatedEvent(IObjectEvent): + """An event that's fired once the Plone portal is enabled as a site. + """ diff --git a/Products/CMFPlone/interfaces/factory.py b/Products/CMFPlone/interfaces/factory.py new file mode 100644 index 0000000..323be85 --- /dev/null +++ b/Products/CMFPlone/interfaces/factory.py @@ -0,0 +1,12 @@ +from zope.interface import Attribute, Interface + +class IFactoryTool(Interface): + """This tool manages the portal factory type registration. + """ + + id = Attribute('id', 'Must be set to "portal_factory"') + + def getFactoryTypes(): + """Return the list of factory types which use the portal factory. + """ + diff --git a/Products/CMFPlone/interfaces/installable.py b/Products/CMFPlone/interfaces/installable.py new file mode 100644 index 0000000..cc31735 --- /dev/null +++ b/Products/CMFPlone/interfaces/installable.py @@ -0,0 +1,11 @@ +from zope.interface import Interface + +class INonInstallable(Interface): + + def getNonInstallableProfiles(): + """Returns a list of profiles that should not be available for + installation at portal creation time. + + The usual use-case is to prevent extension profiles from showing up, + that will be installed as part of the site creation anyways. + """ diff --git a/Products/CMFPlone/interfaces/interface.py b/Products/CMFPlone/interfaces/interface.py new file mode 100644 index 0000000..d79217f --- /dev/null +++ b/Products/CMFPlone/interfaces/interface.py @@ -0,0 +1,19 @@ +from zope.interface import Attribute +from basetool import IPloneBaseTool + +class IInterfaceTool(IPloneBaseTool): + """ This tool exposes the interface package for TTW applications, + by accepting a dotted name of an interface and exporting the + IInterface API """ + + id = Attribute('id', 'Must be set to "portal_interface"') + + def objectImplements(obj, dotted_name): + """ Asserts if an object implements a given interface """ + + def classImplements(obj, dotted_name): + """ Asserts if an object's class implements a given interface """ + + def namesAndDescriptions(dotted_name, all=0): + """ Returns a list of pairs (name, description) for a given + interface""" diff --git a/Products/CMFPlone/interfaces/properties.py b/Products/CMFPlone/interfaces/properties.py new file mode 100644 index 0000000..a84cc1e --- /dev/null +++ b/Products/CMFPlone/interfaces/properties.py @@ -0,0 +1,32 @@ +""" CMFPlone tool interfaces. + +$Id: _tools.py 38762 2005-10-05 10:44:00Z yuppie $ +""" + +from zope.interface import Interface +from zope.interface import Attribute + +# +# Site Properties tool interface +# +class IPropertiesTool(Interface): + + """ Manage properties of the site as a whole. + """ + + id = Attribute('id', 'Must be set to "portal_properties"') + + def editProperties(props): + """ Change portal settings. + + Permission -- Manage portal + """ + + def smtp_server(): + """ Get local SMTP server. + + Returns -- String + """ + +class ISimpleItemWithProperties(Interface): + pass diff --git a/Products/CMFPlone/interfaces/workflow.py b/Products/CMFPlone/interfaces/workflow.py new file mode 100644 index 0000000..2f0332c --- /dev/null +++ b/Products/CMFPlone/interfaces/workflow.py @@ -0,0 +1,5 @@ +from zope.interface.common.sequence import IReadSequence + +class IWorkflowChain( IReadSequence ): + """ an interface denoting the cmf workflow name sequence + """ diff --git a/Products/CMFPlone/log.py b/Products/CMFPlone/log.py new file mode 100644 index 0000000..6913ea4 --- /dev/null +++ b/Products/CMFPlone/log.py @@ -0,0 +1,21 @@ +""" +This module resolves an import order dependency. +Don't import from here, import from utils. +""" + +import logging + +logger = logging.getLogger('Plone') + +# generic log method +def log(message, summary='', severity=logging.INFO): + logger.log(severity, '%s \n%s', summary, message) + +# log message + exception info +def log_exc(message='', summary='', severity=logging.ERROR): + logger.log(severity, '%s \n%s', summary, message, exc_info=True) + +# deprecration warning +def log_deprecated(message, summary='Deprecation Warning', + severity=logging.WARNING): + logger.log(severity, '%s \n%s', summary, message) diff --git a/Products/CMFPlone/profiles/default/kssregistry.xml b/Products/CMFPlone/profiles/default/kssregistry.xml new file mode 100644 index 0000000..1781f48 --- /dev/null +++ b/Products/CMFPlone/profiles/default/kssregistry.xml @@ -0,0 +1,13 @@ +<?xml version="1.0"?> +<object name="portal_kss" meta_type="KSS Registry"> + <kineticstylesheet cacheable="True" compression="safe" cookable="True" + enabled="1" expression="" id="at.kss"/> + <kineticstylesheet cacheable="True" compression="safe" cookable="True" + enabled="1" expression="" id="plone.kss"/> + <kineticstylesheet cacheable="True" compression="safe" cookable="True" + enabled="0" expression="" id="at_experimental.kss"/> + <kineticstylesheet cacheable="True" compression="safe" cookable="True" + enabled="0" expression="" id="plone_experimental.kss"/> + <kineticstylesheet cacheable="True" compression="safe" cookable="True" + enabled="1" expression="" id="++resource++plone.app.form.kss"/> +</object> diff --git a/Products/CMFPlone/profiles/default/plone-final.txt b/Products/CMFPlone/profiles/default/plone-final.txt new file mode 100644 index 0000000..f7dc48b --- /dev/null +++ b/Products/CMFPlone/profiles/default/plone-final.txt @@ -0,0 +1 @@ +The plone-final step is run if this file is present in the profile diff --git a/Products/CMFPlone/profiles/testfixture/metadata.xml b/Products/CMFPlone/profiles/testfixture/metadata.xml new file mode 100644 index 0000000..5458ffd --- /dev/null +++ b/Products/CMFPlone/profiles/testfixture/metadata.xml @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<metadata> + <version>3.1</version> +</metadata> diff --git a/Products/CMFPlone/skins/cmf_legacy/TitleOrId.py b/Products/CMFPlone/skins/cmf_legacy/TitleOrId.py new file mode 100644 index 0000000..933d392 --- /dev/null +++ b/Products/CMFPlone/skins/cmf_legacy/TitleOrId.py @@ -0,0 +1,13 @@ +## Script (Python) "TitleOrId" +##parameters=dontCall=0 +##title=Return Title or getId +if dontCall: + title = context.Title + id = context.id +else: + title = context.Title() + id = context.getId() +if title: + return title +else: + return id diff --git a/Products/CMFPlone/skins/plone_3rdParty/jscalendar/calendar-setup.js b/Products/CMFPlone/skins/plone_3rdParty/jscalendar/calendar-setup.js index c269f7d..b188d33 100644 --- a/Products/CMFPlone/skins/plone_3rdParty/jscalendar/calendar-setup.js +++ b/Products/CMFPlone/skins/plone_3rdParty/jscalendar/calendar-setup.js @@ -19,7 +19,7 @@ * than modifying calendar.js itself). */ -// $Id$ +// $Id: calendar-setup.js 7013 2005-05-26 22:00:04Z hannosch $ /** * This function "patches" an input field (or other element) to use a calendar diff --git a/Products/CMFPlone/skins/plone_3rdParty/jscalendar/calendar.js b/Products/CMFPlone/skins/plone_3rdParty/jscalendar/calendar.js index 386c209..870d133 100644 --- a/Products/CMFPlone/skins/plone_3rdParty/jscalendar/calendar.js +++ b/Products/CMFPlone/skins/plone_3rdParty/jscalendar/calendar.js @@ -12,7 +12,7 @@ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html */ -// $Id$ +// $Id: calendar.js 7013 2005-05-26 22:00:04Z hannosch $ /** The Calendar object constructor. */ Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { diff --git a/Products/CMFPlone/skins/plone_3rdParty/jscalendar/index.html b/Products/CMFPlone/skins/plone_3rdParty/jscalendar/index.html index 56c1f06..2a081fe 100644 --- a/Products/CMFPlone/skins/plone_3rdParty/jscalendar/index.html +++ b/Products/CMFPlone/skins/plone_3rdParty/jscalendar/index.html @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> -<!-- $Id$ --> +<!-- $Id: index.html 7013 2005-05-26 22:00:04Z hannosch $ --> <head> <meta http-equiv="content-type" content="text/xml; charset=utf-8" /> diff --git a/Products/CMFPlone/skins/plone_3rdParty/jscalendar/reference.html b/Products/CMFPlone/skins/plone_3rdParty/jscalendar/reference.html index 965c266..a97372f 100644 --- a/Products/CMFPlone/skins/plone_3rdParty/jscalendar/reference.html +++ b/Products/CMFPlone/skins/plone_3rdParty/jscalendar/reference.html @@ -55,7 +55,7 @@ <h1 class=title align=center><br><br>DHTML Calendar Widget</h1> </div> <p></p> <p> -<span class=small><code class=verbatim>$Id$</code></span> +<span class=small><code class=verbatim>$Id: reference.html 7013 2005-05-26 22:00:04Z hannosch $</code></span> </p> <span class=small><blockquote> <div align=right><table><tr><td> diff --git a/Products/CMFPlone/skins/plone_content/author.cpt.metadata b/Products/CMFPlone/skins/plone_content/author.cpt.metadata new file mode 100644 index 0000000..3ca345f --- /dev/null +++ b/Products/CMFPlone/skins/plone_content/author.cpt.metadata @@ -0,0 +1,12 @@ +[default] +title=Author information + +[security] +View=0:Anonymous + +[validators] +validators=validate_feedback + +[actions] +action.success=traverse_to:string:send_feedback +action.failure=traverse_to:string:author diff --git a/Products/CMFPlone/skins/plone_content/document_view.pt.metadata b/Products/CMFPlone/skins/plone_content/document_view.pt.metadata new file mode 100644 index 0000000..aeba6f7 --- /dev/null +++ b/Products/CMFPlone/skins/plone_content/document_view.pt.metadata @@ -0,0 +1,2 @@ +[default] +title=View Document diff --git a/Products/CMFPlone/skins/plone_content/event_view.pt.metadata b/Products/CMFPlone/skins/plone_content/event_view.pt.metadata new file mode 100644 index 0000000..b0020b4 --- /dev/null +++ b/Products/CMFPlone/skins/plone_content/event_view.pt.metadata @@ -0,0 +1,2 @@ +[default] +title=View Event diff --git a/Products/CMFPlone/skins/plone_content/file_view.pt.metadata b/Products/CMFPlone/skins/plone_content/file_view.pt.metadata new file mode 100644 index 0000000..71c35da --- /dev/null +++ b/Products/CMFPlone/skins/plone_content/file_view.pt.metadata @@ -0,0 +1,2 @@ +[default] +title=View File diff --git a/Products/CMFPlone/skins/plone_content/folder_listing.pt.metadata b/Products/CMFPlone/skins/plone_content/folder_listing.pt.metadata new file mode 100644 index 0000000..eb8758d --- /dev/null +++ b/Products/CMFPlone/skins/plone_content/folder_listing.pt.metadata @@ -0,0 +1,2 @@ +[default] +title=Standard view diff --git a/Products/CMFPlone/skins/plone_content/folder_summary_view.pt.metadata b/Products/CMFPlone/skins/plone_content/folder_summary_view.pt.metadata new file mode 100644 index 0000000..86878d6 --- /dev/null +++ b/Products/CMFPlone/skins/plone_content/folder_summary_view.pt.metadata @@ -0,0 +1,2 @@ +[default] +title=Summary view diff --git a/Products/CMFPlone/skins/plone_content/folder_tabular_view.pt.metadata b/Products/CMFPlone/skins/plone_content/folder_tabular_view.pt.metadata new file mode 100644 index 0000000..83c8670 --- /dev/null +++ b/Products/CMFPlone/skins/plone_content/folder_tabular_view.pt.metadata @@ -0,0 +1,2 @@ +[default] +title=Tabular view diff --git a/Products/CMFPlone/skins/plone_content/image_view.pt.metadata b/Products/CMFPlone/skins/plone_content/image_view.pt.metadata new file mode 100644 index 0000000..b050dcd --- /dev/null +++ b/Products/CMFPlone/skins/plone_content/image_view.pt.metadata @@ -0,0 +1,2 @@ +[default] +title=View Image diff --git a/Products/CMFPlone/skins/plone_content/link_view.pt.metadata b/Products/CMFPlone/skins/plone_content/link_view.pt.metadata new file mode 100644 index 0000000..140cd4e --- /dev/null +++ b/Products/CMFPlone/skins/plone_content/link_view.pt.metadata @@ -0,0 +1,2 @@ +[default] +title=View Link diff --git a/Products/CMFPlone/skins/plone_content/newsitem_view.pt.metadata b/Products/CMFPlone/skins/plone_content/newsitem_view.pt.metadata new file mode 100644 index 0000000..96794f0 --- /dev/null +++ b/Products/CMFPlone/skins/plone_content/newsitem_view.pt.metadata @@ -0,0 +1,2 @@ +[default] +title=View News Item diff --git a/Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js b/Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js new file mode 100644 index 0000000..0f0e18d --- /dev/null +++ b/Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js @@ -0,0 +1,25 @@ +function createCookie(name,value,days) { + if (days) { + var date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + var expires = "; expires="+date.toGMTString(); + } else { + expires = ""; + } + document.cookie = name+"="+escape(value)+expires+"; path=/;"; +}; + +function readCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') { + c = c.substring(1,c.length); + } + if (c.indexOf(nameEQ) == 0) { + return unescape(c.substring(nameEQ.length,c.length)); + } + } + return null; +}; diff --git a/Products/CMFPlone/skins/plone_ecmascript/unittestUtilities.js b/Products/CMFPlone/skins/plone_ecmascript/unittestUtilities.js new file mode 100644 index 0000000..0a3bd76 --- /dev/null +++ b/Products/CMFPlone/skins/plone_ecmascript/unittestUtilities.js @@ -0,0 +1,240 @@ + +function TestCaseRegistry() { + this._testcases = new Object(); + + this.registerTestCase = function(testcase, suite_name) { + if (!testcase) { + throw('TestCaseRegistry.registerTestCase() requires a testcase as argument'); + } + testcase = new testcase(); + if (!suite_name) { + suite_name = 'default'; + } + if (!this._testcases[suite_name]) { + this._testcases[suite_name] = new Array(); + } + this._testcases[suite_name].push(testcase); + } + + this.setTestSuiteFilter = function(filter) { + if (filter) { + this.suite_filter = new RegExp(filter, "i"); + } else { + this.suite_filter = null; + } + } + + this.setTestFilter = function(filter) { + if (filter) { + this.test_filter = new RegExp(filter, "i"); + } else { + this.test_filter = null; + } + } + + this.getFilteredTestCases = function() { + var testcases = new Array(); + + var suites = this.getFilteredTestSuitNames(); + for (var suite_index=0; suite_index < suites.length; suite_index++) { + var suite = this._testcases[suites[suite_index]]; + for (var test_index=0; test_index < suite.length; test_index++) { + var testcase = suite[test_index]; + if (this.test_filter) { + if (!this.test_filter.test(testcase.name)) { + continue; + } + } + testcases.push(testcase); + } + } + + return testcases; + } + + this.getFilteredTestSuitNames = function() { + var names = new Array(); + + for (var suite_name in this._testcases) { + if (this.suite_filter) { + if (!this.suite_filter.test(suite_name)) { + continue; + } + } + names.push(suite_name); + } + + return names; + } + + this.getFilteredTestNames = function() { + var names = new Array(); + + var testcases = this.getFilteredTestCases(); + for (var testcase_index in testcases) { + names.push(testcases[testcase_index].name); + } + + return names; + } +} +testcase_registry = new TestCaseRegistry(); + +function runTestCase(testCase) { + // append TOC entry + var name = testCase.name; + var toc = document.getElementById("testResultsToc"); + var results_box = document.getElementById("testResultsPlaceHolder"); + + // create toc element + var toc_item = document.createElement("li"); + toc_item.appendChild(createLink("test_ecmascripts#"+name, name+" Results", false)); + toc.appendChild(toc_item); + + // append testcase section + var placeHolder = document.createElement("div"); + placeHolder.className = "placeholder"; + var link = createLink(name, name+" Results", true); + var header = document.createElement("h3"); + header.appendChild(link); + placeHolder.appendChild(header); + results_box.appendChild(placeHolder); + testCase.initialize(new HTMLReporter(placeHolder)); + try { + testCase.runTests(); + } catch(e) { + var raw = e; + if (e.name && e.message) { // Microsoft + e = e.name + ': ' + e.message; + } + placeHolder.appendChild(document.createTextNode(e)); + } +}; + +function runTestCases() { + var suite_filter = document.getElementById('suite-filter').value; + var test_filter = document.getElementById('test-filter').value; + testcase_registry.setTestSuiteFilter(suite_filter); + testcase_registry.setTestFilter(test_filter); + var testcases = testcase_registry.getFilteredTestCases(); + + var iframe = window.document.getElementById('iframe'); + if (typeof(iframe) != 'undefined') { + iframe.style.display = 'block'; + // IE seems to re-initialize the iframe on designMode change, + // destroying the blank document. But only Mozilla needs that mode. + if (_SARISSA_IS_MOZ) { + try { + if (typeof(iframe.contentWindow.document.designMode) != 'undefined') + iframe.contentWindow.document.designMode = 'on'; + } catch(e) { + } + }; + } + + for (var testcase_index=0; testcase_index < testcases.length; testcase_index++) { + runTestCase(testcases[testcase_index]); + } + + if (iframe) { + if (_SARISSA_IS_MOZ) { + try { + if (typeof(iframe.contentWindow.document.designMode) != 'undefined') + iframe.contentWindow.document.designMode = 'off'; + } catch(e) { + } + }; + iframe.style.display = 'none'; + } +} + +function clearOutput() { + clearChildNodes(document.getElementById("testResultsToc")); + clearChildNodes(document.getElementById("testResultsPlaceHolder")); + clearChildNodes(document.getElementById("testSandbox")); +} + +function showFilteredTests() { + var suite_filter = document.getElementById('suite-filter').value; + var test_filter = document.getElementById('test-filter').value; + testcase_registry.setTestSuiteFilter(suite_filter); + testcase_registry.setTestFilter(test_filter); + putTextInPlaceHolder(testcase_registry.getFilteredTestSuitNames().join(', ') + + testcase_registry.getFilteredTestNames().join(', ')); +} + +function showMarkup() { + var text = document.getElementById('testResultsPlaceHolder').innerHTML + var msg = this.document.createTextNode(text); + var sandbox = document.getElementById("testSandbox"); + clearChildNodes(sandbox); + sandbox.appendChild(msg); +} + +function putTextInPlaceHolder(text) { + var msg = this.document.createTextNode(text); + var placeholder = document.getElementById("testResultsPlaceHolder"); + clearChildNodes(placeholder); + placeholder.appendChild(msg); +} + +clearChildNodes = function(oNode) { + while(oNode.hasChildNodes()) { + oNode.removeChild(oNode.firstChild); + } +} + +function createLink(link, desc, bName) { + var a = document.createElement("a"); + + a.setAttribute((bName?"name":"href"), link); + if(desc) + a.appendChild(document.createTextNode(desc)); + return a; +} + + +// from the kupu test runner +var skipped_tests = []; +// Mark a specific test as failing under Opera. When Opera is +// fixed (or the test rewritten to cope with it) the flagged test +// will then fail. +function opera_is_broken(self, fname) { + var fn = self[fname]; + if (navigator.userAgent.toLowerCase().indexOf("opera") == -1) { + return; // Browser is not opera. + } + //self.debug('Invert test '+fname+'for broken browser'); + function test() { + try { + fn.call(self); + } catch(e) { + // The function threw an exception, which is what we + // expect. + return + }; + self.assert(false, 'expected test '+fname+' to fail, but it passed!'); + }; + self[fname] = test; + skipped_tests.push(fname); +} +// To demonstrate fairness, mark a specific test as failing under IE. +function ie_is_broken(self, fname) { + var fn = self[fname]; + if (!_SARISSA_IS_IE) { + return; // Browser is not opera. + } + //self.debug('Invert test '+fname+'for broken browser'); + function test() { + try { + fn.call(self); + } catch(e) { + // The function threw an exception, which is what we + // expect. + return + }; + self.assert(false, 'expected test '+fname+' to fail, but it passed!'); + }; + self[fname] = test; + skipped_tests.push(fname); +} diff --git a/Products/CMFPlone/skins/plone_form_scripts/change_ownership.cpy b/Products/CMFPlone/skins/plone_form_scripts/change_ownership.cpy new file mode 100644 index 0000000..a7354e9 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/change_ownership.cpy @@ -0,0 +1,24 @@ +## Script (Python) "change_ownership" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters=userid, subobjects=0 +##title=Change ownership +## +from Products.CMFPlone.utils import transaction_note +from Products.CMFPlone import PloneMessageFactory as _ + +if subobjects: + subobjects=1 + +context.plone_utils.changeOwnershipOf(context, userid, subobjects, + REQUEST=context.REQUEST) + +transaction_note('Changed owner of %s at %s to %s' % + (context.title_or_id(), context.absolute_url(), userid)) + +context.plone_utils.addPortalMessage(_(u'Ownership has been changed.')) +return state.set(context = context) diff --git a/Products/CMFPlone/skins/plone_form_scripts/change_ownership.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/change_ownership.cpy.metadata new file mode 100644 index 0000000..a6cb683 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/change_ownership.cpy.metadata @@ -0,0 +1,6 @@ +[validators] +validators= + +[actions] +action.failure=redirect_to_action:string:ownership_form +action.success=redirect_to_action:string:view diff --git a/Products/CMFPlone/skins/plone_form_scripts/content_status_modify.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/content_status_modify.cpy.metadata new file mode 100644 index 0000000..98b6a5f --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/content_status_modify.cpy.metadata @@ -0,0 +1,6 @@ +[validators] +validators = validate_content_status_modify + +[actions] +action.failure=traverse_to:string:content_status_history +action.success=redirect_to_action:string:view diff --git a/Products/CMFPlone/skins/plone_form_scripts/delete_confirmation.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/delete_confirmation.cpy.metadata new file mode 100644 index 0000000..95bd286 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/delete_confirmation.cpy.metadata @@ -0,0 +1,3 @@ +[actions] +action.success=redirect_to:python:object.aq_inner.aq_parent.absolute_url() +action.confirm=traverse_to:string:delete_confirmation_page diff --git a/Products/CMFPlone/skins/plone_form_scripts/disableSyndication.cpy b/Products/CMFPlone/skins/plone_form_scripts/disableSyndication.cpy new file mode 100644 index 0000000..e5170a4 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/disableSyndication.cpy @@ -0,0 +1,25 @@ +## Controller Python Script "disableSyndication" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##title=Disable Syndication for a resource +##parameters= + +from Products.CMFPlone import PloneMessageFactory as _ +from Products.CMFPlone.utils import safe_unicode + +if context.portal_syndication.isSyndicationAllowed(context): + context.portal_syndication.disableSyndication(context) + message=_(u'Syndication disabled') +else: + message=_(u'Syndication not allowed') + +from Products.CMFPlone.utils import transaction_note +transaction_note('%s for %s at %s' % (message, safe_unicode(context.title_or_id()), context.absolute_url())) + +context.plone_utils.addPortalMessage(message) +return state + diff --git a/Products/CMFPlone/skins/plone_form_scripts/disableSyndication.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/disableSyndication.cpy.metadata new file mode 100644 index 0000000..88a1e84 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/disableSyndication.cpy.metadata @@ -0,0 +1,7 @@ +[validators] +validators = + +[actions] +action.success = traverse_to:string:synPropertiesForm +action.failure = traverse_to:string:synPropertiesForm + diff --git a/Products/CMFPlone/skins/plone_form_scripts/discussion_reply.cpy b/Products/CMFPlone/skins/plone_form_scripts/discussion_reply.cpy new file mode 100644 index 0000000..946ce93 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/discussion_reply.cpy @@ -0,0 +1,68 @@ +## Script (Python) "discussion_reply" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters=subject,body_text,text_format='plain',username=None,password=None +##title=Reply to content + +from Products.PythonScripts.standard import url_quote_plus +from Products.CMFCore.utils import getToolByName +from Products.CMFPlone import PloneMessageFactory as _ +mtool = getToolByName(context, 'portal_membership') +dtool = getToolByName(context, 'portal_discussion') +req = context.REQUEST + +if username or password: + # The user username/password inputs on on the comment form were used, + # which might happen when anonymous commenting is enabled. If they typed + # something in to either of the inputs, we send them to 'logged_in'. + # 'logged_in' will redirect them back to this script if authentication + # succeeds with a query string which will post the message appropriately + # and show them the result. if 'logged_in' fails, the user will be + # presented with the stock login failure page. This all depends + # heavily on cookiecrumbler, but I believe that is a Plone requirement. + came_from = '%s?subject=%s&body_text=%s' % (req['URL'], subject, body_text) + came_from = url_quote_plus(came_from) + portal_url = context.portal_url() + + return req.RESPONSE.redirect( + '%s/logged_in?__ac_name=%s' + '&__ac_password=%s' + '&came_from=%s' % (portal_url, + url_quote_plus(username), + url_quote_plus(password), + came_from, + ) + ) + +# if (the user is already logged in) or (if anonymous commenting is enabled and +# they posted without typing a username or password into the form), we do +# the following + +creator = mtool.getAuthenticatedMember().getId() +tb = dtool.getDiscussionFor(context) +id = tb.createReply(title=subject, text=body_text, Creator=creator) +reply = tb.getReply(id) + +# TODO THIS NEEDS TO GO AWAY! +if hasattr(dtool.aq_explicit, 'cookReply'): + dtool.cookReply(reply, text_format='plain') + +parent = tb.aq_parent + +# return to the discussable object. +redirect_target = context.plone_utils.getDiscussionThread(tb)[0] +view = redirect_target.getTypeInfo().getActionInfo('object/view', + redirect_target)['url'] +anchor = reply.getId() + +from Products.CMFPlone.utils import transaction_note +transaction_note('Added comment to %s at %s' % (parent.title_or_id(), + reply.absolute_url())) + +context.plone_utils.addPortalMessage(_(u'Comment added.')) +target = '%s#%s' % (view, anchor) +return req.RESPONSE.redirect(target) diff --git a/Products/CMFPlone/skins/plone_form_scripts/document_edit.cpy b/Products/CMFPlone/skins/plone_form_scripts/document_edit.cpy new file mode 100644 index 0000000..1c48176 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/document_edit.cpy @@ -0,0 +1,43 @@ +## Controller Python Script "document_edit" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters=text_format, text, file='', SafetyBelt='', title='', description='', id='' +##title=Edit a document + +from Products.CMFPlone import PloneMessageFactory as _ + +filename=getattr(file,'filename', '') +if file and filename: +# # if there is no id or an autogenerated id, use the filename as the id +# if not id or context.isIDAutoGenerated(id): + # if there is no id, use the filename as the id + if not id: + id = filename[max( string.rfind(filename, '/') + , string.rfind(filename, '\\') + , string.rfind(filename, ':') )+1:] + file.seek(0) + +# if there is no id specified, keep the current one +if not id: + id = context.getId() +new_context = context.portal_factory.doCreate(context, id) + +new_context.edit( text_format + , text + , file + , safety_belt=SafetyBelt ) + +from Products.CMFPlone.utils import transaction_note +transaction_note('Edited document %s at %s' % (new_context.title_or_id(), new_context.absolute_url())) + +new_context.plone_utils.contentEdit( new_context + , id=id + , title=title + , description=description ) + +context.plone_utils.addPortalMessage(_(u'Document changes saved.')) +return state.set(context=new_context) diff --git a/Products/CMFPlone/skins/plone_form_scripts/document_edit.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/document_edit.cpy.metadata new file mode 100644 index 0000000..12ad09c --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/document_edit.cpy.metadata @@ -0,0 +1,6 @@ +[validators] +validators=validate_id,validate_title,validate_document_edit + +[actions] +action.failure=redirect_to_action:string:edit +action.success=redirect_to_action:string:view diff --git a/Products/CMFPlone/skins/plone_form_scripts/editSynProperties.cpy b/Products/CMFPlone/skins/plone_form_scripts/editSynProperties.cpy new file mode 100644 index 0000000..33212d3 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/editSynProperties.cpy @@ -0,0 +1,26 @@ +## Controller Python Script "editSynProperties" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters= +##title=Edit Syndication Properties +## + +from Products.CMFPlone import PloneMessageFactory as _ + +REQUEST=context.REQUEST +pSyn = context.portal_syndication +pSyn.editSyInformationProperties(context, + REQUEST['updatePeriod'], + REQUEST['updateFrequency'], + REQUEST['updateBase'], + REQUEST['max_items'], + REQUEST) +from Products.CMFPlone.utils import transaction_note +transaction_note('Updated syndication properties for %s at %s' % (context.title_or_id(), context.absolute_url())) + +context.plone_utils.addPortalMessage(_(u'Syndication properties updated.')) +return state diff --git a/Products/CMFPlone/skins/plone_form_scripts/editSynProperties.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/editSynProperties.cpy.metadata new file mode 100644 index 0000000..0e5d536 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/editSynProperties.cpy.metadata @@ -0,0 +1,6 @@ +[validators] +validators= validate_synPropertiesForm + +[actions] +action.failure=traverse_to:string:synPropertiesForm +action.success=redirect_to:string:folder_contents diff --git a/Products/CMFPlone/skins/plone_form_scripts/enableSyndication.cpy b/Products/CMFPlone/skins/plone_form_scripts/enableSyndication.cpy new file mode 100644 index 0000000..d11c7ab --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/enableSyndication.cpy @@ -0,0 +1,24 @@ +## Controller Python Script "enableSyndication" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##title=Enable Syndication for a resource +##parameters= + +from Products.CMFPlone import PloneMessageFactory as _ +from Products.CMFPlone.utils import safe_unicode + +if context.portal_syndication.isSiteSyndicationAllowed(): + context.portal_syndication.enableSyndication(context) + message=_(u'Syndication enabled') +else: + message=_(u'Syndication not allowed') + +from Products.CMFPlone.utils import transaction_note +transaction_note('%s for %s at %s' % (message, safe_unicode(context.title_or_id()), context.absolute_url())) + +context.plone_utils.addPortalMessage(message) +return state diff --git a/Products/CMFPlone/skins/plone_form_scripts/enableSyndication.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/enableSyndication.cpy.metadata new file mode 100644 index 0000000..5615e18 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/enableSyndication.cpy.metadata @@ -0,0 +1,6 @@ +[validators] +validators = + +[actions] +action.success = traverse_to:string:synPropertiesForm +action.failure = traverse_to:string:synPropertiesForm diff --git a/Products/CMFPlone/skins/plone_form_scripts/event_edit.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/event_edit.cpy.metadata new file mode 100644 index 0000000..ef25d19 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/event_edit.cpy.metadata @@ -0,0 +1,6 @@ +[validators] +validators=validate_id,validate_title,validate_start_end_date + +[actions] +action.failure=redirect_to_action:string:edit +action.success=redirect_to_action:string:view diff --git a/Products/CMFPlone/skins/plone_form_scripts/file_edit.cpy b/Products/CMFPlone/skins/plone_form_scripts/file_edit.cpy new file mode 100644 index 0000000..a7455fe --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/file_edit.cpy @@ -0,0 +1,50 @@ +## Controller Python Script "file_edit" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters=precondition='', file='', id='', title=None, description=None, file_data='' +##title=Edit a file +## + +from StringIO import StringIO +from Products.CMFPlone import PloneMessageFactory as _ + +isIDAutoGenerated = context.plone_utils.isIDAutoGenerated +original_id=context.getId() +filename=getattr(file,'filename', '') + +if file and filename and isIDAutoGenerated(original_id): +# if there is no id or an autogenerated id, use the filename as the id +# if not id or context.isIDAutoGenerated(id): +# if there is no id, use the filename as the id + if not id: + id = filename[max( string.rfind(filename, '/') + , string.rfind(filename, '\\') + , string.rfind(filename, ':') )+1:] +if file and hasattr(file, 'seek'): + file.seek(0) + +# if there is no id specified, keep the current one +if not id: + id = context.getId() + +new_context = context.portal_factory.doCreate(context, id) + +new_context.plone_utils.contentEdit(new_context, + id=id, + title=title, + description=description) + +if file or file_data or precondition: + if not file and file_data: + file = StringIO(file_data) + new_context.edit(precondition=precondition, file=file) + +from Products.CMFPlone.utils import transaction_note +transaction_note('Edited file %s at %s' % (new_context.title_or_id(), new_context.absolute_url())) + +context.plone_utils.addPortalMessage(_(u'Changes made.')) +return state.set(context=new_context) diff --git a/Products/CMFPlone/skins/plone_form_scripts/file_edit.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/file_edit.cpy.metadata new file mode 100644 index 0000000..558bfc1 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/file_edit.cpy.metadata @@ -0,0 +1,6 @@ +[validators] +validators=validate_id,validate_file_edit + +[actions] +action.failure=redirect_to_action:string:edit +action.success=redirect_to_action:string:view diff --git a/Products/CMFPlone/skins/plone_form_scripts/image_edit.cpy b/Products/CMFPlone/skins/plone_form_scripts/image_edit.cpy new file mode 100644 index 0000000..7d45ccc --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/image_edit.cpy @@ -0,0 +1,47 @@ +## Controller Python Script "image_edit" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters=precondition='', file='', id='', title=None, description=None +##title=Edit an image +## + +from Products.CMFPlone.utils import transaction_note +from Products.CMFPlone import PloneMessageFactory as _ + +isIDAutoGenerated = context.plone_utils.isIDAutoGenerated +original_id=context.getId() +filename=getattr(file,'filename', '') + +if file and filename and isIDAutoGenerated(original_id): +# if there is no id or an autogenerated id, use the filename as the id +# if not id or context.isIDAutoGenerated(id): +# if there is no id, use the filename as the id + if not id: + id = filename[max( string.rfind(filename, '/') + , string.rfind(filename, '\\') + , string.rfind(filename, ':') )+1:] +if file and hasattr(file, 'seek'): + file.seek(0) + +# if there is no id specified, keep the current one +if not id: + id = context.getId() + +new_context = context.portal_factory.doCreate(context, id) + +new_context.plone_utils.contentEdit(new_context, + id=id, + title=title, + description=description) + +if file or precondition: + new_context.edit(precondition=precondition, file=file) + +transaction_note('Edited image %s at %s' % (new_context.title_or_id(), new_context.absolute_url())) + +context.plone_utils.addPortalMessage(_(u'Image changes saved.')) +return state.set(context=new_context) diff --git a/Products/CMFPlone/skins/plone_form_scripts/image_edit.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/image_edit.cpy.metadata new file mode 100644 index 0000000..a854f08 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/image_edit.cpy.metadata @@ -0,0 +1,6 @@ +[validators] +validators=validate_id,validate_image_edit + +[actions] +action.failure=redirect_to_action:string:edit +action.success=redirect_to_action:string:view diff --git a/Products/CMFPlone/skins/plone_form_scripts/link_edit.cpy b/Products/CMFPlone/skins/plone_form_scripts/link_edit.cpy new file mode 100644 index 0000000..4058374 --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/link_edit.cpy @@ -0,0 +1,29 @@ +## Controller Python Script "link_edit" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters=remote_url, id='', title=None, description=None, subject=None +##title=Edit a link +## + +from Products.CMFPlone.utils import transaction_note +from Products.CMFPlone import PloneMessageFactory as _ + +# if there is no id specified, keep the current one +if not id: + id = context.getId() + +new_context = context.portal_factory.doCreate(context, id) +new_context.edit(remote_url=remote_url) +new_context.plone_utils.contentEdit(new_context, + id=id, + title=title, + description=description) + +transaction_note('Edited link %s at %s' % (new_context.title_or_id(), new_context.absolute_url())) + +context.plone_utils.addPortalMessage(_(u'Link changes saved.')) +return state.set(context=new_context) diff --git a/Products/CMFPlone/skins/plone_form_scripts/link_edit.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/link_edit.cpy.metadata new file mode 100644 index 0000000..6087ade --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/link_edit.cpy.metadata @@ -0,0 +1,6 @@ +[validators] +validators=validate_id,validate_title,validate_link_edit + +[actions] +action.failure=redirect_to_action:string:edit +action.success=redirect_to_action:string:view diff --git a/Products/CMFPlone/skins/plone_form_scripts/newsitem_edit.cpy b/Products/CMFPlone/skins/plone_form_scripts/newsitem_edit.cpy new file mode 100644 index 0000000..91e239e --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/newsitem_edit.cpy @@ -0,0 +1,29 @@ +## Controller Python Script "newsitem_edit" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters=text, text_format, title='', description='', subject=None, id='' +##title=Edit a news item +## + +from Products.CMFPlone import PloneMessageFactory as _ + +# if there is no id specified, keep the current one +if not id: + id = context.getId() + +new_context = context.portal_factory.doCreate(context,id) +new_context.edit( text, description, text_format ) +new_context.plone_utils.contentEdit( new_context + , id=id + , title=title + , description=description) + +from Products.CMFPlone.utils import transaction_note +transaction_note('Edited news item %s at %s' % (new_context.title_or_id(), new_context.absolute_url())) + +context.plone_utils.addPortalMessage(_(u'News item changes saved.')) +return state.set(context=new_context) diff --git a/Products/CMFPlone/skins/plone_form_scripts/newsitem_edit.cpy.metadata b/Products/CMFPlone/skins/plone_form_scripts/newsitem_edit.cpy.metadata new file mode 100644 index 0000000..71881fc --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/newsitem_edit.cpy.metadata @@ -0,0 +1,6 @@ +[validators] +validators=validate_id,validate_title,validate_newsitem_edit + +[actions] +action.failure=redirect_to_action:string:edit +action.success=redirect_to_action:string:view diff --git a/Products/CMFPlone/skins/plone_form_scripts/portrait_delete.cpy b/Products/CMFPlone/skins/plone_form_scripts/portrait_delete.cpy new file mode 100644 index 0000000..90ea17d --- /dev/null +++ b/Products/CMFPlone/skins/plone_form_scripts/portrait_delete.cpy @@ -0,0 +1,22 @@ +## Controller Python Script "personalize" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind state=state +##bind subpath=traverse_subpath +##parameters= +##title=Personalization Handler. + +from Products.CMFPlone.utils import transaction_note +from Products.CMFPlone import PloneMessageFactory as _ + +member=context.portal_membership.getAuthent... [truncated message content] |