Index: /quintagroup.dropdownmenu/trunk/MANIFEST.in
===================================================================
--- /quintagroup.dropdownmenu/trunk/MANIFEST.in	(revision 1194)
+++ /quintagroup.dropdownmenu/trunk/MANIFEST.in	(revision 1194)
@@ -0,0 +1,4 @@
+recursive-include docs *
+recursive-include quintagroup *
+global-exclude *.pyc
+global-exclude *.mo
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/configure.zcml
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/configure.zcml	(revision 1193)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/configure.zcml	(revision 1194)
@@ -31,5 +31,8 @@
 
   <!-- Register resources -->
-
+  <browser:resource
+      name="drop_down.css"
+      file="resources/drop_down.css"
+      />
 
 </configure>
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/resources/drop_down.css
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/resources/drop_down.css	(revision 1193)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/resources/drop_down.css	(revision 1194)
@@ -1,4 +1,3 @@
-/* <dtml-with base_properties> (do not remove this :) */
-/* <dtml-call "REQUEST.set('portal_url', portal_url())"> (not this either :) */
+/* DropDown Menu Styles */
 
 body {
@@ -16,7 +15,7 @@
 
 #portal-globalnav li {
-        margin: 0;  
+        margin: 0;
         padding: 0;
-        border: 0; 
+        border: 0;
         display: inline;
         float: left;
@@ -87,5 +86,5 @@
 #portal-globalnav .csshover ul li ul li a:hover,
 #portal-globalnav .csshover ul li ul li:hover a {
-        color: &dtml-globalFontColor;;
+        color: #436976;
 }
 
@@ -96,5 +95,5 @@
 
 #portal-globalnav ul li ul {
-        border: &dtml-borderWidth; &dtml-borderStyle; &dtml-globalBorderColor;;
+        border: 1px solid #8cacbb;
         padding-bottom: 1px;
         overflow: hidden;
@@ -102,5 +101,5 @@
 
 #portal-globalnav .csshover ul li:hover ul li:hover ul  a {
-        color: &dtml-globalFontColor;;
+        color: #436976;
 }
 
@@ -108,42 +107,42 @@
 
 #portal-globalnav ul {
-        font-size:8pt;
-        list-style-type:none;
-        list-style-image:none;
+        font-size: 8pt;
+        list-style-type: none;
+        list-style-image: none;
 }
 
 #portal-globalnav ul li {
-        padding:0;
-        margin:0;
-        line-height:normal;
+        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;;
+        background-color: #dee7ec;
+        color: #436976;
 }
 
 #portal-globalnav .csshover ul li:hover ul {
-        margin:0;
-        border: &dtml-borderWidth; &dtml-borderStyle; &dtml-globalBorderColor;;
-        background-color: &dtml-backgroundColor;;
-        overflow:visible;
+        margin: 0;
+        border: 1px solid #8cacbb;
+        background-color: White;
+        overflow: visible;
 }
 
 #portal-globalnav .csshover ul li:hover ul li {
-        padding:0;
-        margin:0;
+        padding: 0;
+        margin: 0;
 }
 
 #portal-globalnav .csshover ul li:hover ul li a {
-        color: &dtml-globalFontColor; !important;
-        margin:0;
-        line-height:normal;
-        width:auto;
+        color: #436976 !important;
+        margin: 0;
+        line-height: normal;
+        width: auto;
 }
 
 #portal-globalnav .csshover ul li ul li a:hover {
-        background-image:none;
+        background-image: none;
 }
 
@@ -154,10 +153,7 @@
 /*Configlet styles************************************************************/
 
-.ieVisible {display:none;}
+.ieVisible {display: none;}
 
 * html .ieHidden {display: none;}
 
 * html .ieVisible {display: block;}
