ad_general_links_list db on_what_id on_which_table item { module " " } { submodule " " } { return_url " " }What it does:
Generates the list of links for this item with the appropriate add/edit links for the general links system.Defined in: /web/philip/tcl/ad-general-links.tcl
Source code:
set user_id [ad_get_user_id]
if [empty_string_p $return_url] {
set return_url [ns_conn url]?[export_ns_set_vars "url"]
}
set approved_clause "and slm.approved_p = 't' and gl.approved_p = 't'"
set return_string ""
set selection [ns_db select $db "select gl.link_id, gl.url, link_title, link_description, slm.map_id, slm.creation_time, first_names || ' ' || last_name as linker_name, u.user_id as link_user_id
from general_links gl, site_wide_link_map slm, users u
where gl.link_id = slm.link_id
and on_what_id = $on_what_id
and on_which_table = '[DoubleApos $on_which_table]' $approved_clause
and slm.creation_user = u.user_id"]
set first_iteration_p 1
while {[ns_db getrow $db $selection]} {
set_variables_after_query
if $first_iteration_p {
append return_string "<h4>Links</h4>\n"
set first_iteration_p 0
}
append return_string "<blockquote>\n[ad_general_link_format $link_id $url $link_title $link_description]"
append return_string "<br><br>-- <a href=\"/shared/community-member?user_id=$link_user_id\">$linker_name</a>"
if { !$first_iteration_p } {
append return_string "</blockquote>\n"
}
}
append return_string "
<center>
<A HREF=\"/general-links/link-add?[export_url_vars on_which_table on_what_id item module return_url]\">Add a link</a>
</center>
"