index.tcl

Does not contain a contract.

Location:
/packages/acs-core-docs/www/index.tcl

Related Files

[ hide source ] | [ make this the default ]

File Contents

set found_p 0
set HTML ""         
        if {[db_table_exists apm_package_types]} {
            db_foreach get_installed_pkgs "select package_key, pretty_name from apm_package_types order by upper(pretty_name) " {
                if { ! $found_p } { 
                   set found_p 1
                   append HTML "\n<h3>Installed Packages</h3>\n<ul>\n"
                }
            set index_page [lindex [glob -nocomplain \
                          "[acs_package_root_dir $package_key]/www/doc/index.*"] 0]
            
                if { [file exists $index_page] } {
                if {$pretty_name ne ""} {
                   append HTML "<li><a href=\"/doc/$package_key/\">$pretty_name</a>\n"
                } else {
                   append HTML "<li><a href=\"/doc/$package_key/\">$package_key</a>\n"
                }
                } else { 
                    if {$pretty_name ne ""} {
                   append HTML "<li>$pretty_name\n"
                } else {
                   append HTML "<li>$package_key\n"
                    }
                }
            }
        }
        
        
        if {!$found_p} {
            append HTML "<li> No installed packages.\n"
        }
            append HTML "</ul>"
        
        set packages [ad_core_docs_uninstalled_packages]
        if { $packages ne "" } { 
          append HTML "\n<h3>Uninstalled packages</h3>\n<ul>"
          foreach {key name} $packages { 
            set index_page [lindex [glob -nocomplain \
                          "[acs_package_root_dir $key]/www/doc/index.*"] 0]
            if { [file exists $index_page] } {
               append HTML "<li> <a href=\"$key\">$name</a>\n"
            } else { 
               append HTML "<li> $name\n"
            }
          }
          append HTML "\n</ul>"
        }