Index: qPloneDropDownMenu/trunk/DropDownMenuTool.py
===================================================================
--- qPloneDropDownMenu/trunk/DropDownMenuTool.py	(revision 1)
+++ qPloneDropDownMenu/trunk/DropDownMenuTool.py	(revision 372)
@@ -5,6 +5,6 @@
 from Products.CMFCore.utils import UniqueObject, getToolByName
 
-from Products.qPloneDropDownMenu.Extensions.Install import updateMenu
-from config import VIEW_PERMISSION, PROJECT_NAME, UNIQUE_ID
+from utils import updateMenu
+from config import MANAGE_PERMISSION, PROJECT_NAME, UNIQUE_ID
 
 
@@ -17,7 +17,8 @@
     security = ClassSecurityInfo()
 
-    security.declareProtected(VIEW_PERMISSION, 'regenerateMenu')
+    security.declareProtected(MANAGE_PERMISSION, 'regenerateMenu')
     def regenerateMenu(self):
-        updateMenu(self)
+        portal = getToolByName(self, 'portal_url').getPortalObject()
+        updateMenu(portal)
 
 InitializeClass(DropDownMenuTool)
Index: qPloneDropDownMenu/trunk/HISTORY.txt
===================================================================
--- qPloneDropDownMenu/trunk/HISTORY.txt	(revision 1)
+++ qPloneDropDownMenu/trunk/HISTORY.txt	(revision 372)
@@ -1,2 +1,8 @@
+0.2
+
+  * some minor fixes to portal status messages and validation stuff
+
+  * compatible with plone 3
+
 0.1.12
 
Index: qPloneDropDownMenu/trunk/README.txt
===================================================================
--- qPloneDropDownMenu/trunk/README.txt	(revision 1)
+++ qPloneDropDownMenu/trunk/README.txt	(revision 372)
@@ -7,5 +7,5 @@
   "Download":http://sourceforge.net/projects/quintagroup
 
-  (c) "Quintagroup":http://quintagroup.com/ , 2005. 
+  (c) "Quintagroup":http://quintagroup.com/ , 2008. 
 
   support@quintagroup.com * quintessence of modern business
@@ -13,7 +13,5 @@
 Requires
 
-  Plone 2.0+
-  CMF 1.4.7+
-  Zope 2.7+
+  Plone 3.0+
 
 Install
@@ -79,5 +77,3 @@
 Authors
 
-  * Myroslav Opyr
-
   * Vitaliy Podoba
Index: qPloneDropDownMenu/trunk/TODO.txt
===================================================================
--- qPloneDropDownMenu/trunk/TODO.txt	(revision 1)
+++ 	(revision )
@@ -1,2 +1,0 @@
-
-# * next optimization of csshover.htc script
Index: qPloneDropDownMenu/trunk/__init__.py
===================================================================
--- qPloneDropDownMenu/trunk/__init__.py	(revision 1)
+++ qPloneDropDownMenu/trunk/__init__.py	(revision 372)
@@ -1,19 +1,14 @@
 from AccessControl import allow_module
-from Products.CMFCore import utils
-from Products.CMFCore.DirectoryView import registerDirectory
+from Products.CMFCore.utils import ToolInit
 
 from Products.qPloneDropDownMenu.DropDownMenuTool import DropDownMenuTool
-from Products.qPloneDropDownMenu.config import PROJECT_NAME, SKINS_DIR, GLOBALS, VIEW_PERMISSION
+from Products.qPloneDropDownMenu.config import PROJECT_NAME
 
 allow_module('Products.qPloneDropDownMenu.utils')
 
-registerDirectory(SKINS_DIR, GLOBALS)
- 
 tools = (DropDownMenuTool,)
  
 def initialize(context):
