Index: openacs-4/packages/acs-developer-support/www/css-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/www/css-edit.tcl,v
diff -u -N -r1.6 -r1.7
--- openacs-4/packages/acs-developer-support/www/css-edit.tcl 5 Jan 2018 22:59:57 -0000 1.6
+++ openacs-4/packages/acs-developer-support/www/css-edit.tcl 15 May 2018 12:29:10 -0000 1.7
@@ -30,10 +30,7 @@
set package_id [ad_conn package_id]
set css_path "$css_location"
set fp [open $file_location "r"]
- set css_content ""
- while { [gets $fp line] >= 0 } {
- append css_content "$line \n"
- }
+ set css_content [read $fp]
close $fp
set item_id [content::item::get_id_by_name -name $file_location -parent_id $package_id]
@@ -58,13 +55,10 @@
}
append revision_html ""
file stat $file_location file_stat_arr
- # mcordova: ugly things until I figure out how to do that in a
- # better way...
- set item_id [content::item::get_id_by_name -name $file_location -parent_id $package_id]
ns_log Notice " * * * the file $file_location (cr_item_id: $item_id) has that modif time: \[$file_stat_arr(mtime)\]"
- #todo compare file mtime with live revision time
- ## if they are not the same date, show user a warning
- # recommening to make a new revision...
+ # todo compare file mtime with live revision time if they
+ # are not the same date, show user a warning recommending
+ # to make a new revision...
} else {
append revision_html "no revisions yet"
}
@@ -91,8 +85,8 @@
# Write the new content to the file
if {[file exists $file_location] && [file extension $file_location] eq ".css"} {
- set fp [open "${file_location}" "w"]
- puts $fp "$css_content"
+ set fp [open $file_location "w"]
+ puts -nonewline $fp $css_content
close $fp
}