-
-
-/* </dtml-with> (do not remove this either :) */
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections.pt
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections.pt	(revision 1193)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections.pt	(revision 1194)
@@ -1,9 +1,12 @@
-<tal:tabs i18n:domain="plone">
+<tal:tabs tal:condition="view/portal_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 class="globalSections">
+                <li tal:replace="structure view/createMenu">
+                    DropDown Menu
+                </li>
+                <li class="invisibleHeightKeeper">&nbsp;</li>
             </ul>
         </div>
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections_recurse.pt
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections_recurse.pt	(revision 1194)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections_recurse.pt	(revision 1194)
@@ -0,0 +1,39 @@
+<tal:master define="level options/level|python:0;
+                    children options/children | nothing"
+            i18n:domain="plone">
+
+<metal:main define-macro="sections_main">
+<tal:navitem repeat="node children">
+<li tal:define="show_children   node/show_children;
+                children        node/children;
+                item_url        node/getURL;
+                item_icon       node/item_icon;
+                is_current      node/currentItem;
+                is_in_path      node/currentParent;
+                li_class        python:is_current and ' globalSectionsCurrentNode selected' or '';
+                li_extr_class   python:is_in_path and ' globalSectionsItemInPath' or '';
+                li_extr_class   python:(is_in_path and not is_current) and li_extr_class + ' selected' or li_extr_class;
+                li_extr_class   python:(not (is_in_path or is_current)) and li_extr_class + ' plain' or li_extr_class;
+                li_folder_class python:show_children and ' globalSectionsFolderish' or '';"
+    tal:attributes="class string:globalSectionsItem visualNoMarker${li_class}${li_extr_class}${li_folder_class}">
+
+    <tal:level define="item_class string:state-${node/normalized_review_state}">
+    <a tal:attributes="href python:item_url;
+                       title node/Description;
+                       class string:$item_class${li_class}${li_extr_class}${li_folder_class}">
+        <img tal:replace="structure item_icon/html_tag" />
+        <span tal:content="node/Title">Selected Item Title</span>
+    </a>
+
+    <ul tal:attributes="class python:'globalSections globalSectionsLevel'+str(level)"
+        tal:condition="python: len(children) > 0 and show_children">
+        <li tal:replace="structure python:view.recurse(children=children, level=level+1)">
+            SubMenu
+        </li>
+    </ul>
+    </tal:level>
+
+</li>
+</tal:navitem>
+</metal:main>
+</tal:master>
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py	(revision 1193)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py	(revision 1194)
@@ -1,14 +1,137 @@
-from zope.component import getMultiAdapter
+# -*- coding: utf-8 -*-
+from Acquisition import aq_inner
+
+from zope.component import getMultiAdapter, queryUtility
 
 from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+from Products.CMFCore.utils import getToolByName
+from Products.CMFCore.interfaces import IAction, IActionCategory
+from Products.CMFCore.ActionInformation import ActionInfo
 
+from plone.memoize.instance import memoize
 from plone.app.layout.viewlets import common
+from plone.registry.interfaces import IRegistry
+
+from quintagroup.dropdownmenu.interfaces import IDropDownMenuSettings
 
 
 class GlobalSectionsViewlet(common.GlobalSectionsViewlet):
     index = ViewPageTemplateFile('templates/sections.pt')
+    recurse = ViewPageTemplateFile('templates/sections_recurse.pt')
 
     def update(self):