-    utils.ToolInit( PROJECT_NAME,
-                    tools = tools,
-                    product_name = PROJECT_NAME,
-                    icon='tool.gif'
-                    ).initialize(context)
+    ToolInit(PROJECT_NAME,
+             tools=tools,
+             icon='tool.gif').initialize(context)
Index: qPloneDropDownMenu/trunk/browser/__init__.py
===================================================================
--- qPloneDropDownMenu/trunk/browser/__init__.py	(revision 372)
+++ qPloneDropDownMenu/trunk/browser/__init__.py	(revision 372)
@@ -0,0 +1,1 @@
+#
Index: qPloneDropDownMenu/trunk/browser/configure.zcml
===================================================================
--- qPloneDropDownMenu/trunk/browser/configure.zcml	(revision 372)
+++ qPloneDropDownMenu/trunk/browser/configure.zcml	(revision 372)
@@ -0,0 +1,16 @@
+<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"
+        />
+
+</configure>
Index: qPloneDropDownMenu/trunk/browser/interfaces.py
===================================================================
--- qPloneDropDownMenu/trunk/browser/interfaces.py	(revision 372)
+++ qPloneDropDownMenu/trunk/browser/interfaces.py	(revision 372)
@@ -0,0 +1,5 @@
+from zope.interface import Interface
+
+class IQPloneDropDownMenuLayer(Interface):
+    """A layer specific to qPloneDropDownMenu product
+    """
Index: qPloneDropDownMenu/trunk/browser/sections.pt
===================================================================
--- qPloneDropDownMenu/trunk/browser/sections.pt	(revision 372)
+++ qPloneDropDownMenu/trunk/browser/sections.pt	(revision 372)
@@ -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: qPloneDropDownMenu/trunk/config.py
===================================================================
--- qPloneDropDownMenu/trunk/config.py	(revision 1)
+++ qPloneDropDownMenu/trunk/config.py	(revision 372)
@@ -1,52 +1,12 @@
-from Products.CMFCore import CMFCorePermissions
+try:
+    from Products.CMFCore import permissions
+except ImportError:
+    from Products.CMFCore import CMFCorePermissions as permissions
  
-VIEW_PERMISSION = CMFCorePermissions.ManagePortal
+MANAGE_PERMISSION = permissions.ManagePortal
 
 PROJECT_NAME = 'qPloneDropDownMenu'
 UNIQUE_ID = "portal_dropdownmenu"
-SKINS_DIR = 'skins'
-
-GLOBALS = globals()
 
 PROPERTY_SHEET = 'dropdownmenu_properties'
