I tested using the storage utility (IViewletSettingsStorage
) and it worked fine for me, but I removed the viewlet from all skins and not only from the default:
(Pdb) from zope.component import queryUtility
(Pdb) from plone.app.viewletmanager.interfaces import IViewletSettingsStorage
(Pdb) storage = queryUtility(IViewletSettingsStorage)
(Pdb) storage._hidden
{u'Plone Default': {u'plone.portalfooter': (u'doormat.footer.bare',), u'plone.portalheader': (u'plone.global_sections',)}, u'Plone Classic Theme': {u'plone.belowcontent': (u'plone.belowcontenttitle.keywords',), u'plone.portalfooter': (u'plone.site_actions',), u'plone.portalheader': (u'plone.personal_bar', u'plone.app.i18n.locales.languageselector'), u'plone.abovecontent': (u'plone.path_bar',)}, 'Sunburst Theme': {'plone.portalheader': ()}}
(Pdb) storage._hidden.keys()
[u'Plone Default', u'Plone Classic Theme', 'Sunburst Theme']
(Pdb) storage.getHidden('plone.portalheader', 'Plone Default')
(u'plone.global_sections',)
(Pdb) storage.getHidden('plone.portalheader', 'Plone Classic Theme')
(u'plone.personal_bar', u'plone.app.i18n.locales.languageselector')
(Pdb) storage.getHidden('plone.portalheader', 'Sunburst Theme')
(u'plone.global_sections',)
(Pdb) storage.setHidden(u'plone.portalheader', u'Plone Default', ())
(Pdb) storage.getHidden(u'plone.portalheader', u'Plone Default')
()
(Pdb) storage.setHidden(u'plone.portalheader', u'Sunburst Theme', ())
(Pdb) storage.getHidden(u'plone.portalheader', u'Sunburst Theme')
()
(Pdb) storage._hidden
{u'Plone Default': {u'plone.portalfooter': (u'doormat.footer.bare',), u'plone.portalheader': ()}, u'Plone Classic Theme': {u'plone.belowcontent': (u'plone.belowcontenttitle.keywords',), u'plone.portalfooter': (u'plone.site_actions',), u'plone.portalheader': (u'plone.personal_bar', u'plone.app.i18n.locales.languageselector'), u'plone.abovecontent': (u'plone.path_bar',)}, 'Sunburst Theme': {'plone.portalheader': ()}}
you have to figure out how to get the names of all available skins to avoid accessing a private attribute (_hidden
).