css_generate_complete_css

one of the documented procedures in this installation of the ACS
Usage:
css_generate_complete_css   db
What it does:
assumes scope is set in the callers enironment. if scope=user it assumes user_id is set in callers environment and if scope=group it assumes that group_id is set in callers environment. it returns generate css string from the css_complete table matching the provided scope
Defined in: /web/philip/tcl/display-defs.tcl

Source code:



    upvar scope scope 

    if { $scope=="group" } {
	upvar group_id group_id
    }
    if { $scope=="user" } {
	upvar user_id user_id
    }

    set selection [ns_db select $db "
    select selector, property, value
    from css_complete
    where [ad_scope_sql]"]
    
    set_variables_after_query
    
    set counter 0
    set last_selector ""
    while { [ns_db getrow $db $selection] } {
	set_variables_after_query
	
	if { [string compare $selector $last_selector]!=0 } {
	    if { $counter > 0 } {
		append css " \}\n" 
	    }
	    append css "$selector \{ "
	} else {
	    append css "; "
	}
	
	append css "$property: $value"
	
	incr counter
	set last_selector $selector
    }
    
    if { $counter > 0 } {
	append css " \}"
    } else {
	# no css values supplied
	set css ""
    }

    return $css


philg@mit.edu