-MENU_HTML = '''<ul><li><a class="first-item" href="http://www.bmc.com">Home</a></li><li><a href="http://www.bmc.com/products/">Solutions &amp; Products</a><ul>
-        <li><a href="http://www.bmc.com/BMC/Common/Templates/hou_generic_tab/0,,19052_34957721,00.html">Business Service Management</a></li>
-        <li><a href="http://www.bmc.com/BMC/Common/Templates/hou_generic_tab/0,,19052_34829607,00.html">Best Practices &amp; Compliance</a></li>
-        <li><a href="http://www.bmc.com/BMC/Common/Templates/hou_generic_tab/0,,19052_34830527,00.html">Small &amp; Mid-Sized Business </a></li>
-        <li><a href="http://www.bmc.comBMC/Common/Templates/hou_generic_tab/0,3846,19052_34818399,00.html">Industry Solutions</a></li>
-        <li><a href="http://www.bmc.com/BMC/Products/CDA/hou_Products_Index/0,2830,19052_23655657,00.html">Product Families</a></li>
-        <li><a href="http://www.bmc.com/BMC/Common/CDA/hou_Page_Generic/0,3465,19052_19432,00.html">Services</a></li>
-        <li><a href="http://www.bmc.com/products/productlist/0,,19052,00.html">Product List A to Z</a></li>
-        <li><a href="http://www.bmc.com/BMC/Products/CDA/hou_Products_Index/0,2830,19052_23655660,00.html">Downloads &amp; Resources</a></li>
-        <li><a href="http://www.bmc.com/pricelist/">Global Pricing</a></li>  	  
-      </ul></li><li><a href="http://www.bmc.com/partners/">Partners</a><ul>
-        <li><a href="http://www.bmc.com/BMC/Partners/CDA/hou_Partner_Generic/0,3319,5377102_5379132,00.html">Find a Partner</a></li>
-        <li><a href="http://www.bmc.com/BMC/Partners/CDA/hou_Partner_Generic/0,3319,5377102_5379134,00.html">Become a Partner</a></li>
-        <li><a href="http://www.bmc.com/BMC/Partners/CDA/hou_Partner_Generic/0,3317,5377102_5379136,00.html">Find a Market Zone Product</a></li>
-      </ul></li><li><a href="http://www.bmc.com/support_home">Support</a><ul>
-        <li><a href="http://www.bmc.com/info_center_support/overview/0,3252,19097_4736148,00.html">Case Tracking &amp; Reporting</a></li>
-        <li><a href="http://www.bmc.com/support/vantive_bridge.cfm?path=http://selfserve.bmc.com/support/Forms/frmResolutionSearch.asp">Knowledge Database</a></li>
-        <li><a href="http://www.bmc.com/info_center_support/overview/0,3252,19097_4736152,00.html">My Support Admin</a></li>
-        <li><a href="http://www.bmc.com/info_center_support/overview/0,3252,19097_4736150,00.html">PTFs, FTP &amp; Installation</a></li>
-        <li><a href="http://www.bmc.com/info_center_support/overview/0,3252,19097_4736154,00.html">Policies &amp; Guidelines</a></li>
-        <li><a href="http://www.bmc.com/info_center_support/overview/0,3252,19097_4736144,00.html">Product Lists &amp; Manuals</a></li>
-        <li><a href="http://www.bmc.com/info_center_support/overview/0,3252,19097_4718041,00.html">Support Contacts</a></li>
-        <li><a href="http://www.bmc.com/info_center_support/All_News/0,2560,19097,00.html">Support News</a></li>
-      </ul></li><li><a href="http://shop.bmc.com/">Store</a><ul>
-        <li><a href="http://shop.bmc.com/shopping_support.cfm">Shopping Support</a></li>
-        <li><a href="http://shop.bmc.com/licensing.cfm">Licensing Information</a></li>
-        <li><a href="http://shop.bmc.com/download.cfm">Download Facility</a></li>
-        <li><a href="http://shop.bmc.com/retrieve_cart.cfm">Retrieve Your Quote</a></li>
-      </ul></li><li><a href="http://www.bmc.com/BMC/Common/CDA/hou_Page_Generic/0,,11629550_11650861_11651561,00.html?c=products_header&amp;n=education_linksupport_homet=11503">Education</a><ul>
-        <li><a href="http://www.bmc.com/BMC/Common/CDA/hou_Page_Generic/0,3465,11629550_11650863,00.html">Certification Program</a></li>
-        <li><a href="http://www.bmc.com/BMC/Common/CDA/hou_Page_Generic/0,3465,11629550_11681301,00.html">Placement Tests</a></li>
-        <li><a href="http://www.bmc.com/BMC/Common/CDA/hou_Page_Generic/0,3465,11629550_11651556,00.html">Product Education</a></li>
-      </ul></li><li><a href="http://www.bmc.com/BMC/Common/CDA/hou_Page_Detail/0,3464,9926222_10667925,00.html">Communities</a><ul>
-        <li><a href="http://www.bmc.com/BMC/Common/CDA/hou_Page_Detail/0,3464,9926222_10636326,00.html">Thought Leadership Council</a></li>
-        <li><a href="http://www.bmc.com/BMC/Common/CDA/hou_Page_Generic/0,3465,9926222_33961809,00.html">Enterprise Leadership</a></li>
-        <li><a href="http://talk.bmc.com/">Blogs &amp; Podcasts @TalkBMC</a></li>
-        <li><a href="http://www.bmc.com/BMC/Common/CDA/hou_Page_Detail/0,3464,9926222_33455235,00.html">External Communities</a></li>
-        <li><a href="http://www.bmc.com/BMC/Common/CDA/hou_Page_Detail/0,3464,9926222_10636328,00.html">User Groups</a></li>
-        <li><a href="http://devcon.bmc.com/">Developer Connection</a></li>
-        <li><a href="http://www.bmc.com/BMC/Common/Views/hou_vw_redirect_url/0,3411,9926222_34207904,00.html">Partner Network Login</a></li>
-      </ul></li></ul>'''
+PROPERTY_FIELD = 'menu'
Index: qPloneDropDownMenu/trunk/configure.zcml
===================================================================
--- qPloneDropDownMenu/trunk/configure.zcml	(revision 372)
+++ qPloneDropDownMenu/trunk/configure.zcml	(revision 372)
@@ -0,0 +1,20 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:cmf="http://namespaces.zope.org/cmf"
+    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+    i18n_domain="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"
+      />
+
+    <cmf:registerDirectory name="qPloneDropDownMenu"/>
+
+    <include package=".browser" />
+
+</configure>
Index: qPloneDropDownMenu/trunk/profiles/default/actionicons.xml
===================================================================
--- qPloneDropDownMenu/trunk/profiles/default/actionicons.xml	(revision 372)
+++ qPloneDropDownMenu/trunk/profiles/default/actionicons.xml	(revision 372)
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<action-icons xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+    i18n:domain="qPloneDropDownMenu">
+ <action-icon category="controlpanel" action_id="qPloneDropDownMenu"
+              title="Drop Down Menu" priority="0"
+              icon_expr="qplonedropdownmenu.gif"
+              i18n:attributes="title"/>
+</action-icons>
Index: qPloneDropDownMenu/trunk/profiles/default/browserlayer.xml
===================================================================
--- qPloneDropDownMenu/trunk/profiles/default/browserlayer.xml	(revision 372)
+++ qPloneDropDownMenu/trunk/profiles/default/browserlayer.xml	(revision 372)
@@ -0,0 +1,4 @@
+<layers>
+  <layer name="qPloneDropDownMenu"
+         interface="Products.qPloneDropDownMenu.browser.interfaces.IQPloneDropDownMenuLayer" />
+</layers>
Index: qPloneDropDownMenu/trunk/profiles/default/controlpanel.xml
===================================================================
--- qPloneDropDownMenu/trunk/profiles/default/controlpanel.xml	(revision 372)
+++ qPloneDropDownMenu/trunk/profiles/default/controlpanel.xml	(revision 372)
@@ -0,0 +1,16 @@
+<?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=""
+    url_expr="string:${portal_url}/prefs_dropdownmenu_edit_form"
+    visible="True" i18n:attributes="title">
+  <permission>Manage portal</permission>
+ </configlet>
+ <configlet title="CSS Hover" action_id="csshover"
+    appId="qPloneDropDownMenu" category="Products" condition_expr=""
+    url_expr="string:${portal_url}/prefs_csshover_edit_form"
+    visible="True" i18n:attributes="title">
+  <permission>Manage portal</permission>
+ </configlet>
+</object>
Index: qPloneDropDownMenu/trunk/profiles/default/cssregistry.xml
===================================================================
--- qPloneDropDownMenu/trunk/profiles/default/cssregistry.xml	(revision 372)
+++ qPloneDropDownMenu/trunk/profiles/default/cssregistry.xml	(revision 372)
@@ -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: qPloneDropDownMenu/trunk/profiles/default/import_steps.xml
===================================================================
--- qPloneDropDownMenu/trunk/profiles/default/import_steps.xml	(revision 372)
+++ qPloneDropDownMenu/trunk/profiles/default/import_steps.xml	(revision 372)
@@ -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: qPloneDropDownMenu/trunk/profiles/default/metadata.xml
===================================================================
--- qPloneDropDownMenu/trunk/profiles/default/metadata.xml	(revision 372)
+++ qPloneDropDownMenu/trunk/profiles/default/metadata.xml	(revision 372)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>0.2</version>
+</metadata>
Index: qPloneDropDownMenu/trunk/profiles/default/qplonedropdownmenu_various.txt
===================================================================
--- qPloneDropDownMenu/trunk/profiles/default/qplonedropdownmenu_various.txt	(revision 372)
+++ qPloneDropDownMenu/trunk/profiles/default/qplonedropdownmenu_various.txt	(revision 372)
@@ -0,0 +1,1 @@
+The qplonedropdownmenu steps are run if this file is present in the profile
Index: qPloneDropDownMenu/trunk/profiles/default/skins.xml
===================================================================
--- qPloneDropDownMenu/trunk/profiles/default/skins.xml	(revision 372)
+++ qPloneDropDownMenu/trunk/profiles/default/skins.xml	(revision 372)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<object name="portal_skins" meta_type="Plone Skins Tool" allow_any="False"
+   cookie_persistence="False" default_skin="Plone Default"
+   request_varname="plone_skin">
+ <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: qPloneDropDownMenu/trunk/profiles/default/toolset.xml
===================================================================
--- qPloneDropDownMenu/trunk/profiles/default/toolset.xml	(revision 372)
+++ qPloneDropDownMenu/trunk/profiles/default/toolset.xml	(revision 372)
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<tool-setup>
+ <required tool_id="portal_dropdownmenu"
+           class="Products.qPloneDropDownMenu.DropDownMenuTool"/>
+</tool-setup>
Index: qPloneDropDownMenu/trunk/setuphandlers.py
===================================================================
--- qPloneDropDownMenu/trunk/setuphandlers.py	(revision 372)
+++ qPloneDropDownMenu/trunk/setuphandlers.py	(revision 372)
@@ -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: qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/csshover_save.cpy
===================================================================
--- qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/csshover_save.cpy	(revision 1)
+++ qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/csshover_save.cpy	(revision 372)
@@ -38,3 +38,5 @@
     message += "For activating csshover.css customize ploneCustom.css and add <dtml-var csshover.css> line before <dtml-var drop_down.css>"
 
