Index: openacs-4/packages/photo-album/tcl/photo-album-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/tcl/photo-album-procs.tcl,v
diff -u -r1.19 -r1.20
--- openacs-4/packages/photo-album/tcl/photo-album-procs.tcl 6 Sep 2013 17:17:43 -0000 1.19
+++ openacs-4/packages/photo-album/tcl/photo-album-procs.tcl 14 Oct 2013 17:56:29 -0000 1.20
@@ -30,7 +30,7 @@
a new root folder is created automatically with appropriate permissions
If value has be previously requested, value pulled from cache
} {
- if [empty_string_p $package_id] {
+ if {$package_id eq ""} {
set package_id [ad_conn package_id]
}
return [util_memoize "pa_get_root_folder_internal $package_id"]
@@ -45,7 +45,7 @@
} {
set folder_id [db_string pa_root_folder "select photo_album.get_root_folder(:package_id) from dual"]
- if { [empty_string_p $folder_id] } {
+ if { $folder_id eq "" } {
set folder_id [pa_new_root_folder $package_id]
}
return $folder_id
@@ -59,7 +59,7 @@
code automatically when a new package instance is created.
} {
- if [empty_string_p $package_id] {
+ if {$package_id eq ""} {
set package_id [ad_conn package_id]
}
@@ -146,14 +146,14 @@
set root_folder_id [pa_get_root_folder]
if {$item_id == $root_folder_id} {
- if {![empty_string_p $final]} {
+ if {$final ne ""} {
return [list $final]
} else {
return {}
}
}
- if [empty_string_p $final] {
+ if {$final eq ""} {
# set start_id and final with a single trip to the database
db_1row get_start_and_final "select parent_id as start_id,
@@ -198,7 +198,7 @@
} {
constructs a filename for an image based on id and extention.
} {
- if {![empty_string_p $ext] && ![regexp {^\.} $ext foo]} {
+ if {$ext ne "" && ![regexp {^\.} $ext foo]} {
#add back the dot
set ext ".${ext}"
}
@@ -233,11 +233,11 @@
foreach dir $dir_list {
ns_log Debug "pa_assert_dir: Checking: $dir"
- if [empty_string_p $dir] {
+ if {$dir eq ""} {
continue
}
append needed_dir "/$dir"
- if ![file exists $needed_dir] {
+ if {![file exists $needed_dir]} {
ns_log Debug "pa_assert_dir: file mkdir $dir"
file mkdir $needed_dir
}
@@ -288,7 +288,7 @@
# Since index page accessed often, and the root_folder is within the package this avoids an unecessary
# trip to the database on a commonly accessed page.
- if {[string equal $content_type "content_folder"] && [string equal $item_id $root_folder]} {
+ if {$content_type eq "content_folder" && $item_id eq $root_folder} {
return "t"
} else {
return [db_string check_is_type_in_package "select decode((select 1
@@ -311,7 +311,7 @@
Grants a set of default privileges stored in parameter PrivilegeForCreator
on object id to user_id. If user_id is not specified, uses current user.
} {
- if {[empty_string_p $user_id]} {
+ if {$user_id eq ""} {
set user_id [ad_conn user_id]
}
set grant_list [split [parameter::get -parameter PrivilegeForCreator] ","]
@@ -415,8 +415,8 @@
list is in ascending order
} {
set images_per_page [parameter::get -parameter ThumbnailsPerPage]
- set start_index [expr $images_per_page * ($page-1)]
- set end_index [expr $start_index + ($images_per_page - 1)]
+ set start_index [expr {$images_per_page * ($page-1)}]
+ set end_index [expr {$start_index + ($images_per_page - 1)}]
return [lrange [pa_all_photos_in_album $album_id] $start_index $end_index]
}
@@ -464,7 +464,7 @@
} {
set rows_per_page [parameter::get -parameter ThumbnailsPerPage]
- set start_row [expr $rows_per_page*[expr $page-1]+1]
+ set start_row [expr $rows_per_page*[expr {$page-1}]+1]
set query "
select *
@@ -532,10 +532,10 @@
}
# what is the range about which to bracket
- set start [expr [lsearch -exact $ids $curr ] - $context]
+ set start [expr {[lsearch -exact $ids $curr ] - $context}]
- if {[expr $start + 2 * $context + 1] > $n_ids} {
- set start [expr $n_ids - 2 * $context - 1]
+ if {[expr {$start + 2 * $context + 1}] > $n_ids} {
+ set start [expr {$n_ids - 2 * $context - 1}]
}
if {$start < 0} {
set start 0
@@ -547,7 +547,7 @@
}
# context
- foreach id [lrange $ids $start [expr $start + 2 * $context]] {
+ foreach id [lrange $ids $start [expr {$start + 2 * $context}]] {
incr start
lappend out $id $start
}
@@ -571,24 +571,24 @@
creates an html fragment that allows user to navigate to any photo by number
next/previous
} {
- if { [empty_string_p $cur_id] || [llength $all_ids] < 2 } {
+ if { $cur_id eq "" || [llength $all_ids] < 2 } {
return ""
}
set cur_index [lsearch -exact $all_ids $cur_id]
- set prev_id [lindex $all_ids [expr $cur_index - 1]]
- set next_id [lindex $all_ids [expr $cur_index + 1]]
+ set prev_id [lindex $all_ids $cur_index-1]
+ set next_id [lindex $all_ids $cur_index+1]
set photo_nav_html ""
- if {![empty_string_p $what]} {
+ if {$what ne ""} {
set what " $what"
}
# append the 'prev' link
append photo_nav_html "
\n"
- if { ![empty_string_p $prev_id] } {
+ if { $prev_id ne "" } {
append photo_nav_html "\t
\n"
}
# append the 'next' link
- if { ![empty_string_p $next_id] } {
+ if { $next_id ne "" } {
append photo_nav_html "\t
\n"
}
@@ -597,7 +597,7 @@
set i 0
set last {}
foreach {id i} [pa_pagination_context_ids $cur_id $all_ids 4] {
- if {![empty_string_p $last] && [expr $last + 1] != $i} {
+ if {$last ne "" && [expr {$last + 1}] != $i} {
append photo_nav_html "•"
}
set last $i
@@ -625,7 +625,7 @@
of the function
} {
set tmp_dir [file join [file dirname $tmpfile] [ns_mktemp "$dest_dir_base-XXXXXX"]]
- if [catch { file mkdir $tmp_dir } errMsg ] {
+ if {[catch { file mkdir $tmp_dir } errMsg ]} {
ns_log Warning "pa_expand_archive: Error creating directory $tmp_dir: $errMsg"
return -code error "pa_expand_archive: Error creating directory $tmp_dir: $errMsg"
}
@@ -798,7 +798,7 @@
set peeraddr [ad_conn peeraddr]
# Create the tmp dir if needed
- if { [empty_string_p $package_id] } {
+ if { $package_id eq "" } {
set package_id [ad_conn package_id]
}
set tmp_path [parameter::get -parameter FullTempPhotoDir -package_id $package_id]
@@ -812,16 +812,16 @@
# Figure out what to call the file...
- if [empty_string_p $client_name] {
+ if {$client_name eq ""} {
set upload_name $image_file
} else {
set upload_name $client_name
}
- if {![empty_string_p $strip_prefix]} {
+ if {$strip_prefix ne ""} {
regsub "^$strip_prefix" $upload_name {} upload_name
}
- if ![regexp {([^/\\]+)$} $upload_name match client_filename] {
+ if {![regexp {([^/\\]+)$} $upload_name match client_filename]} {
# couldn't find a match
set client_filename $upload_name
}
@@ -836,9 +836,9 @@
# If we don't have a mime type we like we try to make a jpg or png
#
- if [empty_string_p $base_mime] {
+ if {$base_mime eq ""} {
set new_image [file join $tmp_path "tmp-[file rootname [file tail $image_file]]"]
- if {![empty_string_p $base_colors] && $base_colors < 257} {
+ if {$base_colors ne "" && $base_colors < 257} {
# convert it to a png
if {[catch {exec [parameter::get -parameter ImageMagickPath]/convert $image_file PNG:$new_image.png} errMsg]} {
ns_log Warning "pa_load_images: Failed convert to PNG for $image_file (magicktype $base_type)"
@@ -848,7 +848,7 @@
}
set image_file $new_image.png
set remove 1
- } elseif {![empty_string_p $base_colors] && $base_colors > 256} {
+ } elseif {$base_colors ne "" && $base_colors > 256} {
# convert it to a jpg
if {[catch {exec [parameter::get -parameter ImageMagickPath]/convert $image_file JPG:$new_image.jpg} errMsg]} {
ns_log Warning "pa_load_images: failed convert to JPG for $image_file (magicktype $base_type)"
@@ -866,15 +866,15 @@
foreach {base_bytes base_width base_height base_type base_mime base_colors base_quantum base_sha256} [pa_file_info $image_file] { break }
}
- if {[string equal $base_mime image/jpeg]} {
+ if {$base_mime eq "image/jpeg"} {
array set exif [pa_get_exif_data ${image_file}]
} else {
array unset exif
}
set BaseExt [string tolower $base_type]
- if [empty_string_p $base_mime] {
+ if {$base_mime eq ""} {
ns_log Debug "pa_load_images: invalid image type $image_file $type even after convert!"
continue
}
@@ -959,7 +959,7 @@
db_dml update_photo_data {}
}
- if $feedback_mode {
+ if {$feedback_mode} {
ns_write "
- Loading image $client_filename
@@ -1087,7 +1087,7 @@
set out(Flashused) 0
}
- if {![empty_string_p $out(Cameramake)]} {
+ if {$out(Cameramake) ne ""} {
set out(Film) Digital
}
@@ -1140,7 +1140,7 @@
@creation-date 2002-10-30
} {
- if {![empty_string_p $rotation] && ![string equal $rotation 0]} {
+ if {$rotation ne "" && $rotation ne "0" } {
set flop [list]
set files [list]
@@ -1169,7 +1169,7 @@
} errMsg
} else {
# flop images that need flopping.
- if {[string equal $rotation 90] || [string equal $rotation 270]} {
+ if {$rotation eq "90" || $rotation eq "270"} {
db_dml flop_image_size "update images set width = height, height = width where image_id in ([join $flop ,])"
}
}
@@ -1220,7 +1220,7 @@
} {
upvar $array row
- if {[empty_string_p $user_id]} {
+ if {$user_id eq ""} {
if {[ad_conn isconnected]} {
set user_id [ad_conn user_id]
} else {
Index: openacs-4/packages/photo-album/www/album-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-add.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/photo-album/www/album-add.tcl 6 Sep 2013 17:17:43 -0000 1.6
+++ openacs-4/packages/photo-album/www/album-add.tcl 14 Oct 2013 17:56:29 -0000 1.7
@@ -72,11 +72,11 @@
} on_error {
# most likely a duplicate name or a double click
- if [db_string duplicate_check "
+ if {[db_string duplicate_check "
select count(*)
from cr_items
where (item_id = :album_id or name = :name)
- and parent_id = :parent_id"] {
+ and parent_id = :parent_id"]} {
ad_return_complaint 1 "[_ photo-album._Either]"
} else {
ad_return_complaint 1 "[_ photo-album._We]"
Index: openacs-4/packages/photo-album/www/album-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-delete.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/photo-album/www/album-delete.tcl 6 Sep 2013 17:17:43 -0000 1.6
+++ openacs-4/packages/photo-album/www/album-delete.tcl 14 Oct 2013 17:56:29 -0000 1.7
@@ -34,7 +34,7 @@
permission::require_permission -object_id $album_id -privilege delete
permission::require_permission -object_id $parent_folder_id -privilege write
-if { [string equal $confirmed_p "t"] } {
+if {$confirmed_p == "t"} {
# they have confirmed that they want to delete the album
db_exec_plsql album_delete "
Index: openacs-4/packages/photo-album/www/album-export.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-export.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/photo-album/www/album-export.tcl 16 Jul 2010 19:54:16 -0000 1.4
+++ openacs-4/packages/photo-album/www/album-export.tcl 14 Oct 2013 17:56:29 -0000 1.5
@@ -17,7 +17,7 @@
set error_message ""
# Create the folder
-if {[empty_string_p $path]} {
+if {$path eq ""} {
db_1row get_album_data { select
cr.title as album_name,
Index: openacs-4/packages/photo-album/www/album-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-move.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/photo-album/www/album-move.tcl 6 Sep 2013 17:17:43 -0000 1.5
+++ openacs-4/packages/photo-album/www/album-move.tcl 14 Oct 2013 17:56:29 -0000 1.6
@@ -91,11 +91,11 @@
set folder_name [db_string folder_name "
select name from cr_items where item_id = :album_id"]
- if [db_string duplicate_check "
+ if {[db_string duplicate_check "
select count(*)
from cr_items
where name = :folder_name
- and parent_id = :new_folder_id"] {
+ and parent_id = :new_folder_id"]} {
ad_return_complaint 1 "[_ photo-album._Either_1]"
} else {
ad_return_complaint 1 "[_ photo-album._We]"
Index: openacs-4/packages/photo-album/www/album.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/photo-album/www/album.tcl 6 Sep 2013 17:17:43 -0000 1.5
+++ openacs-4/packages/photo-album/www/album.tcl 14 Oct 2013 17:56:29 -0000 1.6
@@ -52,11 +52,11 @@
db_1row get_album_info {}
# to move an album need write on album and write on parent folder
-set move_p [expr $write_p && $folder_write_p]
+set move_p [expr {$write_p && $folder_write_p}]
# to delete an album, album must be empty, need delete on album, and write on parent folder
-set has_children_p [expr [pa_count_photos_in_album $album_id] > 0]
-set delete_p [expr !($has_children_p) && $album_delete_p && $folder_write_p]
+set has_children_p [expr {[pa_count_photos_in_album $album_id] > 0}]
+set delete_p [expr {!($has_children_p) && $album_delete_p && $folder_write_p}]
# Did we get a msg id, if so display it at the top of the page
# TODO: JCD: We should remove it from vars so it does not propigate
Index: openacs-4/packages/photo-album/www/base-photo.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/base-photo.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/photo-album/www/base-photo.tcl 6 Sep 2013 17:17:43 -0000 1.6
+++ openacs-4/packages/photo-album/www/base-photo.tcl 14 Oct 2013 17:56:29 -0000 1.7
@@ -27,7 +27,7 @@
width:onevalue
}
-if {![string equal [parameter::get -parameter AllowBasePhotoAccessP] "t"]} {
+if {[parameter::get -parameter AllowBasePhotoAccessP] != "t" } {
ad_return_forbidden "[_ photo-album._No]"
ad_script_abort
}
Index: openacs-4/packages/photo-album/www/clipboard-ae.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/clipboard-ae.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/photo-album/www/clipboard-ae.tcl 18 Nov 2003 22:59:03 -0000 1.4
+++ openacs-4/packages/photo-album/www/clipboard-ae.tcl 14 Oct 2013 17:56:29 -0000 1.5
@@ -36,7 +36,7 @@
set title = :title
where collection_id = :collection_id"
} -after_submit {
- if {![empty_string_p $photo_id]} {
+ if {$photo_id ne ""} {
ad_returnredirect "clipboard-attach?photo_id=$photo_id&collection_id=$collection_id"
} else {
ad_returnredirect "clipboards"
Index: openacs-4/packages/photo-album/www/folder-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-add.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/photo-album/www/folder-add.tcl 6 Sep 2013 17:17:43 -0000 1.5
+++ openacs-4/packages/photo-album/www/folder-add.tcl 14 Oct 2013 17:56:29 -0000 1.6
@@ -91,11 +91,11 @@
} on_error {
# most likely a duplicate name or a double click
- if [db_string duplicate_check "
+ if {[db_string duplicate_check "
select count(*)
from cr_items
where (item_id = :folder_id or name = :name)
- and parent_id = :parent_id"] {
+ and parent_id = :parent_id"]} {
ad_return_complaint 1 "[_ photo-album._Either_2]"
} else {
ad_return_complaint 1 "[_ photo-album._We]"
Index: openacs-4/packages/photo-album/www/folder-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-delete.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/photo-album/www/folder-delete.tcl 6 Sep 2013 17:17:44 -0000 1.6
+++ openacs-4/packages/photo-album/www/folder-delete.tcl 14 Oct 2013 17:56:29 -0000 1.7
@@ -42,7 +42,7 @@
permission::require_permission -object_id $folder_id -privilege delete
permission::require_permission -object_id $parent_folder_id -privilege write
-if { [string equal $confirmed_p "t"] } {
+if {$confirmed_p == "t"} {
# they have confirmed that they want to delete the folder
db_exec_plsql folder_delete "
Index: openacs-4/packages/photo-album/www/folder-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-move.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/photo-album/www/folder-move.tcl 6 Sep 2013 17:17:44 -0000 1.5
+++ openacs-4/packages/photo-album/www/folder-move.tcl 14 Oct 2013 17:56:29 -0000 1.6
@@ -99,11 +99,11 @@
set folder_name [db_string folder_name "
select name from cr_items where item_id = :folder_id"]
- if [db_string duplicate_check "
+ if {[db_string duplicate_check "
select count(*)
from cr_items
where name = :folder_name
- and parent_id = :new_folder_id"] {
+ and parent_id = :new_folder_id"]} {
ad_return_complaint 1 "[_ photo-album._Either_3]"
} else {
ad_return_complaint 1 "[_ photo-album._We]"
Index: openacs-4/packages/photo-album/www/latest-photo.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/latest-photo.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/latest-photo.tcl 8 Aug 2006 21:27:09 -0000 1.2
+++ openacs-4/packages/photo-album/www/latest-photo.tcl 14 Oct 2013 17:56:29 -0000 1.3
@@ -40,10 +40,10 @@
# Let's add the leading/tailing slashes so the url's will always work
set url [string trim $url]
- if {![string equal [string index $url 0] "/"]} {
+ if {[string index $url 0] ne "/" } {
set url "/$url"
}
- if {![string equal [string index $url end] "/"]} {
+ if {[string index $url end] ne "/" } {
set url "$url/"
}
Index: openacs-4/packages/photo-album/www/photo-add-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-add-2.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/photo-album/www/photo-add-2.tcl 6 Sep 2013 17:17:44 -0000 1.8
+++ openacs-4/packages/photo-album/www/photo-add-2.tcl 14 Oct 2013 17:56:29 -0000 1.9
@@ -32,7 +32,7 @@
foreach {base_bytes base_width base_height base_type base_mime base_colors base_quantum base_sha256} $photo_info { break }
- if [empty_string_p $base_mime] {
+ if {$base_mime eq ""} {
set base_mime invalid
}
Index: openacs-4/packages/photo-album/www/photo-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-delete.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/photo-album/www/photo-delete.tcl 6 Sep 2013 17:17:44 -0000 1.6
+++ openacs-4/packages/photo-album/www/photo-delete.tcl 14 Oct 2013 17:56:29 -0000 1.7
@@ -32,7 +32,7 @@
permission::require_permission -object_id $photo_id -privilege delete
permission::require_permission -object_id $album_id -privilege write
-if { [string equal $confirmed_p "t"] } {
+if {$confirmed_p == "t"} {
# they have confirmed that they want to delete the photo
# delete pa_photo object which drops all associate images and schedules binaries to be deleted
Index: openacs-4/packages/photo-album/www/photo-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-edit.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/photo-album/www/photo-edit.tcl 6 Sep 2013 17:17:44 -0000 1.6
+++ openacs-4/packages/photo-album/www/photo-edit.tcl 14 Oct 2013 17:56:29 -0000 1.7
@@ -71,7 +71,7 @@
db_1row get_photo_info { *SQL* }
db_1row get_thumbnail_info { *SQL* }
-if [empty_string_p $live_revision] {
+if {$live_revision eq ""} {
set checked_string "checked"
} else {
set checked_string ""
@@ -112,7 +112,7 @@
db_exec_plsql set_live_revision {}
- if $hide {
+ if {$hide} {
db_dml update_hides { *SQL* }
}
} on_error {
Index: openacs-4/packages/photo-album/www/photo-iconic.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-iconic.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/photo-album/www/photo-iconic.tcl 6 Sep 2013 17:17:44 -0000 1.4
+++ openacs-4/packages/photo-album/www/photo-iconic.tcl 14 Oct 2013 17:56:30 -0000 1.5
@@ -4,7 +4,7 @@
photo_id:integer,notnull
} -validate {
valid_photo -requires {photo_id:integer} {
- if ![string equal [pa_is_photo_p $photo_id] "t"] {
+ if {[pa_is_photo_p $photo_id] != "t" } {
ad_complain "The specified photo is not valid."
}
}
Index: openacs-4/packages/photo-album/www/photo.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo.tcl,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/photo-album/www/photo.tcl 6 Sep 2013 17:17:44 -0000 1.10
+++ openacs-4/packages/photo-album/www/photo.tcl 14 Oct 2013 17:56:30 -0000 1.11
@@ -30,7 +30,7 @@
clipboards:multirow
} -validate {
valid_photo -requires {photo_id:integer} {
- if { [string equal $photo_id 0] && ![string equal $latest_revision 0] } {
+ if { $photo_id eq "0" && $latest_revision ne "0" } {
set photo_id $latest_revision
}
if [string equal [pa_is_photo_p $photo_id] "f"] {
@@ -97,9 +97,9 @@
set path $image_id
# to move a photo need write on photo and write on parent album
- set move_p [expr $write_p && $album_write_p]
+ set move_p [expr {$write_p && $album_write_p}]
# build form to move the photo if move_p is 1
- if $move_p {
+ if {$move_p} {
template::form create move_photo
@@ -149,7 +149,7 @@
set filename [db_string filename {}]
- if [db_string duplicate_check {}] {
+ if {[db_string duplicate_check {}]} {
ad_return_complaint 1 "[_ photo-album._Either_4]"
} else {
ad_return_complaint 1 "[_ photo-album._We_1]
@@ -174,7 +174,7 @@
}
# to delete a photo need delete on photo and write on parent album
- set delete_p [expr $photo_delete_p && $album_write_p]
+ set delete_p [expr {$photo_delete_p && $album_write_p}]
# determine what album page the photo is on so page can present link back to thumbnail page
set page_num [pa_page_of_photo_in_album $photo_id $album_id]
Index: openacs-4/packages/photo-album/www/photos-add-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-add-2.tcl,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/photo-album/www/photos-add-2.tcl 6 Sep 2013 17:17:44 -0000 1.9
+++ openacs-4/packages/photo-album/www/photos-add-2.tcl 14 Oct 2013 17:56:30 -0000 1.10
@@ -18,12 +18,12 @@
}
}
non_empty -requires {upload_file.tmpfile:notnull} {
- if {![empty_string_p $upload_file] && (![file exists ${upload_file.tmpfile}] || [file size ${upload_file.tmpfile}] < 4)} {
+ if {$upload_file ne "" && (![file exists ${upload_file.tmpfile}] || [file size ${upload_file.tmpfile}] < 4)} {
ad_complain "The upload failed or the file was empty"
}
}
directory_exists {
- if {([info exists upload_file] && ![empty_string_p $upload_file]) && ![file isdirectory [parameter::get -parameter FullTempPhotoDir -package_id [ad_conn package_id]]]} {
+ if {([info exists upload_file] && $upload_file ne "") && ![file isdirectory [parameter::get -parameter FullTempPhotoDir -package_id [ad_conn package_id]]]} {
ad_complain "The directory file does not exist"
}
}
@@ -33,7 +33,7 @@
set user_id [ad_conn user_id]
permission::require_permission -object_id $album_id -privilege "pa_create_photo"
-if { ![empty_string_p $upload_file] &&
+if { $upload_file ne "" &&
[ catch {set tmp_dir [pa_expand_archive $upload_file ${upload_file.tmpfile} pa-$album_id] } errMsg] } {
ad_return_complaint 1 "Unable to expand your archive file"
ad_script_abort
@@ -42,7 +42,7 @@
ReturnHeaders text/html
ns_write "Upload LogUpload Log
\n"
-if {![empty_string_p $upload_file]} {
+if {$upload_file ne ""} {
ns_write "starting to load images from file $upload_file
\n"
ns_log Debug "made directory $tmp_dir to extract from ${upload_file.tmpfile} ($upload_file)\n"
set allfiles [pa_walk $tmp_dir]
@@ -62,6 +62,6 @@
ns_write ""
# Now that we are done working on the upload we delete the tmp file
-if [info exists tmp_dir] {
+if {[info exists tmp_dir]} {
file delete -force $tmp_dir
}
Index: openacs-4/packages/photo-album/www/photos-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-edit.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/photo-album/www/photos-edit.tcl 6 Sep 2013 17:17:44 -0000 1.6
+++ openacs-4/packages/photo-album/www/photos-edit.tcl 14 Oct 2013 17:56:30 -0000 1.7
@@ -62,11 +62,11 @@
and ci.item_id = :album_id
}
# to move an album need write on album and write on parent folder
-set move_p [expr $write_p && $folder_write_p]
+set move_p [expr {$write_p && $folder_write_p}]
# to delete an album, album must be empty, need delete on album, and write on parent folder
-set has_children_p [expr [pa_count_photos_in_album $album_id] > 0]
-set delete_p [expr !($has_children_p) && $album_delete_p && $folder_write_p]
+set has_children_p [expr {[pa_count_photos_in_album $album_id] > 0}]
+set delete_p [expr {!($has_children_p) && $album_delete_p && $folder_write_p}]
set photos_on_page [pa_all_photos_on_page $album_id $page]
@@ -146,8 +146,8 @@
set val(viewer_path) $viewer_path
set val(viewer_height) $viewer_height
set val(viewer_width) $viewer_width
- set val(window_height) [expr $viewer_height + 28]
- set val(window_width) [expr $viewer_width + 24]
+ set val(window_height) [expr {$viewer_height + 28}]
+ set val(window_width) [expr {$viewer_width + 24}]
set child($photo_id) [array get val]
}
Index: openacs-4/packages/photo-album/www/random-photo.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/random-photo.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/photo-album/www/random-photo.tcl 8 Aug 2006 21:27:09 -0000 1.5
+++ openacs-4/packages/photo-album/www/random-photo.tcl 14 Oct 2013 17:56:30 -0000 1.6
@@ -39,10 +39,10 @@
# Let's add the leading/tailing slashes so the url's will always work
set url [string trim $url]
- if {![string equal [string index $url 0] "/"]} {
+ if {[string index $url 0] ne "/" } {
set url "/$url"
}
- if {![string equal [string index $url end] "/"]} {
+ if {[string index $url end] ne "/" } {
set url "$url/"
}
Index: openacs-4/packages/photo-album/www/images/index.vuh
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/images/index.vuh,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/photo-album/www/images/index.vuh 6 Sep 2013 17:22:55 -0000 1.4
+++ openacs-4/packages/photo-album/www/images/index.vuh 14 Oct 2013 17:56:30 -0000 1.5
@@ -11,7 +11,7 @@
regexp {^([0-9]+)} [ad_conn path_info] match image_id
-if {[parameter::get -parameter CheckPermissionOnImageServeP] eq "t"} {
+if {[parameter::get -parameter CheckPermissionOnImageServeP] == "t"} {
permission::require_permission -object_id $image_id -privilege "read"
}