Index: /Products.qPloneDropDownMenu/tags/3.0/Products/__init__.py
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/__init__.py	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/__init__.py	(revision 2676)
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/DropDownMenuTool.py
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/DropDownMenuTool.py	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/DropDownMenuTool.py	(revision 2676)
@@ -0,0 +1,24 @@
+from App.class_init import InitializeClass
+from OFS.SimpleItem import SimpleItem
+from AccessControl import ClassSecurityInfo
+
+from Products.CMFCore.utils import UniqueObject, getToolByName
+
+from utils import updateMenu
+from config import MANAGE_PERMISSION, PROJECT_NAME, UNIQUE_ID
+
+
+class DropDownMenuTool(UniqueObject, SimpleItem):
+
+    meta_type = 'DropDownMenu Tool'
+    id = UNIQUE_ID
+    title="DropDown Menu Tool"
+
+    security = ClassSecurityInfo()
+
+    security.declareProtected(MANAGE_PERMISSION, 'regenerateMenu')
+    def regenerateMenu(self):
+        portal = getToolByName(self, 'portal_url').getPortalObject()
+        updateMenu(portal)
+
+InitializeClass(DropDownMenuTool)
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/HISTORY.txt
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/HISTORY.txt	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/HISTORY.txt	(revision 2676)
@@ -0,0 +1,83 @@
+0.3.0
+
+  * eggified product, made compatible
+    with plone4 (no backward compatibility). Thanks to Thomas Desvenain.
+
+0.2.1
+
+  * fix string encoding issues during product installation and menu regeneration
+    for details: http://talk.quintagroup.com/forums/plone-drop-down-menu/237707814
+
+0.2
+
+  * fixed documentation
+
+  * some minor fixes to portal status messages and validation stuff
+
+  * compatible with plone 3
+
+0.1.12
+
+  * added caching for static objects via .metadata
+
+0.1.11
+
+  * divided :hover javascript functionality into two parts: evaluating css by script, saving styles from configlet 
+
+0.1.10
+
+  * fixed kupu related bug (during editing with kupu in zoomed mode)
+
+0.1.9
+
+  * edited for correct work with IE before 6.0
+
+0.1.8 
+
+  * optimized page load time for IE
+
+0.1.7
+
+  * corrected and optimized csshover.htc script
+   
+0.1.6
+
+  * added to readme.txt explanation to use of dropdownmenutool
+
+0.1.5
+
+  * changed drop_down.css
+
+  * compatible with Plone 2.1
+
+0.1.4
+
+  * optimized csshover.htc script
+
+0.1.3+
+
+  * added portal_dropdownmenu tool for security of regenerate procedure
+
+  * added the possibility to regenerate menu
+
+0.1.3
+
+  * install procedure generate html code for portal menu and save it in portal properties
+
+0.1.2
+
+  * install procedure update default portal menu from config.py
+
+0.1.1
+
+  * added the possibility to change portal menu within Plone 
+
+  * Internet Explorer 5.0 and 6.0 compatibility
+
+  * added Plone colors and styles
+
+  * changed the look of second-level menu
+
+0.1.0
+
+  * initial realise
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/README.txt
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/README.txt	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/README.txt	(revision 2676)
@@ -0,0 +1,51 @@
+Quintagroup Plone Drop Down Menu
+================================
+
+The product allows Plone websites to update multilevel portal dropdown menu and edit it within Plone. This is eggified version of old qPloneDropDownMenu product. It is compatible with Plone 4 only.
+  
+Usage
+-----
+
+You have a list of items of your top level menu, which you can edit in 'drop down menu' configlet form. Now, to add submenu to the certain menu item, you need to add unordered list inside of top level menu item ('<li>...</li>') after its title ('<a></a>')::
+
+<ul><li>...</li>...<li>...</li></ul>
+
+Sample menu with 2 submenus. In this example we add submenus to 'Members', and 'Events' tabs::
+ 
+<li id="portaltab-index_html" class="plain"><a href="http://example.com/" accesskey="t">Home</a></li>
+<li id="portaltab-Members" class="plain"><a href="http://example.com/Members" accesskey="t">Members</a>
+<ul>
+<li><a href="http://example.com/Members/jdoe">John Doe</a><li>
+<li><a href="http://example.com/Members/mmajor">Mary Major</a></li>
+</ul>
+</li>
+<li id="portaltab-news" class="plain"><a href="http://example.com/news" accesskey="t">News</a></li>
+<li id="portaltab-events" class="plain"><a href="http://example.com/events" accesskey="t">Events</a>
+<ul>
+<li><a href="http://example.com/events/previous">Past Events</a></li>
+<li><a href="http://example.com/calendar">Calendar</a></li>
+</ul>
+</li>
+
+Customize the following elements in your's css files to change the appearance of drop down menu:
+
+* #portal-globalnav - global navigation bar
+* #portal-globalnav .csshover li.plain a, #portal-globalnav li a - global navigation link
+* #portal-globalnav .csshover li.plain a:hover, #portal-globalnav li a:hover - global navigation link hover
+* #portal-globalnav .csshover li.plain ul, #portal-globalnav li ul - global navigation drop-down box
+* #portal-globalnav .csshover li.plain ul li a, #portal-globalnav li ul li a - global navigation drop-down link
+* #portal-globalnav .csshover li.plain ul li a:hover, #portal-globalnav li ul li a:hover - global navigation drop-down link hover
+
+You can click  button on drop down menu configlet form to reset menu. This can be useful in case html of menu code is broken. Generated code is based on status of 'Automatically generate tabs' in your 'Navigation settings'. However you will lose your previous code of menu with all submenus after click on 'regenerate menu'.
+
+Requires
+--------
+
+Plone 4
+
+Authors
+-------
+
+* Vitaliy Podoba
+* Taras Melnychuk
+
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/__init__.py
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/__init__.py	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/__init__.py	(revision 2676)
@@ -0,0 +1,14 @@
+from AccessControl import allow_module
+from Products.CMFCore.utils import ToolInit
+
+from Products.qPloneDropDownMenu.DropDownMenuTool import DropDownMenuTool
+from Products.qPloneDropDownMenu.config import PROJECT_NAME
+
+allow_module('Products.qPloneDropDownMenu.utils')
+
+tools = (DropDownMenuTool,)
+ 
+def initialize(context):
+    ToolInit(PROJECT_NAME,
+             tools=tools,
+             icon='tool.gif').initialize(context)
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/__init__.py
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/__init__.py	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/__init__.py	(revision 2676)
@@ -0,0 +1,1 @@
+#
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/configure.zcml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/configure.zcml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/configure.zcml	(revision 2676)
@@ -0,0 +1,23 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    i18n_domain="qPloneDropDownMenu">
+
+    <include package="plone.browserlayer" />
+
+    <browser:viewlet
+        name="plone.global_sections"
+        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
+        template="sections.pt"
+        layer=".interfaces.IQPloneDropDownMenuLayer"
+        permission="zope2.View"
+        />
+    
+    <browser:page
+        name="prefs_dropdownmenu"
+        for="Products.CMFCore.interfaces.ISiteRoot"
+        class=".views.PrefsDropDownView"
+        permission="zope2.View"
+    />
+
+</configure>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/interfaces.py
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/interfaces.py	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/interfaces.py	(revision 2676)
@@ -0,0 +1,5 @@
+from zope.interface import Interface
+
+class IQPloneDropDownMenuLayer(Interface):
+    """A layer specific to qPloneDropDownMenu product
+    """
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/sections.pt
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/sections.pt	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/sections.pt	(revision 2676)
@@ -0,0 +1,11 @@
+<tal:tabs i18n:domain="plone">
+    <h5 class="hiddenStructure" i18n:translate="heading_sections">Sections</h5>
+    <div id="portal-globalnav">
+        <div class="csshover">
+            <ul>
+               <span tal:replace="structure context/portal_properties/dropdownmenu_properties/menu|string:qPloneDropDownMenu broken" />
+               <li class="invisibleHeightKeeper">&nbsp;</li>
+            </ul>
+        </div>
+    </div>
+</tal:tabs>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/templates/prefs_dropdownmenu_edit_form.pt
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/templates/prefs_dropdownmenu_edit_form.pt	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/templates/prefs_dropdownmenu_edit_form.pt	(revision 2676)
@@ -0,0 +1,82 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      xmlns:tal="http://xml.zope.org/namespaces/tal"
+      lang="en-US"
+      metal:use-macro="here/prefs_main_template/macros/master"
+      i18n:domain="qPloneDropDownMenu">
+
+  <metal:block fill-slot="top_slot"
+             tal:define="dummy python:request.set('disable_border',1)" />
+
+<body>
+  <div metal:fill-slot="prefs_configlet_main"
+       tal:define="errors python:request.get('errors', {})">
+
+    <h1 i18n:translate="heading_plonedropdownmenu">Plone Drop Down Menu</h1>
+    <a href=""
+       class="link-parent"
+       tal:attributes="href string: $portal_url/plone_control_panel"
+       i18n:translate="label_up_to_plone_setup">
+      Up to Plone Setup
+    </a>
+
+    <div class="documentDescription"
+         i18n:translate="description_plonedropdownmenu">
+      Plone Drop Down Menu ...
+    </div>
+
+    <h2>Post-install instructions</h2>
+
+    <p>Congratulations, you've installed Plone Drop Down Menu product from Quintagroup.</p>
+
+    <p>In case you have some problems following editing DropDown Menu you
+    can only click <a tal:attributes="href string:${here/absolute_url}/${view/__name__}?regenerate_menu=True">regenerate menu</a>, and
+    you'll get the initial portal menu.</p>
+
+    <form name="menu_edit_form"
+          action="." 
+          method="post" 
+          tal:attributes="action string:${here/absolute_url}/${view/__name__}" >
+
+      <div class="formControls" align="right"
+           tal:define="process_creation request/process_creation|nothing;">
+          <input class="context"
+                 type="submit"
+                 value="Regenerate Menu"
+                 name="regenerate_menu"
+                 i18n:attributes="value" />
+      </div>
+
+      <dl class="portalMessage warning"
+          tal:condition="not: view/menu">
+        <dt>Warning</dt>
+        <dd>
+          Dropdown menu property sheet or it's 'menu' field were deleted from portal_properties tool.
+          Before saving any portal tabs you have to 'Regenerate Menu'. This action will add
+          'menu' field back to your properties.
+        </dd>
+      </dl>
+
+      <div class="field">
+          <label for="menu" i18n:translate="label_portaltabs">Portal tabs</label>
+          <div class="formHelp" i18n:translate="help_portaltabs_edit">Here you can change your portal tabs.</div>
+          <textarea cols="80" 
+                    rows="20"
+                    name="menu"
+                    id="menu"
+                    tal:content="view/menu">Portal Tabs</textarea>
+      </div>
+
+      <div class="formControls"
+           tal:define="process_creation request/process_creation|nothing;">
+        <input class="context"
+               type="submit"
+               value="Save"
+               name="save"
+               i18n:attributes="value" />
+      </div>
+    </form>
+
+  </div>
+</body>
+</html>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/views.py
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/views.py	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/browser/views.py	(revision 2676)
@@ -0,0 +1,58 @@
+from zope.component import getMultiAdapter
+from Products.CMFCore.utils import getToolByName
+from Products.Five.browser import BrowserView
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+from Products.statusmessages.interfaces import IStatusMessage
+
+
+
+class PrefsDropDownView(BrowserView):
+    """DropDown configlet.
+    
+    """
+
+    template = ViewPageTemplateFile('templates/prefs_dropdownmenu_edit_form.pt')
+
+    def __init__(self, context, request):
+        super(PrefsDropDownView, self).__init__(context, request)
+        self.portal_state = getMultiAdapter((self.context, self.request),
+                                             name='plone_portal_state')
+        self.portal = self.portal_state.portal()
+        self.pp = getToolByName(self.portal, 'portal_properties')
+        self.dp = getattr(self.pp, 'dropdownmenu_properties', None)
+
+    def menu(self):
+        menu = ''
+        if self.dp is not None:
+             menu = self.dp.getProperty('menu', '')
+        return menu 
+
+    def __call__(self):
+        save = self.request.get('save', None)
+        update = self.request.get('regenerate_menu', None)
+        status = IStatusMessage(self.request)
+
+        if save is not None:
+
+            if self.dp is None:
+                status.addStatusMessage(
+                """Dropdown menu property sheet does not exist.
+                Please, firstly regenerate menu before editing it.""")
+                return self.template()
+
+            menu = self.menu()
+            if not menu:
+                status.addStatusMessage(
+                """Menu field does not exist in dropdown menu property sheet.
+                Please, firstly regenerate menu before editing it.""")
+                return self.template()
+
+            self.dp.manage_changeProperties(menu=self.request.get('menu'))
+            status.addStatusMessage("DropDown Menu updated.")
+            return self.template()
+            
+        if update is not None:
+            getToolByName(self.portal, 'portal_dropdownmenu').regenerateMenu()
+            status.addStatusMessage("DropDown Menu regenerated.")
+
+        return self.template()
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/config.py
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/config.py	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/config.py	(revision 2676)
@@ -0,0 +1,12 @@
+try:
+    from Products.CMFCore import permissions
+except ImportError:
+    from Products.CMFCore import CMFCorePermissions as permissions
+ 
+MANAGE_PERMISSION = permissions.ManagePortal
+
+PROJECT_NAME = 'qPloneDropDownMenu'
+UNIQUE_ID = "portal_dropdownmenu"
+
+PROPERTY_SHEET = 'dropdownmenu_properties'
+PROPERTY_FIELD = 'menu'
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/configure.zcml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/configure.zcml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/configure.zcml	(revision 2676)
@@ -0,0 +1,11 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:cmf="http://namespaces.zope.org/cmf"
+    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+    i18n_domain="qPloneDropDownMenu">
+
+    <include package=".browser" />
+    <include file="profiles.zcml" />
+    <include file="skins.zcml" />
+
+</configure>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles.zcml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles.zcml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles.zcml	(revision 2676)
@@ -0,0 +1,15 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+    i18n_domain="Products.qPloneDropDownMenu">
+
+    <!-- Register the installation GenericSetup extension profile -->
+    <genericsetup:registerProfile
+      name="default"
+      title="qPloneDropDownMenu"
+      directory="profiles/default"
+      description="Allows Plone websites to update multilevel portal dropdown menu"
+      provides="Products.GenericSetup.interfaces.EXTENSION"
+      />
+
+</configure>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/browserlayer.xml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/browserlayer.xml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/browserlayer.xml	(revision 2676)
@@ -0,0 +1,4 @@
+<layers>
+  <layer name="qPloneDropDownMenu"
+         interface="Products.qPloneDropDownMenu.browser.interfaces.IQPloneDropDownMenuLayer" />
+</layers>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/controlpanel.xml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/controlpanel.xml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/controlpanel.xml	(revision 2676)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<object name="portal_controlpanel" meta_type="Plone Control Panel Tool"
+    xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="qPloneDropDownMenu">
+ <configlet title="Drop Down Menu" action_id="qPloneDropDownMenu"
+    appId="qPloneDropDownMenu" category="Products" condition_expr=""
+    icon_expr="string:$portal_url/qplonedropdownmenu.gif"
+    url_expr="string:${portal_url}/@@prefs_dropdownmenu"
+    visible="True" i18n:attributes="title">
+  <permission>Manage portal</permission>
+ </configlet>
+ <configlet title="CSS Hover" action_id="csshover"
+    appId="qPloneDropDownMenu" category="Products" condition_expr=""
+    icon_expr="string:$portal_url/qplonedropdownmenu.gif"
+    url_expr="string:${portal_url}/prefs_csshover_edit_form"
+    visible="True" i18n:attributes="title">
+  <permission>Manage portal</permission>
+ </configlet>
+</object>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/cssregistry.xml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/cssregistry.xml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/cssregistry.xml	(revision 2676)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<object name="portal_css" meta_type="Stylesheets Registry">
+ <stylesheet title="DropDownMenu" cacheable="True" compression="safe" cookable="True"
+    enabled="1" expression="portal/portal_dropdownmenu|nothing"
+    id="drop_down.css" media="screen" rel="stylesheet" rendering="import"/>
+</object>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/import_steps.xml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/import_steps.xml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/import_steps.xml	(revision 2676)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<import-steps>
+ <import-step id="qPloneDropDownMenu_installMenu" version="20081107-01"
+              handler="Products.qPloneDropDownMenu.setuphandlers.installMenu"
+              title="Update Dropdown Menu">
+  <dependency step="toolset"/>
+    Update Dropdown Menu from portal actions or root items
+ </import-step>
+</import-steps>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/metadata.xml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/metadata.xml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/metadata.xml	(revision 2676)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>0.3</version>
+</metadata>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/qplonedropdownmenu_various.txt
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/qplonedropdownmenu_various.txt	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/qplonedropdownmenu_various.txt	(revision 2676)
@@ -0,0 +1,1 @@
+The qplonedropdownmenu steps are run if this file is present in the profile
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/skins.xml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/skins.xml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/skins.xml	(revision 2676)
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<object name="portal_skins" meta_type="Plone Skins Tool">
+ <object name="qPloneDropDownMenu" meta_type="Filesystem Directory View"
+    directory="Products.qPloneDropDownMenu:skins/qPloneDropDownMenu"/>
+ <skin-path name="*" purge="False">
+  <layer name="qPloneDropDownMenu" insert-after="custom"/>
+ </skin-path>
+</object>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/toolset.xml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/toolset.xml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/profiles/default/toolset.xml	(revision 2676)
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<tool-setup>
+ <required tool_id="portal_dropdownmenu"
+           class="Products.qPloneDropDownMenu.DropDownMenuTool"/>
+</tool-setup>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/setuphandlers.py
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/setuphandlers.py	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/setuphandlers.py	(revision 2676)
@@ -0,0 +1,21 @@
+from Products.CMFCore.utils import getToolByName
+
+from utils import updateMenu
+from config import PROPERTY_SHEET, PROPERTY_FIELD
+
+def installMenu(context):
+
+    if context.readDataFile('qplonedropdownmenu_various.txt') is None:
+        return
+
+    site = context.getSite()
+    portal_props = getToolByName(site, 'portal_properties')
+
+    # skip adding property if it already exists
+    prop_sheet = getattr(portal_props.aq_base, PROPERTY_SHEET, None)
+    if prop_sheet is not None:
+        prop_field = getattr(prop_sheet.aq_base, PROPERTY_FIELD, None)
+        if prop_field is not None:
+            return
+
+    updateMenu(site)
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins.zcml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins.zcml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins.zcml	(revision 2676)
@@ -0,0 +1,8 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:cmf="http://namespaces.zope.org/cmf"
+    i18n_domain="Products.qPloneDropDownMenu">
+
+    <cmf:registerDirectory name="qPloneDropDownMenu"/>
+
+</configure>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover.htc.dtml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover.htc.dtml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover.htc.dtml	(revision 2676)
@@ -0,0 +1,143 @@
+<dtml-call "REQUEST.RESPONSE.setHeader('Content-Type', 'text/x-component')">
+<attach event="ondocumentready" handler="parseStylesheets" />
+<script language="JScript">
+/**
+ *    HOVER - V1.11.040203 - whatever:hover in IE
+ *    ---------------------------------------------
+ *    Peterned - http://www.xs4all.nl/~peterned/
+ *    (c) 2004 - Peter Nederlof
+ *
+ *    Credits  - Arnoud Berendsen 
+ *        for finding some really -sick- bugs
+ *
+ *    howto: body { behavior:url("csshover.htc"); }
+ *    ---------------------------------------------
+ */
+var currentSheet, doc = window.document;
+var csshover_nodes = getElementsByClassName("csshover", doc);
+var csshover_rules = [], hoverStyleSheets = "", addRules = true;
+var IE5 = (doc.getElementsByTagName('*').length == 0) ? true : false, configlet = doc.getElementById('csshovering');
+var DEBUG = false, styles = "", parseCSSRulecounter = 0, timer, timerTable = "", d=true;
+
+function parseStylesheets() {
+    var sheets = doc.styleSheets, l = sheets.length;
+    for(var i=0; i<l; i++){
+        parseStylesheet(sheets[i]);
+    };
+    if (configlet) {configlet.innerText = hoverStyleSheets;};
+    if(DEBUG) {
+      alert(styles);
+      alert(timerTable);
+    };
+};
+
+function parseStylesheet(sheet) {
+    if(DEBUG) window.status += '|';
+//    if(sheet.href && sheet.href.indexOf('/ploneCustom.css') == -1) return;
+    var l, rules, imports;
+    if(sheet.imports) {
+        imports = sheet.imports, l = imports.length;
+        for(var i=0; i<l; i++)
+            parseStylesheet(sheet.imports[i]);
+    };
+    rules = (currentSheet = sheet).rules, l = rules.length;
+    for(var j=0; j<l; j++){parseCSSRule(rules[j]);};
+};
+
+function parseCSSRule(rule) {
+    if(DEBUG) {
+        if((parseCSSRulecounter++)%15 == 0) window.status += '.';
+        startTimer();
+    };
+    var select = rule.selectorText, style = rule.style.cssText;
+    if (addRules && (/\.cssHoverCSSExists/i).test(select)) {addRules = false;};
+    if(!(/\.csshover/i).test(select)) return;
+    if(style.replace(/ /, "") == "") return;
+    if(!(/(^|\s)(([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):hover/i).test(select)) return;
+
+    var newSelect = select.replace(/(\.([a-z0-9_-]+):hover)|(:hover)/g, '.$2onHover');
+    if (addRules) {currentSheet.addRule(newSelect, style);};
+    if (configlet) {hoverStyleSheets += newSelect + ' \{\n  ' + style.replace('; ', '\;\n  ') + ';\n\}\n';};
+
+    var hasClass = (/(\.([a-z0-9_-]+):hover)/g).exec(select);
+    var className = (hasClass? hasClass[2]:'') + 'onHover';
+    var affected = select.replace(/:hover.*$/g, '');
+    affected = affected.replace(/^.*([ ]|^)(([^ ]*)\.csshover)/i, '$2');
+    if (DEBUG) {timerTable += stopTimer() + '\n';};
+    if(!csshover_rules[className + ',' + affected]) {
+        if (DEBUG) {startTimer();};
+        var elements = getElementsBySelect(affected);
+        if(DEBUG) {
+            window.status += " "+elements.length;
+            styles += "" + elements.length + ": " + affected + '\n';
+        };
+        for(var i=0; i<elements.length; i++)
+            new HoverElement(elements[i], className);
+        csshover_rules[className + ',' + affected] = true;
+    };
+};
+
+function HoverElement(node, className) {
+    if(!node.hovers) node.hovers = {};
+    if(node.hovers[className]) return;
+    node.hovers[className] = true;
+    node.attachEvent('onmouseover',
+        function() { node.className += ' ' + className; });
+    node.attachEvent('onmouseout',
+        function() { node.className =
+            node.className.replace((new RegExp('\\s+'+className)),''); });
+};
+
+function getElementsBySelect(rule) {
+    var parts, nodes = csshover_nodes;
+    parts = rule.split(' ');
+    for(var i=0; i<parts.length; i++) {
+        nodes = getSelectedNodes(parts[i], nodes, i==0);
+    };
+    return nodes;
+};
+
+function getSelectedNodes(select, elements, includeRoot) {
+    var element, result, node, nodes = [];
+    var classname = (/\.([a-z0-9_-]+)/i).exec(select);
+    if(classname) {classname_re = new RegExp('\\b' + classname[1] + '\\b');};
+    var identify = (/\#([a-z0-9_-]+)/i).exec(select);
+    var tagName = (/^[a-z0-9]+/i).exec(select.toUpperCase()) || '*',
+        ell = elements.length;
+    for(var i=0; i<ell; i++) {
+        element = elements[i]
+        if(includeRoot)
+          if((tagName == '*') || (element.nodeName == tagName)) result = [element]
+          else result = []
+        else
+            if (tagName == '*' && IE5) result = elements[i].all
+            else result = elements[i].getElementsByTagName(tagName)
+        rel = result.length;
+        for(var j=0; j<rel; j++) {
+            node = result[j];
+            if((identify && node.id != identify[1]) || (classname && !(classname_re.exec(node.className))) || arrayHasElement(nodes, node)) continue;
+            nodes[nodes.length] = node;
+        };
+    };
+    return nodes;
+};
+
+function arrayHasElement(a, el) {
+    var l = a.length;
+    for(var i=0; i<l; i++) if(a[i] == el) return true;
+    return false;
+};
+
+function getElementsByClassName(className, parentElement) {
+    var result = new Array(),
+        list = (parentElement || doc.body).getElementsByTagName('*');
+    if(list.length == 0) list = (parentElement || doc.body).all;
+    var class_re = new RegExp('(^|\\s)' + className + '(\\s|$)');
+    for(var i = 0; i < list.length; i++) if(list[i].className.match(class_re)) result[result.length] = list[i];
+    return result;
+};
+
+function startTimer() {timer = new Date().getTime();};
+function stopTimer(message) {return (new Date().getTime()) - timer;};
+
+</script>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover.htc.dtml.metadata
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover.htc.dtml.metadata	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover.htc.dtml.metadata	(revision 2676)
@@ -0,0 +1,3 @@
+[default]
+title=CSS Hover scripts for IE6
+cache=HTTPCache
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover_save.cpy
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover_save.cpy	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover_save.cpy	(revision 2676)
@@ -0,0 +1,42 @@
+## Controller Python Script "csshover_save"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind state=state
+##bind subpath=traverse_subpath
+##parameters=enabled=False, csshovering=[], sheetId='csshover.css', title='CSS Hover'
+##title=
+##
+
+from Products.CMFCore.utils import getToolByName
+from Products.qPloneDropDownMenu.utils import addCSS
+folder = getToolByName(context, 'portal_skins').restrictedTraverse('custom')
+
+if csshovering.find('.cssHoverCSSExists {}') == -1: csshovering = '.cssHoverCSSExists {}\n\n' + csshovering
+if not sheetId in folder.objectIds():
+    if csshovering.find('Use this configlet in IE') != -1: csshovering = " "
+    addCSS(folder, sheetId, title, csshovering)
+    message = 'Added %s to plone_skins  custom folder. ' % sheetId
+else:
+    if csshovering.find('Use this configlet in IE') == -1:
+        getattr(folder, sheetId).manage_edit(csshovering,title)
+        message = 'Updated %s. ' % sheetId
+    else: message = 'Visit this page in IE to see and activate generated CSS. '
+cssreg = getToolByName(context, 'portal_css', None)
+if cssreg is not None:
+    stylesheet_ids = cssreg.getResourceIds()
+    if sheetId not in stylesheet_ids:
+        cssreg.registerStylesheet(id=sheetId, enabled=enabled)
+        try: cssreg.moveResource(sheetId, cssreg.getResourcePosition('textLarge.css')+1)
+        except: pass
+        cssreg.cookResources()
+    else:
+        cssreg.updateStylesheet(sheetId, **{'enabled' : enabled})
+        cssreg.cookResources()
+else:
+    message += "For activating csshover.css customize ploneCustom.css and add <dtml-var csshover.css> line before <dtml-var drop_down.css>"
+
+context.plone_utils.addPortalMessage(message)
+
+return state.set(status='success')
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover_save.cpy.metadata
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover_save.cpy.metadata	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/csshover_save.cpy.metadata	(revision 2676)
@@ -0,0 +1,3 @@
+[actions]
+action.failure=traverse_to:string:prefs_csshover_edit_form
+action.success=redirect_to:string:prefs_csshover_edit_form
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/drop_down.css.dtml
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/drop_down.css.dtml	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/drop_down.css.dtml	(revision 2676)
@@ -0,0 +1,163 @@
+/* <dtml-with base_properties> (do not remove this :) */
+/* <dtml-call "REQUEST.set('portal_url', portal_url())"> (not this either :) */
+
+body {
+  behavior:url("&dtml-portal_url;/csshover.htc");
+}
+
+
+/*             ------  Basic style  ------             */
+#portal-globalnav ul {
+        margin: 0;
+        padding: 0;
+        border: 0;
+        list-style-type: none;
+}
+
+#portal-globalnav li {
+        margin: 0;  
+        padding: 0;
+        border: 0; 
+        display: inline;
+        float: left;
+        z-index: 10000;
+        position: relative;
+}
+
+#portal-globalnav a {
+        float: left;/* \*/float: none;/*  */
+        display: block;
+}
+
+#portal-globalnav li ul {
+        visibility: hidden;
+        position: absolute;
+        width: 20em;
+}
+
+#portal-globalnav li ul li {
+        width: 100%;
+        display: block;
+        float: left;
+        position: static;
+}
+
+#portal-globalnav li ul li a {
+        width: 100%;
+}
+
+html>body #portal-globalnav li ul li {
+        float: none;
+        position: relative;
+}
+
+#portal-globalnav .csshover li ul li:hover {
+        position: relative;
+}
+
+
+/* fix the position */
+#portal-globalnav li ul li ul {
+        top: 0;
+        left: 100%;
+}
+
+
+
+/* simulate child selector for IE */
+div#portal-globalnav .csshover li:hover ul, #portal-globalnav .csshover li:hover li:hover ul, #portal-globalnav .csshover li:hover li:hover li:hover ul, #portal-globalnav .csshover li:hover li:hover li:hover li:hover ul {
+        visibility: visible;
+}
+#portal-globalnav .csshover li:hover li ul, #portal-globalnav .csshover li:hover li:hover li ul, #portal-globalnav .csshover li:hover li:hover li:hover li ul, #portal-globalnav .csshover li:hover li:hover li:hover li:hover li ul { 
+        visibility: hidden;
+}
+
+/* do the normal show, with increased specificity */
+#portal-globalnav ul#portal-globalnavList .csshover li:hover > ul {
+       visibility: visible;
+}
+
+/*     ------   Make-up --------            */
+
+#portal-globalnav li.invisibleHeightKeeper {
+        visibility: hidden;
+        float: none;
+}
+
+#portal-globalnav .csshover ul li ul li a:hover,
+#portal-globalnav .csshover ul li ul li:hover a {
+        color: &dtml-globalFontColor;;
+}
+
+#portal-globalnav ul li ul li a {
+        border-style: none;
+        margin-right: 0em;
+}
+
+#portal-globalnav ul li ul {
+        border: &dtml-borderWidth; &dtml-borderStyle; &dtml-globalBorderColor;;
+        padding-bottom: 1px;
+        overflow: hidden;
+}
+
+#portal-globalnav .csshover ul li:hover ul li:hover ul  a {
+        color: &dtml-globalFontColor;;
+}
+
+/* latest changes */
+
+#portal-globalnav ul {
+        font-size:8pt;
+        list-style-type:none;
+        list-style-image:none;
+}
+
+#portal-globalnav ul li {
+        padding:0;
+        margin:0;
+        line-height:normal;
+}
+
+#portal-globalnav ul li.selected a,
+#portal-globalnav .csshover ul li a:hover {
+        background-color:&dtml-globalBackgroundColor;;
+        color:&dtml-globalFontColor;;
+}
+
+#portal-globalnav .csshover ul li:hover ul {
+        margin:0;
+        border: &dtml-borderWidth; &dtml-borderStyle; &dtml-globalBorderColor;;
+        background-color: &dtml-backgroundColor;;
+        overflow:visible;
+}
+
+#portal-globalnav .csshover ul li:hover ul li {
+        padding:0;
+        margin:0;
+}
+
+#portal-globalnav .csshover ul li:hover ul li a {
+        color: &dtml-globalFontColor; !important;
+        margin:0;
+        line-height:normal;
+        width:auto;
+}
+
+#portal-globalnav .csshover ul li ul li a:hover {
+        background-image:none;
+}
+
+.kupu-fulleditor-zoomed #portal-globalnav {
+        display: none;
+}
+
+/*Configlet styles************************************************************/
+
+.ieVisible {display:none;}
+
+* html .ieHidden {display: none;}
+
+* html .ieVisible {display: block;}
+
+
+/* </dtml-with> (do not remove this either :) */
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/prefs_csshover_edit_form.cpt
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/prefs_csshover_edit_form.cpt	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/prefs_csshover_edit_form.cpt	(revision 2676)
@@ -0,0 +1,67 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      xmlns:tal="http://xml.zope.org/namespaces/tal"
+      lang="en-US"
+      metal:use-macro="here/prefs_main_template/macros/master"
+      i18n:domain="qPloneDropDownMenu">
+
+  <metal:block fill-slot="top_slot"
+             tal:define="dummy python:request.set('disable_border',1)" />
+
+<body>
+  <div metal:fill-slot="prefs_configlet_main"
+       tal:define="errors python:request.get('errors', {})">
+
+    <h1 i18n:translate="heading_plonecsshovering">Plone CSS Hover Functionality</h1>
+    <a href=""
+       class="link-parent"
+       tal:attributes="href string: $portal_url/plone_control_panel"
+       i18n:translate="label_up_to_plone_setup">
+    Up to Plone Setup
+    </a>
+
+    <div class="ieHidden">Visit this page in IE to see and activate generated CSS</div>
+
+    <form name="csshovering_edit_form"
+          action="."
+          method="post"
+          tal:attributes="action string:${here/absolute_url}/${template/getId}" >
+
+     <div class="field">
+         <label for="csshovering" class="ieVisible" i18n:translate="label_csshovering">CSS Hover</label>
+         <div class="formHelp" i18n:translate="help_csshovering_edit">
+         Due to limitation of IE &lt; 7 to understand :hover CSS pseudo-selector only on A elements
+         and performance issues while applying dynamic stylesheets on each page load, it is possible to 
+         pre-generate CSS that will enable IE with JavaScript turned on to understand :hover elements.
+         </div>
+         <textarea cols="80"
+                   rows="20"
+                   name="csshovering"
+                   id="csshovering"
+                   class="ieVisible">Use this configlet in IE</textarea>
+     </div>
+
+     <div class="field"
+          tal:define="portal_css nocall:here/portal_css|nothing"
+          tal:condition="portal_css">
+         <input type="checkbox" name="enabled" id="enabled"  value="1"
+                tal:define="csshover python:portal_css and portal_css.getResource('csshover.css') or None"
+                tal:attributes="checked csshover/getEnabled|nothing" />
+         <label for="enabled" i18n:translate="label_enabled">Enabled</label>
+     </div>
+
+     <div class="formControls"
+             tal:define="process_creation request/process_creation|nothing;">
+         <input class="context"
+                type="submit"
+                value="Save"
+                name="form.button.Save"
+                i18n:attributes="value"/>
+     </div>
+
+     <input type="hidden" name="form.submitted" value="1" />
+    </form>
+
+  </div>
+</body>
+</html>
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/prefs_csshover_edit_form.cpt.metadata
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/prefs_csshover_edit_form.cpt.metadata	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/prefs_csshover_edit_form.cpt.metadata	(revision 2676)
@@ -0,0 +1,11 @@
+[security]
+View=0:Authenticated
+
+[default]
+title=Set csshover functionality
+
+[actions]
+action.success..Save=traverse_to:string:csshover_save
+action.success=traverse_to:string:csshover_save
+action.failure..Save=traverse_to:string:prefs_csshover_edit_form
+action.failure=traverse_to:string:prefs_csshover_edit_form
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/qplonedropdownmenu.gif.metadata
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/qplonedropdownmenu.gif.metadata	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/skins/qPloneDropDownMenu/qplonedropdownmenu.gif.metadata	(revision 2676)
@@ -0,0 +1,3 @@
+[default]
+title=Drop Down Menu Control Panel Icon
+cache=HTTPCache
Index: /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/utils.py
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/utils.py	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/Products/qPloneDropDownMenu/utils.py	(revision 2676)
@@ -0,0 +1,66 @@
+# -*- coding: utf-8 -*-
+""" Utility functions """
+
+from zope.component import getMultiAdapter
+
+from OFS.DTMLMethod import addDTMLMethod
+
+from Products.CMFCore.utils import getToolByName
+try: 
+    # Plone 4 
+    from plone.app.upgrade.utils import safeEditProperty 
+except: 
+    from Products.CMFPlone.migrations.migration_util import safeEditProperty 
+
+from Products.CMFCore.Expression import Expression, createExprContext
+
+from config import PROPERTY_FIELD, PROPERTY_SHEET
+
+
+TAB_HTML_SNIPPET = """<li id="portaltab-%(id)s" class="plain">
+  <a href="%(url)s" accesskey="t" title="%(desc)s">%(name)s</a>
+</li>
+"""
+
+
+def addCSS(container, sheetId, title, csshovering):
+    """ Add DTML Method object to portal root """
+    addDTMLMethod(container, sheetId, title, csshovering)
+
+def updateMenu(site):
+    pu = getToolByName(site, 'plone_utils')
+    pa = getToolByName(site, 'portal_actions')
+    portal_props = getToolByName(site, 'portal_properties')
+
+    # collect all portal tabs
+    context_state = getMultiAdapter((site, site.REQUEST),
+                                    name=u'plone_context_state')
+    actions = context_state.actions()
+    if type(actions) == dict:
+        # Plone 4
+        actions = actions['portal_tabs']
+
+    portal_tabs_view = getMultiAdapter((site, site.REQUEST),
+                                       name='portal_tabs_view')
+    portal_tabs = portal_tabs_view.topLevelTabs(actions=actions)
+
+    # dump to html
+    value = u""
+    enc = portal_props.site_properties.getProperty('default_charset', 'utf-8')
+    for tab in portal_tabs:
+        value += TAB_HTML_SNIPPET % {'id': toUnicode(tab['id'], enc),
+                                     'url': toUnicode(tab['url'], enc),
+                                     'desc': toUnicode(tab['description'], enc),
+                                     'name': toUnicode(tab['name'], enc)}
+
+    if not hasattr(portal_props.aq_base, PROPERTY_SHEET):
+        portal_props.addPropertySheet(PROPERTY_SHEET,
+                                      'DropDown Menu Properties')
+    ap = getattr(portal_props.aq_base, PROPERTY_SHEET)
+    safeEditProperty(ap, PROPERTY_FIELD, value, 'text')
+
+def toUnicode(value, enc='utf-8'):
+    if isinstance(value, str):
+        return value.decode(enc)
+    else:
+        return value
Index: /Products.qPloneDropDownMenu/tags/3.0/README.txt
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/README.txt	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/README.txt	(revision 2676)
@@ -0,0 +1,51 @@
+Quintagroup Plone Drop Down Menu
+================================
+
+The product allows Plone websites to update multilevel portal dropdown menu and edit it within Plone. This is eggified version of old qPloneDropDownMenu product. It is compatible with Plone 4 only.
+  
+Usage
+-----
+
+You have a list of items of your top level menu, which you can edit in 'drop down menu' configlet form. Now, to add submenu to the certain menu item, you need to add unordered list inside of top level menu item ('<li>...</li>') after its title ('<a></a>')::
+
+<ul><li>...</li>...<li>...</li></ul>
+
+Sample menu with 2 submenus. In this example we add submenus to 'Members', and 'Events' tabs::
+ 
+<li id="portaltab-index_html" class="plain"><a href="http://example.com/" accesskey="t">Home</a></li>
+<li id="portaltab-Members" class="plain"><a href="http://example.com/Members" accesskey="t">Members</a>
+<ul>
+<li><a href="http://example.com/Members/jdoe">John Doe</a><li>
+<li><a href="http://example.com/Members/mmajor">Mary Major</a></li>
+</ul>
+</li>
+<li id="portaltab-news" class="plain"><a href="http://example.com/news" accesskey="t">News</a></li>
+<li id="portaltab-events" class="plain"><a href="http://example.com/events" accesskey="t">Events</a>
+<ul>
+<li><a href="http://example.com/events/previous">Past Events</a></li>
+<li><a href="http://example.com/calendar">Calendar</a></li>
+</ul>
+</li>
+
+Customize the following elements in your's css files to change the appearance of drop down menu:
+
+* #portal-globalnav - global navigation bar
+* #portal-globalnav .csshover li.plain a, #portal-globalnav li a - global navigation link
+* #portal-globalnav .csshover li.plain a:hover, #portal-globalnav li a:hover - global navigation link hover
+* #portal-globalnav .csshover li.plain ul, #portal-globalnav li ul - global navigation drop-down box
+* #portal-globalnav .csshover li.plain ul li a, #portal-globalnav li ul li a - global navigation drop-down link
+* #portal-globalnav .csshover li.plain ul li a:hover, #portal-globalnav li ul li a:hover - global navigation drop-down link hover
+
+You can click  button on drop down menu configlet form to reset menu. This can be useful in case html of menu code is broken. Generated code is based on status of 'Automatically generate tabs' in your 'Navigation settings'. However you will lose your previous code of menu with all submenus after click on 'regenerate menu'.
+
+Requires
+--------
+
+Plone 4
+
+Authors
+-------
+
+* Vitaliy Podoba
+* Taras Melnychuk
+
Index: /Products.qPloneDropDownMenu/tags/3.0/docs/HISTORY.txt
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/docs/HISTORY.txt	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/docs/HISTORY.txt	(revision 2676)
@@ -0,0 +1,8 @@
+Changelog
+=========
+
+3.0 - July 14, 2010
+-------------------
+
+* Plone 4 support added
+
Index: /Products.qPloneDropDownMenu/tags/3.0/docs/INSTALL.txt
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/docs/INSTALL.txt	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/docs/INSTALL.txt	(revision 2676)
@@ -0,0 +1,22 @@
+Installation
+============
+
+You can install Products.qPloneDropDownMenu on Plone 4 sites. For that:
+
+* Add ``Products.qPloneDropDownMenu`` to the list of eggs to install::
+
+   [buildout]
+   ....
+   eggs =
+        ...
+        Products.qPloneDropDownMenu
+
+* Re-run buildout, e.g. with::
+
+   $ ./bin/buildout
+
+* Restart the Zope server, e.g with the following command in the terminal::
+
+   $ ./bin/instance restart
+
+* Install Products.qPloneDropDownMenu via QuickInstaller in Plone.
Index: /Products.qPloneDropDownMenu/tags/3.0/docs/LICENSE.GPL
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/docs/LICENSE.GPL	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/docs/LICENSE.GPL	(revision 2676)
@@ -0,0 +1,225 @@
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
Index: /Products.qPloneDropDownMenu/tags/3.0/docs/LICENSE.txt
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/docs/LICENSE.txt	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/docs/LICENSE.txt	(revision 2676)
@@ -0,0 +1,16 @@
+  Products.qPloneDropDownMenu is copyright (c) "Quintagroup": http://quintagroup.com/, 2010
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA 02111-1307 USA.
Index: /Products.qPloneDropDownMenu/tags/3.0/setup.cfg
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/setup.cfg	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/setup.cfg	(revision 2676)
@@ -0,0 +1,2 @@
+[egg_info]
+
Index: /Products.qPloneDropDownMenu/tags/3.0/setup.py
===================================================================
--- /Products.qPloneDropDownMenu/tags/3.0/setup.py	(revision 2676)
+++ /Products.qPloneDropDownMenu/tags/3.0/setup.py	(revision 2676)
@@ -0,0 +1,33 @@
+from setuptools import setup, find_packages
+import os
+
+version = '3.0'
+
+setup(name='Products.qPloneDropDownMenu',
+      version=version,
+      description="The product allows Plone websites to update multilevel portal dropdown menu",
+      long_description=open("README.txt").read() + "\n" +
+                       open(os.path.join("docs", "INSTALL.txt")).read() + "\n" +
+                       open(os.path.join("docs", "HISTORY.txt")).read(),
+      # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[
+        "Programming Language :: Python",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+        ],
+      keywords='plone dropdown menu',
+      author='Quintagroup',
+      author_email='support@quintagroup.com',
+      url='http://quintagroup.com/services/plone-development/products/plone-drop-down-menu',
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['Products'],
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=[
+          'setuptools',
+          # -*- Extra requirements: -*-
+      ],
+      entry_points="""
+      # -*- Entry points: -*-
+      """,
+      )
