Index: openacs-4/packages/connections/connections.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/connections.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/connections.info 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,27 @@
+
+
+
+
+ Connection
+ Connections
+ f
+ t
+
+
+ Hamilton Chua
+ A package that uses the categories package to store and map connection keywords (aka tags) to objects.
+ Solutiongrove
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/connections/lib/addform.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/addform.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/addform.adp 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,5 @@
+
\ No newline at end of file
Index: openacs-4/packages/connections/lib/addform.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/addform.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/addform.tcl 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,16 @@
+# packages/connections/lib/addform.tcl
+#
+# Connections
+#
+# Add one connection keyword
+# expects object_id and return_url
+
+if {![info exists object_id]} {
+ return -code error "Object ID is a required parameter."
+}
+
+if {![info exists return_url]} {
+ set return_url "./"
+}
+
+set connections_url [connections::get_url]
\ No newline at end of file
Index: openacs-4/packages/connections/lib/conlist.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/conlist.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/conlist.adp 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,3 @@
+
+ @connections.name@
+
\ No newline at end of file
Index: openacs-4/packages/connections/lib/conlist.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/conlist.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/conlist.tcl 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,24 @@
+# packages/connections/lib/conlist.tcl
+#
+# expects connections multirow
+#
+# Creates a customizable lists of connections
+# add code here to customize the multirow
+
+set connections_url [connections::get_url]
+
+template::multirow extend connections callout fontsize
+
+template::multirow foreach connections {
+ set fontsize [expr 12+$count]
+ if { [exists_and_not_null effects] && $effects == 1 } {
+ if { $fontsize > 17 } {
+ set callout [ah::ajax_bubblecallout -url "${connections_url}xmlhttp/getlatestobj" \
+ -pars "category_id=$category_id"]
+ } else {
+ set callout "onmouseout=\"nd();\""
+ }
+ } else {
+ set callout ""
+ }
+}
\ No newline at end of file
Index: openacs-4/packages/connections/lib/connections-view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/connections-view.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/connections-view.adp 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1 @@
+
\ No newline at end of file
Index: openacs-4/packages/connections/lib/connections-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/connections-view.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/connections-view.tcl 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,22 @@
+# packages/connections/lib/connections-view.tcl
+#
+# Given an object id, create a comma separated list of connection keywords
+#
+# @author Hamilton Chua (ham@solutiongrove.com)
+# @creation-date 2006-01-11
+
+
+# this include expects an object_id variable
+
+if {![info exists object_id]} {
+ return -code error "Object ID is a required parameter."
+}
+
+set connections_url [connections::get_url]
+set locale [ad_conn locale]
+
+db_multirow -extend { url } connections connections {
+ select c.category_id, c.object_id, t.name, count(*) as count from category_object_map c, category_translations t where c.category_id=t.category_id and t.locale=:locale and c.object_id=:object_id group by c.category_id,c.object_id,t.name;
+} {
+ set url [export_vars -base $connections_url\oneconnection { category_id }]
+}
\ No newline at end of file
Index: openacs-4/packages/connections/lib/connections.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/connections.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/connections.adp 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+ Start typing to search through tags:
+
+
+
+
+
+
+
+
+ @js_update_connections;noquote@
+
+
+
+
+
Index: openacs-4/packages/connections/lib/connections.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/connections.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/connections.tcl 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,61 @@
+# packages/connections/lib/connections.tcl
+#
+# Connections
+#
+# @author Roel Canicula (roel@solutiongrove.com)
+# @creation-date 2006-01-12
+# @arch-tag: 8c0fe913-8832-419a-9a35-672b4e1a8719
+# @cvs-id $Id: connections.tcl,v 1.1 2006/04/07 08:05:53 hamiltonc Exp $
+
+if {![info exists portlet_mode_p]} {
+ set portlet_mode_p 0
+}
+
+set tree_id [connections::category_tree_id]
+set locale [ad_conn locale]
+set connections_url [connections::get_url]
+
+if {!$portlet_mode_p} {
+ foreach required_param {search} {
+ if {![info exists $required_param]} {
+ return -code error "$required_param is a required parameter."
+ }
+ }
+ set limit_n 250
+} else {
+ set search ""
+ set limit_n 15
+}
+
+foreach optional_param {} {
+ if {![info exists $optional_param]} {
+ set $optional_param {}
+ }
+}
+
+set search_conn_js [ah::ajaxupdate -container "connections" \
+ -url "${connections_url}xmlhttp/getconnections" \
+ -pars "'search='+this.value+'&object_id=&limit_n=$limit_n'" \
+ -effectopts "duration: 0.5"]
+
+ad_form -name search -has_submit {1} -html { style "padding:0;margin:0" } -form {
+ {search:text {label ""} {html {size 15 onKeyDown "\$('connections').style.opacity=0;" onKeyUp "$search_conn_js" }}}
+}
+
+if { $search eq "" } {
+ set search_clause ""
+} else {
+ set search_clause {
+ and lower(t.name) like '%'||:search||'%'
+ }
+}
+
+if { ![exists_and_not_null effects] } {
+ set effects "0"
+}
+
+set js_update_connections [ah::ajaxupdate -container "connections" \
+ -url "${connections_url}xmlhttp/getconnections" \
+ -enclose \
+ -pars "'effects=$effects&limit_n=$limit_n'" \
+ -effectopts "duration: 0.5"]
\ No newline at end of file
Index: openacs-4/packages/connections/lib/objectlist.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/objectlist.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/objectlist.adp 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,6 @@
+
+
+
\ No newline at end of file
Index: openacs-4/packages/connections/lib/objectlist.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/objectlist.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/objectlist.tcl 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,22 @@
+# packages/connections/lib/objectlist.tcl
+#
+# expects objectlist multirow
+#
+# Creates a customizable lists of objects. Each object will have a link.
+# add code here to customize the multirow
+
+set connections_url [connections::get_url]
+
+template::multirow extend objectlist onmouseover
+
+template::multirow foreach objectlist {
+
+ set onmouseover "onmouseover=\""
+ append onmouseover [ah::ajaxupdate -container "$object_id" \
+ -url "$connections_url/xmlhttp/getoneobj" \
+ -pars "'object_id=$object_id'" \
+ -effectopts "duration: 1.0"]
+ append onmouseover "; \""
+
+ # set onmouseout "onmouseout=\"\$('$object_id').style.display='none';\""
+}
\ No newline at end of file
Index: openacs-4/packages/connections/lib/ot-user.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/ot-user.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/ot-user.adp 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,11 @@
+
+
+ @portrait;noquote@
+
+ @city@ , @state@ @zip@ @country@
+
@myintentions;noquote@
+
Connections:
@connections;noquote@
+
+
+ Sorry, we could not find details of this object.
+
\ No newline at end of file
Index: openacs-4/packages/connections/lib/ot-user.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/connections/lib/ot-user.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/connections/lib/ot-user.tcl 7 Apr 2006 08:05:53 -0000 1.1
@@ -0,0 +1,23 @@
+# packages/connections/lib/ot-user.tcl
+#
+# Retrieves a user's information
+#
+
+if { [db_0or1row "getusers" "select * from pi_user_list where user_id=:object_id"] } {
+
+ set abundant_p [pi::user::abundant_member_p -user_id $user_id]
+ set user_name [pi::user::name -user_id $user_id]
+
+ if { [dotfolio::user::portrait_p $user_id] } {
+ set portrait ""
+ }
+
+ regsub -all {<.+?>} $myintentions "" myintentions
+ if { [string length $myintentions] > 200 } {
+ set myintentions [string range $myintentions 0 199]
+ append myintentions " ..."
+ }
+
+ set connections [join [mypi::connections::getlist -user_id $user_id -with_url "0"] ", " ]
+
+}
\ No newline at end of file