#  WAeUP CMS Product
#  Archetypes based content types for the West African e-University Project web portal
#  Copyright (c) 2005 WAeUP
#
#  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
#

from Products.CMFCore.utils import getToolByName

def modifyMTool(self):
    mt=getToolByName(self, 'portal_membership')

    acts=list(mt.listActions())
    selection=[acts.index(a) for a in acts]
    mt.deleteActions(selection)

    mt.addAction('mystuff'
                ,'My Folder'
                ,'string:${portal/portal_membership/getHomeUrl}/folder_contents'
                ,'python: member and portal.portal_membership.getHomeFolder()'
                ,'View'
                ,'user'
                , visible=1)
    mt.addAction('preferences'
                ,'My Preferences'
                ,'string:${portal_url}/plone_memberprefs_panel'
                ,'member'
                ,'View'
                ,'user'
                , visible=1)
    mt.addAction('login'
                ,'Secure Login'
                ,'python:portal_url.replace("http:","https:")+"/login_form"'
                ,'not: member'
                ,'View'
                ,'user'
                , visible=1)
    mt.addAction('login'
                ,'Unsecure Login'
                ,'python:portal_url.replace("https:","http:")+"/login_form"'
                ,'not: member'
                ,'View'
                ,'user'
                , visible=1)
    mt.addAction('plone_setup'
                ,'Site Setup'
                ,'string:${portal_url}/plone_control_panel'
                ,''
                ,'Manage portal'
                ,'user'
                , visible=1)
    mt.addAction('svnrepos'
                ,'SVN Repositories'
                ,'string:https://svn.waeup.org/repos/'
                ,'member'
                ,'View'
                ,'user'
                , visible=0)
    mt.addAction('svninter'
                ,'SVN Web Interface'
                ,'string:https://svn.waeup.org/'
                ,'member'
                ,'View'
                ,'user'
                , visible=1)
    mt.addAction('trac'
                ,'Trac'
                ,'string:https://trac.waeup.org/'
                ,'member'
                ,'View'
                ,'user'
                , visible=1)
    mt.addAction('ldap'
                ,'LDAP Server'
                ,'string:https://ldap.waeup.org/'
                ,'member'
                ,'View'
                ,'user'
                , visible=1)
    mt.addAction('lists'
                ,'Mailing Lists'
                ,'string:http://lists.waeup.org/mailman/listinfo'
                ,''
                ,'View'
                ,'user'
                , visible=1)
    mt.addAction('webmail'
                ,'Webmail'
                ,'string:https://mail.waeup.org'
                ,'member'
                ,'View'
                ,'user'
                , visible=1)
    mt.addAction('logout'
                ,'Log out'
                ,'python:portal_url.replace("https:","http:")+"/logout"'
                ,'member'
                ,'View'
                ,'user'
                , visible=1)
