Index: openacs-4/packages/datamanager-portlet/www/datamanager-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/datamanager-portlet/www/datamanager-admin-portlet.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/datamanager-portlet/www/datamanager-admin-portlet.tcl 22 Jun 2006 14:47:00 -0000 1.2 @@ -0,0 +1,48 @@ +# +# Copyright (C) 2004 University XYZ +# +# This file is part of dotLRN. +# +# dotLRN 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. +# +# dotLRN 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. +# + +ad_page_contract { + The display logic for the datamanager admin portlet + + @author Luis de la Fuente (lfuente@it.uc3m.es) + @creation-date 2005-07-07 + @version $Id: datamanager-admin-portlet.tcl,v 0.1 2005/07/07 + +} -properties { +} + +array set config $cf +set user_id [ad_conn user_id] +set list_of_package_ids $config(package_id) + +if {[llength $list_of_package_ids] > 1} { + # We have a problem! + return -code error "There should be only one instance of datamanager for admin purposes" +} + +set package_id [lindex $list_of_package_ids 0] + +set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0] + + +set site_admin [acs_user::site_wide_admin_p] + +if {$site_admin eq 1} { + append url "admin/index" +} + + +ad_return_template