-        super(GlobalSectionsViewlet, self).update()
+        # we may need some previously defined variables
+        #super(GlobalSectionsViewlet, self).update()
+
+        # prepare to gather portal tabs
+        tabs = []
+        context = aq_inner(self.context)
+        self.conf = conf = self._settings()
+        self.tool = getToolByName(context, 'portal_actions')
+
+        # fetch actions-based tabs?
+        if conf.show_actions_tabs:
+            tabs.extend(self._actions_tabs())
+
+        # fetch content structure-based tabs?
+        if conf.show_content_tabs:
+            # put content-based actions before content structure-based ones?
+            if conf.content_before_actions_tabs:
+                tabs = self._content_tabs() + tabs
+            else:
+                tabs.extend(self._content_tabs())
+
+        # assign collected tabs eventually
+        self.portal_tabs = tabs
+
+    def _actions_tabs(self):
+        """Return tree of tabs based on portal_actions tool configuration"""
+        conf = self.conf
+        tool = self.tool
+        context = aq_inner(self.context)
+
+        # check if we have required root actions category inside tool
+        if conf.actions_category not in tool.objectIds():
+            return []
+
+        #category_ids = category.objectIds()
+        #selectedTabs = self.context.restrictedTraverse('selectedTabs')
+        ## try to find out selected subtab
+        #if tab['id'] == self.selected_portal_tab:
+            #selection = selectedTabs(None, None, tab['subtabs'])
+            #self.selected_sub_tab = selection['portal']
+        return self._subactions(tool._getOb(conf.actions_category), context)
+
+    def _subactions(self, category, object, level=0):
+        tabs = []
+        for info in self._actionInfos(category, object):
+            # prepare data for action
+            # TODO: implement current element functionality, maybe should be
+            #       done on a template level because of separate content and 
+            #       actions tabs are rendered separately
+            currentItem = False
+            currentParent = False
+            # TODO: adjust img tag
+            icon = info['icon'] and '<img src="%s" />' % info['icon'] or ''
+
+            # look up children for a given action
+            children = []
+            if level <= self.conf.actions_tabs_level:
+                # try to find out appropriate subcategory
+                subcat_id = self.conf.nested_category_prefix + info['id'] + \
+                         self.conf.nested_category_sufix
+                if subcat_id in category.objectIds():
+                    subcat = category._getOb(subcat_id)
+                    if IActionCategory.providedBy(subcat):
+                        children = self._subactions(subcat, object, level+1)
+
+            # make up final tab dictionary
+            tab = {'Title': info['title'],
+                   'Description': info['description'],
+                   'getURL': info['url'],
+                   'show_children': len(children) > 0,
+                   'children': children,
+                   'currentItem': currentItem,
+                   'currentParent': currentParent,
+                   'item_icon': {'html_tag': icon},
+                   'normalized_review_state': 'visible'}
+            tabs.append(tab)
+        return tabs
+
+    def _actionInfos(self, category, object, check_visibility=1,
+                     check_permissions=1, check_condition=1, max=-1):
+        """Return action infos for a given category"""
+        context = aq_inner(self.context)
+        ec = self.tool._getExprContext(object)
+        actions = [ActionInfo(action, ec) for action in category.objectValues()
+                    if IAction.providedBy(action)]
+
+        action_infos = []
+        for ai in actions:
+            if check_visibility and not ai['visible']:
+                continue
+            if check_permissions and not ai['allowed']:
+                continue
+            if check_condition and not ai['available']:
+                continue
+            action_infos.append(ai)
+            if max + 1 and len(action_infos) >= max:
+                break
+        return action_infos
+
+    def _content_tabs(self):
+        """Return tree of tabs based on content structure"""
+        return []
+
+    @memoize
+    def _settings(self):
+        """Fetch dropdown menu settings registry"""
+        registry = queryUtility(IRegistry)
+        return registry.forInterface(IDropDownMenuSettings)
+
+    def createMenu(self):
+        return self.recurse(children=self.portal_tabs, level=1)
+
+    def _old_update(self):
         context_state = getMultiAdapter((self.context, self.request),
                                         name=u'plone_context_state')
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/interfaces.py
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/interfaces.py	(revision 1193)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/interfaces.py	(revision 1194)
@@ -57,5 +57,6 @@
                       u"nested menu stops. 0 means no limit. 1 only includes "
                       u"the root folder."),
-        default=0)
+        default=0,
+        required=False)
 
     actions_category = schema.TextLine(
@@ -75,5 +76,6 @@
                       u"to 'pre_index_html_sub' will be looked up on the same "
                       u"level to get nested menu for 'index_html' action."),
-        default=u"")
+        default=u"",
+        required=False)
 
     nested_category_sufix = schema.TextLine(
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/profiles/default/cssregistry.xml
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/profiles/default/cssregistry.xml	(revision 1193)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/profiles/default/cssregistry.xml	(revision 1194)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
 <object name="portal_css" meta_type="Stylesheets Registry">
- <stylesheet title="DropDownMenu" cacheable="True" compression="safe" cookable="True"
+ <stylesheet title="DropDown Menu" cacheable="True" compression="safe" cookable="True"
      enabled="1" expression="" id="++resource++drop_down.css" media="screen"
      rel="stylesheet" rendering="import"/>
