fs::category_links (private)

 fs::category_links -object_id object_id -folder_id folder_id \
    [ -selected_category_id selected_category_id ] [ -fs_url fs_url ] \
    [ -joinwith joinwith ]

Defined in packages/file-storage/tcl/file-storage-procs.tcl

Switches:
-object_id (required)
the file storage object_id whose category list we creating
-folder_id (required)
the folder the category link should shearch on
-selected_category_id (optional)
the category that has been selected and for which a link to return to the folder without that category limitation should exist
-fs_url (optional)
is the file storage url for which these links will be created - defaults to the current package_url
-joinwith (optional, defaults to ", ")
allows you to join the link list with something other than the default ", "
Returns:
a list of category_links to filter the supplied folder for a given category

Partial Call Graph (max 5 caller/called nodes):
%3 packages/file-storage/www/file.tcl packages/file-storage/ www/file.tcl fs::category_links fs::category_links packages/file-storage/www/file.tcl->fs::category_links packages/file-storage/www/folder-chunk.tcl packages/file-storage/ www/folder-chunk.tcl packages/file-storage/www/folder-chunk.tcl->fs::category_links packages/file-storage/www/simple.tcl packages/file-storage/ www/simple.tcl packages/file-storage/www/simple.tcl->fs::category_links ad_conn ad_conn (public) fs::category_links->ad_conn category::get_mapped_categories category::get_mapped_categories (public) fs::category_links->category::get_mapped_categories category::get_name category::get_name (public) fs::category_links->category::get_name export_vars export_vars (public) fs::category_links->export_vars

Testcases:
No testcase defined.
Source code:
    if { $fs_url eq "" } {
        set fs_url [ad_conn package_url]
    }
    set selected_found_p 0
    set categories [list]
    foreach category_id [category::get_mapped_categories $object_id] {
        set name [category::get_name $category_id]
        if { $category_id eq $selected_category_id } {
            set selected_found_p 1
            set href [export_vars -base $fs_url -url {folder_id}]
            lappend categories "[ns_quotehtml $name] <a href=\"[ns_quotehtml $href]\">(x)</a>"
        } else {
            set href [export_vars -base $fs_url -url {folder_id category_id}]
            lappend categories "<a href=\"[ns_quotehtml $href]\">[ns_quotehtml $name]</a>"
        }
    }
    if { [string is false $selected_found_p] && $selected_category_id ne "" } {
        # we need to show the link to remove this category file at the
        # top of the folder
        set href [export_vars -base $fs_url -url {folder_id}]
        set name [category::get_name $selected_category_id]
        lappend categories "[ns_quotehtml $name] <a href=\"[ns_quotehtml $href]\">(x)</a>"
    }
    return [join $categories $joinwith]
Generic XQL file:
packages/file-storage/tcl/file-storage-procs.xql

PostgreSQL XQL file:
packages/file-storage/tcl/file-storage-procs-postgresql.xql

Oracle XQL file:
packages/file-storage/tcl/file-storage-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: