# /tcl/ad-defs.tcl # # Author: philg@arsdigita.com on April 2, 1998 # # ArsDigita Community System Defs # # ad-defs.tcl.preload,v 3.6.2.3 2000/03/17 05:56:11 aure Exp # ----------------------------------------------------------------------------- # The following two procs use the ACS release tag to return the # current version and release date. In a development copy of acs the # release tag is not expanded and these procs return "development" and # "not released". In a released copy the tag is expanded to something # of the form "acs-major-minor-release-Ryyyymmdd", and these procs # return e.g. "3.1.3" and "February 20, 2000". util_report_library_entry proc ad_acs_version {} { set release_tag {acs-3-2-2-R20000412} regexp "acs-(\[0-9\]+)-(\[0-9\]+)-(\[0-9\]+)" \ $release_tag match major minor release if {[info exists major] && [info exists minor] && [info exists release]} { return "$major.$minor.$release" } else { return "development" } } proc ad_acs_release_date {} { set release_tag {acs-3-2-2-R20000412} regexp "R(\[0-9\]+)" $release_tag match release_date if {[info exists release_date]} { set year [string range $release_date 0 3] set month [string range $release_date 4 5] set day [string range $release_date 6 7] return [util_AnsiDatetoPrettyDate "$year-$month-$day"] } else { return "not released" } } # for setting cookies that will work on, e.g., # http://www.foobar.com and http://foobar.com # we need to push user through the cookie-chain.tcl # pipeline and use both host names explicitly proc ad_need_cookie_chain_p {} { return [ad_parameter NeedCookieChainP] } proc ad_cookie_chain_first_host_name {} { return [ad_parameter CookieChainFirstHostName] } proc ad_cookie_chain_second_host_name {} { return [ad_parameter CookieChainSecondHostName] } # this is a technical person who can fix problems proc ad_host_administrator {} { return [ad_parameter HostAdministrator] } # set to return 1 if there is a graphics site proc ad_graphics_site_available_p {} { return [ad_parameter GraphicsSiteAvailableP] } # this is the main name of the Web service that you're offering # on top of the Arsdigita Web Publishing System proc ad_system_name {} { return [ad_parameter SystemName] } # This is the URL of a user's private workspace on the system, usually # /pvt/home.tcl proc ad_pvt_home {} { return "/pvt/home.tcl" } proc ad_pvt_home_name {} { return "workspace" } proc ad_pvt_home_link {} { return "your workspace" } proc ad_site_home_link {} { if { [ad_get_user_id] != 0 } { return "[ad_system_name]" } else { # we don't know who this person is return "[ad_system_name]" } } # person who owns the service # this person would be interested in user feedback, etc. proc ad_system_owner {} { return [ad_parameter SystemOwner] } # a human-readable name of the publisher, suitable for # legal blather proc ad_publisher_name {} { return [ad_parameter PublisherName] } proc ad_url {} { # this will be called by email alerts. Do not use ns_conn location return [ad_parameter SystemURL] } proc ad_present_user {user_id name} { return "$name" } proc ad_admin_present_user {user_id name} { return "$name" } proc_doc ad_header {page_title {extra_stuff_for_document_head ""}} "writes HEAD, TITLE, and BODY tags to start off pages in a consistent fashion" { return [openacs_header $page_title] if {[ad_parameter MenuOnUserPagesP pdm] == 1} { return [ad_header_with_extra_stuff $page_title [ad_pdm] [ad_pdm_spacer]] } else { return [ad_header_with_extra_stuff $page_title $extra_stuff_for_document_head] } } proc_doc ad_header_with_extra_stuff {page_title {extra_stuff_for_document_head ""} {pre_content_html ""}} "This is the version of the ad_header that accepts extra stuff for the document head and pre-page content html" { set html "
$extra_stuff_for_document_head