Index: openacs-4/packages/acs-templating/acs-templating.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/acs-templating.info,v diff -u -r1.66.2.23 -r1.66.2.24 --- openacs-4/packages/acs-templating/acs-templating.info 4 Apr 2022 09:46:54 -0000 1.66.2.23 +++ openacs-4/packages/acs-templating/acs-templating.info 7 Apr 2022 12:38:36 -0000 1.66.2.24 @@ -9,7 +9,7 @@ f t - + OpenACS Templating library. 2021-09-15 @@ -27,8 +27,9 @@ GPL version 2 3 - + + Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-templating/tcl/style-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-templating/tcl/tag-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/tag-init.tcl,v diff -u -r1.49.2.15 -r1.49.2.16 --- openacs-4/packages/acs-templating/tcl/tag-init.tcl 30 Dec 2021 14:45:14 -0000 1.49.2.15 +++ openacs-4/packages/acs-templating/tcl/tag-init.tcl 7 Apr 2022 12:38:36 -0000 1.49.2.16 @@ -1035,6 +1035,68 @@ template::adp_append_code "append __adp_output {}" } + +namespace eval ::template::icon { + set ::template::icon::map { + bootstrap-icons { + edit pencil-square + radio-checked check2-circle + radio-unchecked circle + checkbox-checked check2-square + checkbox-unchecked square + } + glyphicons { + edit pencil + radio-checked record + radio-unchecked /shared/images/radio.gif + checkbox-checked check + checkbox-unchecked unchecked + } + classic { + edit /shared/images/Edit16.gif + trash /shared/images/Delete16.gif + radio-checked /shared/images/radiochecked.gif + radio-unchecked /shared/images/radio.gif + checkbox-checked /shared/images/checkboxchecked.gif + checkbox-unchecked /shared/images/checkbox.gif + arrow-down /resources/acs-subsite/arrow-down.gif + arrow-up /resources/acs-subsite/arrow-up.gif + } + } +} + +template::tag adp:icon { params } { + set d [::template::icon \ + -name [ns_set iget $params name] \ + -class [ns_set iget $params class] \ + -style [ns_set iget $params style] \ + -title [ns_set iget $params title]] + dict with d { + template::adp_append_string $HTML + if {$cmd ne ""} { + template::adp_append_code $cmd + } + } +} + +template::tag adp:toggle_button { chunk params } { + # + # In case we need to determine the toolit upon every call, we have + # to reconsider (e.g. add the toolkit to the namespace for + # compiled code, like template::code::adp::...) + # + set data [expr {[template::toolkit] eq "bootstrap5" ? "data-bs" : "data"}] + append value \ + " +} + + # Local variables: # mode: tcl # tcl-indent-level: 4