Site control panel
==================

First some initial setup code:

    >>> from zope.component import getUtility
    >>> from Products.CMFCore.interfaces import IPropertiesTool
    >>> ptool = getUtility(IPropertiesTool)
    >>> self.loginAsManager()
    >>> types_configlet_url = 'http://nohost/plone/@@types-controlpanel'

Viewing the types control panel
-----------------------------

Choose a standard type and hit cancel:

    >>> self.browser.open(types_configlet_url)
    >>> self.browser.getControl(name='type_id').value = ['Link']
    >>> self.browser.getControl('Cancel').click()

We should be back on the Site Setup screen:

    >>> 'plone_control_panel' in self.browser.url
    True

Navigate back to the type control panel and select link again:
    
    >>> self.browser.getLink('Types').click()
    >>> self.browser.getControl(name='type_id').value = ['Link']
    >>> self.browser.getForm(action=types_configlet_url).submit()

Enable allow commenting for the link type

    >>> self.browser.getControl('Allow comments').selected = True
    >>> self.browser.getControl('Apply Changes').click()
    
Navigate back to link type to confirm setting.  Also confirm that the
redirect_links setting is enabled:

    >>> self.browser.getLink('Types').click()
    >>> self.browser.getControl(name='type_id').value = ['Link']
    >>> self.browser.getForm(action=types_configlet_url).submit()
    >>> self.browser.contents
    '...Globally addable...
    ...Allow comments...
    ...Visible in searches...
    ...<input id="redirect_links"...
    ...type="checkbox"...
    ...name="redirect_links:boolean"...
    ...checked="checked" />...
    ...<label for="redirect_links">...
    ...Redirect immediately to link target...'

For only the link type, we have a special setting that controls whether the 
view will redirect to the remote url for users without editing permissions:

    >>> self.browser.open(types_configlet_url)
    >>> self.browser.getControl(name='type_id').value = ['News Item']
    >>> self.browser.getForm(action=types_configlet_url).submit()
    >>> '<input id="redirect_links"' in self.browser.contents
    False
    
We'll confirm that we can disable the redirect_links option for the link type:

    >>> self.browser.getControl(name='type_id').value = ['Link']
    >>> self.browser.getForm(action=types_configlet_url).submit()
    >>> '<input id="redirect_links"' in self.browser.contents
    True
    >>> self.browser.getControl(name='redirect_links:boolean').value = False
    >>> self.browser.getControl('Apply Changes').click()
    
Now the redirect links checkbox option is no longer checked:

    >>> self.browser.open(types_configlet_url)
    >>> self.browser.getControl(name='type_id').value = ['Link']
    >>> self.browser.getForm(action=types_configlet_url).submit()
    >>> self.browser.contents
    '...Globally addable...
    ...Allow comments...
    ...Visible in searches...
    ...<input id="redirect_links"...
    ...type="checkbox"...
    ...class="noborder"...
    ...name="redirect_links:boolean" />...
    ...<label for="redirect_links">...
    ...Redirect immediately to link target...'

This change should modify the redirect_links value in site_properties as well:

    >>> ptool.site_properties.redirect_links
    False

