openacs_bootstrap3_theme::resource_info (private)

 openacs_bootstrap3_theme::resource_info [ -version version ]

Defined in packages/openacs-bootstrap3-theme/tcl/init-procs.tcl

Get information about available version(s) of the bootstrap packages. The goal is to deliver resources either from the local filesystem, or from CDN.

Switches:
-version (optional)
Returns:
dict containing resourceDir, resourceName, cdn, cdnHost, prefix, cssFiles, jsFiles and extraFiles.

Partial Call Graph (max 5 caller/called nodes):
%3 packages/openacs-bootstrap3-theme/www/sitewide-admin/download.tcl packages/openacs-bootstrap3-theme/ www/sitewide-admin/download.tcl openacs_bootstrap3_theme::resource_info openacs_bootstrap3_theme::resource_info packages/openacs-bootstrap3-theme/www/sitewide-admin/download.tcl->openacs_bootstrap3_theme::resource_info packages/openacs-bootstrap3-theme/www/sitewide-admin/index.tcl packages/openacs-bootstrap3-theme/ www/sitewide-admin/index.tcl packages/openacs-bootstrap3-theme/www/sitewide-admin/index.tcl->openacs_bootstrap3_theme::resource_info acs_package_root_dir acs_package_root_dir (public) openacs_bootstrap3_theme::resource_info->acs_package_root_dir parameter::get_global_value parameter::get_global_value (public) openacs_bootstrap3_theme::resource_info->parameter::get_global_value

Testcases:
No testcase defined.
Source code:
        variable parameter_info
        if {$version eq ""} {
            dict with parameter_info {
                set version [::parameter::get_global_value  -package_key $package_key  -parameter $parameter_name  -default $default_value]
            }
        }

        #
        # Provide paths for loading either via resources or CDN
        #
        set resourceDir [acs_package_root_dir openacs-bootstrap3-theme/www/resources/bootstrap]
        set cdn         //maxcdn.bootstrapcdn.com/bootstrap

        if {[file exists $resourceDir/$version]} {
            set prefix  /resources/openacs-bootstrap3-theme/bootstrap/$version
            set cdnHost ""
            set cspMap ""
        } else {
            set prefix $cdn/$version
            set cdnHost maxcdn.bootstrapcdn.com
            dict set cspMap urn:ad:css:bootstrap3 [subst {
                style-src $cdnHost
                font-src $cdnHost
            }]
            dict set cspMap urn:ad:js:bootstrap3 [subst {
                script-src $cdnHost
            }]
        }

        lappend result  resourceName "Bootstrap 3"  resourceDir $resourceDir  cdn $cdn  cdnHost $cdnHost  prefix $prefix  cssFiles {css/bootstrap.min.css}  jsFiles  {js/bootstrap.min.js}  extraFiles {
                fonts/glyphicons-halflings-regular.woff
                fonts/glyphicons-halflings-regular.woff2
                fonts/glyphicons-halflings-regular.ttf
                css/bootstrap.min.css.map
            }  cspMap $cspMap  urnMap {
                urn:ad:css:bootstrap3 css/bootstrap.min.css
                urn:ad:js:bootstrap3  js/bootstrap.min.js
            }  vulnerabilityCheck {service snyk library bootstrap}  configuredVersion $version

        return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: