Index: openacs-4/packages/acs-admin/www/apm/package-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/package-add-2.tcl,v diff -u -r1.18 -r1.18.2.1 --- openacs-4/packages/acs-admin/www/apm/package-add-2.tcl 4 Apr 2018 08:11:26 -0000 1.18 +++ openacs-4/packages/acs-admin/www/apm/package-add-2.tcl 14 Feb 2019 16:15:00 -0000 1.18.2.1 @@ -1,6 +1,6 @@ ad_page_contract { Adds a package to the package manager. - + @author Bryan Quinn (bquinn@arsdigita.com) @creation-date 17 April 2000 @cvs-id $Id$ @@ -24,64 +24,64 @@ version_id:naturalnum { owner_name:multiple } { owner_uri:multiple} - { vendor [db_null] } - { vendor_uri [db_null] } + { vendor ""} + { vendor_uri ""} { install_p:boolean 0 } {implements_subsite_p:boolean "f"} {inherit_templates_p:boolean "f"} } -validate { package_key_format -requires {package_key} { - if { [regexp {[^a-z0-9-]} $package_key] } { - ad_complain - } + if { [regexp {[^a-z0-9-]} $package_key] } { + ad_complain + } } package_key_unique -requires {package_key} { - if {[apm_package_registered_p $package_key] } { - ad_complain "The package key, $package_key, you have requested -is already registered to another package." - } + if {[apm_package_registered_p $package_key] } { + ad_complain "The package key, $package_key, you have requested + is already registered to another package." + } } pretty_plural_unique -requires {pretty_plural} { - if {[db_string apm_pretty_plural_unique_ck { - select decode(count(*), 0, 0, 1) from apm_package_types - where pretty_plural = :pretty_plural - } -default 0]} { - ad_complain "A package with the pretty plural of $pretty_plural already exists." - } + if {[db_string apm_pretty_plural_unique_ck { + select decode(count(*), 0, 0, 1) from apm_package_types + where pretty_plural = :pretty_plural + } -default 0]} { + ad_complain "A package with the pretty plural of $pretty_plural already exists." + } } package_name_unique -requires {pretty_name} { - if { [db_string apm_name_unique_ck { - select decode(count(*), 0, 0, 1) from apm_package_types - where pretty_name = :pretty_name - } -default 0] } { - ad_complain "A package with the name $pretty_name already exists." - } + if { [db_string apm_name_unique_ck { + select decode(count(*), 0, 0, 1) from apm_package_types + where pretty_name = :pretty_name + } -default 0] } { + ad_complain "A package with the name $pretty_name already exists." + } } package_uri_unique -requires {package_uri} { - if { [db_string apm_uri_unique_ck { - select decode(count(*), 0, 0, 1) from apm_package_types - where package_uri = :package_uri - } -default 0] } { - ad_complain "A package with the URL $package_uri already exists." - } + if { [db_string apm_uri_unique_ck { + select decode(count(*), 0, 0, 1) from apm_package_types + where package_uri = :package_uri + } -default 0] } { + ad_complain "A package with the URL $package_uri already exists." + } } version_uri_unique -requires {version_uri} { - if { [db_string apm_version_uri_unique_ck { - select decode(count(*), 0, 0, 1) from apm_package_versions - where version_uri = :version_uri - } -default 0] } { - ad_complain "A version with the URL $version_uri already exists." - } + if { [db_string apm_version_uri_unique_ck { + select decode(count(*), 0, 0, 1) from apm_package_versions + where version_uri = :version_uri + } -default 0] } { + ad_complain "A version with the URL $version_uri already exists." + } } - version_name_ck -requires {version_uri} { - if {![regexp {^[0-9]+((\.[0-9]+)+((d|a|b|)[0-9]?)?)$} $version_name match]} { - ad_complain - } + version_name_ck -requires {version_uri} { + if {![regexp {^[0-9]+((\.[0-9]+)+((d|a|b|)[0-9]?)?)$} $version_name match]} { + ad_complain + } } } -errors { @@ -105,42 +105,42 @@ db_transaction { # Register the package. apm_package_register $package_key $pretty_name $pretty_plural $package_uri \ - $package_type $initial_install_p $singleton_p $implements_subsite_p \ - $inherit_templates_p - # Insert the version + $package_type $initial_install_p $singleton_p $implements_subsite_p \ + $inherit_templates_p + # Insert the version set version_id [apm_package_install_version \ - -callback apm_dummy_callback \ - -version_id $version_id \ - -array attributes \ - $package_key $version_name $version_uri $summary $description \ - $description_format $vendor $vendor_uri $auto_mount] + -callback apm_dummy_callback \ + -version_id $version_id \ + -array attributes \ + $package_key $version_name $version_uri $summary $description \ + $description_format $vendor $vendor_uri $auto_mount] apm_version_enable -callback apm_dummy_callback $version_id apm_build_one_package_relationships $package_key apm_build_subsite_packages_list apm_package_install_owners -callback apm_dummy_callback \ - [apm_package_install_owners_prepare $owner_name $owner_uri] $version_id + [apm_package_install_owners_prepare $owner_name $owner_uri] $version_id if { $install_p } { - if {[catch { - apm_package_install_spec $version_id - } errmsg]} { - ad_return_error "Filesystem Error" \ + if {[catch { + apm_package_install_spec $version_id + } errmsg]} { + ad_return_error "Filesystem Error" \ "I was unable to create your package for the following reason: -
" +[ns_quotehtml $errmsg]
" ad_script_abort - } + } } } on_error { if {[db_string apm_package_add_doubleclick { - select decode(count(*), 0, 0, 1) from apm_package_versions - where version_id = :version_id + select decode(count(*), 0, 0, 1) from apm_package_versions + where version_id = :version_id } -default 0]} { - ad_returnredirect "version-view?version_id=$version_id" - ad_script_abort + ad_returnredirect "version-view?version_id=$version_id" + ad_script_abort } ad_return_error "Database Error" \ "I was unable to create your package for the following reason: -[ns_quotehtml $errmsg]
" +[ns_quotehtml $errmsg]
" ad_script_abort } Index: openacs-4/packages/acs-admin/www/apm/parameter-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/parameter-add-2.tcl,v diff -u -r1.14 -r1.14.2.1 --- openacs-4/packages/acs-admin/www/apm/parameter-add-2.tcl 16 May 2018 17:08:51 -0000 1.14 +++ openacs-4/packages/acs-admin/www/apm/parameter-add-2.tcl 14 Feb 2019 16:15:00 -0000 1.14.2.1 @@ -13,40 +13,40 @@ description:notnull,nohtml datatype:notnull scope:notnull - {default_value [db_null]} + {default_value ""} {min_n_values:integer 1} {max_n_values:integer 1} } -validate { datatype_type_ck { - if {$datatype ne "number" && $datatype ne "string" && $datatype ne "text"} { - ad_complain - } + if {$datatype ne "number" && $datatype ne "string" && $datatype ne "text"} { + ad_complain + } } param_name_unique_ck { - if {[db_string param_name_unique_ck { - select decode(count(*), 0, 0, 1) - from apm_parameters - where parameter_name = :parameter_name + if {[db_string param_name_unique_ck { + select decode(count(*), 0, 0, 1) + from apm_parameters + where parameter_name = :parameter_name and package_key= :package_key - }]} { - ad_complain "The parameter name $parameter_name already exists for this package" - } + }]} { + ad_complain "The parameter name $parameter_name already exists for this package" + } } } -errors { datatype_type_ck {The datatype must be either a number or a string or text.} } db_transaction { apm_parameter_register -parameter_id $parameter_id -scope $scope $parameter_name $description $package_key \ - $default_value $datatype $section_name $min_n_values $max_n_values + $default_value $datatype $section_name $min_n_values $max_n_values apm_package_install_spec $version_id } on_error { if {![db_string apm_parameter_register_doubleclick_p { - select 1 from apm_parameters where parameter_id = :parameter_id + select 1 from apm_parameters where parameter_id = :parameter_id } -default 0]} { - ad_return_error "Database Error" "The database is complaining about the parameter you entered:[ns_quotehtml $errmsg]
-
" - ad_script_abort + ad_return_error "Database Error" "The database is complaining about the parameter you entered:[ns_quotehtml $errmsg]
+
" + ad_script_abort } } Index: openacs-4/packages/acs-admin/www/apm/parameter-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/parameter-edit-2.tcl,v diff -u -r1.12 -r1.12.2.1 --- openacs-4/packages/acs-admin/www/apm/parameter-edit-2.tcl 16 May 2018 17:08:51 -0000 1.12 +++ openacs-4/packages/acs-admin/www/apm/parameter-edit-2.tcl 14 Feb 2019 16:15:00 -0000 1.12.2.1 @@ -12,34 +12,33 @@ section_name description:notnull,nohtml datatype:notnull - {default_value [db_null]} + {default_value ""} {min_n_values:integer 1} {max_n_values:integer 1} } -validate { datatype_type_ck { - if {$datatype ne "number" && $datatype ne "string" && $datatype ne "text"} { - ad_complain - } + if {$datatype ne "number" && $datatype ne "string" && $datatype ne "text"} { + ad_complain + } } } -errors { datatype_type_ck {The datatype must be either a number or a string or text.} } -db_transaction { +db_transaction { ns_log Debug "APM: Updating Parameter: $parameter_id, $parameter_name $description, $package_key, $default_value, $datatype, $section_name, $min_n_values, $max_n_values" apm_parameter_update $parameter_id $package_key $parameter_name $description \ - $default_value $datatype $section_name $min_n_values $max_n_values + $default_value $datatype $section_name $min_n_values $max_n_values apm_package_install_spec $version_id } on_error { - ad_return_error "Database Error" "The parameter could not be updated. + ad_return_error "Database Error" "The parameter could not be updated. The database returned the following error:[ns_quotehtml $errmsg]
" ad_script_abort -} +} - ad_returnredirect [export_vars -base "version-parameters" { version_id section_name }] ad_script_abort Index: openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl,v diff -u -r1.114 -r1.114.2.1 --- openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 30 Jan 2019 22:12:34 -0000 1.114 +++ openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 14 Feb 2019 16:15:00 -0000 1.114.2.1 @@ -1096,18 +1096,6 @@ set user_id [db_nextval acs_object_id_seq] } - if { $password_question eq "" } { - set password_question [db_null] - } - - if { $password_answer eq "" } { - set password_answer [db_null] - } - - if { $url eq "" } { - set url [db_null] - } - set creation_user "" set peeraddr "" Index: openacs-4/packages/acs-core-docs/www/db-api-detailed.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/db-api-detailed.adp,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/acs-core-docs/www/db-api-detailed.adp 25 Apr 2018 08:38:27 -0000 1.5 +++ openacs-4/packages/acs-core-docs/www/db-api-detailed.adp 14 Feb 2019 16:15:00 -0000 1.5.2.1 @@ -332,22 +332,6 @@ # null, because Oracle has coerced the empty string (even for the # numeric column "bar") into null in both cases -[ns_quotehtml $errmsg]
Since databases other than Oracle do not coerce empty strings
-into null
, this code has
-different semantics depending on the underlying database (i.e., the
-row that gets inserted may not have null as its column values),
-which defeats the purpose of SQL abstraction.
Therefore, the Database Access API provides a
-database-independent way to represent null
(instead of the Oracle-specific idiom
-of the empty string): db_null
.
Use it instead of the empty string whenever you want to set a
-column value explicitly to null
, e.g.:
- -set bar [db_null] -set baz [db_null] - -db_dml foo_create {insert into foo(bar, baz) values(:bar, :baz)} -# -# sets the values for both the "bar" and "baz" columns to null -
-Since databases other than Oracle do not coerce empty strings into
-null
, this code has different semantics depending on the
-underlying database (i.e., the row that gets inserted may not have null as
-its column values), which defeats the purpose of SQL abstraction.
-
Therefore, the Database Access API provides a database-independent way to
-represent null
(instead of the Oracle-specific idiom of the
-empty string): db_null
.
Use it instead of the empty string whenever you want to set a column value
-explicitly to null
, e.g.:
- -set bar [db_null] -set baz [db_null] - -db_dml foo_create {insert into foo(bar, baz) values(:bar, :baz)} -# -# sets the values for both the "bar" and "baz" columns to null - -- - - -
Since databases other than Oracle do not coerce empty strings
-into null
, this code has
-different semantics depending on the underlying database (i.e., the
-row that gets inserted may not have null as its column values),
-which defeats the purpose of SQL abstraction.
Therefore, the Database Access API provides a
-database-independent way to represent null
(instead of the Oracle-specific idiom
-of the empty string): db_null
.
Use it instead of the empty string whenever you want to set a
-column value explicitly to null
, e.g.:
set bar [db_null] -set baz [db_null] - -db_dml foo_create "insert into foo(bar, baz) values(:bar, :baz)" -# -# sets the values for both the "bar" and "baz" columns to null+
Technically it's equivalent to using a code block on the end of your db_multirow.
-db_null
db_null
Returns a value which can be used in a bind variable to
-represent the SQL value null
.
-See Nulls and Bind Variables
-above.
db_foreach
db_foreach statement-name sql [ -bind bind_set_id | -bind bind_value_list ] \ @@ -543,34 +525,6 @@ }-
-db_nullify_empty_string
-db_nullify_empty_string string
-
For true SQL purists, we provide the convenience function
-db_nullify_empty_string
, which
-returns [db_null] if its string
argument is the empty
-string and can be used to encapsulate another Oracle quirk:
- -set baz "" - -# Clean out the foo table -# -db_dml unused {delete from foo} -db_dml unused {insert into foo(baz) values(:baz)} - -set n_rows [db_string unused "select count(*) from foo where baz is null"] -# -# $n_rows is 1; in effect, the "baz is null" criterion is matching -# the empty string we just inserted (because of Oracle's coercion -# quirk) - -
To balance out this asymmetry, you can explicitly set
-baz
to null
by writing:
- -db_dml foo_insert {insert into foo(baz) values(:1)} {[db_nullify_empty_string $baz]} - -
($Id: db-api.xml,v 1.14 2017/08/07 23:47:54 gustafn Exp $)
@@ -615,4 +569,4 @@ rightLink="templates" rightLabel="Next" rightTitle="Using Templates in OpenACS" homeLink="index" homeLabel="Home" upLink="dev-guide" upLabel="Up"> - \ No newline at end of file + Index: openacs-4/packages/acs-core-docs/www/db-api.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/db-api.html,v diff -u -r1.53 -r1.53.2.1 --- openacs-4/packages/acs-core-docs/www/db-api.html 25 Apr 2018 08:38:27 -0000 1.53 +++ openacs-4/packages/acs-core-docs/www/db-api.html 14 Feb 2019 16:15:00 -0000 1.53.2.1 @@ -339,27 +339,6 @@ # numeric column "bar") into null in both cases - -
- Since databases other than Oracle do not coerce empty strings into
- null
, this code has different semantics depending on the
- underlying database (i.e., the row that gets inserted may not have null as
- its column values), which defeats the purpose of SQL abstraction.
-
Therefore, the Database Access API provides a database-independent way to
- represent null
(instead of the Oracle-specific idiom of the
- empty string): db_null
.
Use it instead of the empty string whenever you want to set a column value
- explicitly to null
, e.g.:
set bar [db_null] -set baz [db_null] - -db_dml foo_create "insert into foo(bar, baz) values(:bar, :baz)" -# -# sets the values for both the "bar" and "baz" columns to null
Technically it's equivalent to using a code block on the end of your db_multirow.
-
- db_null
-
-
-
-
-db_null
-
-
-
- Returns a value which can be used in a bind variable
- to represent the SQL value
- null
.
- See Nulls and
- Bind Variables above.
-
@@ -885,51 +845,7 @@
}
-
-
-
- db_nullify_empty_string
-
-
-
-
-db_nullify_empty_string string
-
- For true SQL purists, we provide the convenience function
- db_nullify_empty_string
, which returns
- [db_null] if its string
argument is the empty string
- and can be used to encapsulate another Oracle quirk:
-
-
-
-set baz ""
-
-# Clean out the foo table
-#
-db_dml unused {delete from foo}
-db_dml unused {insert into foo(baz) values(:baz)}
-
-set n_rows [db_string unused "select count(*) from foo where baz is null"]
-#
-# $n_rows is 1; in effect, the "baz is null" criterion is matching
-# the empty string we just inserted (because of Oracle's coercion
-# quirk)
-
-
-
-
- To balance out this asymmetry, you can explicitly set baz
to
- null
by writing:
-
-
-
-
-
-db_dml foo_insert {insert into foo(baz) values(:1)} {[db_nullify_empty_string $baz]}
-
-
-
Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/db-api.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/db-api.xml,v
diff -u -r1.17 -r1.17.2.1
--- openacs-4/packages/acs-core-docs/www/xml/developers-guide/db-api.xml 30 Sep 2018 15:53:28 -0000 1.17
+++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/db-api.xml 14 Feb 2019 16:15:00 -0000 1.17.2.1
@@ -366,27 +366,6 @@
# numeric column "bar") into null in both cases
-
- <mount package="package-key instance-name="name" mount-point="url" /> <mount-existing package-id="package-id mount-point="url" /> <rename-instance package-id="package-id" url="url" instance-name="new instance name" /> <register-parameter name="parameter" description="description" package-key="package-key" scope="instance or global" default-value="default-value" datatype="datatype" [ [ [ section="section" ] min-n-values="min-n-values" ] max-n-values="max-n-values" ] [ callback="callback" ] [ parameter-id="parameter-id" ] <set-parameter name="parameter" [ package="package-key | url="package-url" ] type="[id|literal]" value="value" /> <set-permissions grantee="party" privilege="package-key /> <unset-permissions grantee="party" privilege="package-key /> <package [ id="id" | key="package-key" | url="package-url" ] /> <group id="group_id" [ type="group type" relation="relation-type" ] />
#chat.Log_off#
Index: openacs-4/packages/chat/www/chat.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/chat.tcl,v
diff -u -r1.20 -r1.20.2.1
--- openacs-4/packages/chat/www/chat.tcl 24 Oct 2018 10:29:13 -0000 1.20
+++ openacs-4/packages/chat/www/chat.tcl 14 Feb 2019 16:15:01 -0000 1.20.2.1
@@ -53,11 +53,8 @@
ad_script_abort
}
-template::head::add_css -href resources/chat.css
+set chat_frame [::chat::Chat login -chat_id $room_id]
-set chat_frame [::chat::Chat login \
- -chat_id $room_id]
-
# Local variables:
# mode: tcl
# tcl-indent-level: 4
Index: openacs-4/packages/chat/www/message-delete-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/message-delete-2.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/chat/www/message-delete-2.tcl 7 Aug 2017 23:48:07 -0000 1.9
+++ openacs-4/packages/chat/www/message-delete-2.tcl 14 Feb 2019 16:15:01 -0000 1.9.2.1
@@ -19,3 +19,9 @@
::chat::Chat flush_messages -chat_id $room_id
ad_returnredirect .
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/chat/www/message-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/message-delete.tcl,v
diff -u -r1.8 -r1.8.2.1
--- openacs-4/packages/chat/www/message-delete.tcl 7 Aug 2017 23:48:07 -0000 1.8
+++ openacs-4/packages/chat/www/message-delete.tcl 14 Feb 2019 16:15:01 -0000 1.8.2.1
@@ -22,4 +22,10 @@
set message_count [chat_message_count $room_id]
-ad_return_template
\ No newline at end of file
+ad_return_template
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/chat/www/moderator-grant-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/moderator-grant-2.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/chat/www/moderator-grant-2.tcl 7 Aug 2017 23:48:07 -0000 1.4
+++ openacs-4/packages/chat/www/moderator-grant-2.tcl 14 Feb 2019 16:15:01 -0000 1.4.2.1
@@ -1,8 +1,8 @@
#/chat/www/moderator-grant-2.tcl
ad_page_contract {
-
+
Add moderator to a room.
-
+
@author David Dao (ddao@arsdigita.com)
@creation-date November 17, 2000
@cvs-id $Id$
@@ -16,3 +16,9 @@
chat_moderator_grant $room_id $party_id
ad_returnredirect "room?room_id=$room_id"
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/chat/www/moderator-grant.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/moderator-grant.tcl,v
diff -u -r1.6 -r1.6.2.1
--- openacs-4/packages/chat/www/moderator-grant.tcl 7 Aug 2017 23:48:07 -0000 1.6
+++ openacs-4/packages/chat/www/moderator-grant.tcl 14 Feb 2019 16:15:01 -0000 1.6.2.1
@@ -28,3 +28,8 @@
ad_return_template grant-entry
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/chat/www/moderator-revoke-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/moderator-revoke-2.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/chat/www/moderator-revoke-2.tcl 7 Aug 2017 23:48:07 -0000 1.4
+++ openacs-4/packages/chat/www/moderator-revoke-2.tcl 14 Feb 2019 16:15:01 -0000 1.4.2.1
@@ -15,4 +15,10 @@
chat_moderator_revoke $room_id $party_id
-ad_returnredirect "room?room_id=$room_id"
\ No newline at end of file
+ad_returnredirect "room?room_id=$room_id"
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/chat/www/moderator-revoke.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/moderator-revoke.tcl,v
diff -u -r1.8 -r1.8.2.1
--- openacs-4/packages/chat/www/moderator-revoke.tcl 18 Jun 2018 14:30:00 -0000 1.8
+++ openacs-4/packages/chat/www/moderator-revoke.tcl 14 Feb 2019 16:15:01 -0000 1.8.2.1
@@ -18,3 +18,9 @@
set party_pretty_name [acs_object_name $party_id]
set pretty_name [chat_room_name $room_id]
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/chat/www/noactive.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/noactive.tcl,v
diff -u -r1.1 -r1.1.14.1
--- openacs-4/packages/chat/www/noactive.tcl 14 Mar 2006 12:16:09 -0000 1.1
+++ openacs-4/packages/chat/www/noactive.tcl 14 Feb 2019 16:15:01 -0000 1.1.14.1
@@ -12,3 +12,9 @@
set context_bar [list "[_ chat.Unauthorized_privilege]"]
ad_return_template
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/chat/www/room-delete-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room-delete-2.tcl,v
diff -u -r1.8 -r1.8.2.1
--- openacs-4/packages/chat/www/room-delete-2.tcl 7 Aug 2017 23:48:07 -0000 1.8
+++ openacs-4/packages/chat/www/room-delete-2.tcl 14 Feb 2019 16:15:01 -0000 1.8.2.1
@@ -16,8 +16,10 @@
ad_script_abort
}
-ad_returnredirect .
+ad_returnredirect .
-
-
-
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/chat/www/room-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room-delete.tcl,v
diff -u -r1.8 -r1.8.2.1
--- openacs-4/packages/chat/www/room-delete.tcl 7 Aug 2017 23:48:07 -0000 1.8
+++ openacs-4/packages/chat/www/room-delete.tcl 14 Feb 2019 16:15:01 -0000 1.8.2.1
@@ -19,4 +19,10 @@
set pretty_name [chat_room_name $room_id]
-ad_return_template
\ No newline at end of file
+ad_return_template
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/chat/www/room-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room-edit.tcl,v
diff -u -r1.15 -r1.15.2.1
--- openacs-4/packages/chat/www/room-edit.tcl 25 Jun 2018 14:46:38 -0000 1.15
+++ openacs-4/packages/chat/www/room-edit.tcl 14 Feb 2019 16:15:01 -0000 1.15.2.1
@@ -70,72 +70,72 @@
{messages_time_window:integer
{label "#chat.MessagesTimeWindow#" }
{help_text "[_ chat.MessagesTimeWindowHelp]"}
- {value "$four_hours"}
+ {value "$four_hours"}
}
} -new_data {
if {[catch {
- set room_id [chat_room_new \
- -moderated_p $moderated_p \
- -description $description \
- -active_p $active_p \
- -archive_p $archive_p \
- -auto_flush_p $auto_flush_p \
- -auto_transcript_p $auto_transcript_p \
- -login_messages_p $login_messages_p \
- -logout_messages_p $logout_messages_p \
- -messages_time_window $messages_time_window \
- -context_id [ad_conn package_id] \
- -creation_user [ad_conn user_id] \
- -creation_ip [ad_conn peeraddr] $pretty_name]
+ set room_id [chat_room_new \
+ -moderated_p $moderated_p \
+ -description $description \
+ -active_p $active_p \
+ -archive_p $archive_p \
+ -auto_flush_p $auto_flush_p \
+ -auto_transcript_p $auto_transcript_p \
+ -login_messages_p $login_messages_p \
+ -logout_messages_p $logout_messages_p \
+ -messages_time_window $messages_time_window \
+ -context_id [ad_conn package_id] \
+ -creation_user [ad_conn user_id] \
+ -creation_ip [ad_conn peeraddr] $pretty_name]
} errmsg]} {
ad_return_complaint 1 "[_ chat.Create_new_room_failed]: $errmsg"
ad_script_abort
}
set comm_id ""
if {[info commands dotlrn_community::get_community_id] ne ""} {
- set comm_id [dotlrn_community::get_community_id]
+ set comm_id [dotlrn_community::get_community_id]
}
if {$comm_id ne ""} {
- chat_user_grant $room_id $comm_id
+ chat_user_grant $room_id $comm_id
} else {
- #-2 Registered Users
- #chat_user_grant $room_id -2
- #0 Unregistered Visitor
- #chat_user_grant $room_id 0
- #-1 The Public
- chat_user_grant $room_id -2
+ #-2 Registered Users
+ #chat_user_grant $room_id -2
+ #0 Unregistered Visitor
+ #chat_user_grant $room_id 0
+ #-1 The Public
+ chat_user_grant $room_id -2
}
} -edit_request {
if {[catch {
- chat_room_get -room_id $room_id -array r
- set pretty_name $r(pretty_name)
- set description $r(description)
- set moderated_p $r(moderated_p)
- set archive_p $r(archive_p)
- set auto_flush_p $r(auto_flush_p)
- set auto_transcript_p $r(auto_transcript_p)
- set login_messages_p $r(login_messages_p)
- set logout_messages_p $r(logout_messages_p)
- set messages_time_window $r(messages_time_window)
+ chat_room_get -room_id $room_id -array r
+ set pretty_name $r(pretty_name)
+ set description $r(description)
+ set moderated_p $r(moderated_p)
+ set archive_p $r(archive_p)
+ set auto_flush_p $r(auto_flush_p)
+ set auto_transcript_p $r(auto_transcript_p)
+ set login_messages_p $r(login_messages_p)
+ set logout_messages_p $r(logout_messages_p)
+ set messages_time_window $r(messages_time_window)
} errmsg]} {
- ad_return_complaint 1 "[_ chat.Room_not_found]."
+ ad_return_complaint 1 "[_ chat.Room_not_found]."
ad_script_abort
}
} -edit_data {
if {[catch {
- chat_room_edit \
- $room_id \
- $pretty_name \
- $description \
- $moderated_p \
- $active_p \
- $archive_p \
- $auto_flush_p \
- $auto_transcript_p \
- $login_messages_p \
- $logout_messages_p \
- $messages_time_window
+ chat_room_edit \
+ $room_id \
+ $pretty_name \
+ $description \
+ $moderated_p \
+ $active_p \
+ $archive_p \
+ $auto_flush_p \
+ $auto_transcript_p \
+ $login_messages_p \
+ $logout_messages_p \
+ $messages_time_window
} errmsg]} {
ad_return_complaint 1 "[_ chat.Could_not_update_room]: $errmsg"
ad_script_abort
@@ -144,3 +144,9 @@
ad_returnredirect "room?room_id=$room_id"
ad_script_abort
}
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/chat/www/room.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room.adp,v
diff -u -r1.11 -r1.11.2.1
--- openacs-4/packages/chat/www/room.adp 7 Aug 2017 23:48:07 -0000 1.11
+++ openacs-4/packages/chat/www/room.adp 14 Feb 2019 16:15:01 -0000 1.11.2.1
@@ -73,3 +73,26 @@
} $content "\n\n" content
- regsub -all {(/[^>]*>)} $content "" content
- } else {
- set content [ad_html_text_convert -from $format -to text/plain -- $content]
- }
+ #
+ # GN: The standard conversion from "text/enhanced" to
+ # "text/plain" converts first from "text/enhanced" to
+ # "text/html" and then from "text/html" to "text/plain". This
+ # can take for large forums posting a long time (e.g a few
+ # minutes on openacs.org). Since this function is used just
+ # for the summarizer (when listing a short paragraph in the
+ # context of the search result), we can live here with a much
+ # simpler version, which computes the same in less than one
+ # ms.
+ #
+ if {$message(format) eq "text/enhanced"} {
+ regsub -all { } $content "\n\n" content
+ regsub -all {(/[^>]*>)} $content "" content
+ } else {
+ set content [ad_html_text_convert -from $format -to text/plain -- $content]
+ }
append combined_content $content
# In case this text is not only used for indexing but also for display, beautify it
@@ -209,11 +209,11 @@
title $message(subject) \
content $combined_content \
relevant_date $relevant_date \
- community_id [db_null] \
+ community_id "" \
keywords {} \
storage_type text \
mime text/plain \
- package_id $package_id]
+ package_id $package_id]
}
ad_proc -public -callback search::url -impl forums_message {} {
@@ -272,12 +272,12 @@
The from_user_id is the user_id of the user
that will be deleted and all the *forums*
of this user will be mapped to the to_user_id.
-
+
} {
set msg "Forums items of $user_id"
ns_log Notice $msg
set result [list $msg]
-
+
set last_poster [db_list_of_lists sel_poster {} ]
set msg "Last Poster of $last_poster"
lappend result $msg
@@ -297,12 +297,12 @@
The from_user_id is the user_id of the user
that will be deleted and all the *forums*
of this user will be mapped to the to_user_id.
-
+
} {
- set msg "Merging forums"
+ set msg "Merging forums"
ns_log Notice $msg
set result [list $msg]
-
+
db_dml upd_poster {}
db_dml upd_user_id {}
@@ -314,64 +314,64 @@
# application-track callbacks
-ad_proc -callback application-track::getApplicationName -impl forums {} {
+ad_proc -callback application-track::getApplicationName -impl forums {} {
Callback implementation.
} {
return "forums"
-}
-
-ad_proc -callback application-track::getGeneralInfo -impl forums {} {
+}
+
+ad_proc -callback application-track::getGeneralInfo -impl forums {} {
Callback implementation.
} {
db_1row my_query {
- select count(f.forum_id) as result
- FROM forums_forums f, dotlrn_communities_full com
- WHERE com.community_id=:comm_id
- and apm_package__parent_id(f.package_id) = com.package_id
+ select count(f.forum_id) as result
+ FROM forums_forums f, dotlrn_communities_full com
+ WHERE com.community_id=:comm_id
+ and apm_package__parent_id(f.package_id) = com.package_id
}
-
+
return $result
}
-
-ad_proc -callback application-track::getSpecificInfo -impl forums {} {
+
+ad_proc -callback application-track::getSpecificInfo -impl forums {} {
Callback implementation.
} {
-
+
upvar $query_name my_query
upvar $elements_name my_elements
set my_query {
- SELECT f.name as name,f.thread_count as threads,
- f.last_post,
- to_char(o.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date
- FROM forums_forums f,dotlrn_communities_full com,acs_objects o
- WHERE com.community_id=:class_instance_id
- and f.forum_id = o.object_id
- and apm_package__parent_id(f.package_id) = com.package_id
+ SELECT f.name as name,f.thread_count as threads,
+ f.last_post,
+ to_char(o.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date
+ FROM forums_forums f,dotlrn_communities_full com,acs_objects o
+ WHERE com.community_id=:class_instance_id
+ and f.forum_id = o.object_id
+ and apm_package__parent_id(f.package_id) = com.package_id
}
-
+
set my_elements {
name {
label "Name"
- display_col name
- html {align center}
-
+ display_col name
+ html {align center}
+
}
threads {
label "Threads"
- display_col threads
- html {align center}
+ display_col threads
+ html {align center}
}
creation_date {
label "creation_date"
- display_col creation_date
- html {align center}
+ display_col creation_date
+ html {align center}
}
last_post {
label "last_post"
- display_col last_post
- html {align center}
- }
+ display_col last_post
+ html {align center}
+ }
}
return "OK"
Index: openacs-4/packages/forums-portlet/www/forums-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums-portlet/www/forums-portlet.adp,v
diff -u -r1.24 -r1.24.2.1
--- openacs-4/packages/forums-portlet/www/forums-portlet.adp 19 Jun 2018 15:23:42 -0000 1.24
+++ openacs-4/packages/forums-portlet/www/forums-portlet.adp 14 Feb 2019 16:15:01 -0000 1.24.2.1
@@ -25,7 +25,7 @@
[ad_html_text_convert -from $comment_mime_type -- $content]
- set script [ah::ajaxupdate -container "connections" \
- -url "/xmlhttp/getconnections" \
- -pars "'q=test&limit_n=3'"
- -enclose \
- -effectopts "duration: 1.5"]
-
+
+ set script [ah::ajaxupdate -container "connections" \
+ -url "/xmlhttp/getconnections" \
+ -pars "'q=test&limit_n=3'"
+ -enclose \
+ -effectopts "duration: 1.5"]
+
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-01-16
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-01-16
- @param container the 'id' of the layer (div) you want to update via ajax
- @param url the url that will be querried for the content to update the container's innerHtml
- @param options optional parameters that you can pass to the Ajax.Updater script
- @param effect optionally specify an effect to use as the container is updated
- @param effectopts options for the effect
- @param enclose optionally specify whether you want your script to be enclosed in < script > tags
+ @param container the 'id' of the layer (div) you want to update via ajax
+ @param url the url that will be querried for the content to update the container's innerHtml
+ @param options optional parameters that you can pass to the Ajax.Updater script
+ @param effect optionally specify an effect to use as the container is updated
+ @param effectopts options for the effect
+ @param enclose optionally specify whether you want your script to be enclosed in < script > tags
- @return
+ @return
- @error
+ @error
} {
ah::requires -sources "scriptaculous"
- if { !$container_is_var_p } {
- set container [ah::isnot_js_var $container]
- }
+ if { !$container_is_var_p } {
+ set container [ah::isnot_js_var $container]
+ }
- set preoptions "asynchronous:$asynchronous,method:'post'"
+ set preoptions "asynchronous:$asynchronous,method:'post'"
- if { $pars ne "" } {
- append preoptions ",parameters:$pars"
- }
- if { $options ne "" } { append preoptions ",$options" }
+ if { $pars ne "" } {
+ append preoptions ",parameters:$pars"
+ }
+ if { $options ne "" } { append preoptions ",$options" }
- if { $effect ne "" } {
- set effects_script [ah::effects -element $container -effect $effect -options $effectopts -element_is_var]
- append preoptions ",onSuccess: function(t) { $effects_script }"
- }
+ if { $effect ne "" } {
+ set effects_script [ah::effects -element $container -effect $effect -options $effectopts -element_is_var]
+ append preoptions ",onSuccess: function(t) { $effects_script }"
+ }
- set script "new Ajax.Updater ($container,'$url',\{$preoptions\}); "
+ set script "new Ajax.Updater ($container,'$url',\{$preoptions\}); "
- if { $enclose_p } { set script [ah::enclose_in_script -script ${script} ] }
+ if { $enclose_p } { set script [ah::enclose_in_script -script ${script} ] }
- return $script
+ return $script
}
# *********** Overlib PopUp **************
ad_proc -public ah::popup {
- -content:required
- {-options ""}
+ -content:required
+ {-options ""}
} {
- This proc will generate javascript for an overlibmws popup.
- This script has to go into a javascript event like onClick or onMouseover.
- The ah::source must be executed with -source "overlibmws"
- For more information about the options that you can pass
- http://www.macridesweb.com/oltest/
- See ah::yui::tooltip for Yahoo's implementation
+ This proc will generate javascript for an overlibmws popup.
+ This script has to go into a javascript event like onClick or onMouseover.
+ The ah::source must be executed with -source "overlibmws"
+ For more information about the options that you can pass
+ http://www.macridesweb.com/oltest/
+ See ah::yui::tooltip for Yahoo's implementation
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-02-12
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-02-12
- @param content this is what the popup will contain or display. if content is text, enclose it in single quotes (' ').
- @param options the options to pass to overlibmws
+ @param content this is what the popup will contain or display. if content is text, enclose it in single quotes (' ').
+ @param options the options to pass to overlibmws
- @return
+ @return
- @error
+ @error
} {
ah::requires -sources "overlibmws"
- if { $options ne "" } {
- set overlibopt ","
- append overlibopt $options
- } else {
- set overlibopt ""
- }
- set script "return overlib\(${content}${overlibopt}\);"
- return $script
+ if { $options ne "" } {
+ set overlibopt ","
+ append overlibopt $options
+ } else {
+ set overlibopt ""
+ }
+ set script "return overlib\(${content}${overlibopt}\);"
+ return $script
}
ad_proc -public ah::clearpopup {
} {
- This proc will generate javascript for to clear a popup.
- This script has to go into a javascript event like onClick or onMouseover.
- The ah::source must be executed with -source "overlibmws"
+ This proc will generate javascript for to clear a popup.
+ This script has to go into a javascript event like onClick or onMouseover.
+ The ah::source must be executed with -source "overlibmws"
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-02-12
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-02-12
- @return
+ @return
- @error
+ @error
} {
ah::requires -sources "overlibmws"
- set script "nd();"
- return $script
+ set script "nd();"
+ return $script
}
ad_proc -public ah::bubblecallout {
- -text:required
- {-type "square"}
- {-textsize "x-small"}
+ -text:required
+ {-type "square"}
+ {-textsize "x-small"}
} {
- This proc will generate mouseover and mouseout javascript
- for dhtml callout or popup using overlibmws
- and the overlibmws bubble plugin.
+ This proc will generate mouseover and mouseout javascript
+ for dhtml callout or popup using overlibmws
+ and the overlibmws bubble plugin.
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-01-16
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-01-16
- @param type this is passed to the overlibmws script, refer to overlib documentation for possible values.
- @param text the text that will appear in the popup.
- @param textsize the size of the text in the popup
+ @param type this is passed to the overlibmws script, refer to overlib documentation for possible values.
+ @param text the text that will appear in the popup.
+ @param textsize the size of the text in the popup
- @return
- @error
+ @return
+ @error
} {
ah::requires -sources "overlibmws_bubble"
- set script "onmouseover=\""
- append script [ah::popup -content "'$text'" -options "BUBBLE,BUBBLETYPE,'$type',TEXTSIZE,'$textsize'"]
- append script "\" onmouseout=\""
- append script [ah::clearpopup]
- append script "\""
- return $script
+ set script "onmouseover=\""
+ append script [ah::popup -content "'$text'" -options "BUBBLE,BUBBLETYPE,'$type',TEXTSIZE,'$textsize'"]
+ append script "\" onmouseout=\""
+ append script [ah::clearpopup]
+ append script "\""
+ return $script
}
ad_proc -public ah::ajax_bubblecallout {
- -url:required
- {-pars ""}
- {-options ""}
- {-type "square"}
- {-textsize "x-small"}
+ -url:required
+ {-pars ""}
+ {-options ""}
+ {-type "square"}
+ {-textsize "x-small"}
} {
- This proc executes an xmlhttp call and outputs the response text in a bubblecallout.
+ This proc executes an xmlhttp call and outputs the response text in a bubblecallout.
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-01-16
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-01-16
- @param url the url to make the xmlhttp call to
- @param pars the parameters in querystring format you want to pass to the url
- @param options the options you want to pass to overlibmws
- @param type parameter specific to the bubble callout
- @param textsize the size of the text in the callout
+ @param url the url to make the xmlhttp call to
+ @param pars the parameters in querystring format you want to pass to the url
+ @param options the options you want to pass to overlibmws
+ @param type parameter specific to the bubble callout
+ @param textsize the size of the text in the callout
- @return
+ @return
- @error
+ @error
} {
ah::requires -sources "overlibmws_bubble"
- set popup [ah::popup -content "t.responseText" -options "BUBBLE,BUBBLETYPE,'$type',TEXTSIZE,'$textsize'"]
- set request [ah::ajaxrequest -url $url -pars '$pars' -options "onSuccess: function(t) { $popup }" ]
- set script "onmouseover=\"$request\" onmouseout=\"nd();\""
- return $script
+ set popup [ah::popup -content "t.responseText" -options "BUBBLE,BUBBLETYPE,'$type',TEXTSIZE,'$textsize'"]
+ set request [ah::ajaxrequest -url $url -pars '$pars' -options "onSuccess: function(t) { $popup }" ]
+ set script "onmouseover=\"$request\" onmouseout=\"nd();\""
+ return $script
}
# ********** Effects **************
ad_proc -public ah::effects {
- -element:required
- {-effect "Appear"}
- {-options ""}
- {-element_is_var:boolean}
+ -element:required
+ {-effect "Appear"}
+ {-options ""}
+ {-element_is_var:boolean}
} {
- Generates javascript for effects by scriptaculous.
- Refer to the scriptaculous documentation for a list of effects.
- This proc by default will use the "Appear" effect
- The parameters are passed directly to the scriptaculous effects script.
- Parameters and options are case sensitive, refer to scriptaculous documentation.
- http://wiki.script.aculo.us/scriptaculous/show/CoreEffects
+ Generates javascript for effects by scriptaculous.
+ Refer to the scriptaculous documentation for a list of effects.
+ This proc by default will use the "Appear" effect
+ The parameters are passed directly to the scriptaculous effects script.
+ Parameters and options are case sensitive, refer to scriptaculous documentation.
+ http://wiki.script.aculo.us/scriptaculous/show/CoreEffects
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-01-16
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-01-16
- @param element the page element that you want to apply the effect to
- @param effect specify one of the scriptaculous effects you want to implement
- @param options specify the options to pass to the scritpaculous javascript
- @param element_is_var specify this if the element you are passing is a javascript variable
+ @param element the page element that you want to apply the effect to
+ @param effect specify one of the scriptaculous effects you want to implement
+ @param options specify the options to pass to the scritpaculous javascript
+ @param element_is_var specify this if the element you are passing is a javascript variable
- @return
- @error
+ @return
+ @error
} {
ah::requires -sources "scriptaculous"
- if { !$element_is_var_p } {
- set element [ah::isnot_js_var $element]
- }
- set script "new Effect.$effect\($element,\{$options\}\); "
- return $script
+ if { !$element_is_var_p } {
+ set element [ah::isnot_js_var $element]
+ }
+ set script "new Effect.$effect\($element,\{$options\}\); "
+ return $script
}
ad_proc -public ah::toggle {
- -element:required
- {-effect "Appear"}
- {-options ""}
- {-element_is_var:boolean}
+ -element:required
+ {-effect "Appear"}
+ {-options ""}
+ {-element_is_var:boolean}
} {
- Generates javascript that toggles the state of an element.
- The parameters are passed directly to the scriptaculous toggle script.
- Parameters and options are case sensitive, refer to scriptaculous documentation.
- http://wiki.script.aculo.us/scriptaculous/show/Effect.toggle
+ Generates javascript that toggles the state of an element.
+ The parameters are passed directly to the scriptaculous toggle script.
+ Parameters and options are case sensitive, refer to scriptaculous documentation.
+ http://wiki.script.aculo.us/scriptaculous/show/Effect.toggle
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-02-23
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-02-23
- @param element the page element that you want to apply the effect to
- @param effect specify one of the scriptaculous effects you want to toggle
- @param options specify the options to pass to the scritpaculous javascript
- @param element_is_var specify this if the element you are passing is a javascript variable
+ @param element the page element that you want to apply the effect to
+ @param effect specify one of the scriptaculous effects you want to toggle
+ @param options specify the options to pass to the scritpaculous javascript
+ @param element_is_var specify this if the element you are passing is a javascript variable
- @return
- @error
+ @return
+ @error
} {
ah::requires -sources "scriptaculous"
- if { !$element_is_var_p } {
- set element [ah::isnot_js_var $element]
- }
- set script "Effect.toggle\($element,'$effect',{$options}\)"
- return $script
+ if { !$element_is_var_p } {
+ set element [ah::isnot_js_var $element]
+ }
+ set script "Effect.toggle\($element,'$effect',{$options}\)"
+ return $script
}
# ********** Drag n Drop **************
ad_proc -public ah::draggable {
- -element:required
- {-options ""}
- {-uid ""}
- {-element_is_var:boolean}
+ -element:required
+ {-options ""}
+ {-uid ""}
+ {-element_is_var:boolean}
} {
- Generates javascript to make the given element a draggable.
- The parameters are passed directly to the scriptaculous script.
- Parameters and options are case sensitive, refer to scriptaculous documentation.
- http://wiki.script.aculo.us/scriptaculous/show/Draggables
+ Generates javascript to make the given element a draggable.
+ The parameters are passed directly to the scriptaculous script.
+ Parameters and options are case sensitive, refer to scriptaculous documentation.
+ http://wiki.script.aculo.us/scriptaculous/show/Draggables
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-01-24
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-01-24
- @param element the page element that you want to make draggable
- @param options specify the scriptaculous options
- @param uid provide a unique id that is used as a variable to associate with the draggable
- @param element_is_var specify this parameter if the element you are passing is a javascript variable
+ @param element the page element that you want to make draggable
+ @param options specify the scriptaculous options
+ @param uid provide a unique id that is used as a variable to associate with the draggable
+ @param element_is_var specify this parameter if the element you are passing is a javascript variable
- @return
+ @return
- @error
+ @error
} {
ah::requires -sources "scriptaculous"
- if { !$element_is_var_p } {
- set element [ah::isnot_js_var $element]
- }
- set script "new Draggable \($element,\{$options\}\);"
- return $script
+ if { !$element_is_var_p } {
+ set element [ah::isnot_js_var $element]
+ }
+ set script "new Draggable \($element,\{$options\}\);"
+ return $script
}
ad_proc -public ah::droppable {
- -element:required
- {-options ""}
- {-uid ""}
- {-element_is_var:boolean}
+ -element:required
+ {-options ""}
+ {-uid ""}
+ {-element_is_var:boolean}
} {
- Generates javascript to make the given element a droppable.
- If a uid parameter is provided, the script will also check if the droppable with the same uid has already been created.
- The parameters are passed directly to the scriptaculous script.
- Parameters and options are case sensitive, refer to scriptaculous documentation.
- http://wiki.script.aculo.us/scriptaculous/show/Droppables
+ Generates javascript to make the given element a droppable.
+ If a uid parameter is provided, the script will also check if the droppable with the same uid has already been created.
+ The parameters are passed directly to the scriptaculous script.
+ Parameters and options are case sensitive, refer to scriptaculous documentation.
+ http://wiki.script.aculo.us/scriptaculous/show/Droppables
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-02-24
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-02-24
- @param element the page element that you want to be a droppable
- @param element_is_var specify this parameter if the element you are passing is a javascript variable
- @param uid provide a unique id that is used as a variable to associate with the droppable
- @param options specify the scriptaculous options for droppables
+ @param element the page element that you want to be a droppable
+ @param element_is_var specify this parameter if the element you are passing is a javascript variable
+ @param uid provide a unique id that is used as a variable to associate with the droppable
+ @param options specify the scriptaculous options for droppables
- @return
+ @return
- @error
+ @error
} {
ah::requires -sources "scriptaculous"
- if { !$element_is_var_p } {
- set element [ah::isnot_js_var $element]
- }
+ if { !$element_is_var_p } {
+ set element [ah::isnot_js_var $element]
+ }
- set script "Droppables.add (${element},{${options}});"
+ set script "Droppables.add (${element},{${options}});"
- return $script
+ return $script
}
ad_proc -public ah::droppableremove {
- -element:required
- {-element_is_var:boolean}
+ -element:required
+ {-element_is_var:boolean}
} {
- Generates javascript to remove a droppable.
- The parameters are passed directly to the scriptaculous script.
- Parameters and options are case sensitive, refer to scriptaculous documentation.
- http://wiki.script.aculo.us/scriptaculous/show/Droppables
+ Generates javascript to remove a droppable.
+ The parameters are passed directly to the scriptaculous script.
+ Parameters and options are case sensitive, refer to scriptaculous documentation.
+ http://wiki.script.aculo.us/scriptaculous/show/Droppables
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-02-24
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-02-24
- @param element the page element that you want to be a droppable
- @param element_is_var specify this parameter if the element you are passing is a javascript variable
+ @param element the page element that you want to be a droppable
+ @param element_is_var specify this parameter if the element you are passing is a javascript variable
- @return
- @error
+ @return
+ @error
} {
ah::requires -sources "scriptaculous"
- if { !$element_is_var_p } {
- set element [ah::isnot_js_var $element]
- }
- set script "Droppables.remove \($element);"
- return $script
+ if { !$element_is_var_p } {
+ set element [ah::isnot_js_var $element]
+ }
+ set script "Droppables.remove \($element);"
+ return $script
}
ad_proc -public ah::sortable {
- -element:required
- {-options ""}
- {-element_is_var:boolean}
+ -element:required
+ {-options ""}
+ {-element_is_var:boolean}
} {
- Generates javascript for sortable elements.
- The parameters are passed directly to the scriptaculous sortable script.
- Parameters and options are case sensitive, refer to scriptaculous documentation.
- http://wiki.script.aculo.us/scriptaculous/show/Sortables
+ Generates javascript for sortable elements.
+ The parameters are passed directly to the scriptaculous sortable script.
+ Parameters and options are case sensitive, refer to scriptaculous documentation.
+ http://wiki.script.aculo.us/scriptaculous/show/Sortables
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-01-24
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-01-24
- @param element the page element that you want to apply the effect to
- @param options specify the scriptaculous options
- @param element_is_var specify this parameter if the element you are passing is a javascript variable
+ @param element the page element that you want to apply the effect to
+ @param options specify the scriptaculous options
+ @param element_is_var specify this parameter if the element you are passing is a javascript variable
- @return
- @error
+ @return
+ @error
} {
ah::requires -sources "scriptaculous"
- if { !$element_is_var_p } {
- set element [ah::isnot_js_var $element]
- }
- set script "Sortable.destroy($element); "
- append script "Sortable.create\($element, \{$options\}\); "
- return $script
+ if { !$element_is_var_p } {
+ set element [ah::isnot_js_var $element]
+ }
+ set script "Sortable.destroy($element); "
+ append script "Sortable.create\($element, \{$options\}\); "
+ return $script
}
# ********** Round Corners ************
ad_proc -public ah::rounder {
- -classname:required
- {-jsobjname "myBoxObject"}
- {-validtags "div"}
- {-radius "20"}
- {-element_is_var:boolean}
- {-enclose:boolean}
+ -classname:required
+ {-jsobjname "myBoxObject"}
+ {-validtags "div"}
+ {-radius "20"}
+ {-element_is_var:boolean}
+ {-enclose:boolean}
} {
- Generates javascript to round html div elements.
- Parameters are case sensitive.
- http://www.curvycorners.net/
+ Generates javascript to round html div elements.
+ Parameters are case sensitive.
+ http://www.curvycorners.net/
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-01-24
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-01-24
- @param classname The name of the html class that the script will look for. All validtags with this classname will be rounded.
- @param jsobjname The javascript object name you want to use.
- @param validtags Comma separated values of valid tags to apply rounded corners. Values include "div", "form" or "div,form"
- @param radius The radius of the rounded corners.
+ @param classname The name of the html class that the script will look for. All validtags with this classname will be rounded.
+ @param jsobjname The javascript object name you want to use.
+ @param validtags Comma separated values of valid tags to apply rounded corners. Values include "div", "form" or "div,form"
+ @param radius The radius of the rounded corners.
} {
ah::requires -sources "rounder"
- if { !$element_is_var_p } {
- set element [ah::isnot_js_var $element]
- }
+ if { !$element_is_var_p } {
+ set element [ah::isnot_js_var $element]
+ }
- set script "var settings = { tl: { radius: ${radius} },tr: { radius: ${radius} },bl: { radius: ${radius} },br: { radius: ${radius} },antiAlias: true,autoPad: true,validTags: \[\"${validtags}\"\]};
- var ${jsobjname} = new curvyCorners(settings, \"${classname}\");
- ${jsobjname}.applyCornersToAll();"
+ set script "var settings = { tl: { radius: ${radius} },tr: { radius: ${radius} },bl: { radius: ${radius} },br: { radius: ${radius} },antiAlias: true,autoPad: true,validTags: \[\"${validtags}\"\]};
+ var ${jsobjname} = new curvyCorners(settings, \"${classname}\");
+ ${jsobjname}.applyCornersToAll();"
- if { $enclose_p } { set script [ah::enclose_in_script -script ${script} ] }
+ if { $enclose_p } { set script [ah::enclose_in_script -script ${script} ] }
- return $script
+ return $script
}
# ************* Auto Suggest *****************
@@ -930,65 +930,65 @@
@creation-date 2006-06-21
@param array_list a list of lists which will be constructed
- as the javascript array. this takes priority
- over sql_query parameter.
+ as the javascript array. this takes priority
+ over sql_query parameter.
@param sql_query sql query to pass to db_list_of_lists to generate
- the array
+ the array
} {
ah::requires -sources "autosuggest"
if {[llength $array_list]} {
- set suggestion_list $array_list
+ set suggestion_list $array_list
} elseif {$sql_query ne {} } {
- set suggestion_list [db_list_of_lists get_array_list $sql_query]
+ set suggestion_list [db_list_of_lists get_array_list $sql_query]
} else {
- # just do something for failover
- set suggestion_list {}
+ # just do something for failover
+ set suggestion_list {}
}
set suggestions_stub {}
append suggestions_stub "
-function AUTOSuggestions() {
- this.auto = \[
- "
+ function AUTOSuggestions() {
+ this.auto = \[
+ "
-set suggestion_formatted_list {}
-foreach suggestion $suggestion_list {
- lappend suggestion_formatted_list "\[\"[lindex $suggestion 0]\",\"[lindex $suggestion 1]\"\]"
-}
+ set suggestion_formatted_list {}
+ foreach suggestion $suggestion_list {
+ lappend suggestion_formatted_list "\[\"[lindex $suggestion 0]\",\"[lindex $suggestion 1]\"\]"
+ }
-append suggestions_stub [join $suggestion_formatted_list ","]
+ append suggestions_stub [join $suggestion_formatted_list ","]
-append suggestions_stub "
- \];
-}
-"
-append suggestions_stub {
- AUTOSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/,
- bTypeAhead /*:boolean*/) {
- var aSuggestions = [];
- var aDescriptions = [];
- var sTextboxValue = oAutoSuggestControl.textbox.value.toLowerCase();
+ append suggestions_stub "
+ \];
+ }
+ "
+ append suggestions_stub {
+ AUTOSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/,
+ bTypeAhead /*:boolean*/) {
+ var aSuggestions = [];
+ var aDescriptions = [];
+ var sTextboxValue = oAutoSuggestControl.textbox.value.toLowerCase();
- if (sTextboxValue.length > 0){
+ if (sTextboxValue.length > 0){
- //search for matching states
- for (var i=0; i < this.auto.length; i++) {
- if (this.auto[i][0].toLowerCase().indexOf(sTextboxValue) == 0) {
- aSuggestions.push(this.auto[i][0]);
- aDescriptions.push(this.auto[i][1]);
- }
- }
- }
+ //search for matching states
+ for (var i=0; i < this.auto.length; i++) {
+ if (this.auto[i][0].toLowerCase().indexOf(sTextboxValue) == 0) {
+ aSuggestions.push(this.auto[i][0]);
+ aDescriptions.push(this.auto[i][1]);
+ }
+ }
+ }
- //provide suggestions to the control
- oAutoSuggestControl.autosuggest(aSuggestions, aDescriptions, bTypeAhead);
- };
-}
+ //provide suggestions to the control
+ oAutoSuggestControl.autosuggest(aSuggestions, aDescriptions, bTypeAhead);
+ };
+ }
-return $suggestions_stub
+ return $suggestions_stub
}
Index: openacs-4/packages/ajaxhelper/tcl/ajax-yahoo-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/tcl/ajax-yahoo-procs.tcl,v
diff -u -r1.14 -r1.14.2.1
--- openacs-4/packages/ajaxhelper/tcl/ajax-yahoo-procs.tcl 25 Apr 2018 19:47:46 -0000 1.14
+++ openacs-4/packages/ajaxhelper/tcl/ajax-yahoo-procs.tcl 14 Feb 2019 16:15:01 -0000 1.14.2.1
@@ -1,10 +1,10 @@
ad_library {
- Library for Ajax Helper Procs
- based on Yahoo's User Interface Libraries
+ Library for Ajax Helper Procs
+ based on Yahoo's User Interface Libraries
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-01-16
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-01-16
}
namespace eval ah::yui { }
@@ -48,12 +48,12 @@
-js_source
} {
This proc will determine if the YUI js_source file is the name is a valid name associated to
- a javascript source. This proc contains hard coded list of javascript sources that
- ajaxhelper supports.
+ a javascript source. This proc contains hard coded list of javascript sources that
+ ajaxhelper supports.
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-12-19
- @param js_source The name of the javascript source to check
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-12-19
+ @param js_source The name of the javascript source to check
} {
set valid_sources [list "utilities" \
@@ -78,37 +78,38 @@
}
ad_proc -private ah::yui::is_js_sources_loaded {
- -js_source
+ -js_source
} {
- This proc will loop thru the global source_list
- and check for the presence of the given js_source.
- If found, this proc will return 1
- If not found, this proc will return 0
+ This proc will loop thru the global source_list
+ and check for the presence of the given js_source.
+ If found, this proc will return 1
+ If not found, this proc will return 0
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-11-05
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-11-05
} {
- set state 0
- if { [info exists ::ajax_helper_yui_js_sources] } {
- foreach source $::ajax_helper_yui_js_sources {
- if { [string match $source $js_source] } {
- set state 1
- break
- }
- }
- }
- return $state
+ set state 0
+ if { [info exists ::ajax_helper_yui_js_sources] } {
+ foreach source $::ajax_helper_yui_js_sources {
+ if { [string match $source $js_source] } {
+ set state 1
+ break
+ }
+ }
+ }
+ return $state
}
ad_proc -private ah::yui::requires {
-sources
} {
- This proc should be called by an ajaxhelper proc that uses YUI with a comma separated list of YUI javascript sources
- that the ajaxhelper proc needs in order to work.
+ This proc should be called by an ajaxhelper proc that
+ uses YUI with a comma separated list of YUI javascript sources
+ that the ajaxhelper proc needs in order to work.
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-12-19
- @param sources Comma separated list of sources
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-12-19
+ @param sources Comma separated list of sources
} {
#split up the comma delimited sources into a list
set source_list [split $sources ","]
@@ -138,41 +139,40 @@
}
-ad_proc -public ah::yui::js_sources {
- {-source "default"}
- {-min:boolean}
+ad_proc -deprecated -public ah::yui::js_sources {
+ {-source "default"}
+ {-min:boolean}
} {
+ Generates the \n"
- }
- }
- "event" {
- if { ![ah::yui::is_js_sources_loaded -js_source "event"] } {
- append script " \n"
- }
- }
- "treeview" {
- if { ![ah::yui::is_js_sources_loaded -js_source "treeview"] } {
- append script " \n"
- }
- }
- "calendar" {
- if { ![ah::yui::is_js_sources_loaded -js_source "calendar"] } {
- append script " \n"
- }
- }
- "dragdrop" {
- if { ![ah::yui::is_js_sources_loaded -js_source "dragdrop"] } {
- append script " \n"
- }
- }
- "slider" {
- if { ![ah::yui::is_js_sources_loaded -js_source "slider"] } {
- append script " \n"
- }
- }
- "container" {
- if { ![ah::yui::is_js_sources_loaded -js_source "container"] } {
- append script " \n"
- append script " \n"
- }
- }
- "menu" {
- if { ![ah::yui::is_js_sources_loaded -js_source "menu"] } {
- append script " \n"
- append script " \n"
- }
- }
- "connection" {
- if { ![ah::yui::is_js_sources_loaded -js_source "connection"] } {
- append script " \n"
- }
- }
- "dom" {
- if { ![ah::yui::is_js_sources_loaded -js_source "yahoo"] } {
- append script " \n"
- }
+ foreach x $js_file_list {
+ switch $x {
+ "animation" {
+ if { ![ah::yui::is_js_sources_loaded -js_source "animation"] } {
+ append script " \n"
+ }
}
+ "event" {
+ if { ![ah::yui::is_js_sources_loaded -js_source "event"] } {
+ append script " \n"
+ }
+ }
+ "treeview" {
+ if { ![ah::yui::is_js_sources_loaded -js_source "treeview"] } {
+ append script " \n"
+ }
+ }
+ "calendar" {
+ if { ![ah::yui::is_js_sources_loaded -js_source "calendar"] } {
+ append script " \n"
+ }
+ }
+ "dragdrop" {
+ if { ![ah::yui::is_js_sources_loaded -js_source "dragdrop"] } {
+ append script " \n"
+ }
+ }
+ "slider" {
+ if { ![ah::yui::is_js_sources_loaded -js_source "slider"] } {
+ append script " \n"
+ }
+ }
+ "container" {
+ if { ![ah::yui::is_js_sources_loaded -js_source "container"] } {
+ append script " \n"
+ append script " \n"
+ }
+ }
+ "menu" {
+ if { ![ah::yui::is_js_sources_loaded -js_source "menu"] } {
+ append script " \n"
+ append script " \n"
+ }
+ }
+ "connection" {
+ if { ![ah::yui::is_js_sources_loaded -js_source "connection"] } {
+ append script " \n"
+ }
+ }
+ "dom" {
+ if { ![ah::yui::is_js_sources_loaded -js_source "yahoo"] } {
+ append script " \n"
+ }
+ }
"yahoo" {
- if { ![ah::yui::is_js_sources_loaded -js_source "yahoo"] } {
- append script " \n"
- }
- }
+ if { ![ah::yui::is_js_sources_loaded -js_source "yahoo"] } {
+ append script " \n"
+ }
+ }
"utilities" {
if { ![ah::yui::is_js_sources_loaded -js_source "utilities"] } {
append script " \n"
}
}
- }
- }
- return $script
+ }
+ }
+ return $script
}
ad_proc -public ah::yui::cssclass {
@@ -276,7 +276,7 @@
} {
Generates javascript code to control css class on html elements.
-
+
http://developer.yahoo.com/yui/dom/
@author Hamilton Chua (ham@solutiongrove.com)
@@ -299,75 +299,75 @@
"add" { append script "addClass(${element},\"${classname}\"); " }
"remove" { append script "removeClass(${element},\"${classname}\") ;" }
"check" { append script "hasClass(${element},\"${classname}\"); " }
-
+
}
return ${script}
}
ad_proc -public ah::yui::addlistener {
- -element:required
- -event:required
- -callback:required
- {-element_is_var:boolean}
+ -element:required
+ -event:required
+ -callback:required
+ {-element_is_var:boolean}
} {
- Creates javascript for Yahoo's Event Listener.
- http://developer.yahoo.com/yui/event/
+ Creates javascript for Yahoo's Event Listener.
+ http://developer.yahoo.com/yui/event/
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-11-05
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-11-05
- @param element The element that this function will listen for events. This is the id of an html element (e.g. div or a form)
- @param event The event that this function waits for. Values include load, mouseover, mouseout, unload etc.
- @param callback The name of the javascript function to execute when the event for the given element has been triggered.
+ @param element The element that this function will listen for events. This is the id of an html element (e.g. div or a form)
+ @param event The event that this function waits for. Values include load, mouseover, mouseout, unload etc.
+ @param callback The name of the javascript function to execute when the event for the given element has been triggered.
} {
ah::yui::requires -sources "event"
- if { !$element_is_var_p } {
- set element [ah::isnot_js_var $element]
- }
+ if { !$element_is_var_p } {
+ set element [ah::isnot_js_var $element]
+ }
- return "YAHOO.util.Event.addListener($element,\"$event\",${callback});\n"
+ return "YAHOO.util.Event.addListener($element,\"$event\",${callback});\n"
}
ad_proc -public ah::yui::tooltip {
- -varname:required
- -element:required
- -message:required
- {-enclose:boolean}
- {-options ""}
+ -varname:required
+ -element:required
+ -message:required
+ {-enclose:boolean}
+ {-options ""}
} {
- Generates the javascript to create a tooltip using yahoo's user interface javascript library.
- http://developer.yahoo.com/yui/container/tooltip/index.html
+ Generates the javascript to create a tooltip using yahoo's user interface javascript library.
+ http://developer.yahoo.com/yui/container/tooltip/index.html
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-11-05
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-11-05
- @param varname The variable name you want to give to the tooltip
- @param element The element where you wish to attache the tooltip
- @param message The message that will appear in the tooltip
+ @param varname The variable name you want to give to the tooltip
+ @param element The element where you wish to attache the tooltip
+ @param message The message that will appear in the tooltip
} {
ah::yui::requires -sources "container"
- set script "var $varname = new YAHOO.widget.Tooltip(\"alertTip\", { context:\"$element\", text:\"$message\", $options });"
+ set script "var $varname = new YAHOO.widget.Tooltip(\"alertTip\", { context:\"$element\", text:\"$message\", $options });"
global ajax_helper_init_scripts
append ajax_helper_init_scripts $script
}
ad_proc -public ah::yui::create_tree {
- -element:required
- -nodes:required
- {-varname "tree"}
- {-css ""}
+ -element:required
+ -nodes:required
+ {-varname "tree"}
+ {-css ""}
{-nodedroppable:boolean}
} {
- Generates the javascript to create a yahoo tree view control.
+ Generates the javascript to create a yahoo tree view control.
Nodes accepts a list of lists.
This is an example of a node list.
- set nodes {}
+ set nodes [list]
lappend nodes [list "fld1" "Folder 1" "tree" "" "" "" ""]
lappend nodes [list "fld2" "Folder 2" "tree" "javascript:alert('this is a tree node')" "" "" ""]
@@ -381,44 +381,44 @@
5 - a javascript function to execute if the node should load it's children dynamically
6 - should the node be opened or closed
- http://developer.yahoo.com/yui/treeview/
+ http://developer.yahoo.com/yui/treeview/
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-11-05
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-11-05
- @param element This is the id of the html elment where you want to generate the tree view control.
- @param nodes Is list of lists. Each list contains the node information to be passed to ah::yui::create_tree_node to create a node.
- @param varname The javascript variable name to give the tree.
+ @param element This is the id of the html element where you want to generate the tree view control.
+ @param nodes Is list of lists. Each list contains the node information to be passed to ah::yui::create_tree_node to create a node.
+ @param varname The javascript variable name to give the tree.
} {
ah::yui::requires -sources "dom,treeview"
if { $css ne "" } { template::head::add_css -href $css }
- set script "var ${varname} = new YAHOO.widget.TreeView(\"${element}\"); "
- append script "var ${varname}root = ${varname}.getRoot(); "
- foreach node $nodes {
+ set script "var ${varname} = new YAHOO.widget.TreeView(\"${element}\"); "
+ append script "var ${varname}root = ${varname}.getRoot(); "
+ foreach node $nodes {
if { $nodedroppable_p } {
- append script [ah::yui::create_tree_node -varname [lindex $node 0] \
- -label [lindex $node 1] \
- -treevarname [lindex $node 2] \
- -href [lindex $node 3] \
- -attach_to_node [lindex $node 4] \
- -dynamic_load [lindex $node 5] \
- -open [lindex $node 6] \
- -droppable ]
+ append script [ah::yui::create_tree_node -varname [lindex $node 0] \
+ -label [lindex $node 1] \
+ -treevarname [lindex $node 2] \
+ -href [lindex $node 3] \
+ -attach_to_node [lindex $node 4] \
+ -dynamic_load [lindex $node 5] \
+ -open [lindex $node 6] \
+ -droppable ]
} else {
- append script [ah::yui::create_tree_node -varname [lindex $node 0] \
- -label [lindex $node 1] \
- -treevarname [lindex $node 2] \
- -href [lindex $node 3] \
- -attach_to_node [lindex $node 4] \
- -dynamic_load [lindex $node 5] \
- -open [lindex $node 6] ]
+ append script [ah::yui::create_tree_node -varname [lindex $node 0] \
+ -label [lindex $node 1] \
+ -treevarname [lindex $node 2] \
+ -href [lindex $node 3] \
+ -attach_to_node [lindex $node 4] \
+ -dynamic_load [lindex $node 5] \
+ -open [lindex $node 6] ]
}
- }
- append script "${varname}.draw(); "
+ }
+ append script "${varname}.draw(); "
global ajax_helper_init_scripts
append ajax_helper_init_scripts [ah::yui::addlistener \
@@ -431,20 +431,20 @@
}
ad_proc -private ah::yui::create_tree_node {
- -varname:required
- -label:required
- -treevarname:required
- {-href "javascript:void(0)"}
- {-attach_to_node ""}
- {-dynamic_load ""}
- {-open "false"}
+ -varname:required
+ -label:required
+ -treevarname:required
+ {-href "javascript:void(0)"}
+ {-attach_to_node ""}
+ {-dynamic_load ""}
+ {-open "false"}
{-droppable:boolean}
} {
- Generates the javascript to add a node to a yahoo tree view control
- http://developer.yahoo.com/yui/treeview/
+ Generates the javascript to add a node to a yahoo tree view control
+ http://developer.yahoo.com/yui/treeview/
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-11-05
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-11-05
@param varname The name to give the javascript variable to represent the node.
@param label The label to assign the node.
@@ -454,28 +454,28 @@
@param dynamic_load A javascript function that is executed when the children of this node are loaded.
@param open Set this to "true" if you want this node to be open by default when it is rendered.
} {
- set script "var od${varname} = {label: \"${label}\", id: \"${varname}\", href: \"${href}\"}; "
+ set script "var od${varname} = {label: \"${label}\", id: \"${varname}\", href: \"${href}\"}; "
- if { $attach_to_node ne "" } {
- append script "var node = ${treevarname}.getNodeByProperty('id','${attach_to_node}'); "
- append script "if ( node == null ) { var node = nd${attach_to_node}; } "
- } else {
- append script "var node = ${treevarname}root; "
- }
+ if { $attach_to_node ne "" } {
+ append script "var node = ${treevarname}.getNodeByProperty('id','${attach_to_node}'); "
+ append script "if ( node == null ) { var node = nd${attach_to_node}; } "
+ } else {
+ append script "var node = ${treevarname}root; "
+ }
- if { $open eq "" } { set open "false" }
+ if { $open eq "" } { set open "false" }
- append script "var nd${varname} = new YAHOO.widget.TextNode(od${varname},node,${open}); "
+ append script "var nd${varname} = new YAHOO.widget.TextNode(od${varname},node,${open}); "
if { $droppable_p } {
append script "var dd${varname} = new YAHOO.util.DDTarget(nd${varname}.labelElId); "
}
- if { $dynamic_load ne "" } {
- append script "nd${varname}.setDynamicLoad(${dynamic_load}); "
- }
+ if { $dynamic_load ne "" } {
+ append script "nd${varname}.setDynamicLoad(${dynamic_load}); "
+ }
- return $script
+ return $script
}
ad_proc -public ah::yui::menu_from_markup {
@@ -531,17 +531,17 @@
Converts a properly structured list of menu items into JSON format.
The list of lists may look something like
- set submenu {}
+ set submenu [list]
lappend submenu [list [list "text" "Submenu1"] [list "url" "http://www.google.com"] ]
lappend submenu [list [list "text" "Submenu2"] [list "url" "http://www.yahoo.com"] ]
each line represents a row composed of lists.
Each list in the row holds a pair that will be joined by ":".
} {
- set rows {}
+ set rows [list]
foreach row $lists_of_pairs {
- set pairs {}
+ set pairs [list]
foreach pair $row {
if { [lindex $pair 0] eq "submenu" } {
set submenulist [lindex $pair 1]
@@ -695,33 +695,33 @@
if { [llength [lindex $suggestlist 0]] > 1} {
# yes , let's create the array for the innerlist and put each array into one big array
- set outerlist {}
+ set outerlist [list]
foreach onelist $suggestlist {
- set escaped_list {}
+ set escaped_list [list]
foreach elm $onelist {
lappend escaped_list [string map {' \\'} $elm]
}
lappend outerlist "\[ '[join $escaped_list "','"]' \]"
}
set script "var ${varname}Arr = \[ [join $outerlist ","] \];"
- set markup {}
+ set markup [list]
for { set x 0} { $x < [llength [lindex $suggestlist 0]] } { incr x} {
lappend markup "oResultItem\[${x}\]"
}
set markup [join $markup "+\" \"+"]
set format "${varname}.formatResult=function(oResultItem, sQuery) { var sMarkup=${markup}; return sMarkup; };"
} else {
-
+
# no, transform the list into an array
set script "var ${varname}Arr = \[ '[join $suggestlist "','"]' \];"
set format ""
}
-
+
# create the datasource object
append script "var ${varname}DS = new YAHOO.widget.DS_JSArray(${varname}Arr);"
-
+
# create autocomplete object with some predefined options
append script "if (document.getElementById('${inputid}')) {"
append script "var ${varname} = new YAHOO.widget.AutoComplete('${inputid}','${id}', ${varname}DS);"
@@ -733,33 +733,32 @@
append script "${varname}.delimChar=\"${delimchar}\";"
append script "${varname}.forceSelection=\"${forceselection}\";"
- append script "${varname}.allowBrowserAutocomplete=false;"
- append script "${varname}.typeAhead=true;"
- append script ${format}
+ append script "${varname}.allowBrowserAutocomplete=false;"
+ append script "${varname}.typeAhead=true;"
+ append script ${format}
-# append script "${varname}.doBeforeExpandContainer = function(oTextbox, oContainer, sQuery, aResults) {var pos = YAHOO.util.Dom.getXY(oTextbox);pos\[1\] += YAHOO.util.Dom.get(oTextbox).offsetHeight;YAHOO.util.Dom.setXY(oContainer,pos);YAHOO.util.Dom.setStyle(oContainer,'overflow-y','auto');YAHOO.util.Dom.setStyle(oContainer,'overflow-x','hidden');YAHOO.util.Dom.setStyle(oContainer,'position','absolute');YAHOO.util.Dom.setStyle(oContainer,'height','150px');YAHOO.util.Dom.setStyle(oContainer,'z-index','100');return true;};"
-# append script ${format}
-# append script "${varname}.containerCollapseEvent.subscribe([ah::create_js_function -body "YAHOO.util.Dom.setStyle('${id}', 'height', 0)" -parameters [list "type" "args"] ]);"
-# append script "${varname}.itemArrowToEvent.subscribe([ah::create_js_function -body "elItem\[1\].scrollIntoView(false)" -parameters [list "oSelf" "elItem"] ]); "
+ # append script "${varname}.doBeforeExpandContainer = function(oTextbox, oContainer, sQuery, aResults) {var pos = YAHOO.util.Dom.getXY(oTextbox);pos\[1\] += YAHOO.util.Dom.get(oTextbox).offsetHeight;YAHOO.util.Dom.setXY(oContainer,pos);YAHOO.util.Dom.setStyle(oContainer,'overflow-y','auto');YAHOO.util.Dom.setStyle(oContainer,'overflow-x','hidden');YAHOO.util.Dom.setStyle(oContainer,'position','absolute');YAHOO.util.Dom.setStyle(oContainer,'height','150px');YAHOO.util.Dom.setStyle(oContainer,'z-index','100');return true;};"
+ # append script ${format}
+ # append script "${varname}.containerCollapseEvent.subscribe([ah::create_js_function -body "YAHOO.util.Dom.setStyle('${id}', 'height', 0)" -parameters [list "type" "args"] ]);"
+ # append script "${varname}.itemArrowToEvent.subscribe([ah::create_js_function -body "elItem\[1\].scrollIntoView(false)" -parameters [list "oSelf" "elItem"] ]); "
- foreach {name value} $events {
+ foreach {name value} $events {
append script "${varname}.${name}.subscribe${value};\n"
}
-
+
# prevent the container from overlapping other elements, e.g. buttons, links
- # remove the yui-ac-input class
+ # remove the yui-ac-input class
append script [ah::yui::cssclass \
-varname "yuiinputclass${varname}" \
-action "remove" \
-element ${inputid} \
-classname "yui-ac-input" ]
-
+
append script "}; "
-
+
global ajax_helper_init_scripts
append ajax_helper_init_scripts $script
}
}
-
Index: openacs-4/packages/ajaxhelper/tcl/dynamic-load-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/tcl/dynamic-load-procs.tcl,v
diff -u -r1.1 -r1.1.6.1
--- openacs-4/packages/ajaxhelper/tcl/dynamic-load-procs.tcl 6 Nov 2006 13:15:29 -0000 1.1
+++ openacs-4/packages/ajaxhelper/tcl/dynamic-load-procs.tcl 14 Feb 2019 16:15:01 -0000 1.1.6.1
@@ -1,149 +1,149 @@
ad_library {
- Ajax Exprimental Procs
+ Ajax Experimental Procs
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-11-1
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-11-1
}
namespace eval ah::exp { }
ad_proc -public ah::exp::yui_js_source_dynamic {
- {-js "default"}
- {-enclose:boolean}
+ {-js "default"}
+ {-enclose:boolean}
} {
- Dynamically Loads the Yahoo UI javascript libraries.
- WARNING : experimental, use ah::yui::js_sources instead
+ Dynamically Loads the Yahoo UI javascript libraries.
+ WARNING : experimental, use ah::yui::js_sources instead
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-04-20
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-04-20
- @param js Comma separated list of javascript files to load
- Valid values include
- "default" : loads yui.js and dom.js, the most commonly used
- "animation" : loads js for animation
- "event" : loads js for event monitoring (e.g. listnern)
- "treeview" : loads js for Yahoo's Tree View control
- "calendar" : loads js for Yahoo's Calendar Control
- "dragdrop" : loads js for Yahoo's Drag and Drop functions
- "slider" : loads js for slider functions
+ @param js Comma separated list of javascript files to load
+ Valid values include
+ "default" : loads yui.js and dom.js, the most commonly used
+ "animation" : loads js for animation
+ "event" : loads js for event monitoring (e.g. listnern)
+ "treeview" : loads js for Yahoo's Tree View control
+ "calendar" : loads js for Yahoo's Calendar Control
+ "dragdrop" : loads js for Yahoo's Drag and Drop functions
+ "slider" : loads js for slider functions
} {
- set ah_base_url [ah::get_url]
- set script ""
- set js_file_list [split $js ","]
-
- foreach x $js_file_list {
- switch $x {
- "animation" {
- append script [ah::js_include -js_file "${ah_base_url}yui/animation/animation.js"]
- }
- "event" {
- append script [ah::js_include -js_file "${ah_base_url}yui/event/event.js"]
- }
- "treeview" {
- append script [ah::js_include -js_file "${ah_base_url}yui/treeview/treeview.js"]
- }
- "calendar" {
- append script [ah::js_include -js_file "${ah_base_url}yui/calendar/calendar.js"]
- }
- "dragdrop" {
- append script [ah::js_include -js_file "${ah_base_url}yui/dragdrop/dragdrop.js"]
- }
- "slider" {
- append script [ah::js_include -js_file "${ah_base_url}yui/slider/slider.js"]
- }
- default {
- append script [ah::js_include -js_file "${ah_base_url}yui/yui.js"]
- append script [ah::js_include -js_file "${ah_base_url}yui/dom/dom.js"]
- }
- }
- }
+ set ah_base_url [ah::get_url]
+ set script ""
+ set js_file_list [split $js ","]
- if { $enclose_p } { set script [ah::enclose_in_script -script ${script} ] }
+ foreach x $js_file_list {
+ switch $x {
+ "animation" {
+ append script [ah::js_include -js_file "${ah_base_url}yui/animation/animation.js"]
+ }
+ "event" {
+ append script [ah::js_include -js_file "${ah_base_url}yui/event/event.js"]
+ }
+ "treeview" {
+ append script [ah::js_include -js_file "${ah_base_url}yui/treeview/treeview.js"]
+ }
+ "calendar" {
+ append script [ah::js_include -js_file "${ah_base_url}yui/calendar/calendar.js"]
+ }
+ "dragdrop" {
+ append script [ah::js_include -js_file "${ah_base_url}yui/dragdrop/dragdrop.js"]
+ }
+ "slider" {
+ append script [ah::js_include -js_file "${ah_base_url}yui/slider/slider.js"]
+ }
+ default {
+ append script [ah::js_include -js_file "${ah_base_url}yui/yui.js"]
+ append script [ah::js_include -js_file "${ah_base_url}yui/dom/dom.js"]
+ }
+ }
+ }
- return $script
+ if { $enclose_p } { set script [ah::enclose_in_script -script ${script} ] }
+
+ return $script
}
ad_proc -private ah::exp::dynamic_load_functions {
-
+
} {
- Generates the javascript functions that perform dynamic loading of local javascript files.
- http://www.phpied.com/javascript-include/
- WARNING : experimental
+ Generates the javascript functions that perform dynamic loading of local javascript files.
+ http://www.phpied.com/javascript-include/
+ WARNING : experimental
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-04-20
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-04-20
} {
- set ah_base_url [ah::get_url]
- set script ""
- return $script
+ set ah_base_url [ah::get_url]
+ set script ""
+ return $script
}
ad_proc -public ah::exp::js_include {
- {-js_file ""}
+ {-js_file ""}
} {
- Generates the javscript to include a js file dynamically via DOM to the head section of the page.
- WARNING : experimental
+ Generates the javscript to include a js file dynamically via DOM to the head section of the page.
+ WARNING : experimental
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-04-20
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-04-20
} {
- return "js_include_once('$js_file'); "
+ return "js_include_once('$js_file'); "
}
ad_proc -public ah::exp::js_source_dynamic {
- {-js "default"}
- {-enclose:boolean}
+ {-js "default"}
+ {-enclose:boolean}
} {
- Uses the javascript dynamic loading functions to load the comma separated list of javascript source file.
- WARNING : experimental
+ Uses the javascript dynamic loading functions to load the comma separated list of javascript source file.
+ WARNING : experimental
- @author Hamilton Chua (ham@solutiongrove.com)
- @creation-date 2006-04-20
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2006-04-20
- @param js A comma separated list of js files to load. Possible values include prototype, scriptaculous, rounder, rico, overlibmws, overlibmws_bubble, overlibmws_scroll, overlibmws_drag
- @param enclose Specify this if you want the javascript to be enclosed in script tags, which is usually the case unless you include this along with other javascript.
+ @param js A comma separated list of js files to load. Possible values include prototype, scriptaculous, rounder, rico, overlibmws, overlibmws_bubble, overlibmws_scroll, overlibmws_drag
+ @param enclose Specify this if you want the javascript to be enclosed in script tags, which is usually the case unless you include this along with other javascript.
} {
- set ah_base_url [ah::get_url]
- set script ""
- set js_file_list [split $js ","]
-
- foreach x $js_file_list {
- switch $x {
- "rico" {
- append script [ah::js_include -js_file "${ah_base_url}rico/rico.js"]
- }
- "rounder" {
- append script [ah::js_include -js_file "${ah_base_url}rico/rico.js"]
- append script [ah::js_include -js_file "${ah_base_url}rico/rounder.js"]
- }
- "overlibmws" {
- append script [ah::js_include -js_file "${ah_base_url}overlibmws/overlibmws.js"]
- append script [ah::js_include -js_file "${ah_base_url}overlibmws/overlibmws_overtwo.js"]
- }
- "overlibmws_bubble" {
- append script [ah::js_include -js_file "${ah_base_url}overlibmws/overlibmws_bubble.js"]
- }
- "overlibmws_scroll" {
- append script [ah::js_include -js_file "${ah_base_url}overlibmws/overlibmws_scroll.js"]
- }
- "overlibmws_drag" {
- append script [ah::js_include -js_file "${ah_base_url}overlibmws/overlibmws_draggable.js"]
- }
- default {
- append script [ah::js_include -js_file "${ah_base_url}prototype/prototype.js"]
- append script [ah::js_include -js_file "${ah_base_url}scriptaculous/scriptaculous.js"]
- }
- }
- }
+ set ah_base_url [ah::get_url]
+ set script ""
+ set js_file_list [split $js ","]
- if { $enclose_p } { set script [ah::enclose_in_script -script ${script} ] }
+ foreach x $js_file_list {
+ switch $x {
+ "rico" {
+ append script [ah::js_include -js_file "${ah_base_url}rico/rico.js"]
+ }
+ "rounder" {
+ append script [ah::js_include -js_file "${ah_base_url}rico/rico.js"]
+ append script [ah::js_include -js_file "${ah_base_url}rico/rounder.js"]
+ }
+ "overlibmws" {
+ append script [ah::js_include -js_file "${ah_base_url}overlibmws/overlibmws.js"]
+ append script [ah::js_include -js_file "${ah_base_url}overlibmws/overlibmws_overtwo.js"]
+ }
+ "overlibmws_bubble" {
+ append script [ah::js_include -js_file "${ah_base_url}overlibmws/overlibmws_bubble.js"]
+ }
+ "overlibmws_scroll" {
+ append script [ah::js_include -js_file "${ah_base_url}overlibmws/overlibmws_scroll.js"]
+ }
+ "overlibmws_drag" {
+ append script [ah::js_include -js_file "${ah_base_url}overlibmws/overlibmws_draggable.js"]
+ }
+ default {
+ append script [ah::js_include -js_file "${ah_base_url}prototype/prototype.js"]
+ append script [ah::js_include -js_file "${ah_base_url}scriptaculous/scriptaculous.js"]
+ }
+ }
+ }
- return $script
+ if { $enclose_p } { set script [ah::enclose_in_script -script ${script} ] }
+
+ return $script
}
Index: openacs-4/packages/ajaxhelper/tcl/json-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/tcl/json-procs.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/ajaxhelper/tcl/json-procs.tcl 25 Apr 2018 19:47:46 -0000 1.4
+++ openacs-4/packages/ajaxhelper/tcl/json-procs.tcl 14 Feb 2019 16:15:01 -0000 1.4.2.1
@@ -67,7 +67,7 @@
# we are dealing with an Object
getc
set state OBJECT
- set dictVal {}
+ set dictVal [list]
}
VALUE {
# this object element's value is an Object
Index: openacs-4/packages/ajaxhelper/www/doc/default-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/www/doc/default-master.tcl,v
diff -u -r1.2 -r1.2.4.1
--- openacs-4/packages/ajaxhelper/www/doc/default-master.tcl 27 Oct 2014 16:40:53 -0000 1.2
+++ openacs-4/packages/ajaxhelper/www/doc/default-master.tcl 14 Feb 2019 16:15:01 -0000 1.2.4.1
@@ -45,7 +45,7 @@
accesskey \
class \
id \
- tabindex
+ tabindex
}
for {set i 1} {$i <= [template::multirow size navigation]} {incr i} {
template::multirow get navigation $i
@@ -65,7 +65,7 @@
en \
"all"
-#
+#
# User information and top level navigation links
#
set user_id [ad_conn user_id]
@@ -108,7 +108,7 @@
#
util_get_user_messages -multirow user_messages
-#
+#
# Set acs-lang urls
#
set acs_lang_url [apm_package_url_from_key "acs-lang"]
@@ -161,7 +161,7 @@
#
# Curriculum specific bar
-# TODO: remove this and add a more systematic / package independent way
+# TODO: remove this and add a more systematic / package independent way
# TODO of getting this content here
#
set curriculum_bar_p [expr {
Index: openacs-4/packages/ajaxhelper/www/doc/head-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/www/doc/head-procs.tcl,v
diff -u -r1.5 -r1.5.2.1
--- openacs-4/packages/ajaxhelper/www/doc/head-procs.tcl 25 Apr 2018 19:47:46 -0000 1.5
+++ openacs-4/packages/ajaxhelper/www/doc/head-procs.tcl 14 Feb 2019 16:15:01 -0000 1.5.2.1
@@ -20,28 +20,28 @@
} {
variable ::template::head::scripts
array unset scripts
- array set scripts {}
+ array set scripts [list]
variable ::template::head::links
array unset links
- array set links {}
+ array set links [list]
variable ::template::head::metas
array unset metas
- array set metas {}
+ array set metas [list]
variable ::template::body_handlers
array unset body_handlers
- array set body_handlers {}
+ array set body_handlers [list]
variable ::template::body_scripts
array unset body_scripts
- set body_scripts {}
+ set body_scripts [list]
variable ::template::headers
- set headers {}
+ set headers [list]
variable ::template::footers
- set footers {}
+ set footers [list]
}
ad_proc -public template::head::add_script {
@@ -349,7 +349,7 @@
}
if {$direction eq "outer"} {
- set headers [concat [list $values] $headers]
+ set headers [linsert $headers 0 [list $values]]
} else {
lappend headers $values
}
Index: openacs-4/packages/ajaxhelper/www/tests/test_dojochartengine.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/www/tests/test_dojochartengine.tcl,v
diff -u -r1.3 -r1.3.2.1
--- openacs-4/packages/ajaxhelper/www/tests/test_dojochartengine.tcl 26 Apr 2018 08:56:37 -0000 1.3
+++ openacs-4/packages/ajaxhelper/www/tests/test_dojochartengine.tcl 14 Feb 2019 16:15:01 -0000 1.3.2.1
@@ -1,6 +1,6 @@
# create the list that holds our data
-set data {}
+set data [list]
lappend data [list [list "x" "1"] [list "y" "10"] ]
lappend data [list [list "x" "5"] [list "y" "20"] ]
@@ -25,7 +25,7 @@
return $type
}
$objname proc bindings_from_list {lists_of_pairs} {
- set pairs {}
+ set pairs [list]
foreach pair $lists_of_pairs {
lappend pairs [join $pair ":"]
}
@@ -58,7 +58,7 @@
return $varname
}
$objname proc range_from_list {rangelist} {
- set pairs {}
+ set pairs [list]
foreach pair $rangelist {
lappend pairs [join $pair ":"]
}
@@ -100,7 +100,7 @@
return $varname
}
$objname proc range_from_list {rangelist} {
- set pairs {}
+ set pairs [list]
foreach pair $rangelist {
lappend pairs [join $pair ":"]
}
@@ -135,7 +135,7 @@
$objname set axis_obj_list [list "axis1" "axis2"]
$objname proc createscript { } {
my instvar varname series_obj_list axis_obj_list
- set axislist {}
+ set axislist [list]
foreach axis $axis_obj_list {
lappend axislist [$axis getvarname]
}
Index: openacs-4/packages/ajaxhelper/www/tests/test_yahoomenu-js.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/www/tests/test_yahoomenu-js.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/ajaxhelper/www/tests/test_yahoomenu-js.tcl 25 Apr 2018 19:47:46 -0000 1.4
+++ openacs-4/packages/ajaxhelper/www/tests/test_yahoomenu-js.tcl 14 Feb 2019 16:15:01 -0000 1.4.2.1
@@ -2,7 +2,7 @@
# Menu 1
-# set menulist1 {}
+# set menulist1 [list]
# lappend menulist1 [list [list "text" "Google"] [list "url" "http://www.google.com"] ]
# lappend menulist1 [list [list "text" "Yahoo"] [list "url" "http://www.yahoo.com"] ]
@@ -19,11 +19,11 @@
# Menu 2
-# set submenuitems {}
+# set submenuitems [list]
# lappend submenuitems [list [list "text" "Home Page"] [list "url" "http://www.solutiongrove.com"] ]
# lappend submenuitems [list [list "text" "Blog"] [list "url" "http://www.solutiongrove.com/blogger/"] ]
# set submenulist1 [list [list "id" "sgrovelinks"] [list "itemdata" $submenuitems] ]
-# set menulist2 {}
+# set menulist2 [list]
# lappend menulist2 [list [list "text" "OpenACS"] [list "url" "http://www.openacs.org"] ]
# lappend menulist2 [list [list "text" "Solution Grove"] [list "submenu" $submenulist1] ]
Index: openacs-4/packages/ajaxhelper/www/tests/test_yahootreeview.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/www/tests/test_yahootreeview.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/ajaxhelper/www/tests/test_yahootreeview.tcl 26 Apr 2018 08:56:37 -0000 1.4
+++ openacs-4/packages/ajaxhelper/www/tests/test_yahootreeview.tcl 14 Feb 2019 16:15:01 -0000 1.4.2.1
@@ -1,5 +1,5 @@
# create the nodes for our tree
-set nodes {}
+set nodes [list]
# 1st level
lappend nodes [list "fld1" "Folder 1" "tree" "" "" "" ""]
Index: openacs-4/packages/assessment/tcl/as-action-proc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-action-proc.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/assessment/tcl/as-action-proc.tcl 3 May 2018 20:27:42 -0000 1.4
+++ openacs-4/packages/assessment/tcl/as-action-proc.tcl 14 Feb 2019 16:15:01 -0000 1.4.2.1
@@ -2,33 +2,29 @@
Assessment action procs
@author vivian@viaro.net Viaro Networks (www.viaro.net)
@creation-date 2005-01-13
-
}
namespace eval as::action_p {}
ad_proc -public as::action_p::action_exec {
{-inter_item_check_id}
{-session_id}
-
-
} {
Execute the action created on the tcl_code
} {
db_foreach get_check_params { select * from as_param_map where inter_item_check_id = :inter_item_check_id } {
- set parameter_name [db_1row select_name "select varname from as_action_params where parameter_id = :parameter_id"]
- if {![info exists value] || $value eq ""} {
- set $varname [db_string get_item_choice {select idc.choice_id from as_item_data_choices idc,as_item_data id where id.as_item_id=$item_id and id.item_data_id=idc.item_data_id and id.session_id=:session_id}]
+ set parameter_name [db_1row select_name "select varname from as_action_params where parameter_id = :parameter_id"]
+ if {![info exists value] || $value eq ""} {
+ set $varname [db_string get_item_choice {select idc.choice_id from as_item_data_choices idc,as_item_data id where id.as_item_id=$item_id and id.item_data_id=idc.item_data_id and id.session_id=:session_id}]
- }else {
+ } else {
- set $varname $value
+ set $varname $value
+ }
}
- }
set tcl_code [db_1row select_tcl "select a.tcl_code from as_actions a,as_actions_map am where am.action_id = a.action_id and inter_item_check_id = :inter_item_check_id"]
eval $tcl_code
return
-
}
# Local variables:
Index: openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl,v
diff -u -r1.27 -r1.27.2.1
--- openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 7 Aug 2017 23:48:03 -0000 1.27
+++ openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 14 Feb 2019 16:15:01 -0000 1.27.2.1
@@ -28,14 +28,14 @@
db_transaction {
set item_item_type_mc_id [content::item::new -parent_id $folder_id -content_type {as_item_type_mc} -name [as::item::generate_unique_name]]
set as_item_type_mc_id [content::revision::new \
- -item_id $item_item_type_mc_id \
- -content_type {as_item_type_mc} \
- -title $title \
- -attributes [list [list increasing_p $increasing_p] \
- [list allow_negative_p $allow_negative_p] \
- [list num_correct_answers $num_correct_answers] \
- [list num_answers $num_answers] \
- [list allow_other_p $allow_other_p] ] ]
+ -item_id $item_item_type_mc_id \
+ -content_type {as_item_type_mc} \
+ -title $title \
+ -attributes [list [list increasing_p $increasing_p] \
+ [list allow_negative_p $allow_negative_p] \
+ [list num_correct_answers $num_correct_answers] \
+ [list num_answers $num_answers] \
+ [list allow_other_p $allow_other_p] ] ]
}
return $as_item_type_mc_id
@@ -57,16 +57,16 @@
} {
# Update as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id)
db_transaction {
- set type_item_id [db_string type_item_id {}]
+ set type_item_id [db_string type_item_id {}]
set new_item_type_id [content::revision::new \
- -item_id $type_item_id \
- -content_type {as_item_type_mc} \
- -title $title \
- -attributes [list [list increasing_p $increasing_p] \
- [list allow_negative_p $allow_negative_p] \
- [list num_correct_answers $num_correct_answers] \
- [list num_answers $num_answers] \
- [list allow_other_p $allow_other_p] ] ]
+ -item_id $type_item_id \
+ -content_type {as_item_type_mc} \
+ -title $title \
+ -attributes [list [list increasing_p $increasing_p] \
+ [list allow_negative_p $allow_negative_p] \
+ [list num_correct_answers $num_correct_answers] \
+ [list num_answers $num_answers] \
+ [list allow_other_p $allow_other_p] ] ]
}
return $new_item_type_id
@@ -83,23 +83,23 @@
} {
# Update as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id)
db_transaction {
- db_1row item_type_data {}
+ db_1row item_type_data {}
set new_item_type_id [content::revision::new \
- -item_id $type_item_id \
- -content_type {as_item_type_mc} \
- -title $title \
- -attributes [list [list increasing_p $increasing_p] \
- [list allow_negative_p $allow_negative_p] \
- [list num_correct_answers $num_correct_answers] \
- [list num_answers $num_answers] \
- [list allow_other_p $allow_other_p] ] ]
+ -item_id $type_item_id \
+ -content_type {as_item_type_mc} \
+ -title $title \
+ -attributes [list [list increasing_p $increasing_p] \
+ [list allow_negative_p $allow_negative_p] \
+ [list num_correct_answers $num_correct_answers] \
+ [list num_answers $num_answers] \
+ [list allow_other_p $allow_other_p] ] ]
- if {$with_choices_p == "t"} {
- set choices [db_list get_choices {}]
- foreach choice_id $choices {
- set new_choice_id [as::item_choice::new_revision -choice_id $choice_id -mc_id $new_item_type_id]
- }
- }
+ if {$with_choices_p == "t"} {
+ set choices [db_list get_choices {}]
+ foreach choice_id $choices {
+ set new_choice_id [as::item_choice::new_revision -choice_id $choice_id -mc_id $new_item_type_id]
+ }
+ }
}
return $new_item_type_id
@@ -120,24 +120,24 @@
# Insert as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id)
db_transaction {
- db_1row item_type_data {}
+ db_1row item_type_data {}
if {[info exists new_title]} {
- set title $new_title
- }
- if {[string is false $copy_correct_answer_p]} {
- set num_correct_answers 0
- }
- set new_item_type_id [new -title $title \
- -increasing_p $increasing_p \
- -allow_negative_p $allow_negative_p \
- -num_correct_answers $num_correct_answers \
- -num_answers $num_answers \
+ set title $new_title
+ }
+ if {[string is false $copy_correct_answer_p]} {
+ set num_correct_answers 0
+ }
+ set new_item_type_id [new -title $title \
+ -increasing_p $increasing_p \
+ -allow_negative_p $allow_negative_p \
+ -num_correct_answers $num_correct_answers \
+ -num_answers $num_answers \
-allow_other_p $allow_other_p]
- set choices [db_list get_choices {}]
- foreach choice_id $choices {
- set new_choice_id [as::item_choice::copy -choice_id $choice_id -mc_id $new_item_type_id -copy_correct_answer_p $copy_correct_answer_p]
- }
+ set choices [db_list get_choices {}]
+ foreach choice_id $choices {
+ set new_choice_id [as::item_choice::copy -choice_id $choice_id -mc_id $new_item_type_id -copy_correct_answer_p $copy_correct_answer_p]
+ }
}
return $new_item_type_id
@@ -157,52 +157,52 @@
Render a Multiple Choice Type
} {
set allow_other_p [as::item_type_mc::allow_other_p -item_type_id $type_id]
-
+
set defaults ""
if {$default_value ne ""} {
array set values $default_value
- set defaults $values(choice_answer)
+ set defaults $values(choice_answer)
if {$allow_other_p} {
set defaults [list $defaults $values(clob_answer)]
}
}
if {$session_id ne ""} {
- if {$show_feedback eq "" || $show_feedback eq "none"} {
- set choice_list ""
- db_foreach get_sorted_choices {} {
- if {$content_value ne ""} {
- db_1row get_content_value ""
- set title [as::assessment::display_content -content_id $content_rev_id -filename $content_filename -content_type $content_type -title $title]
- }
- lappend choice_list [list $title $choice_id]
- }
- } else {
- # incorrect correct
- set choice_list ""
+ if {$show_feedback eq "" || $show_feedback eq "none"} {
+ set choice_list ""
+ db_foreach get_sorted_choices {} {
+ if {$content_value ne ""} {
+ db_1row get_content_value ""
+ set title [as::assessment::display_content -content_id $content_rev_id -filename $content_filename -content_type $content_type -title $title]
+ }
+ lappend choice_list [list $title $choice_id]
+ }
+ } else {
+ # incorrect correct
+ set choice_list ""
- db_foreach get_sorted_choices_with_feedback {} {
- if {$content_value ne ""} {
- db_1row get_content_value ""
- set title [as::assessment::display_content -content_id $content_rev_id -filename $content_filename -content_type $content_type -title $title]
- }
- set pos [lsearch -exact $defaults $choice_id]
- if {$pos>-1 && $correct_answer_p == "t" && $show_feedback ne "incorrect"} {
- lappend choice_list [list "$title $feedback_text" $choice_id]
- } elseif {$pos>-1 && $correct_answer_p == "f" && $show_feedback ne "correct"} {
- lappend choice_list [list "$title $feedback_text" $choice_id]
- } else {
- if {[llength $defaults] && $correct_answer_p == "t" && $show_feedback ne "incorrect" && $show_feedback ne "correct"} {
- lappend choice_list [list "$title " $choice_id]
- } else {
- lappend choice_list [list $title $choice_id]
- }
- }
- }
- }
-
- if {[llength $choice_list] > 0} {
- return [list $defaults $choice_list]
- }
+ db_foreach get_sorted_choices_with_feedback {} {
+ if {$content_value ne ""} {
+ db_1row get_content_value ""
+ set title [as::assessment::display_content -content_id $content_rev_id -filename $content_filename -content_type $content_type -title $title]
+ }
+ set pos [lsearch -exact $defaults $choice_id]
+ if {$pos>-1 && $correct_answer_p == "t" && $show_feedback ne "incorrect"} {
+ lappend choice_list [list "$title $feedback_text" $choice_id]
+ } elseif {$pos>-1 && $correct_answer_p == "f" && $show_feedback ne "correct"} {
+ lappend choice_list [list "$title $feedback_text" $choice_id]
+ } else {
+ if {[llength $defaults] && $correct_answer_p == "t" && $show_feedback ne "incorrect" && $show_feedback ne "correct"} {
+ lappend choice_list [list "$title " $choice_id]
+ } else {
+ lappend choice_list [list $title $choice_id]
+ }
+ }
+ }
+ }
+
+ if {[llength $choice_list] > 0} {
+ return [list $defaults $choice_list]
+ }
}
db_1row item_type_data {}
@@ -212,108 +212,108 @@
set wrong_choices [list]
set total 0
db_foreach choices {} {
- incr total
- if {$content_value ne ""} {
- db_1row get_content_value ""
- set title [as::assessment::display_content -content_id $content_rev_id -filename $content_filename -content_type $content_type -title $title]
- }
- if {$show_feedback ne "" && $show_feedback ne "none"} {
- set pos [lsearch -exact $defaults $choice_id]
- if {$pos > -1 && $correct_answer_p == "t" && $show_feedback ne "incorrect"} {
- lappend display_choices [list "$title $feedback_text" $choice_id]
- } elseif {$pos>-1 && $correct_answer_p == "f" && $show_feedback ne "correct"} {
- lappend display_choices [list "$title $feedback_text" $choice_id]
- } else {
- if {$correct_answer_p == "t" && $show_feedback ne "incorrect" && $show_feedback ne "correct"} {
- lappend display_choices [list "$title " $choice_id]
- } else {
- lappend display_choices [list $title $choice_id]
- }
- }
- } else {
- lappend display_choices [list $title $choice_id]
- }
-
-# lappend display_choices [list $title $choice_id]
- if {$selected_p == "t"} {
- lappend defaults $choice_id
- }
- if {$fixed_position ne ""} {
- set fixed_pos($fixed_position) [list $title $choice_id]
- if {$num_answers ne ""} {
- incr num_answers -1
- }
- if {$correct_answer_p == "t" && $num_correct_answers ne ""} {
- incr num_correct_answers -1
- }
- } else {
- if {$correct_answer_p == "t"} {
- lappend correct_choices [list $title $choice_id]
- } else {
- lappend wrong_choices [list $title $choice_id]
- }
- }
+ incr total
+ if {$content_value ne ""} {
+ db_1row get_content_value ""
+ set title [as::assessment::display_content -content_id $content_rev_id -filename $content_filename -content_type $content_type -title $title]
+ }
+ if {$show_feedback ne "" && $show_feedback ne "none"} {
+ set pos [lsearch -exact $defaults $choice_id]
+ if {$pos > -1 && $correct_answer_p == "t" && $show_feedback ne "incorrect"} {
+ lappend display_choices [list "$title $feedback_text" $choice_id]
+ } elseif {$pos>-1 && $correct_answer_p == "f" && $show_feedback ne "correct"} {
+ lappend display_choices [list "$title $feedback_text" $choice_id]
+ } else {
+ if {$correct_answer_p == "t" && $show_feedback ne "incorrect" && $show_feedback ne "correct"} {
+ lappend display_choices [list "$title " $choice_id]
+ } else {
+ lappend display_choices [list $title $choice_id]
+ }
+ }
+ } else {
+ lappend display_choices [list $title $choice_id]
+ }
+
+ # lappend display_choices [list $title $choice_id]
+ if {$selected_p == "t"} {
+ lappend defaults $choice_id
+ }
+ if {$fixed_position ne ""} {
+ set fixed_pos($fixed_position) [list $title $choice_id]
+ if {$num_answers ne ""} {
+ incr num_answers -1
+ }
+ if {$correct_answer_p == "t" && $num_correct_answers ne ""} {
+ incr num_correct_answers -1
+ }
+ } else {
+ if {$correct_answer_p == "t"} {
+ lappend correct_choices [list $title $choice_id]
+ } else {
+ lappend wrong_choices [list $title $choice_id]
+ }
+ }
}
if {[array exists fixed_pos]} {
- if {$num_answers eq ""} {
- set num_answers [expr {[llength $correct_choices] + [llength $wrong_choices]}]
- }
- if {$num_correct_answers eq ""} {
- set num_correct_answers [llength $correct_choices]
- }
+ if {$num_answers eq ""} {
+ set num_answers [expr {[llength $correct_choices] + [llength $wrong_choices]}]
+ }
+ if {$num_correct_answers eq ""} {
+ set num_correct_answers [llength $correct_choices]
+ }
}
if {$num_answers ne "" && $num_answers < $total} {
- # display fewer choices, select random
- set correct_choices [util::randomize_list $correct_choices]
- set wrong_choices [util::randomize_list $wrong_choices]
+ # display fewer choices, select random
+ set correct_choices [util::randomize_list $correct_choices]
+ set wrong_choices [util::randomize_list $wrong_choices]
- if {$num_correct_answers ne "" && $num_correct_answers > 0 && $num_correct_answers < [llength $correct_choices]} {
- # display fewer correct answers than there are
- set display_choices [lrange $correct_choices 1 $num_correct_answers]
- } else {
- # display all correct answers
- set display_choices $correct_choices
- }
+ if {$num_correct_answers ne "" && $num_correct_answers > 0 && $num_correct_answers < [llength $correct_choices]} {
+ # display fewer correct answers than there are
+ set display_choices [lrange $correct_choices 1 $num_correct_answers]
+ } else {
+ # display all correct answers
+ set display_choices $correct_choices
+ }
- # now fill up with wrong answers
- set display_choices [concat $display_choices [lrange $wrong_choices 0 [expr $num_answers - [llength $display_choices] -1]]]
- set display_choices [util::randomize_list $display_choices]
+ # now fill up with wrong answers
+ set display_choices [concat $display_choices [lrange $wrong_choices 0 [expr $num_answers - [llength $display_choices] -1]]]
+ set display_choices [util::randomize_list $display_choices]
}
# now add fixed positions in result list
if {[array exists fixed_pos]} {
- set max_pos [expr {$num_answers + [array size fixed_pos]}]
- set open_positions $display_choices
- set display_choices [list]
+ set max_pos [expr {$num_answers + [array size fixed_pos]}]
+ set open_positions $display_choices
+ set display_choices [list]
- for {set position 1} {$position <= $max_pos} {incr position} {
- if {[info exists fixed_pos($position)]} {
- lappend display_choices $fixed_pos($position)
- array unset fixed_pos $position
- } elseif {[llength $open_positions] > 0} {
- lappend display_choices [lindex $open_positions 0]
- set open_positions [lreplace $open_positions 0 0]
- }
- }
- # set negative fixed positions relative to the end of the choice list
- if {[array exists fixed_pos]} {
- foreach position [lsort -integer [array names fixed_pos]] {
- if {$position < 0} {
- lappend display_choices $fixed_pos($position)
- }
- }
- }
+ for {set position 1} {$position <= $max_pos} {incr position} {
+ if {[info exists fixed_pos($position)]} {
+ lappend display_choices $fixed_pos($position)
+ array unset fixed_pos $position
+ } elseif {[llength $open_positions] > 0} {
+ lappend display_choices [lindex $open_positions 0]
+ set open_positions [lreplace $open_positions 0 0]
+ }
+ }
+ # set negative fixed positions relative to the end of the choice list
+ if {[array exists fixed_pos]} {
+ foreach position [lsort -integer [array names fixed_pos]] {
+ if {$position < 0} {
+ lappend display_choices $fixed_pos($position)
+ }
+ }
+ }
}
# save choice order
if {$session_id ne ""} {
- set count 0
- foreach one_choice $display_choices {
- lassign $one_choice title choice_id
- incr count
- db_dml save_order {}
- }
+ set count 0
+ foreach one_choice $display_choices {
+ lassign $one_choice title choice_id
+ incr count
+ db_dml save_order {}
+ }
}
return [list $defaults $display_choices]
@@ -339,36 +339,36 @@
array set type [util_memoize [list as::item_type_mc::data -type_id $type_id]]
array set choices $type(choices)
if {[info exists type(correct_choices)]} {
- array set correct_choices $type(correct_choices)
+ array set correct_choices $type(correct_choices)
}
if {$type(increasing_p) == "t"} {
- # if not all correct answers are given, award fraction of the points
- set percent 0
- foreach choice_id $response {
- incr percent $choices($choice_id)
- }
+ # if not all correct answers are given, award fraction of the points
+ set percent 0
+ foreach choice_id $response {
+ incr percent $choices($choice_id)
+ }
} else {
- # award 100% points if and only if all correct answers are given
- set count_correct 0
- if {[array exists correct_choices] && [lsort -integer $response] == [lsort -integer [array names correct_choices]]} {
- set points $max_points
- } elseif {[array size correct_choices] > 0} {
- # FIXME !! create setting for partial credit or use existing one
- foreach elm $response {
- if {[lsearch [array names correct_choices] $elm] > -1} {
- incr count_correct
- }
- }
- set points [expr {$count_correct / (0.0 + [array size correct_choices]) * $max_points}]
- } else {
- set points 0
- }
+ # award 100% points if and only if all correct answers are given
+ set count_correct 0
+ if {[array exists correct_choices] && [lsort -integer $response] == [lsort -integer [array names correct_choices]]} {
+ set points $max_points
+ } elseif {[array size correct_choices] > 0} {
+ # FIXME !! create setting for partial credit or use existing one
+ foreach elm $response {
+ if {[lsearch [array names correct_choices] $elm] > -1} {
+ incr count_correct
+ }
+ }
+ set points [expr {$count_correct / (0.0 + [array size correct_choices]) * $max_points}]
+ } else {
+ set points 0
+ }
}
if {$type(allow_negative_p) == "f" && $points < 0} {
- # don't allow negative percentage
- set points 0
+ # don't allow negative percentage
+ set points 0
}
if {$type(allow_other_p)} {
@@ -394,15 +394,15 @@
db_1row item_type_data {} -column_array type
db_foreach check_choices {} {
- if {$correct_answer_p == "t"} {
- set correct_choices($choice_id) $percent_score
- }
- set choices($choice_id) $percent_score
+ if {$correct_answer_p == "t"} {
+ set correct_choices($choice_id) $percent_score
+ }
+ set choices($choice_id) $percent_score
}
set type(choices) [array get choices]
if {[array exists correct_choices]} {
- set type(correct_choices) [array get correct_choices]
+ set type(correct_choices) [array get correct_choices]
}
return [array get type]
@@ -419,28 +419,28 @@
Return the results of a given item in a given list of sessions as an array
} {
-
+
db_foreach get_results {} {
- if {$text_value eq ""} {
- lappend results($session_id) [as::assessment::quote_export -text $title]
- } else {
- lappend results($session_id) [as::assessment::quote_export -text $text_value]
- }
+ if {$text_value eq ""} {
+ lappend results($session_id) [as::assessment::quote_export -text $title]
+ } else {
+ lappend results($session_id) [as::assessment::quote_export -text $text_value]
+ }
}
foreach session_id [array names results] {
- set results($session_id) [join $results($session_id) ","]
+ set results($session_id) [join $results($session_id) ","]
}
if {[array exists results]} {
- return [array get results]
+ return [array get results]
} else {
- return
+ return
}
}
ad_proc -private as::item_type_mc::add_choices_to_form {
- -form_id
+ -form_id
-num_choices
-choice_array_name
-correct_choice_array_name
@@ -469,7 +469,7 @@
} else {
ad_form -extend -name $form_id -form [list [list choice.$i:text,optional,nospell {label "[_ assessment.Choice] $i"} {html {style {width: 80%;} maxlength 1000}}]]
}
-
+
if {[info exists correct($i)]} {
ad_form -extend -name $form_id -form [list [list correct.$i:text(checkbox),optional {label "[_ assessment.Correct_Answer_Choice] $i"} {options $correct_options} {values t }]]
} else {
@@ -491,7 +491,7 @@
{-allow_negative_p "f"}
{-allow_other_p "f"}
} {
- Add the multiple choice item to an assessment. The creates the
+ Add the multiple choice item to an assessment. The creates the
as_item_type_mc object and all the choices and associates the as_item_id
with an assessment, or updates the assessment with the latest version
@@ -519,23 +519,23 @@
}
foreach c [array names correct] {
if {$correct($c) == "t"} {
- incr num_correct_answers
+ incr num_correct_answers
}
}
-
+
if {![as::item::get_item_type_info -as_item_id $as_item_id] \
- || $item_type_info(object_type) ne "as_item_type_mc"} {
- # always set mc title to empty on new mc question
- # we ask for a title for the mc answer set separately if
- # required
+ || $item_type_info(object_type) ne "as_item_type_mc"} {
+ # always set mc title to empty on new mc question
+ # we ask for a title for the mc answer set separately if
+ # required
set mc_id [as::item_type_mc::new \
-title $title \
-increasing_p $increasing_p \
-allow_negative_p $allow_negative_p \
-num_correct_answers $num_correct_answers \
-num_answers $num_answers \
-allow_other_p $allow_other_p]
-
+
if {![info exists item_type_info(object_type)]} {
# first item type mapped
as::item_rels::new -item_rev_id $as_item_id -target_rev_id $mc_id -type as_item_type_rel
@@ -553,7 +553,7 @@
-allow_negative_p $allow_negative_p \
-num_correct_answers $num_correct_answers \
-num_answers $num_answers]
-
+
as::item::update_item_type -item_type_id $mc_id -as_item_id $as_item_id
}
@@ -593,15 +593,15 @@
}
ad_proc -private as::item_type_mc::add_existing_choices_to_edit_form {
- -form_id
+ -form_id
-existing_choices
-choice_array_name
-correct_choice_array_name
} {
Add form elements for multiple choice question choices
@param form_id Form builder form_id of the form to add the elements to. Error if form does not exist
- @param num_choices Number of choice form elements to add
+ @param existing_choices Choice form elements to add
@param choice_array_name Name of array in callers scope to look for existing choices
@param correct_choice_array_name Name of array in the caller's scope to check for correct choices
@@ -722,9 +722,9 @@
db_1row get_sort_order_to_be_removed {}
set choices [db_list get_choices {}]
foreach old_choice_id $choices {
- if {$old_choice_id != $choice_id} {
- set new_choice_id [as::item_choice::new_revision -choice_id $old_choice_id -mc_id $new_mc_id]
- }
+ if {$old_choice_id != $choice_id} {
+ set new_choice_id [as::item_choice::new_revision -choice_id $old_choice_id -mc_id $new_mc_id]
+ }
}
db_dml move_up_choices {}
}
Index: openacs-4/packages/assessment/tcl/as-list-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-list-procs.tcl,v
diff -u -r1.12 -r1.12.2.1
--- openacs-4/packages/assessment/tcl/as-list-procs.tcl 10 Jul 2018 15:14:01 -0000 1.12
+++ openacs-4/packages/assessment/tcl/as-list-procs.tcl 14 Feb 2019 16:15:01 -0000 1.12.2.1
@@ -135,7 +135,7 @@
{-hide_p 0}
{-element_select 1}
{-element_from 1}
-} {
+} {
Build list template specs from assessment item information.
@return list of specs
@@ -217,8 +217,7 @@
} {
Generate list builder filter spec from one assessment question
- @param as_item_id Revision_id of hte question
- @param item_type Type of question
+ @param as_item_id Revision_id of the question
@param item_title What we display for the filter label for the question
} {
@@ -364,8 +363,7 @@
} {
Generate list builder groupby filter spec from one assessment question
- @param as_item_id Revision_id of hte question
- @param item_type Type of question
+ @param as_item_id Revision_id of the question
@param item_title What we display for the filter label for the question
} {
@@ -380,8 +378,7 @@
} {
Generate list builder orderby filter spec from one assessment question
- @param as_item_id Revision_id of hte question
- @param item_type Type of question
+ @param as_item_id Revision_id of the question
@param item_title What we display for the filter label for the question
} {
set item_ref as_item_id_$cr_item_id
Index: openacs-4/packages/assessment/tcl/as-qti-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-qti-procs.tcl,v
diff -u -r1.50 -r1.50.2.1
--- openacs-4/packages/assessment/tcl/as-qti-procs.tcl 7 Aug 2017 23:48:03 -0000 1.50
+++ openacs-4/packages/assessment/tcl/as-qti-procs.tcl 14 Feb 2019 16:15:01 -0000 1.50.2.1
@@ -11,26 +11,26 @@
{-tmp_dir:required}
{-community_id:required}
} {
- Relation with assessment
+ Relation with assessment
} {
-
+
if {[regexp -nocase -- {\.zip$} $tmp_dir]} {
- # Generate a random directory name
- set tmpdirectory [ad_tmpnam]
- # Create a temporary directory
- file mkdir $tmpdirectory
- # UNZIP the zip file in the temporary directory
- catch { exec unzip ${tmp_dir} -d $tmpdirectory } outMsg
+ # Generate a random directory name
+ set tmpdirectory [ad_tmpnam]
+ # Create a temporary directory
+ file mkdir $tmpdirectory
+ # UNZIP the zip file in the temporary directory
+ catch { exec unzip ${tmp_dir} -d $tmpdirectory } outMsg
- set url_assessment {}
- # Read the content of the temporary directory
- foreach file_i [ glob -directory $tmpdirectory *{.xml} ] {
- set url_assessment [as::qti::register_xml -xml_file $file_i -community_id $community_id]
- }
+ set url_assessment {}
+ # Read the content of the temporary directory
+ foreach file_i [ glob -directory $tmpdirectory *{.xml} ] {
+ set url_assessment [as::qti::register_xml -xml_file $file_i -community_id $community_id]
+ }
- # Delete the temporary directory
- file delete -force -- $tmpdirectory
+ # Delete the temporary directory
+ file delete -force -- $tmpdirectory
} else {
set url_assessment [as::qti::register_xml -xml_file $tmp_dir -community_id $community_id]
}
@@ -84,7 +84,7 @@
set assessment_id [as::qti::register_xml_object_id -xml_file $xml_file -community_id $community_id -prop $prop]
set url_assessment "../../assessment/assessment?assessment_id=$assessment_id"
-
+
return $url_assessment
}
@@ -104,23 +104,23 @@
# FIXME this is a hack until I figure out how to get the
# package_id of the assessment of the current community
ad_conn -set package_id [db_string get_assessment_package_id {select dotlrn_community_applets.package_id from dotlrn_community_applets join apm_packages on (dotlrn_community_applets.package_id=apm_packages.package_id) where community_id = :community_id and package_key='assessment'}]
-
+
set assessment_revision_id [as::qti::parse_qti_xml -prop $prop $xml_file]
content::item::set_live_revision -revision_id $assessment_revision_id
set assessment_id [db_string items_items_as_item_id "SELECT item_id FROM cr_revisions WHERE revision_id = :assessment_revision_id"]
# Restore the package_id
ad_conn -set package_id $current_package_id
-
+
return $assessment_id
}
ad_proc -private as::qti::mattext_gethtml { mattextNode } { Get the HTML of a mattext } {
set texttype [$mattextNode getAttribute {texttype} {text/plain}]
if { $texttype eq "text/html" } {
- return [$mattextNode text]
+ return [$mattextNode text]
} else {
- return [ad_html_text_convert -from text/plain -to text/html -- [$mattextNode text]]
+ return [ad_html_text_convert -from text/plain -to text/html -- [$mattextNode text]]
}
}
@@ -136,318 +136,318 @@
# get all @doc.title@
XoWiki Includelet
+
+
+
+
+
"]
+ -object_id $object_id \
+ -folder_id $cat_folder_id \
+ -selected_category_id $category_id \
+ -fs_url $fs_url \
+ -joinwith "
"]
}
}
Index: openacs-4/packages/file-storage/www/folder-zip-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-zip-add.tcl,v
diff -u -r1.11 -r1.11.2.1
--- openacs-4/packages/file-storage/www/folder-zip-add.tcl 6 Dec 2018 15:48:10 -0000 1.11
+++ openacs-4/packages/file-storage/www/folder-zip-add.tcl 14 Feb 2019 16:15:01 -0000 1.11.2.1
@@ -1,36 +1,49 @@
ad_page_contract {
- page to add a new file to the system
+ Page to upload and decompress a zip file into the file storage.
+
@author Kevin Scaldeferri (kevin@arsdigita.com)
@creation-date 6 Nov 2000
@cvs-id $Id$
+
} {
+
file_id:naturalnum,optional,notnull
- folder_id:naturalnum,optional,notnull
+ {folder_id:naturalnum,notnull ""}
upload_file:trim,optional,notnull
- return_url:localurl,optional
+ {return_url:localurl ""}
upload_file.tmpfile:tmpfile,optional
{title ""}
{lock_title_p:boolean 0}
} -properties {
+
folder_id:onevalue
context:onevalue
title:onevalue
lock_title_p:onevalue
+
} -validate {
+
file_id_or_folder_id {
- if {[info exists file_id] && $file_id ne ""
- && (![info exists folder_id] || $folder_id eq "")} {
+ #
+ # Get parent folder_id from file_id, if such exists and folder_id is
+ # empty, and complain if the resultant folder is not valid.
+ #
+ if {[info exists file_id] && $file_id ne "" && $folder_id eq ""} {
set folder_id [db_string get_folder_id {
select parent_id as folder_id from cr_items where item_id=:file_id
} -default ""]
}
- if {![info exists folder_id] || ![fs_folder_p $folder_id]} {
+ if {$folder_id eq "" || ![fs_folder_p $folder_id]} {
ad_complain "The specified parent folder is not valid."
}
}
+
max_size -requires {upload_file} {
+ #
+ # Check if the file is larger than fs::max_upload_size.
+ #
set n_bytes [file size ${upload_file.tmpfile}]
set max_bytes [fs::max_upload_size]
if { $n_bytes > $max_bytes } {
@@ -39,203 +52,238 @@
}
}
-set user_id [ad_conn user_id]
-set package_id [ad_conn package_id]
-# check for write permission on the folder or item
+set user_id [ad_conn user_id]
+set package_id [ad_conn package_id]
+set creation_ip [ad_conn peeraddr]
+# Check for write permission on the folder.
permission::require_permission \
-object_id $folder_id \
-party_id $user_id \
-privilege "write"
if {![ad_form_new_p -key file_id]} {
+ #
+ # Check for write permission on the file if we are editing existing data,
+ # adding a file revision in this case, and set the context bar accordingly.
+ #
permission::require_permission \
- -object_id $file_id \
- -party_id $user_id \
- -privilege "write"
+ -object_id $file_id \
+ -party_id $user_id \
+ -privilege "write"
set context [fs_context_bar_list -final "[_ file-storage.Add_Revision]" $folder_id]
-
} else {
set context [fs_context_bar_list -final "[_ file-storage.Add_File]" $folder_id]
}
+# Add file_id and upload_file to the form.
ad_form -name file_add -html { enctype multipart/form-data } -export { folder_id lock_title_p } -form {
file_id:key
{upload_file:file {label \#file-storage.Upload_a_file\#} {html "size 30"}}
}
-if {[info exists return_url] && $return_url ne ""} {
+# Add return_url to the form if is not empty.
+if {$return_url ne ""} {
ad_form -extend -name file_add -form {
- {return_url:text(hidden) {value $return_url}}
+ {return_url:text(hidden) {value $return_url}}
}
}
+# 'Lock' title if lock_title_p.
if {$lock_title_p} {
ad_form -extend -name file_add -form {
- {title:text(hidden) {value $title}}
+ {title:text(hidden) {value $title}}
}
} else {
ad_form -extend -name file_add -form {
- {title:text {label \#file-storage.Title\#} {html {size 30}} }
+ {title:text {label \#file-storage.Title\#} {html {size 30}} }
}
}
-if {[ad_form_new_p -key file_id]} {
+# Add an explanation about the purpose of the form.
+if {[ad_form_new_p -key file_id]} {
ad_form -extend -name file_add -form {
{unpack_message:text(inform) {label "[_ file-storage.Important]"} {value "[_ file-storage.Use_this_form_to_upload_a_ZIP]"}}
}
}
+# Rest of the form.
ad_form -extend -name file_add -form {} -new_data {
-
- # create a new folder to hold the zip contents
- # TODO make sure its name is unique?
-
+ #
+ # new_data block, which unzips the file and uploads its contents to the file
+ # storage, creating the necessary folders.
+ #
+ # Start defining the title if it does not exist already.
+ #
if {$title eq ""} {
- set title [file rootname [list [template::util::file::get_property filename $upload_file]]]
+ set title [file rootname [list [template::util::file::get_property filename $upload_file]]]
}
- set folder_id [content::item::get_id_by_name -name $title -parent_id $folder_id]
+
+ #
+ # Create a new folder to hold the zip contents, if it does not exist already.
+ #
+ set parent_folder_id $folder_id
+ set folder_id [content::item::get_id_by_name -name $title -parent_id $parent_folder_id]
if {$folder_id eq ""} {
- set folder_id [content::folder::new -name $title -parent_id $folder_id -label $title]
+ set folder_id [content::folder::new -name $title -parent_id $parent_folder_id -label $title]
}
-
+
+ #
+ # Uncompress the file.
+ #
set unzip_binary [string trim [parameter::get -parameter UnzipBinary]]
-
if { $unzip_binary ne "" } {
-
+ #
+ # Create temp directory to unzip.
+ #
set unzip_path [ad_tmpnam]
file mkdir $unzip_path
+
+ #
+ # Unzip.
+ #
+ # More flexible parameter design could be:
+ # zip {unzip -jd {out_path} {in_file}} tar {tar xf {in_file} {out_path}} tgz {tar xzf {in_file} {out_path}}
+ #
# save paths! get rid of -j switch --DAVEB 20050628
+ #
catch { exec $unzip_binary -d $unzip_path ${upload_file.tmpfile} } errmsg
-
- # More flexible parameter design could be:
- # zip {unzip -jd {out_path} {in_file}} tar {tar xf {in_file} {out_path}} tgz {tar xzf {in_file} {out_path}}
-
+
+ #
+ # Get two lists of the files to upload, with and without their full path.
+ #
set upload_files [list]
set upload_tmpfiles [list]
-
foreach file [ad_find_all_files "$unzip_path"] {
lappend upload_files [regsub "^$unzip_path\/" $file {}]
lappend upload_tmpfiles $file
}
-
} else {
- set upload_files [list [template::util::file::get_property filename $upload_file]]
+ #
+ # No unzip available, just upload the whole zip file.
+ #
+ set upload_files [list [template::util::file::get_property filename $upload_file]]
set upload_tmpfiles [list [template::util::file::get_property tmp_filename $upload_file]]
}
-
- if { [lindex $upload_files 0] eq ""} {
+ set number_upload_files [llength $upload_files]
+
+ #
+ # Something is quite broken if there are no files to upload.
+ #
+ if {$number_upload_files == 0} {
ad_return_complaint 1 "
revision_id
} {
- aa_export_vars {p_item_id
+ aa_export_vars {p_item_id
p_full_details p_title p_text p_package_id p_make_active_revision_p
p_description
- p_approval_user p_approval_ip p_approval_date p_archive_date
+ p_approval_user p_approval_ip p_approval_date p_archive_date
revision_id}
if {$p_full_details == "t"} {
set p_approval_user [ad_conn "user_id"]
set p_approval_ip [ad_conn "peeraddr"]
set p_approval_date [dt_sysdate]
set p_archive_date [dt_sysdate]
} else {
- set p_approval_user [db_null]
- set p_approval_ip [db_null]
- set p_approval_date [db_null]
- set p_archive_date [db_null]
+ set p_approval_user ""
+ set p_approval_ip ""
+ set p_approval_date ""
+ set p_archive_date ""
}
set revision_id [db_exec_plsql revision-create {
begin
@@ -371,7 +371,7 @@
set retrieval_ok_p 1
if {![db_0or1row get-cr-news-row {
select package_id, archive_date,
- approval_user, approval_date, approval_ip
+ approval_user, approval_date, approval_ip
from cr_news
where news_id = :p_news_id
}]} {
@@ -646,7 +646,7 @@
db
config
} -on_error {
- The "news" object type doesn't exist, or has isn't configured correctly.
+ The "news" object type doesn't exist, or has isn't configured correctly.
The most probable cause of this is that the news package datamodel hasn't been
installed.
} "check_object_type" {
@@ -797,7 +797,7 @@
# Call the news.name function to retrieve the item name.
#
aa_log "Call news.name function to retrieve title of content revision"
- set p_news_id $news_id
+ set p_news_id $news_id
set name [db_exec_plsql news-name {}]
aa_equals "Check the return from news.name is correct" $name $p_title
}
@@ -820,7 +820,7 @@
set p_item_id $item_id
aa_call_component db-get-cr-items-row
aa_false "Check the cr_items row was deleted" {$retrieval_ok_p}
-
+
set p_revision_id $news_id
aa_call_component db-get-cr-revisions-row
aa_false "Check the cr_revisions row was deleted" {$retrieval_ok_p}
@@ -1041,7 +1041,7 @@
#
set p_news_id $news_id
aa_call_component db-get-cr-news-row
- aa_equals "Check the archive_date is null" $archive_date [db_null]
+ aa_equals "Check the archive_date is null" $archive_date ""
#
# Set the archive period, providing an explicit archive date.
@@ -1162,10 +1162,10 @@
if {!$retrieval_ok_p} {
aa_error "cr_news row not found for new revision news_id $revision2_id"
} else {
- aa_equals "Check the archive_date is null" $archive_date [db_null]
- aa_equals "Check the approval_date is null" $approval_date [db_null]
- aa_equals "Check the aprroval_user is null" $approval_user [db_null]
- aa_equals "Check the approval_ip is null" $approval_ip [db_null]
+ aa_equals "Check the archive_date is null" $archive_date ""
+ aa_equals "Check the approval_date is null" $approval_date ""
+ aa_equals "Check the aprroval_user is null" $approval_user ""
+ aa_equals "Check the approval_ip is null" $approval_ip ""
}
#
@@ -1176,7 +1176,7 @@
if {!$retrieval_ok_p} {
aa_error "cr_revisions row not found for new revision revision_id $revision2_id"
} else {
- aa_equals "Check revision 2 publish_date is null" $publish_date [db_null]
+ aa_equals "Check revision 2 publish_date is null" $publish_date ""
}
#
@@ -1295,10 +1295,10 @@
aa_log "Unapproving revision 1, setting publish_date null, archive_date null"
set p_revision_id $revision1_id
set p_approve_p "t"
- set p_publish_date [db_null]
- set p_archive_date [db_null]
+ set p_publish_date ""
+ set p_archive_date ""
set p_approval_user [ad_conn "user_id"]
- set p_approval_date [db_null]
+ set p_approval_date ""
set p_approval_ip [ad_conn "peeraddr"]
set p_live_revision_p "t"
aa_call_component db-news-set-approve
@@ -1317,7 +1317,7 @@
set p_revision_id $revision1_id
set p_approve_p "t"
set p_publish_date [clock format [clock scan "+ 1 year"] -format %Y-%m-%d] ; # in the future
- set p_archive_date [db_null]
+ set p_archive_date ""
set p_approval_user [ad_conn "user_id"]
set p_approval_date "2001-11-03"
set p_approval_ip [ad_conn "peeraddr"]
@@ -1359,7 +1359,7 @@
set p_revision_id $revision1_id
set p_approve_p "t"
set p_publish_date "2000-11-01"
- set p_archive_date [db_null]
+ set p_archive_date ""
set p_approval_user [ad_conn "user_id"]
set p_approval_date "2001-11-03"
set p_approval_ip [ad_conn "peeraddr"]
Index: openacs-4/packages/news/www/item-create-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/item-create-3.tcl,v
diff -u -r1.22 -r1.22.2.1
--- openacs-4/packages/news/www/item-create-3.tcl 19 Jun 2018 10:08:24 -0000 1.22
+++ openacs-4/packages/news/www/item-create-3.tcl 14 Feb 2019 16:15:01 -0000 1.22.2.1
@@ -13,8 +13,8 @@
publish_body:allhtml,notnull,trim
publish_body.format:path,notnull,trim
{publish_lead {}}
- {publish_date_ansi:trim "[db_null]"}
- {archive_date_ansi:trim "[db_null]"}
+ {publish_date_ansi:trim ""}
+ {archive_date_ansi:trim ""}
permanent_p:boolean,notnull
} -errors {
imgfile_valid {Image file invalid}
@@ -36,22 +36,22 @@
#
# the news_admin or an open approval policy allow immediate publishing
#
-if { $news_admin_p == 1 || $approval_policy eq "open" } {
+if { $news_admin_p == 1 || $approval_policy eq "open" } {
set approval_user [ad_conn user_id]
set approval_ip [ad_conn peeraddr]
set approval_date [dt_sysdate]
set live_revision_p "t"
} else {
- set approval_user [db_null]
- set approval_ip [db_null]
- set approval_date [db_null]
+ set approval_user ""
+ set approval_ip ""
+ set approval_date ""
set live_revision_p "f"
}
# Allow the user to "never expire" a news item.
if {$permanent_p == "t"} {
- set archive_date_ansi [db_null]
-}
+ set archive_date_ansi ""
+}
# get creation_foo
set creation_date [dt_sysdate]
@@ -80,9 +80,9 @@
# case: user submitted news item, is returned to a Thank-you page
set title [_ news.News_item_submitted]
set context [list $title]
- ad_return_template item-create-thankyou
+ ad_return_template item-create-thankyou
}
-} else {
+} else {
# case: administrator returned to index page
ad_returnredirect ""
ad_script_abort
Index: openacs-4/packages/news/www/admin/approve-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/approve-2.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/news/www/admin/approve-2.tcl 2 Feb 2018 00:17:02 -0000 1.9
+++ openacs-4/packages/news/www/admin/approve-2.tcl 14 Feb 2019 16:15:01 -0000 1.9.2.1
@@ -5,12 +5,12 @@
This page makes the insert of publish_date and archive_date (optionally)
into cr_revisions and cr_news(news_id) resp. without intermediate confirmation.
The administrator is redirected to return_url:localurl
-
+
@author stefan@arsdigita.com
@creation-date 2000-12-20
@cvs-id $Id$
-} {
+} {
revision_id:naturalnum,notnull
{return_url:localurl ""}
{permanent_p:boolean "f"}
@@ -25,17 +25,17 @@
if {$permanent_p == "t"} {
- set archive_date_ansi [db_null]
+ set archive_date_ansi ""
} else {
set archive_date_ansi $archive_date(date)
if { [dt_interval_check $archive_date_ansi $publish_date_ansi] >= 0 } {
- ad_return_error "[_ news.Scheduling_Error]" \
- "[_ news.lt_The_archive_date_must]"
+ ad_return_error "[_ news.Scheduling_Error]" \
+ "[_ news.lt_The_archive_date_must]"
ad_script_abort
- }
+ }
}
@@ -46,9 +46,9 @@
foreach id $revision_id {
-
- db_exec_plsql news_item_approve_publish {}
+ db_exec_plsql news_item_approve_publish {}
+
}
set package_id [ad_conn package_id]
if {[rss_support::subscription_exists \
Index: openacs-4/packages/news/www/admin/revision-add-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/revision-add-3.tcl,v
diff -u -r1.16 -r1.16.2.1
--- openacs-4/packages/news/www/admin/revision-add-3.tcl 19 Jun 2018 10:08:24 -0000 1.16
+++ openacs-4/packages/news/www/admin/revision-add-3.tcl 14 Feb 2019 16:15:01 -0000 1.16.2.1
@@ -2,14 +2,14 @@
ad_page_contract {
- This page adds a new revision to a news item
+ This page adds a new revision to a news item
and redirects to the item page of that item
@author stefan@arsdigita.com
@creation-date 2000-12-20
@cvs-id $Id$
-} {
+} {
item_id:naturalnum,notnull
publish_title:notnull
publish_lead
@@ -25,36 +25,36 @@
set mime_type ${publish_body.format}
if {$permanent_p == "t"} {
- set archive_date_ansi [db_null]
-}
+ set archive_date_ansi ""
+}
# approval foo
set approval_user [ad_conn "user_id"]
set approval_ip [ad_conn "peeraddr"]
set approval_date [dt_sysdate]
set live_revision_p "t"
-# creation foo
+# creation foo
set creation_ip [ad_conn "peeraddr"]
set creation_user [ad_conn "user_id"]
# make new revision the active revision
set active_revision_p "t"
# Insert is 2-step process, same as in item-create-3.tcl
-if {[catch {
+if {[catch {
set revision_id [db_exec_plsql create_news_item_revision {}]
set content_add [db_map content_add]
- if {![string match $content_add ""]} {
- db_dml content_add {
+ if {![string match $content_add ""]} {
+ db_dml content_add {
update cr_revisions
set content = empty_blob()
where revision_id = :revision_id
returning content into :1
} -blobs [list $publish_body]
}
-
+
} errmsg ]} {
set complaint " [_ news.lt_The_database_did_not_] \
Index: openacs-4/packages/search/tcl/search-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/search/tcl/search-procs.tcl,v
diff -u -r1.55 -r1.55.2.1
--- openacs-4/packages/search/tcl/search-procs.tcl 29 Jan 2019 19:14:32 -0000 1.55
+++ openacs-4/packages/search/tcl/search-procs.tcl 14 Feb 2019 16:15:01 -0000 1.55.2.1
@@ -420,7 +420,7 @@
if {[apm_package_installed_p dotlrn]} {
set site_node [site_node::get_node_id_from_object_id -object_id $package_id]
set dotlrn_package_id [site_node::closest_ancestor_package -node_id $site_node -package_key dotlrn -include_self]
- set community_id [db_string get_community_id {select community_id from dotlrn_communities_all where package_id=:dotlrn_package_id} -default [db_null]]
+ set community_id [db_string get_community_id {select community_id from dotlrn_communities_all where package_id=:dotlrn_package_id} -default ""]
return $community_id
}
return ""
Index: openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl,v
diff -u -r1.16 -r1.16.2.1
--- openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 7 Aug 2017 23:48:29 -0000 1.16
+++ openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 14 Feb 2019 16:15:01 -0000 1.16.2.1
@@ -30,6 +30,8 @@
ad_proc -public get_pretty_name {
} {
+ Get pretty name.
+ } {
return [parameter::get_from_package_key -package_key [my_package_key] -parameter static_admin_portlet_pretty_name]
}
@@ -40,14 +42,16 @@
ad_proc -public link {
} {
+ Get link. This is currently empty.
+ } {
return ""
}
ad_proc -public add_self_to_page {
{-portal_id:required}
{-package_id:required}
} {
- Adds a static admin PE to the given portal
+ Adds a static admin PE to the given portal.
} {
return [portal::add_element_parameters \
-portal_id $portal_id \
@@ -61,7 +65,7 @@
ad_proc -public remove_self_from_page {
{-portal_id:required}
} {
- Removes static PE from the given page
+ Removes static PE from the given page.
} {
# This is easy since there's one and only one instace_id
portal::remove_element \
@@ -72,7 +76,7 @@
ad_proc -public show {
cf
} {
- Display the PE
+ Display the PE.
} {
portal::show_proc_helper \
-package_key [my_package_key] \
Index: openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl,v
diff -u -r1.22 -r1.22.2.1
--- openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 12 Apr 2018 07:47:22 -0000 1.22
+++ openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 14 Feb 2019 16:15:01 -0000 1.22.2.1
@@ -32,7 +32,7 @@
{-pretty_name:required}
{-format "text/html"}
} {
- Calls the pl/sql to create the new content item
+ Calls the pl/sql to create the new content item.
} {
# Create the content item
set content_id [db_exec_plsql new_content_item {}]
@@ -120,7 +120,7 @@
} {
A helper proc for cloning. There could be multiple static portlets
that need to be cloned. Make a deep copy of all the static portal
- content and update the all the corresponding element's pointers
+ content and update the all the corresponding element's pointers.
} {
set ds_id [portal::get_datasource_id [static_portlet::get_my_name]]
@@ -145,13 +145,18 @@
ad_proc -public remove_from_portal {
{-portal_id:required}
{-content_id:required}
+ } {
+ Remove content from the portal. This is currently not
+ implemented and will return an error to the user.
} {
ad_return_complaint 1 "static_portal_content::remove_from_portal not implemented"
}
ad_proc -public remove_all_from_portal {
{-portal_id:required}
} {
+ Remove all static portlets from the portal.
+ } {
db_transaction {
# should remove all of 'em
set element_id [portal::remove_element \
@@ -168,7 +173,7 @@
{-pretty_name:required}
{-format "text/html"}
} {
- updates the content item
+ Updates the content item.
} {
db_transaction {
# update the content item
@@ -190,7 +195,7 @@
ad_proc -public delete {
{-content_id:required}
} {
- deletes the item
+ Deletes the item.
} {
db_dml delete_content_item {
delete from static_portal_content where content_id = :content_id
@@ -200,15 +205,15 @@
ad_proc -public get_pretty_name {
{-content_id:required}
} {
- Get the pretty_name of the item
+ Get the pretty_name of the item.
} {
return [db_string select {}]
}
ad_proc -public get_content {
{-content_id:required}
} {
- Get the content of the item
+ Get the content of the item.
} {
return [db_string get_content.select {
select content
@@ -220,15 +225,15 @@
ad_proc -public get_package_id {
{-content_id:required}
} {
- Get the package_id of the item
+ Get the package_id of the item.
} {
return [db_string get_package_id.select {}]
}
ad_proc -public get_content_format {
{-content_id:required}
} {
- Get the format of the content's item
+ Get the format of the content's item.
} {
return [db_string get_content_format.select {} ]
}
Index: openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl 7 Aug 2017 23:48:29 -0000 1.9
+++ openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl 14 Feb 2019 16:15:01 -0000 1.9.2.1
@@ -33,6 +33,8 @@
ad_proc -public get_pretty_name {
} {
+ Get pretty name. This is currently empty.
+ } {
return ""
}
@@ -43,14 +45,16 @@
ad_proc -public link {
} {
+ Get link. This is currently empty.
+ } {
return ""
}
ad_proc -public add_self_to_page {
{-portal_id:required}
{-package_id:required}
} {
- Adds a static PE to the given page
+ Adds a static PE to the given page.
} {
ns_log notice "static_portlet::add_self_to_page - Don't call me. Use static_portal_content:: instead"
error
@@ -60,7 +64,7 @@
portal_id
element_id
} {
- Removes static PE from the given page
+ Removes static PE from the given page.
} {
# This is easy since there's one and only one instace_id
portal::remove_element $element_id
@@ -69,6 +73,7 @@
ad_proc -public show {
cf
} {
+ Show the static portlet.
} {
portal::show_proc_helper \
-package_key [my_package_key] \
Index: openacs-4/packages/static-portlet/www/element-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/element-delete.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/static-portlet/www/element-delete.tcl 7 Aug 2017 23:48:29 -0000 1.9
+++ openacs-4/packages/static-portlet/www/element-delete.tcl 14 Feb 2019 16:15:01 -0000 1.9.2.1
@@ -16,9 +16,9 @@
ad_page_contract {
delete a static element
-
+
@author arjun (arjun@openforce)
- @cvs_id $Id$
+ @cvs-id $Id$
} -query {
{content_id:naturalnum,notnull}
{referer:notnull}
Index: openacs-4/packages/static-portlet/www/element.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/element.tcl,v
diff -u -r1.23 -r1.23.2.1
--- openacs-4/packages/static-portlet/www/element.tcl 23 Apr 2018 13:45:44 -0000 1.23
+++ openacs-4/packages/static-portlet/www/element.tcl 14 Feb 2019 16:15:01 -0000 1.23.2.1
@@ -18,7 +18,7 @@
edit a static element
@author arjun (arjun@openforce)
- @cvs_id $Id$
+ @cvs-id $Id$
} -query {
{content_id:naturalnum,optional ""}
referer:notnull
@@ -80,59 +80,59 @@
-package_id $package_id \
-content [template::util::richtext::get_property contents $content] \
-format [template::util::richtext::get_property format $content] \
- -pretty_name $pretty_name]
-
+ -pretty_name $pretty_name]
+
set old_element_id [static_portal_content::add_to_portal \
- -portal_id $portal_id \
- -package_id $package_id \
- -content_id $item_id]
+ -portal_id $portal_id \
+ -package_id $package_id \
+ -content_id $item_id]
}
# support for templates & already created portals for users,
# classes, etc. (roc)
switch $type {
- user {
- set query "select portal_id as target_portal_id from dotlrn_users"
- set community_id $package_id
- set new_content_id $item_id
- }
- dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" }
- dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" }
- dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" }
- default {
- ad_returnredirect $referer
- ad_script_abort
- }
+ user {
+ set query "select portal_id as target_portal_id from dotlrn_users"
+ set community_id $package_id
+ set new_content_id $item_id
+ }
+ dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" }
+ dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" }
+ dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" }
+ default {
+ ad_returnredirect $referer
+ ad_script_abort
+ }
}
-
+
db_foreach dotlrn_type_portals "$query" {
- if {$type ne "user" } {
- # clone the template's content
- set new_content_id [static_portal_content::new \
- -package_id $community_id \
- -content [template::util::richtext::get_property contents $content] \
- -format [template::util::richtext::get_property format $content] \
- -pretty_name $pretty_name ]
- }
-
+ if {$type ne "user" } {
+ # clone the template's content
+ set new_content_id [static_portal_content::new \
+ -package_id $community_id \
+ -content [template::util::richtext::get_property contents $content] \
+ -format [template::util::richtext::get_property format $content] \
+ -pretty_name $pretty_name ]
+ }
- set new_element_id [ static_portal_content::add_to_portal \
- -portal_id $target_portal_id \
- -package_id $community_id \
- -content_id $new_content_id]
-
+ set new_element_id [ static_portal_content::add_to_portal \
+ -portal_id $target_portal_id \
+ -package_id $community_id \
+ -content_id $new_content_id]
- portal::set_element_param $new_element_id "package_id" $community_id
- portal::set_element_param $new_element_id "content_id" $new_content_id
- if {$enforce_portlet == 0} {
- db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :new_element_id }
- }
+ portal::set_element_param $new_element_id "package_id" $community_id
+ portal::set_element_param $new_element_id "content_id" $new_content_id
+
+ if {$enforce_portlet == 0} {
+ db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :new_element_id }
+ }
+
}
# redirect and abort
@@ -145,84 +145,82 @@
static_portal_content::update \
-portal_id $portal_id \
-content_id $element_content_id \
- -pretty_name $pretty_name \
- -content [template::util::richtext::get_property contents $content] \
- -format [template::util::richtext::get_property format $content]
+ -pretty_name $pretty_name \
+ -content [template::util::richtext::get_property contents $content] \
+ -format [template::util::richtext::get_property format $content]
}
switch $type {
- user {
- set query "select portal_id as target_portal_id from dotlrn_users"
+ user {
+ set query "select portal_id as target_portal_id from dotlrn_users"
set community_id $package_id
- }
- dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" }
- dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" }
- dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" }
- default {
- ad_returnredirect $referer
- ad_script_abort
- }
+ }
+ dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" }
+ dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" }
+ dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" }
+ default {
+ ad_returnredirect $referer
+ ad_script_abort
+ }
}
db_foreach dotlrn_type_portals "$query" {
- if { ($type ne "user") } {
- catch {
- set element_content_id [db_string get_content_id {
- select content_id
- from static_portal_content
- where package_id = :community_id
- and pretty_name = :pretty_name
- }]
- } errmsg2
- }
+ if { $type ne "user" } {
+ catch {
+ set element_content_id [db_string get_content_id {
+ select content_id
+ from static_portal_content
+ where package_id = :community_id
+ and pretty_name = :pretty_name
+ }]
+ } errmsg2
+ }
- set no_portlet [catch {set element_id [portal::get_element_id_from_unique_param -portal_id $target_portal_id -key content_id -value $element_content_id]} errmsg]
+ set no_portlet [catch {set element_id [portal::get_element_id_from_unique_param -portal_id $target_portal_id -key content_id -value $element_content_id]} errmsg]
- if { $no_portlet } {
+ if { $no_portlet } {
- # if we are here, means that the portlet do not exists
- # for given portal_id, then instead of update, we'll
- # create it
+ # if we are here, means that the portlet do not exists
+ # for given portal_id, then instead of update, we'll
+ # create it
- if {$type ne "user" } {
- # clone the template's content
- set element_content_id [static_portal_content::new \
- -package_id $community_id \
- -content [template::util::richtext::get_property contents $content] \
- -format [template::util::richtext::get_property format $content] \
- -pretty_name $pretty_name ]
- }
+ if {$type ne "user" } {
+ # clone the template's content
+ set element_content_id [static_portal_content::new \
+ -package_id $community_id \
+ -content [template::util::richtext::get_property contents $content] \
+ -format [template::util::richtext::get_property format $content] \
+ -pretty_name $pretty_name ]
+ }
- set new_element_id [ static_portal_content::add_to_portal \
- -portal_id $target_portal_id \
- -package_id $community_id \
- -content_id $element_content_id]
+ set new_element_id [ static_portal_content::add_to_portal \
+ -portal_id $target_portal_id \
+ -package_id $community_id \
+ -content_id $element_content_id]
- portal::set_element_param $new_element_id "package_id" $community_id
- portal::set_element_param $new_element_id "content_id" $element_content_id
- set element_id $element_content_id
+ portal::set_element_param $new_element_id "package_id" $community_id
+ portal::set_element_param $new_element_id "content_id" $element_content_id
+ set element_id $element_content_id
+ } else {
- } else {
+ static_portal_content::update \
+ -portal_id $target_portal_id \
+ -content_id $element_content_id \
+ -pretty_name $pretty_name \
+ -content [template::util::richtext::get_property contents $content] \
+ -format [template::util::richtext::get_property format $content]
+ }
- static_portal_content::update \
- -portal_id $target_portal_id \
- -content_id $element_content_id \
- -pretty_name $pretty_name \
- -content [template::util::richtext::get_property contents $content] \
- -format [template::util::richtext::get_property format $content]
- }
-
- if {$enforce_portlet == 0} {
- db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :element_id }
- } else {
- db_dml hide_portlet { update portal_element_map set state = 'full' where element_id = :element_id }
- }
-
+ if {$enforce_portlet == 0} {
+ db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :element_id }
+ } else {
+ db_dml hide_portlet { update portal_element_map set state = 'full' where element_id = :element_id }
+ }
}
-
+
# redirect and abort
ad_returnredirect $referer
ad_script_abort
@@ -238,18 +236,18 @@
{label "[_ static-portlet.File]"}
}
{content_format:text(select)
- {label "Format"}
- {options [template::util::richtext::format_options]}
+ {label "Format"}
+ {options [template::util::richtext::format_options]}
{value "text/plain"}
}
}
if {$type in $templates} {
set elements [list \
- [list {enforce_portlet:text(select)} [list label [_ static-portlet.lt_Enforce_this_applet_t]] \
- [list help_text [_ static-portlet.lt_Enforce_True_means_th]] \
- [list options [list [list [_ static-portlet.True] 1] [list [_ static-portlet.False_0] 0]]] \
- [list value 0]]]
+ [list {enforce_portlet:text(select)} [list label [_ static-portlet.lt_Enforce_this_applet_t]] \
+ [list help_text [_ static-portlet.lt_Enforce_True_means_th]] \
+ [list options [list [list [_ static-portlet.True] 1] [list [_ static-portlet.False_0] 0]]] \
+ [list value 0]]]
ad_form -extend -name static_file -form $elements
}
@@ -283,8 +281,8 @@
set item_id [static_portal_content::new \
-package_id $package_id \
-content $content \
- -format $content_format \
- -pretty_name $pretty_name
+ -format $content_format \
+ -pretty_name $pretty_name
]
static_portal_content::add_to_portal \
@@ -298,48 +296,46 @@
# classes, etc. (roc)
switch $type {
- user {
- set query "select portal_id as target_portal_id from dotlrn_users"
- set community_id $package_id
- set new_content_id $item_id
- }
- dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" }
- dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" }
- dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" }
- default {
- ad_returnredirect $referer
- ad_script_abort
- }
+ user {
+ set query "select portal_id as target_portal_id from dotlrn_users"
+ set community_id $package_id
+ set new_content_id $item_id
+ }
+ dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" }
+ dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" }
+ dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" }
+ default {
+ ad_returnredirect $referer
+ ad_script_abort
+ }
}
-
+
db_foreach dotlrn_type_portals "$query" {
- if {$type ne "user" } {
- # clone the template's content
- set new_content_id [static_portal_content::new \
- -package_id $community_id \
- -content $content \
- -format $content_format \
- -pretty_name $pretty_name ]
- }
+ if {$type ne "user" } {
+ # clone the template's content
+ set new_content_id [static_portal_content::new \
+ -package_id $community_id \
+ -content $content \
+ -format $content_format \
+ -pretty_name $pretty_name ]
+ }
- set new_element_id [ static_portal_content::add_to_portal \
- -portal_id $target_portal_id \
- -package_id $community_id \
- -content_id $new_content_id]
+ set new_element_id [ static_portal_content::add_to_portal \
+ -portal_id $target_portal_id \
+ -package_id $community_id \
+ -content_id $new_content_id]
- portal::set_element_param $new_element_id "package_id" $community_id
- portal::set_element_param $new_element_id "content_id" $new_content_id
+ portal::set_element_param $new_element_id "package_id" $community_id
+ portal::set_element_param $new_element_id "content_id" $new_content_id
- if {$enforce_portlet == 0} {
- db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :new_element_id }
- }
-
+ if {$enforce_portlet == 0} {
+ db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :new_element_id }
+ }
}
-
# redirect and abort
ad_returnredirect $referer
ad_script_abort
@@ -361,83 +357,80 @@
-portal_id $portal_id \
-content_id $file_content_id \
-pretty_name $pretty_name \
- -content $content \
- -format $content_format
+ -content $content \
+ -format $content_format
}
switch $type {
- user {
- set query "select portal_id as target_portal_id from dotlrn_users"
- set community_id $package_id
- }
- dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" }
- dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" }
- dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" }
- default {
- ad_returnredirect $referer
- ad_script_abort
- }
+ user {
+ set query "select portal_id as target_portal_id from dotlrn_users"
+ set community_id $package_id
+ }
+ dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" }
+ dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" }
+ dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" }
+ default {
+ ad_returnredirect $referer
+ ad_script_abort
+ }
}
-
+
db_foreach dotlrn_type_portals "$query" {
- if {$type ne "user" } {
- catch {
- set file_content_id [db_string get_content_id {
- select content_id
- from static_portal_content
- where package_id = :community_id
- and pretty_name = :pretty_name
- }]
- } errmsg2
- }
+ if {$type ne "user" } {
+ catch {
+ set file_content_id [db_string get_content_id {
+ select content_id
+ from static_portal_content
+ where package_id = :community_id
+ and pretty_name = :pretty_name
+ }]
+ } errmsg2
+ }
+ set no_portlet [catch {set element_id [portal::get_element_id_from_unique_param -portal_id $target_portal_id -key content_id -value $file_content_id]} errmsg]
- set no_portlet [catch {set element_id [portal::get_element_id_from_unique_param -portal_id $target_portal_id -key content_id -value $file_content_id]} errmsg]
+ if { $no_portlet } {
- if { $no_portlet } {
+ # if we are here, means that the portlet do not exists
+ # for given portal_id, then instead of update, we'll
+ # create it
- # if we are here, means that the portlet do not exists
- # for given portal_id, then instead of update, we'll
- # create it
+ if {$type ne "user" } {
+ # clone the template's content
+ set file_content_id [static_portal_content::new \
+ -package_id $community_id \
+ -content $content \
+ -format $content_format \
+ -pretty_name $pretty_name ]
+ }
- if {$type ne "user" } {
- # clone the template's content
- set file_content_id [static_portal_content::new \
- -package_id $community_id \
- -content $content \
- -format $content_format \
- -pretty_name $pretty_name ]
- }
+ set new_element_id [ static_portal_content::add_to_portal \
+ -portal_id $target_portal_id \
+ -package_id $community_id \
+ -content_id $file_content_id]
- set new_element_id [ static_portal_content::add_to_portal \
- -portal_id $target_portal_id \
- -package_id $community_id \
- -content_id $file_content_id]
+ portal::set_element_param $new_element_id "package_id" $community_id
+ portal::set_element_param $new_element_id "content_id" $file_content_id
+ set element_id $file_content_id
- portal::set_element_param $new_element_id "package_id" $community_id
- portal::set_element_param $new_element_id "content_id" $file_content_id
- set element_id $file_content_id
+ } else {
+ static_portal_content::update \
+ -portal_id $target_portal_id \
+ -content_id $file_content_id \
+ -pretty_name $pretty_name \
+ -content $content \
+ -format $content_format
+ }
- } else {
-
- static_portal_content::update \
- -portal_id $target_portal_id \
- -content_id $file_content_id \
- -pretty_name $pretty_name \
- -content $content \
- -format $content_format
- }
+ if {$enforce_portlet == 0} {
+ db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :element_id }
+ } else {
+ db_dml hide_portlet { update portal_element_map set state = 'full' where element_id = :element_id }
+ }
+ }
- if {$enforce_portlet == 0} {
- db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :element_id }
- } else {
- db_dml hide_portlet { update portal_element_map set state = 'full' where element_id = :element_id }
- }
-
- }
-
# redirect and abort
ad_returnredirect $referer
ad_script_abort
Index: openacs-4/packages/static-portlet/www/static-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-admin-portlet.tcl,v
diff -u -r1.22 -r1.22.2.1
--- openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 7 Aug 2017 23:48:29 -0000 1.22
+++ openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 14 Feb 2019 16:15:01 -0000 1.22.2.1
@@ -16,10 +16,10 @@
ad_page_contract {
The display logic for the static admin portlet
-
+
@author arjun (arjun@openforce)
@author Ben Adida (ben@openforce)
- @cvs_id $Id$
+ @cvs-id $Id$
} {
{package_id:naturalnum,optional ""}
{template_portal_id:naturalnum,optional ""}
Index: openacs-4/packages/static-portlet/www/static-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-portlet.adp,v
diff -u -r1.11 -r1.11.2.1
--- openacs-4/packages/static-portlet/www/static-portlet.adp 7 Aug 2017 23:48:29 -0000 1.11
+++ openacs-4/packages/static-portlet/www/static-portlet.adp 14 Feb 2019 16:15:01 -0000 1.11.2.1
@@ -18,11 +18,11 @@
%>
-