-return state.set(status='success', portal_status_message=message)
+context.plone_utils.addPortalMessage(message)
+
+return state.set(status='success')
Index: qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/drop_down.css.dtml
===================================================================
--- qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/drop_down.css.dtml	(revision 1)
+++ qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/drop_down.css.dtml	(revision 372)
Index: qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/dropdownmenu_edit.cpy
===================================================================
--- qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/dropdownmenu_edit.cpy	(revision 1)
+++ qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/dropdownmenu_edit.cpy	(revision 372)
@@ -6,12 +6,26 @@
 ##bind state=state
 ##bind subpath=traverse_subpath
-##parameters=menu=None, RESPONSE=None
+##parameters=menu
 ##title=
 ##
 
-REQUEST=context.REQUEST
+from Products.CMFCore.utils import getToolByName
 
-properties = context.portal_properties.dropdownmenu_properties
-properties.manage_editProperties(REQUEST)
+# some checks whether dropdown properties exist
+pp = getToolByName(context, 'portal_properties')
+if 'dropdownmenu_properties' not in pp.objectIds():
+    context.plone_utils.addPortalMessage('Dropdown menu property sheet does not exist. Please, firstly regenerate menu before editing it.',
+                                         type='error')
+    return state.set(status='failure')
 
-return state.set(status='success', portal_status_message='DropDown Menu updated.')
+
+properties = pp.dropdownmenu_properties
+if not properties.hasProperty('menu'):
+    context.plone_utils.addPortalMessage('menu field does not exist in dropdown menu property sheet. Please, firstly regenerate menu before editing it.',
+                                         type='error')
+    return state.set(status='failure')
+
+# do actual work
+properties.manage_changeProperties(menu=menu)
+context.plone_utils.addPortalMessage('DropDown Menu updated.')
+return state.set(status='success')
Index: qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/dropdownmenu_update.cpy
===================================================================
--- qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/dropdownmenu_update.cpy	(revision 1)
+++ qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/dropdownmenu_update.cpy	(revision 372)
@@ -9,8 +9,8 @@
 ##title=
 ##
