Notizie

1 2 3 4
Data EventoUltimo AggiornamentoTitolo
20-03-202320-03-2023After LIFE Conservation Plan
20-03-202320-03-2023Layman's Report
22-07-202222-07-2022Formazione Continua
29-09-202006-10-2020Convegno finale di progetto
29-09-202006-10-2020Convegno finale di progetto
28-09-202029-09-2020LAYMAN'S REPORT - RAPPORTO DIVULGATIVO
11-09-202022-09-2020Summit per la Gestione sostenibile della Risorsa idrica
11-09-202015-09-2020Summit per la Gestione sostenibile della Risorsa idrica
14-02-202026-03-2020Deframmentato un tratto fluviale di circa 18 km sul Torrente Enza
14-10-201926-03-2020Recupero delle specie autoctone di barbo: i numeri del LIFE BARBIE
02-08-201903-12-2019Deframmentazione di un Tratto di Fiume Enza
13-12-201807-12-2018Idee e proposte per una gestione più sostenibile della risorsa idrica e per la valorizzazione del fiume Parma e del fiume Taro
16-11-201806-11-2018Erasmus+ e LIFE una sinergia di successo per la valorizzazione delle aree protette
24-07-201824-07-2018Rilasci avannotti di Barbo in ambiente naturale
10-05-201810-05-2018BarboLino in visita alla mostra il Terzo Giorno !
14-04-201828-03-2018La cultura degli animali: una nuova frontiera per la conoscenza e la conservazione della biodiversita
15-02-201815-03-2018BARBIE & Life for LASCA
29-11-201715-03-2018Platform meeting sulle Specie Aliene Invasive (IAS)
20-11-201715-03-2018IV visita di monitoraggio al progetto
20-06-201722-09-2017TAVOLO DI CONFRONTO per la Gestione sostenibile della risorsa idrica relativo all'ambito Enza: qui il programma

class "Gallery" already exists while executing "::itcl::class Gallery { inherit Barbie private variable galleria_d private variable gallery_sect_menu private variabl..." (in namespace eval "::rwdatas" script line 3) invoked from within "namespace eval ::rwdatas { ::itcl::class Gallery { inherit Barbie private variable galleria_d private variable gallery_s..."

OUTPUT BUFFER:

source [file join $rweb_root tcl before.tcl] # # -- gallery.tcl # # datasource per pagina gestione delle # # package require Barbie package require rwbinary namespace eval ::rwdatas { ::itcl::class Gallery { inherit Barbie private variable galleria_d private variable gallery_sect_menu private variable gallery_menu private common thumb_h_size 200 private common gallery_dir private common thumbnails_dir private method page_handled {v p} public method willHandle {arglist keyvar} public method fetchData {key reassigned_key} public method init {args} public method menu_list {page} #public method to_url {lm} { return [Barbie::to_url $lm] } #public method will_provide {keyword reassigned_key} public proc create_thumbnail {photo} public proc gallery {} public proc gallery_latest_entries {dbhandle nentries} public proc thumbnail_fs_path {photo} public proc thumbnail_path {photo} public proc thumbnail_exists {photo} } ::itcl::body Gallery::thumbnail_exists {photo} { return [file exists [thumbnail_fs_path $photo]] } ::itcl::body Gallery::thumbnail_fs_path {photo} { return [file join galleria thumbnails ${photo}] } ::itcl::body Gallery::thumbnail_path {photo} { return [::rivetweb::rewrite_generic_path [join [list galleria thumbnails $photo] "/"]] } ::itcl::body Gallery::create_thumbnail {photo} { set thumbnail [thumbnail_fs_path $photo] set photo_name [file join $gallery_dir $photo] if {[catch {exec gm convert $photo_name -geometry $thumb_h_size $thumbnail} e]} { ::rivet::apache_log_error err "Error creating thumbnail $thumbnail: $e" return -code error -errorcode thumbnail_creation_error $e $e } } # -- page_handled # # ::itcl::body Gallery::page_handled {varsqs page_key} { upvar $page_key p foreach p [list photo gallery] { if {[dict exists $varsqs $p]} { return true } } return false } ::itcl::body Gallery::willHandle {arglist keyvar} { upvar $keyvar key set varsqs [dict create {*}$arglist] if {[dict exists $varsqs photo]} { set photo_filename [dict get $varsqs photo] # # proposed change #set key "view_photo_[regsub -all {[^[:alnum:]]} ${photo_filename}]" # set key "view_photo_[::rivet::escape_string ${photo_filename}]" return -code break -errorcode rw_ok } elseif {[dict exists $varsqs gallery]} { set key "view_gallery" return -code break -errorcode rw_ok } return -code continue -errorcode rw_continue } ::itcl::body Gallery::fetchData {key reassigned_key} { upvar $reassigned_key rkey set rkey $key set key [::rivet::unescape_string $key] switch -regexp -matchvar photo_name -- $key { view_photo_(.+) { $this check_class ::rwpage::Photo set photo_name [lindex $photo_name 1] set p [::rwpage::Photo ::#auto $key $gallery_dir $photo_name] #::rivet::apache_log_error notice "new instance of $p ::rwpage::Photo" } view_gallery { $this check_class ::rwpage::Gallery set p [::rwpage::Gallery ::#auto $key $gallery_dir] #::rivet::apache_log_error notice "new instance of $p ::rwpage::Gallery" } default { set p "" } } #::rivet::apache_log_error notice "new instance of ::rwpage::Photo (binary: [$p binary_content])" return $p } ::itcl::body Gallery::gallery_latest_entries {dbhandle nentries} { set q "select g.*,s.descrizione from galleria g " append q "join sezioni s on s.sectionid=g.sezione " append q "order by g.creazione desc limit $nentries;" set galleria_d [dict create] $dbhandle forall $q photo_a { dict set galleria_d [incr idx] [dict create {*}[array get photo_a]] } return $galleria_d } ::itcl::body Gallery::gallery {} { set q "select g.*,s.descrizione from galleria g " append q "join sezioni s on s.sectionid=g.sezione order by s.descrizione,s.ordine,g.ordine;" set galleria_d [dict create] $::barbie::dbhandle forall $q photo_a { set photo_name $photo_a(filename) set sezione $photo_a(sezione) set descrizione $photo_a(descrizione) unset photo_a(sezione) unset photo_a(filename) unset photo_a(descrizione) dict set galleria_d $sezione photos $photo_name \ [dict create {*}[array get photo_a]] dict set galleria_d $sezione descrizione $descrizione } return $galleria_d } ::itcl::body Gallery::init {args} { Barbie::init $args set gallery_dir [file join $::rivetweb::site_base galleria] if {![file exists $gallery_dir]} { file mkdir $gallery_dir } set thumbnails_dir [file join $gallery_dir thumbnails] if {![file exists $thumbnails_dir]} { file mkdir $thumbnails_dir } set galleria_d [::rwdatas::Gallery::gallery] $this register_class ::rwpage::Photo $this register_class ::rwpage::Gallery } ::itcl::body Gallery::menu_list {page} { set page_class [$page info class] if {($page_class == "::rwpage::Gallery") || \ ($page_class == "::rwpage::Photo")} { set mm $::rivetweb::menumodel set lm $::rivetweb::linkmodel set galleria_d [::rwdatas::Gallery::gallery] if {[dict size $galleria_d] == 0} { return [Datasource::menu_list $page] } catch {$gallery_menu destroy} set gallery_menu [$mm create_menu sezioni_galleria none normal] $gallery_menu assign title "Photo Gallery" en $gallery_menu assign title "Galleria Fotografica" it dict for {sectid section_d} $galleria_d { set gallery_section [$lm create Gallery "" \ [list it [dict get $galleria_d $sectid descrizione]] \ [dict create gallery 1 section $sectid] ""] $gallery_menu add_link $gallery_section } return [list evidenza $gallery_menu] } else { return {} } } } package provide Gallery 1.0 source [file join $rweb_root tcl after.tcl]