-request = container.REQUEST
-RESPONSE =  request.RESPONSE
 
-context.portal_dropdownmenu.regenerateMenu()
+from Products.CMFCore.utils import getToolByName
 
-return state.set(status='success', portal_status_message='DropDown Menu regenerated.')
+getToolByName(context, 'portal_dropdownmenu').regenerateMenu()
+context.plone_utils.addPortalMessage('DropDown Menu regenerated.')
+return state.set(status='success')
Index: qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/dropdownmenu_update.cpy.metadata
===================================================================
--- qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/dropdownmenu_update.cpy.metadata	(revision 1)
+++ qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/dropdownmenu_update.cpy.metadata	(revision 372)
Index: qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/global_sections.pt
===================================================================
--- qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/global_sections.pt	(revision 1)
+++ 	(revision )
@@ -1,21 +1,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
-      i18n:domain="plone">
-
-<body>
-
-  <!-- THE SECTION TABS DEFINITION -->
-
-   <div metal:define-macro="portal_tabs"
-        tal:omit-tag="">
-      <h5 class="hiddenStructure" i18n:translate="heading_sections">Sections</h5>
-     <div id="portal-globalnav">
-       <div class="csshover">
-         <ul>
-           <span tal:replace="structure portal/portal_properties/dropdownmenu_properties/menu | string:qPloneDropDownMenu broken" />
-           <li class="invisibleHeightKeeper">&nbsp;</li>
-         </ul>
-       </div>
-     </div>
-   </div>
-</body>
-</html>
Index: qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/prefs_csshover_edit_form.cpt.metadata
===================================================================
--- qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/prefs_csshover_edit_form.cpt.metadata	(revision 1)
+++ qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/prefs_csshover_edit_form.cpt.metadata	(revision 372)
@@ -7,3 +7,5 @@
 [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: qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/prefs_dropdownmenu_edit_form.cpt
===================================================================
--- qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/prefs_dropdownmenu_edit_form.cpt	(revision 1)
+++ qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/prefs_dropdownmenu_edit_form.cpt	(revision 372)
@@ -18,16 +18,15 @@
        tal:attributes="href string: $portal_url/plone_control_panel"
        i18n:translate="label_up_to_plone_setup">
-    Up to Plone Setup
+      Up to Plone Setup
     </a>
 
     <div class="documentDescription"
          i18n:translate="description_plonedropdownmenu">
-    Plone Drop Down Menu ...
+      Plone Drop Down Menu ...
     </div>
 
     <h2>Post-install instructions</h2>
 
-    <p>Congratulations, you've installed Plone Drop Down Menu product from 
-    Quintagroup.</p>
+    <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
@@ -40,42 +39,49 @@
           tal:attributes="action string:${here/absolute_url}/${template/getId}" >
 
-     <div class="formControls" align="right"
-             tal:define="process_creation request/process_creation|nothing;">
-         <input class="context"
-                tabindex=""
-                type="submit"
-                value="Regenerate Menu"
-                name="form.button.Regenerate"
-                i18n:attributes="value"
-                tal:attributes="tabindex tabindex/next" />
-     </div>
+      <div class="formControls" align="right"
+           tal:define="process_creation request/process_creation|nothing;">
+          <input class="context"
+                 tabindex=""
+                 type="submit"
+                 value="Regenerate Menu"
+                 name="form.button.Regenerate"
+                 i18n:attributes="value"
+                 tal:attributes="tabindex tabindex/next" />
+      </div>
 
-     <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"
-                   tabindex=""
-                   name="menu"
-                   id="menu"
-                   tal:content="portal/portal_properties/dropdownmenu_properties/menu"
-                   tal:attributes="tabindex tabindex/next;"
-                   >Portal Tabs</textarea>
-     </div>
+      <dl class="portalMessage warning"
+          tal:condition="not: portal/portal_properties/dropdownmenu_properties/menu|nothing">
+        <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="formControls"
-             tal:define="process_creation request/process_creation|nothing;">
-         <input class="context"
-                tabindex=""
-                type="submit"
-                value="Save"
-                name="form.button.Save"
-                i18n:attributes="value"
-                tal:attributes="tabindex tabindex/next" />
-     </div>
+      <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"
+                    tabindex=""
+                    name="menu"
+                    id="menu"
+                    tal:content="portal/portal_properties/dropdownmenu_properties/menu|string:"
+                    tal:attributes="tabindex tabindex/next;">Portal Tabs</textarea>
+      </div>
 
-     <input type="hidden" name="form.submitted" value="1" />
+      <div class="formControls"
+           tal:define="process_creation request/process_creation|nothing;">
+        <input class="context"
+               tabindex=""
+               type="submit"
+               value="Save"
+               name="form.button.Save"
+               i18n:attributes="value"
+               tal:attributes="tabindex tabindex/next" />
+      </div>
+
+      <input type="hidden" name="form.submitted" value="1" />
     </form>
 
Index: qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/prefs_dropdownmenu_edit_form.cpt.metadata
===================================================================
--- qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/prefs_dropdownmenu_edit_form.cpt.metadata	(revision 1)
+++ qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/prefs_dropdownmenu_edit_form.cpt.metadata	(revision 372)
@@ -8,8 +8,11 @@
 validators..Save=validate_dropdownmenu_edit
 validators..Regenerate=validate_dropdownmenu_edit
+validators=validate_dropdownmenu_edit
 
 [actions]
 action.success..Save=traverse_to:string:dropdownmenu_edit
 action.success..Regenerate=redirect_to:string:dropdownmenu_update
+action.success=traverse_to:string:dropdownmenu_edit
 action.failure..Save=traverse_to:string:prefs_dropdownmenu_edit_form
 action.failure..Regenerate=traverse_to:string:prefs_dropdownmenu_edit_form
+action.failure=traverse_to:string:prefs_dropdownmenu_edit_form
Index: qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/validate_dropdownmenu_edit.vpy
===================================================================
--- qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/validate_dropdownmenu_edit.vpy	(revision 1)
+++ qPloneDropDownMenu/trunk/skins/qPloneDropDownMenu/validate_dropdownmenu_edit.vpy	(revision 372)
@@ -11,4 +11,5 @@
 
 if state.getErrors():
-    return state.set(status='failure', portal_status_message='Please correct the indicated errors.')
+    context.plone_utils.addPortalMessage('Please correct the indicated errors.')
+    return state.set(status='failure')
 return state
Index: qPloneDropDownMenu/trunk/utils.py
===================================================================
--- qPloneDropDownMenu/trunk/utils.py	(revision 1)
+++ qPloneDropDownMenu/trunk/utils.py	(revision 372)
@@ -1,6 +1,38 @@
 """ Utility functions """
+
+from zope.component import getMultiAdapter
+
+from OFS.DTMLMethod import addDTMLMethod
+
+from Products.CMFCore.utils import getToolByName
+from Products.CMFPlone.migrations.migration_util import safeEditProperty
+from Products.CMFCore.Expression import Expression, createExprContext
+
+from config import PROPERTY_FIELD, PROPERTY_SHEET
 
 def addCSS(container, sheetId, title, csshovering):
     """ Add DTML Method object to portal root """
-    from OFS.DTMLMethod import addDTMLMethod
     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()
+    portal_tabs_view = getMultiAdapter((site, site.REQUEST), name='portal_tabs_view')
+    portal_tabs = portal_tabs_view.topLevelTabs(actions=actions)
+
+    # dump to html
+    value = ''
+    for tab in portal_tabs:
+        value += '<li id="portaltab-%s" class="plain">\n' % tab['id']
+        value += '  <a href="%s" accesskey="t" title="%s">%s</a>\n' % (tab['url'], tab['description'], tab['name'])
+        value += '</li>\n'
+
+    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')
Index: qPloneDropDownMenu/trunk/version.txt
===================================================================
--- qPloneDropDownMenu/trunk/version.txt	(revision 1)
+++ 	(revision )
@@ -1,1 +1,0 @@
-0.1.11
