Index: openacs-4/packages/content-portlet/.DS_Store
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/.DS_Store,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/.DS_Store 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1 @@
+ Bud1 � i0blob w w wfwi0blob icnv w w wfwswlong � @ � @ � @ � @ E � DSDB ` @ � @ � @
\ No newline at end of file
Index: openacs-4/packages/content-portlet/content-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/content-portlet.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/content-portlet.info 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,30 @@
+
+
+
+
+ Content Portlet
+ Content Portlet
+ f
+ t
+
+
+ Byron Linares (admin)
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/content-portlet/catalog/content-portlet.de_DE.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/catalog/content-portlet.de_DE.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/catalog/content-portlet.de_DE.ISO-8859-1.xml 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,9 @@
+
+
+
+ Content Portlet
+ Content Portlets verwalten
+ Neues %element_pretty_name%
+ Name
+ Neu
+
Index: openacs-4/packages/content-portlet/catalog/content-portlet.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/catalog/content-portlet.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/catalog/content-portlet.en_US.ISO-8859-1.xml 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,39 @@
+
+
+
+ Add new section
+ Add new unit
+ Content Portlet
+ Content Portlet Administration
+ Back
+ You Can delete this section
+ Content
+ Decreasing
+ Delete Section
+ Welcome to the content section of your course.
+ Here you will find the study material that your teacher has uploaded for you.
+If you have any doubts about the usage of this application you can consult the user's guide
+ Edit Header Page
+ Edit content index
+ Edit Name
+ Home
+ Increasing
+ Content Index page
+ This section have mapped object
+ Name
+ New
+ New %element_pretty_name%
+ New Seccion
+ Next
+ Each Unit is divided in the following sections: <br /><ul>
+<li> Introduction</li>
+<li> Content</li>
+<li> Activities</li>
+<li> Glossary</li>
+<li> Annexed</li>
+</ul>
+These sections can change once the Unit is created. And it is possible to create new sub-sections.
+
+ Welcome to GES Web content editor
+ Welcome this section you can create a web content for you coures
+
Index: openacs-4/packages/content-portlet/catalog/content-portlet.es_GT.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/catalog/content-portlet.es_GT.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/catalog/content-portlet.es_GT.ISO-8859-1.xml 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,41 @@
+
+
+
+ Agregar Secci�n
+ Agregar una Unidad/Capitulo nuevo.
+ Portlet Contenido
+ Administracion de contenido
+ Atr�s
+ Puede Eliminar esta seccion si desea
+ Contenido
+ Desender
+ Eliminar Secci�n
+ Bienvenido a la secci�n de contenido de tu curso.
+ Aqu� encontrar�s el material de estudio que tu catedr�tico ha subido.
+Si tienes dudas de c�mo usar esta aplicaci�n puedes consultar el manual
+ Editar P�gina de Encabezado
+ Editar �ndice de contenido
+ Editar Nombre
+ Inicio
+ Incrementar
+ Indice de contenido
+ Esta secci�n NO puede ser borrada, ya que tiene elementos.
+ Nombre
+ Nuevo
+ Nuevo %element_pretty_name%
+ Nueva Secci�n
+ Siguiente
+ Cada Unidad o Capitulo se divide en las siguiente secciones:<br /><ul>
+<li> Introducci�n</li>
+<li> Contenido</li>
+<li> Actividades</li>
+<li> Glosario</li>
+<li> Anexo</li>
+</ul>
+ Dichas secciones pueden cambiarse una vez creada la Unidad /
+ Capitulo. Y se puede crear adicionalmente nuevas sub-secciones.
+
+ Bienvenido al editor de contenido web de GES
+ En esta secci�n usted podr� crear contenido web para su curso
+Si tiene dudas de c�mo usar esta aplicaci�n puede consultar el manual
+
Index: openacs-4/packages/content-portlet/misc/admin/category-add-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/category-add-edit.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/category-add-edit.adp 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1 @@
+@name@
\ No newline at end of file
Index: openacs-4/packages/content-portlet/misc/admin/category-add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/category-add-edit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/category-add-edit.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,62 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-08-24
+ @arch-tag: F871480C-371A-46DB-81EF-F5761D7A984C
+ @cvs-id $Id: category-add-edit.tcl,v 1.1 2007/10/24 22:50:25 victorg Exp $
+} {
+
+ tree_id:integer
+ name:notnull
+ category_id:integer,optional
+ return_url:optional
+ {parent_id:integer,optional [db_null]}
+ {language "es_GT"}
+ {mode 1}
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+set user_id [ad_maybe_redirect_for_registration]
+set package_id [ad_conn package_id]
+permission::require_permission -object_id $tree_id -privilege category_tree_write
+set description "User category for content package"
+
+if {$mode eq 1 && [exists_and_not_null category_id]} {
+ ## edit mode####
+ category::update -category_id $category_id \
+ -locale $language \
+ -name $name \
+ -description $description
+
+} elseif {$mode eq 2} {
+ if {[content_category::valid_level_and_count -tree_id $tree_id \
+ -category_id $parent_id]} {
+ set new_cat [category::add -tree_id $tree_id \
+ -parent_id $parent_id \
+ -locale $language \
+ -name $name \
+ -description $description]
+ set parent_cat [content_category::category_parent -category_id $new_cat -tree_id $tree_id]
+ }
+} elseif {$mode eq 3} {
+ set new_cat [content_category::new_subtree -tree_id $tree_id]
+ set parent_cat $new_cat
+
+}
+
+if {[exists_and_not_null return_url]} {
+ if {[exists_and_not_null new_cat]} {
+ ad_returnredirect "$return_url&new_cat=$new_cat&parent_cat=$parent_cat"
+ } else {
+ ad_returnredirect $return_url
+ }
+} else {
+ # ad_return_template
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/misc/admin/category-confirm.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/category-confirm.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/category-confirm.adp 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,10 @@
+
+
Confirmacion
+
+
+
+
+@body_msg;noquote@
+
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/misc/admin/category-confirm.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/category-confirm.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/category-confirm.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,37 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-09-13
+ @arch-tag: F4A0ADC6-B070-4452-B70E-2FB409C8A738
+ @cvs-id $Id: category-confirm.tcl,v 1.1 2007/10/24 22:50:25 victorg Exp $
+} {
+
+ tree_id:integer
+ category_id:integer,notnull
+ {locale ""}
+ object_id:integer,optional
+ return_url:optional
+
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+set user_id [ad_maybe_redirect_for_registration]
+set body_msg "[_ content-portlet.can_delete]"
+permission::require_permission -object_id $tree_id -privilege category_tree_write
+set tree_list [content_category::get_tree_levels -subtree_id $category_id $tree_id]
+set tree_list [linsert $tree_list 0 $category_id]
+foreach category $tree_list {
+ set my_category_id [lindex $category 0]
+ if {[db_string dbqd.xowiki.www.admin.category-delete.check_mapped_objects {}] eq 1} {
+ set body_msg "[_ content-portlet.mapped_objects]"
+ ad_return_template
+ }
+}
+
Index: openacs-4/packages/content-portlet/misc/admin/category-delete-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/category-delete-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/category-delete-2.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,37 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-08-27
+ @arch-tag: 37E094FE-5831-4CF6-80AC-0FC7C1A64252
+ @cvs-id $Id: category-delete-2.tcl,v 1.1 2007/10/24 22:50:25 victorg Exp $
+} {
+
+ tree_id:integer
+ category_id:integer,notnull
+ {locale ""}
+ object_id:integer,optional
+ return_url:optional
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+
+set user_id [ad_maybe_redirect_for_registration]
+permission::require_permission -object_id $tree_id -privilege category_tree_write
+
+db_transaction {
+ category::delete $category_id
+ category_tree::flush_cache $tree_id
+} on_error {
+ ad_return_complaint 1 "[_ content-portlet.still_contains_subcategories]"
+ ad_script_abort
+}
+
+ad_returnredirect $return_url
+
Index: openacs-4/packages/content-portlet/misc/admin/category-delete-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/category-delete-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/category-delete-postgresql.xql 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+ postgresql
+ 7.2
+
+
+
+
+
+ select case when count(*) = 0 then 0 else 1 end
+ where exists (select 1 from category_object_map
+ where category_id = :my_category_id)
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/misc/admin/category-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/category-delete.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/category-delete.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,48 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-08-27
+ @arch-tag: 2D2A97D5-0515-479D-90D6-A22F05718776
+ @cvs-id $Id: category-delete.tcl,v 1.1 2007/10/24 22:50:25 victorg Exp $
+} {
+
+ tree_id:integer
+ category_id:integer,notnull
+ {locale ""}
+ object_id:integer,optional
+ return_url:optional
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+
+set user_id [ad_maybe_redirect_for_registration]
+permission::require_permission -object_id $tree_id -privilege category_tree_write
+set delete_url [export_vars -no_empty -base category-delete-2 { tree_id category_id:multiple locale object_id }]
+set cancel_url [export_vars -no_empty -base tree-view { tree_id locale object_id }]
+set page_title "Delete categories"
+
+set tree_list [content_category::get_tree_levels -subtree_id $category_id $tree_id]
+set tree_list [linsert $tree_list 0 $category_id]
+foreach category $tree_list {
+ set my_category_id [lindex $category 0]
+ if {[db_string check_mapped_objects {}] eq 1} {
+ ad_return_complaint 1 "[_ content-portlet.mapped_objects]"
+ ad_script_abort
+ }
+ lappend category_ids $my_category_id
+}
+
+ns_log notice "byronnnnn $tree_id $category_ids $return_url"
+set result [content_category::category_delete $tree_id $category_ids]
+if {$result eq 0} {
+ ad_return_complaint 1 "[_ content-portlet.still_contains_subcategories]"
+}
+ad_returnredirect $return_url
+
Index: openacs-4/packages/content-portlet/misc/admin/category-view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/category-view.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/category-view.adp 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,56 @@
+
+ @title@
+
+
+
+
+ @ah_sources;noquote@
+
+
+
+
+
+
+Regresar
+
+ @cat_tree;noquote@
+
+
+
+
+
+
+
+#content-portlet.unit_descirption#
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/content-portlet/misc/admin/category-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/category-view.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/category-view.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,168 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-08-24
+ @arch-tag: 9EFDF2BF-FE25-4238-8A63-2FFDB9C7BD31
+ @cvs-id $Id: category-view.tcl,v 1.1 2007/10/24 22:50:25 victorg Exp $
+} {
+ tree_id:optional
+ package_id:optional
+ {new_cat 0}
+ {parent_cat 0}
+} -properties {
+} -validate {
+} -errors {
+}
+
+
+set ah_sources [ah::js_sources]
+if {![exists_and_not_null tree_id] && [exists_and_not_null package_id]} {
+ set tree_id [lindex [lindex [category_tree::get_mapped_trees $package_id] 0] 0]
+}
+
+
+
+set user_id [ad_maybe_redirect_for_registration]
+set package_id [ad_conn package_id]
+permission::require_permission -object_id $tree_id -privilege category_tree_write
+
+set tree_list [category_tree::get_tree $tree_id]
+array set tree [category_tree::get_data $tree_id]
+set class "liClosed"
+
+set tmp_level 1
+set title "\#content-portlet.edit_index\#"
+set context_bar [list [_ content-portlet.edit_index]]
+set return_url [ad_return_url]
+set root_add_link "category-add-edit?tree_id=${tree_id}&name=Root&mode=3&return_url=$return_url"
+
+set level_1_tree ""
+set level_2_tree ""
+set level_list [list]
+set aux_level 0
+set my_tmp_level 0
+set inplaceeditor_js ""
+
+set msg_fade [ah::effects -element "msg_div" \
+ -effect "Fade" \
+ -options "duration: 1.5"]
+
+set msg_fade_0 [ah::effects -element "msg_div" \
+ -effect "Fade" \
+ -options "duration: 0"]
+
+set msg_appear [ah::effects -element "msg_div" \
+ -effect "Appear" \
+ -options "duration: 0.5"]
+
+set msg2_fade [ah::effects -element "msg_div2" \
+ -effect "Fade" \
+ -options "duration: 1.5"]
+
+set msg2_appear [ah::effects -element "msg_div2" \
+ -effect "Appear" \
+ -options "duration: 0.5"]
+
+set msg2_fade_0 [ah::effects -element "msg_div2" \
+ -effect "Fade" \
+ -options "duration: 0"]
+
+
+set cat_tree "$tree(tree_name)
+
+ \#content-portlet.add_unit\# \n"
+
+
+foreach tree_level $tree_list {
+
+ if { $tmp_level < [lindex $tree_level 3]} {
+ #ns_log notice "paso a nivel superior de $tmp_level a [lindex $tree_level 3]"
+ lappend level_list "$tmp_level"
+ set tmp_level [lindex $tree_level 3]
+ } elseif {$tmp_level > [lindex $tree_level 3]} {
+ #ns_log notice "paso a nivel inferior de $tmp_level a [lindex $tree_level 3]"
+ append level_${tmp_level}_tree "\n"
+ set aux_level [lindex $tree_level 3]
+ set my_tmp_level $tmp_level
+ for {set i 1} {$i < [expr ($tmp_level - $aux_level) + 1]} {incr i} {
+ set aux2_level [lindex $level_list [expr [llength $level_list] - $i]]
+ eval "append level_${aux2_level}_tree \"\n \n\$level_${my_tmp_level}_tree \n\n\""
+ set level_${my_tmp_level}_tree ""
+ set my_tmp_level $aux2_level
+ }
+ set level_list [lrange $level_list 0 [expr $aux_level - 2]]
+# eval "append level_${aux_level}_tree \"\n \n\$level_${my_tmp_level}_tree\n \n\n\""
+ #set level_${my_tmp_level}_tree ""
+ set level_${tmp_level}_tree ""
+ set tmp_level [lindex $tree_level 3]
+ set my_tmp_level ""
+ set aux_level ""
+ } else {
+ eval "set aux_string \$level_${tmp_level}_tree"
+ if {[string length $aux_string] > 0} {
+ append level_${tmp_level}_tree " \n"
+ }
+ }
+ set add_link "category-add-edit?tree_id=${tree_id}&parent_id=[lindex $tree_level 0]&name=[_ content-portlet.new_seccion]&mode=2&return_url=$return_url"
+ set del_link "category-delete?tree_id=${tree_id}&category_id=[lindex $tree_level 0]&return_url=$return_url"
+ if {$new_cat eq [lindex $tree_level 0]} {
+ append inplaceeditor_js "var editor = new Ajax.InPlaceEditor(\$('cat_${new_cat}'), 'category-add-edit', {
+ callback: function(post,value) { return 'tree_id=${tree_id}&category_id=${new_cat}&name=' + value},
+ externalControl: 'control_${new_cat}',
+ okText: 'Guardar',
+ cancelText: 'Cancelar',
+ savingText: 'Actualizando'});
+ editor.enterEditMode('click');"
+ set class "liOpen"
+ } else {
+ append inplaceeditor_js "new Ajax.InPlaceEditor(\$('cat_[lindex $tree_level 0]'), 'category-add-edit', {
+ callback: function(post,value) { return 'tree_id=${tree_id}&category_id=[lindex $tree_level 0]&name=' + value},
+ externalControl: 'control_[lindex $tree_level 0]',
+ okText: 'Guardar',
+ cancelText: 'Cancelar',
+ savingText: 'Actualizando'})\; \n"
+ }
+
+ if {$parent_cat eq [lindex $tree_level 0]} {
+ set class "liOpen"
+ }
+ append level_${tmp_level}_tree "
+ [lindex $tree_level 1]
+
+
+ "
+ if {[content_category::valid_level_and_count -tree_id $tree_id -category_id [lindex $tree_level 0]]} {
+ append level_${tmp_level}_tree "
+ "
+ }
+ if {[content_category::delete_p -tree_id $tree_id -category_id [lindex $tree_level 0]]} {
+ append level_${tmp_level}_tree "
+ "
+ }
+ append level_${tmp_level}_tree " "
+
+ #ns_log notice "estoy en nivel $tmp_level"
+}
+
+
+
+append level_${tmp_level}_tree " \n"
+set aux_level 2
+set my_tmp_level $tmp_level
+for {set i 1} {$i < [expr ($tmp_level - $aux_level) + 1]} {incr i} {
+ set aux2_level [lindex $level_list [expr [llength $level_list] - $i]]
+ eval "append level_${aux2_level}_tree \"\n\n\$level_${my_tmp_level}_tree \n\n\""
+ set level_${my_tmp_level}_tree ""
+ set my_tmp_level $aux2_level
+}
+
+if {[string length $level_2_tree] > 0} {
+ append level_1_tree "\n\n\n"
+}
+append cat_tree "$level_1_tree \n"
+
+#ns_log notice "$cat_tree"
Index: openacs-4/packages/content-portlet/misc/admin/order.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/order.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/order.adp 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/misc/admin/order.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/order.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/order.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,56 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-07-04
+ @arch-tag: 491DB986-A2AF-4EE1-9857-821F536C41CA
+ @cvs-id $Id: order.tcl,v 1.1 2007/10/24 22:50:25 victorg Exp $
+} {
+
+ page_id:optional
+ page_pos:optional
+ page_name:optional
+ content_id:optional
+ status:optional
+ dir:optional
+ show:optional
+ {action 0}
+
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+if {![string match $page_pos "@page_order@"]} {
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ if {![ permission::permission_p -object_id $item_id -privilege admin]} {
+ set show 0
+ } else {
+
+ set my_cat_id [category::get_mapped_categories $item_id]
+
+ set count_page [db_string select_count {
+ select count(ci.item_id)
+ from category_object_map c, cr_items ci, cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ and category_id = :my_cat_id} -default 0]
+
+ if {$count_page > 1} {
+ set show 1
+ } else {
+ set show 0
+ }
+ }
+} else {
+ set show 0
+}
+
Index: openacs-4/packages/content-portlet/misc/admin/toggle-page-order.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/toggle-page-order.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/toggle-page-order.adp 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,4 @@
+
+
+
+
Index: openacs-4/packages/content-portlet/misc/admin/toggle-page-order.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/admin/toggle-page-order.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/admin/toggle-page-order.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,116 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-06-25
+ @arch-tag: E81B62CE-430F-4586-9DFA-2AC7C57672D6
+ @cvs-id $Id: toggle-page-order.tcl,v 1.1 2007/10/24 22:50:25 victorg Exp $
+} {
+ page_id:optional
+ page_pos:optional
+ page_name:optional
+ content_id:optional
+ status:optional
+ dir:optional
+ show:optional
+ {action 0}
+} -properties {
+} -validate {
+} -errors {
+}
+
+set page_list [list]
+set next_list [list]
+if {![string match $page_pos "@page_order@"]} {
+ set wiki_url "[site_node::get_url_from_object_id -object_id $content_id]$page_name"
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set cat_id [category::get_mapped_categories $item_id]
+
+ if {![ permission::permission_p -object_id $item_id -privilege admin]} {
+ set show 0
+ } else {
+
+ db_foreach select_page {
+ select ci.item_id as tmp_item_id, r.revision_id, ci.name, ci.content_type, r.title, category_id,p.page_order, ci.publish_status
+ from category_object_map c, cr_items ci, cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ and category_id = :cat_id
+ order by p.page_order} {
+
+ lappend page_list [list $tmp_item_id $page_order $name $revision_id $publish_status]
+ }
+
+
+ set order_page [lsort -$dir -command content_compare::compare $page_list]
+ set count 0
+ foreach pages $order_page {
+ set current_pos [lsearch -exact $pages $page_id]
+ if {$current_pos >= 0} {
+ incr count
+ set next_list [lindex $order_page $count]
+ break
+ }
+ incr count
+ }
+
+ if {[llength $next_list] > 0} {
+
+ if {$action == 0} {
+ set show 1
+ switch $dir {
+ "decreasing" {
+ set img_name "up"
+ }
+ "increasing" {
+ set img_name "down"
+ }
+ }
+ set nexturl [export_vars -base admin/toggle-page-order {page_id page_pos page_name content_id status dir {action 1} {show 0}}]
+ set alt "[_ content-portlet.page_${dir}]"
+ } elseif {$action == 1} {
+
+ set tmp_order [lindex $next_list 1]
+ set tmp_item_id [lindex $next_list 0]
+ set tmp_page_id [lindex $next_list 3]
+ set tmp_status [lindex $next_list 4]
+ db_dml update_page {
+ UPDATE xowiki_page
+ SET page_order = :tmp_order where page_id = :page_id
+ }
+
+ ns_cache flush xotcl_object_cache ::$item_id
+ ns_cache flush xotcl_object_cache ::$page_id
+ db_0or1row make_live {
+ select content_item__set_live_revision(:page_id, :status)
+ }
+
+
+ db_dml update_page {
+ UPDATE xowiki_page
+ SET page_order = :page_pos where page_id = :tmp_page_id
+ }
+
+
+ ns_cache flush xotcl_object_cache ::$tmp_item_id
+ ns_cache flush xotcl_object_cache ::$tmp_page_id
+ db_0or1row make_live {
+ select content_item__set_live_revision(:tmp_page_id, :tmp_status)
+ }
+
+ ad_returnredirect "${wiki_url}\#cont1"
+ }
+ } else {
+ set show 0
+ }
+ }
+} else {
+ set show 0
+}
Index: openacs-4/packages/content-portlet/misc/portlets/ges-categories.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/portlets/ges-categories.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/portlets/ges-categories.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,130 @@
+# $Id: ges-categories.tcl,v 1.1 2007/10/24 22:50:25 victorg Exp $
+# display the category tree with associated pages
+# -gustaf neumann
+#
+# valid parameters from the adp include are
+# tree_name: match pattern, if specified displays only the trees
+# with matching names
+# no_tree_name: if specified, tree names are not displayed
+# open_page: name (e.g. en:iMacs) of the page to be opened initially
+# tree_style: boolean, default: true, display based on mktree
+# skin: name of adp-file to render content
+
+::xowiki::Page proc __render_html {
+ -package_id
+ {-tree_name ""}
+ -tree_style
+ -no_tree_name:boolean
+ -count:boolean
+ {-summary 0}
+ {-open_page ""}
+ {-category_ids ""}
+ {-except_category_ids ""}
+} {
+
+ set folder_id [$package_id folder_id]
+ # get the folder id from the including page
+ set open_item_id [expr {$open_page ne "" ?
+ [CrItem lookup -name $open_page -parent_id $folder_id] : 0}]
+
+ set content ""
+ foreach tree [category_tree::get_mapped_trees $package_id] {
+ foreach {tree_id my_tree_name ...} $tree {break}
+ if {$tree_name ne "" && ![string match $tree_name $my_tree_name]} continue
+ if {!$no_tree_name} {
+ append content "$my_tree_name "
+ }
+ set categories [list]
+ set pos 0
+ set cattree(0) [::xowiki::CatTree new -volatile -orderby pos -name $my_tree_name]
+ foreach category_info [category_tree::get_tree $tree_id] {
+ foreach {cid category_label deprecated_p level} $category_info {break}
+ set c [::xowiki::Category new -orderby pos -category_id $cid -package_id $package_id \
+ -level $level -label $category_label -pos [incr pos]]
+ set cattree($level) $c
+ set plevel [expr {$level -1}]
+ $cattree($plevel) add $c
+ set category($cid) $c
+ lappend categories $cid
+ #set itemobj [Object new -set name en:index -set title MyTitle -set prefix "" -set suffix ""]
+ #$cattree(0) add_to_category -category $c -itemobj $itemobj -orderby title
+ }
+
+ set sql "category_object_map c, cr_items ci, cr_revisions r, xowiki_page p \
+ where c.object_id = ci.item_id and ci.parent_id = $folder_id \
+ and ci.content_type not in ('::xowiki::PageTemplate') \
+ and category_id in ([join $categories ,]) \
+ and r.revision_id = ci.live_revision \
+ and p.page_id = r.revision_id
+ and ci.name not in ('es:header_page','es:index','es:indexe')"
+
+ if {$except_category_ids ne ""} {
+ append sql \
+ " and not exists (select * from category_object_map c2 \
+ where ci.item_id = c2.object_id \
+ and c2.category_id in ($except_category_ids))"
+ }
+ ns_log notice "--c category_ids=$category_ids"
+ if {$category_ids ne ""} {
+ foreach cid [split $category_ids ,] {
+ append sql " and exists (select * from category_object_map \
+ where object_id = ci.item_id and category_id = $cid)"
+ }
+ }
+
+ if {$count} {
+ db_foreach get_counts \
+ "select count(*) as nr,category_id from $sql group by category_id" {
+ $category($category_id) set count $nr
+ set s [expr {$summary ? "&summary=$summary" : ""}]
+ $category($category_id) href [ad_conn url]?category_id=$category_id$s
+ $category($category_id) open_tree
+ }
+ append content [$cattree(0) render -tree_style $tree_style]
+ } else {
+ db_foreach get_pages \
+ "select ci.item_id, ci.name, ci.content_type, r.title, category_id, p.page_order from $sql" {
+ if {$title eq ""} {set title $name}
+ set itemobj [Object new]
+ set prefix ""
+ set suffix ""
+ foreach var {name title prefix page_order suffix} {$itemobj set $var [set $var]}
+ $cattree(0) add_to_category \
+ -category $category($category_id) \
+ -itemobj $itemobj \
+ -orderby page_order \
+ -open_item [expr {$item_id == $open_item_id}]
+ }
+ append content [$cattree(0) render -tree_style $tree_style]
+ }
+ }
+ return $content
+}
+
+set link ""
+if {![info exists name]} {set name "Categories"}
+# TODO new style includelets, based on ::xo::cc
+set summary [expr {[ns_conn isconnected] ? [ns_queryget summary 0]} : 0]
+foreach _ {category_ids except_category_ids} {
+ if {![info exists $_]} {
+ # TODO new style includelets, based on ::xo::cc
+ set $_ [expr {[ns_conn isconnected] ? [ns_queryget $_ ""] : ""}]
+ }
+}
+
+set content [::xowiki::Page __render_html \
+ -package_id [$__including_page set package_id] \
+ -tree_name [expr {[info exists tree_name] ? $tree_name : ""}] \
+ -tree_style [expr {[info exists tree_style] ? $tree_style : 1}] \
+ -no_tree_name [info exists no_tree_name] \
+ -count [info exists count] \
+ -summary $summary \
+ -open_page [expr {[info exists open_page] ? $open_page : ""}] \
+ -category_ids $category_ids \
+ -except_category_ids $except_category_ids \
+ ]
+
+if {![info exists skin]} {set skin portlet-skin}
+if {![string match /* $skin]} {set skin [file dir $__adp_stub]/$skin}
+template::set_file $skin
+
Index: openacs-4/packages/content-portlet/misc/www/ges-view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/www/ges-view.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/www/ges-view.adp 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,174 @@
+
+ @title;noquote@
+ @context;noquote@
+ @header_stuff;noquote@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @content;noquote@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@footer;noquote@
+
+
+ Categories: @per_object_categories_with_links;noquote@
+
+
+
+ #general-comments.Comments#
+
+
+
+ @gc_link;noquote@
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/misc/www/page-instance-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/www/page-instance-new.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/www/page-instance-new.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,71 @@
+#
+::xowiki::Package initialize -ad_doc {
+
+ This is the resolver for this package. It turns a request into
+ an object and executes the object with the computed method
+
+ @author byron linares (bhlr@galileo.edu)
+
+
+} -parameter {
+}
+
+set autoname [::$package_id get_parameter autoname 0]
+set folder_id [::xowiki::Page require_folder -name xowiki -package_id $package_id]
+set page [::xowiki::PageInstance new ]
+set page_index [db_string page_index {
+ select count(p.page_id) from cr_items ci, cr_revisions r, xowiki_page p
+ where ci.parent_id = :folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id} -default 0]
+
+set page_name "es:page_[incr page_index]"
+if {[db_string select_name {
+ select 1 from cr_items
+ where name = :page_name
+ and parent_id = :folder_id} -default 0]} {
+
+ set page_name "es:[format "%0.0f" [expr [random] * 10]]_[format "%0.0f" [expr [random] * 10]]_page_[incr page_index]"
+}
+
+$page configure -name $page_name -parent_id $folder_id -package_id $package_id
+
+
+
+set list_page_order [db_list select_order {
+ select p.page_order
+ from cr_items ci, cr_revisions r, xowiki_page p
+ where ci.parent_id = :folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ and p.page_order is not null
+ order by p.page_order desc
+ }]
+
+set max_page_order [lindex [lsort -decreasing -command content_compare::simple_compare $list_page_order] 0]
+if {[llength $list_page_order] < 1} {
+ set max_page_order 0
+}
+incr max_page_order
+
+db_0or1row select_instance [::xowiki::PageTemplate instance_select_query \
+ -folder_id $folder_id \
+ -select_attributes {name} \
+ -where_clause "name = 'es:Template_de_ges'"]
+
+set template_id $item_id
+
+$page set page_template $template_id
+$page set page_order $max_page_order
+$page destroy_on_cleanup
+$page initialize_loaded_object
+$page save_new
+set item_id [$page item_id]
+set return_url "[::$package_id package_url][$page set name]"
+set link [::$package_id pretty_link [$page set name]]
+ad_returnredirect [export_vars -base $link {{m edit} page_template return_url item_id}]
+
+
+
Index: openacs-4/packages/content-portlet/misc/www/view-links-ges.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/misc/www/view-links-ges.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/misc/www/view-links-ges.adp 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,19 @@
+
Index: openacs-4/packages/content-portlet/sql/postgresql/content-portlet-admin-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/sql/postgresql/content-portlet-admin-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/sql/postgresql/content-portlet-admin-drop.sql 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,118 @@
+--
+-- Copyright (C) 2001, 2002 MIT
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+
+--
+-- content-portlet-admin-drop.sql
+--
+
+-- Deletes a portal datasource for the static portlet factory
+-- (admin interface)
+
+-- Copyright (C) 2001 MIT
+-- @author Arjun Sanyal (arjun@openforce.net)
+
+-- $Id: content-portlet-admin-drop.sql,v 1.1 2007/10/24 22:50:25 victorg Exp $
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+--
+-- PostGreSQL port samir@symphinity.com 11 July 2002
+--
+
+
+
+create function inline_1()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ select datasource_id into ds_id
+ from portal_datasources
+ where name = ''content_admin_portlet'';
+
+ if not found then
+ RAISE EXCEPTION '' No datasource id found '', ds_id;
+ ds_id := null;
+ end if;
+
+ if ds_id is NOT null then
+ perform portal_datasource__delete(ds_id);
+ end if;
+
+ -- drop the hooks
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''GetMyName''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''GetPrettyName''
+ );
+
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''Link''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''AddSelfToPage''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''Show''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''Edit''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''RemoveSelfFromPage''
+ );
+
+ -- Drop the binding
+ perform acs_sc_binding__delete (
+ ''portal_datasource'',
+ ''content_admin_portlet''
+ );
+
+ -- drop the impl
+ perform acs_sc_impl__delete (
+ ''portal_datasource'',
+ ''content_admin_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+drop function inline_1();
+
Index: openacs-4/packages/content-portlet/sql/postgresql/content-portlet-admin.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/sql/postgresql/content-portlet-admin.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/sql/postgresql/content-portlet-admin.sql 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,190 @@
+--
+-- Copyright (C) 2001, 2002 MIT
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+
+--
+-- content-admin-portlet.sql
+--
+
+-- Creates a portal datasource for the content portlet factory
+-- (admin interface)
+
+-- Copyright (C) 2001 MIT
+-- @author Arjun Sanyal (arjun@openforce.net)
+
+-- $Id: content-portlet-admin.sql,v 1.1 2007/10/24 22:50:25 victorg Exp $
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+--
+-- PostGreSQL port samir@symphinity.com 11 July 2002
+--
+
+create function inline_0()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+ ds_id := portal_datasource__new(
+ ''content_admin_portlet'', -- name
+ ''Displays the admin interface for the content data portlets'' -- Description
+ );
+
+ -- 4 defaults procs
+
+ -- shadeable_p
+ perform portal_datasource__set_def_param (
+ ds_id, -- datasource_id
+ ''t'', -- config_required_p
+ ''t'', -- configured_p
+ ''shadeable_p'', -- key
+ ''f'' -- value
+);
+
+ -- shaded_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shaded_p'',
+ ''f''
+);
+
+ -- hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''hideable_p'',
+ ''t''
+);
+
+ -- user_editable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''user_editable_p'',
+ ''f''
+);
+
+ -- link_hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''link_hideable_p'',
+ ''t''
+);
+
+
+ -- content-admin-specific procs
+
+ -- package_id must be configured
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''f'',
+ ''package_id'',
+ ''''
+);
+ return 0;
+end;' language 'plpgsql';
+
+select inline_0();
+
+drop function inline_0();
+
+
+create function inline_1()
+returns integer as '
+begin
+ -- create the implementation
+ perform acs_sc_impl__new (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''content_admin_portlet''
+ );
+
+ -- add all the hooks
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''GetMyName'',
+ ''content_admin_portlet::get_my_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''GetPrettyName'',
+ ''content_admin_portlet::get_pretty_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''Link'',
+ ''content_admin_portlet::link'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''AddSelfToPage'',
+ ''content_admin_portlet::add_self_to_page'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''Show'',
+ ''content_admin_portlet::show'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''Edit'',
+ ''content_admin_portlet::edit'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_admin_portlet'',
+ ''RemoveSelfFromPage'',
+ ''content_admin_portlet::remove_self_from_page'',
+ ''TCL''
+ );
+
+ -- Add the binding
+ perform acs_sc_binding__new (
+ ''portal_datasource'', -- contract_name
+ ''content_admin_portlet'' -- impl_name
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+
+drop function inline_1();
Index: openacs-4/packages/content-portlet/sql/postgresql/content-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/sql/postgresql/content-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/sql/postgresql/content-portlet-create.sql 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,20 @@
+--
+-- Copyright (C) 2001, 2002 MIT
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+--
+-- PostGreSQL port samir@symphinity.com 11 July 2002
+--
+\i content-portlet-portlet.sql
+\i content-portlet-admin.sql
Index: openacs-4/packages/content-portlet/sql/postgresql/content-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/sql/postgresql/content-portlet-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/sql/postgresql/content-portlet-drop.sql 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,20 @@
+--
+-- Copyright (C) 2001, 2002 MIT
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+--
+-- PostGreSQL port samir@symphinity.com 11 July 2002
+--
+\i content-portlet-portlet-drop.sql
+\i content-portlet-admin-drop.sql
Index: openacs-4/packages/content-portlet/sql/postgresql/content-portlet-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/sql/postgresql/content-portlet-portlet-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/sql/postgresql/content-portlet-portlet-drop.sql 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,121 @@
+--
+-- Copyright (C) 2001, 2002 MIT
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+
+--
+-- content-portlet-portlet-drop.sql
+--
+
+-- Deletes a portal datasource for the content portlet factory
+
+-- Copyright (C) 2001 MIT
+-- @author Arjun Sanyal (arjun@openforce.net)
+
+-- $Id: content-portlet-portlet-drop.sql,v 1.1 2007/10/24 22:50:25 victorg Exp $
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+--
+-- PostGreSQL port samir@symphinity.com 11 July 2002
+--
+
+
+
+create function inline_1()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ select datasource_id into ds_id
+ from portal_datasources
+ where name = ''content_portlet'';
+
+ if not found then
+ RAISE EXCEPTION '' No datasource id found '', ds_id;
+ ds_id := null;
+ end if;
+
+ if ds_id is NOT null then
+ perform portal_datasource__delete(ds_id);
+ end if;
+
+ -- drop the hooks
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''GetMyName''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''GetPrettyName''
+ );
+
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''Link''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''AddSelfToPage''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''Show''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''Edit''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''RemoveSelfFromPage''
+ );
+
+ -- Drop the binding
+ perform acs_sc_binding__delete (
+ ''portal_datasource'',
+ ''content_portlet''
+ );
+
+ -- drop the impl
+ perform acs_sc_impl__delete (
+ ''portal_datasource'',
+ ''content_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+drop function inline_1();
+
+
+
+
+
Index: openacs-4/packages/content-portlet/sql/postgresql/content-portlet-portlet.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/sql/postgresql/content-portlet-portlet.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/sql/postgresql/content-portlet-portlet.sql 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,201 @@
+--
+-- Copyright (C) 2001, 2002 MIT
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+
+--
+-- content-portlet-portlet.sql
+--
+
+-- Creates a portal datasource for the content portlet factory
+
+-- Copyright (C) 2001 MIT
+-- @author Arjun Sanyal (arjun@openforce.net)
+
+-- $Id: content-portlet-portlet.sql,v 1.1 2007/10/24 22:50:25 victorg Exp $
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+--
+-- PostGreSQL port samir@symphinity.com 11 July 2002
+--
+
+
+create function inline_0()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+ ds_id := portal_datasource__new(
+ ''content_portlet'', -- name
+ ''Displays an content page as a portlet'' -- description
+ );
+
+ -- 4 defaults procs
+
+ -- shadeable_p
+ perform portal_datasource__set_def_param (
+ ds_id, -- datasource_id
+ ''t'', -- config_required_p
+ ''t'', -- configured_p
+ ''shadeable_p'', -- key
+ ''t'' -- value
+ );
+
+ -- shaded_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shaded_p'',
+ ''f''
+ );
+
+ -- hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''hideable_p'',
+ ''t''
+ );
+
+ -- user_editable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''user_editable_p'',
+ ''f''
+);
+
+ -- link_hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''link_hideable_p'',
+ ''t''
+);
+
+
+ -- content-specific procs
+
+ -- package_id must be configured
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''f'',
+ ''package_id'',
+ ''''
+);
+
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''f'',
+ ''page_name'',
+ ''''
+);
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_0();
+
+drop function inline_0();
+
+
+create function inline_1()
+returns integer as '
+begin
+
+ -- create the implementation
+ perform acs_sc_impl__new (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''content_portlet''
+ );
+
+ -- add all the hooks
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''GetMyName'',
+ ''content_portlet::get_my_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''GetPrettyName'',
+ ''content_portlet::get_pretty_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''Link'',
+ ''content_portlet::link'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''AddSelfToPage'',
+ ''content_portlet::add_self_to_page'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''Show'',
+ ''content_portlet::show'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''Edit'',
+ ''content_portlet::edit'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''content_portlet'',
+ ''RemoveSelfFromPage'',
+ ''content_portlet::remove_self_from_page'',
+ ''TCL''
+ );
+
+ -- Add the binding
+ perform acs_sc_binding__new (
+ ''portal_datasource'', -- contract_name
+ ''content_portlet'' -- impl_name
+ );
+
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+
+drop function inline_1();
Index: openacs-4/packages/content-portlet/tcl/apm-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/tcl/apm-callback-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/tcl/apm-callback-procs.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,149 @@
+#
+
+ad_library {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-09-08
+ @arch-tag: DA257725-36B9-464F-96B8-663D77F70456
+ @cvs-id $Id: apm-callback-procs.tcl,v 1.1 2007/10/24 22:50:25 victorg Exp $
+}
+
+namespace eval content-portlet::apm {}
+
+ad_proc -public content-portlet::apm::after_upgrade {
+ {-from_version_name:required}
+ {-to_version_name:required}
+} {
+ apm_upgrade_logic \
+ -from_version_name $from_version_name \
+ -to_version_name $to_version_name \
+ -spec {
+ 0.1d2 0.1d3 {
+ set count 0
+ set instructor_id ""
+ set wiki_package_list [xowiki::Package instances]
+ foreach wiki_package_id $wiki_package_list {
+ set trees [category_tree::get_mapped_trees $wiki_package_id]
+ set tree_id [lindex [lindex $trees 0] 0]
+ set wiki_folder_id [::xowiki::Page require_folder \
+ -name xowiki \
+ -package_id $wiki_package_id]
+ set tree_list [category_tree::get_tree_levels $tree_id]
+
+
+
+ set wiki_url [site_node::get_url_from_object_id \
+ -object_id $wiki_package_id]
+ set community_id [dotlrn_community::get_community_id_from_url \
+ -url $wiki_url]
+
+ set instructors [dotlrn_community::list_users_in_role \
+ -rel_type "dotlrn_instructor_rel" $community_id]
+
+ set instructor_id [lindex [lindex $instructors 0] 3]
+
+ set new_tree_id [content_category::map_new_tree \
+ -object_id $wiki_package_id \
+ -tree_name "Indice De Contenido" \
+ -user_id $instructor_id]
+
+ set new_tree_list [category_tree::get_tree_levels \
+ -only_level 2 $new_tree_id]
+
+ foreach category $tree_list {
+ set cat_id [lindex $category 0]
+ set new_cat_id [lindex [lindex $new_tree_list $count] 0]
+ db_foreach select_content {
+ select ci.item_id, p.page_order,
+ ci.name, ci.content_type, category_id,
+ xpi.page_instance_id
+ from category_object_map c, cr_items ci,
+ xowiki_page p,
+ xowiki_page_instance xpi
+ where c.object_id = ci.item_id
+ and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and p.page_id = xpi.page_instance_id
+ and category_id = :cat_id
+ and xpi.page_instance_id = ci.live_revision
+ order by p.page_order} {
+ category::map_object -remove_old -object_id $item_id $new_cat_id
+ }
+ incr count
+ }
+ set count 0
+
+
+ foreach tree $trees {
+ set tree_id [lindex $tree 0]
+ category_tree::unmap -tree_id $tree_id -object_id $wiki_package_id
+ }
+
+
+ db_0or1row select_instance [::xowiki::PageTemplate instance_select_query \
+ -folder_id $wiki_folder_id \
+ -select_attributes {name} \
+ -where_clause "name = 'es:Template_de_ges'"]
+
+ set template_id $item_id
+
+ set template [xowiki::Package instantiate_page_from_id -item_id $item_id]
+
+ set text [list {
+
+ {{adp /packages/xowiki/www/admin/order {page_pos @page_order@ page_id @revision_id@ content_id @package_id@ type @object_type@ dir "decreasing" action 0 page_name @name@ status @publish_status@}}}
+
+
+ }]
+
+ $template set text $text
+ $template destroy_on_cleanup
+ $template save
+ $template initialize_loaded_object
+
+ }
+
+ }
+
+ }
+
+}
Index: openacs-4/packages/content-portlet/tcl/content-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/tcl/content-admin-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/tcl/content-admin-portlet-procs.tcl 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,84 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# This file is part of dotLRN.
+#
+# dotLRN is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+ad_library {
+
+ Procedures to support the content ADMIN portlet
+
+ @author bhlr@galileo.edu
+
+}
+
+namespace eval content_admin_portlet {
+
+ ad_proc -private get_my_name {
+ } {
+ return "content_admin_portlet"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ return [parameter::get_from_package_key \
+ -package_key [my_package_key] \
+ -parameter admin_portlet_pretty_name]
+ }
+
+ ad_proc -private my_package_key {
+ } {
+ return "content-portlet"
+ }
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+ ad_proc -public add_self_to_page {
+ {-portal_id:required}
+ {-package_id:required}
+ } {
+ Adds a content admin PE to the given portal
+ } {
+ return [portal::add_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -key package_id \
+ -value $package_id
+ ]
+ }
+
+ ad_proc -public remove_self_from_page {
+ {-portal_id:required}
+ } {
+ Removes content PE from the given page
+ } {
+ # This is easy since there's one and only one instace_id
+ portal::remove_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ }
+
+ ad_proc -public show {
+ cf
+ } {
+ Display the PE
+ } {
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "content-admin-portlet"
+ }
+
+}
Index: openacs-4/packages/content-portlet/tcl/content-portlet-compare-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/tcl/content-portlet-compare-procs-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/tcl/content-portlet-compare-procs-postgresql.xql 24 Oct 2007 22:50:25 -0000 1.1
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+ postgresql
+ 7.2
+
+
+
+
+
+ select case when count(*) = 0 then 0 else 1 end
+ where exists (select 1 from category_object_map
+ where category_id = :my_category_id)
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/tcl/content-portlet-compare-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/tcl/content-portlet-compare-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/tcl/content-portlet-compare-procs.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,638 @@
+#
+
+ad_library {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-06-21
+ @arch-tag: 55D83508-E579-4609-887E-5917B9C5744E
+ @cvs-id $Id: content-portlet-compare-procs.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+}
+
+namespace eval content_compare {}
+namespace eval content_page {}
+namespace eval content_category {}
+
+
+ad_proc -public content_category::delete_p {
+ -tree_id
+ -category_id
+} {
+ set tree_list [content_category::get_tree_levels \
+ -subtree_id $category_id $tree_id]
+ set tree_list [linsert $tree_list 0 $category_id]
+ foreach category $tree_list {
+ set my_category_id [lindex $category 0]
+ if {[db_string check_mapped_objects {}] eq 1} {
+ return 0
+ }
+ }
+ return 1
+}
+
+ad_proc -private content_page::update_object {
+ {-wiki_package_id ""}
+} {
+
+ if {[empty_string_p $wiki_package_id]} {
+ set wiki_package_list [xowiki::Package instances]
+ } else {
+ set wiki_package_list [list $wiki_package_id]
+ }
+ foreach wiki_package_id $wiki_package_list {
+ set wiki_folder_id [::xowiki::Page require_folder \
+ -name xowiki \
+ -package_id $wiki_package_id]
+
+ if { [db_0or1row select_instance [::xowiki::Object \
+ instance_select_query \
+ -folder_id $wiki_folder_id \
+ -select_attributes {name} \
+ -where_clause "name ='es:o_index'"]]} {
+ set template_id $item_id
+
+ set myobject [xowiki::Package instantiate_page_from_id -item_id $item_id]
+
+ set text [list {proc content {} {
+set community_id [dotlrn_community::get_community_id]
+set com_package_id [dotlrn_community::get_package_id $community_id]
+set package_id [site_node_apm_integration::get_child_package_id \
+ -package_id $com_package_id \
+ -package_key "xowiki"]
+
+set wk_folder_id [::xowiki::Page require_folder -name xowiki -package_id $package_id]
+if { ![db_0or1row select_instance [::xowiki::PageInstance instance_select_query \
+ -folder_id $wk_folder_id -select_attributes {name} \
+ -where_clause "name = 'es:header_page'"]]} {
+
+ db_0or1row select_instance [::xowiki::PageTemplate instance_select_query \
+ -folder_id $wk_folder_id -select_attributes {name} \
+ -where_clause "name = 'es:Template_de_header'"]
+ set tmp_item_id $item_id
+
+ set fn "[get_server_root]/packages/content-portlet/www/prototypes/gestemplate/GesTemplateheaderpage.page"
+ set standard_page "es:header_page"
+ if {[file readable $fn]} {
+ set page [source $fn]
+ $page configure -name $standard_page -parent_id $wk_folder_id -package_id $package_id
+ if {![$page exists title]} {
+ $page set title $template1
+ }
+ $page set page_template $tmp_item_id
+ $page destroy_on_cleanup
+ $page set instance_attributes "Curso Curso Carrera Carrera Facultad Facultad"
+ $page initialize_loaded_object
+ $page save_new
+ }
+}
+
+set user_id [ad_conn user_id]
+set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id [dotlrn_community::get_community_id]]
+if {$admin_p} {
+ return {
+
+ #content-portlet.welcome#
+
+
+ #content-portlet.welcome_body#
+
+ [[es:header_page|#content-portlet.edit_header#]]
+ }
+} else {
+ return {
+
+ #content-portlet.e_welcome#
+
+
+ #content-portlet.e_welcome_body#
+
+ }
+}
+}
+}]
+
+$myobject set text [lindex $text 0]
+$myobject destroy_on_cleanup
+$myobject save
+$myobject initialize_loaded_object
+ns_cache flush xotcl_object_cache ::[$myobject set item_id]
+}
+}
+}
+
+
+ad_proc -private content_category::up {
+ {-wiki_package_id ""}
+ {-level 1}
+} {
+
+ set count 0
+ if {[empty_string_p $wiki_package_id]} {
+ set wiki_package_list [xowiki::Package instances]
+ } else {
+ set wiki_package_list [list $wiki_package_id]
+ }
+ foreach wiki_package_id $wiki_package_list {
+ ns_log notice "inicia actualizacion de content"
+ set trees [category_tree::get_mapped_trees $wiki_package_id]
+ set tree_id [lindex [lindex $trees 0] 0]
+ set wiki_folder_id [::xowiki::Page require_folder \
+ -name xowiki \
+ -package_id $wiki_package_id]
+
+ if {$level eq 1} {
+ set tree_list [content_category::get_tree_levels $tree_id]
+ } else {
+ set tree_list [content_category::get_tree_levels -only_level 2 $tree_id]
+ }
+
+ set wiki_url [site_node::get_url_from_object_id \
+ -object_id $wiki_package_id]
+ set community_id [dotlrn_community::get_community_id_from_url -url $wiki_url]
+
+ set instructors [dotlrn_community::list_users_in_role \
+ -rel_type "dotlrn_instructor_rel" $community_id]
+
+ set instructor_id [lindex [lindex $instructors 0] 3]
+
+ set new_tree_id [content_category::map_new_tree -object_id $wiki_package_id \
+ -tree_name "Indice De Contenido." \
+ -user_id $instructor_id]
+
+ set new_tree_list [content_category::get_tree_levels \
+ -only_level 2 $new_tree_id]
+
+
+ ns_log notice " Package_id $wiki_package_id $tree_list :: $new_tree_list"
+ foreach category $tree_list {
+ set cat_id [lindex $category 0]
+ set new_cat_id [lindex [lindex $new_tree_list $count] 0]
+ db_foreach select_content {
+ select ci.item_id, p.page_order,
+ ci.name, ci.content_type, category_id, xpi.page_instance_id
+ from category_object_map c, cr_items ci, xowiki_page p,
+ xowiki_page_instance xpi
+ where c.object_id = ci.item_id
+ and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and p.page_id = xpi.page_instance_id
+ and category_id = :cat_id
+ and xpi.page_instance_id = ci.live_revision
+ order by p.page_order} {
+ ns_log notice "--------- -object_id $item_id $new_cat_id "
+ category::map_object -remove_old -object_id $item_id $new_cat_id
+ }
+ incr count
+ }
+
+ set count 0
+
+ foreach tree $trees {
+ set tree_id [lindex $tree 0]
+ category_tree::unmap -tree_id $tree_id -object_id $wiki_package_id
+ }
+
+ db_0or1row select_instance [::xowiki::PageTemplate instance_select_query \
+ -folder_id $wiki_folder_id \
+ -select_attributes {name} \
+ -where_clause "name = 'es:Template_de_ges'"]
+
+ set template_id $item_id
+
+ set template [xowiki::Package instantiate_page_from_id -item_id $item_id]
+
+ set text [list {
+
+ {{adp /packages/xowiki/www/admin/order {page_pos @page_order@ page_id @revision_id@ content_id @package_id@ type @object_type@ dir "decreasing" action 0 page_name @name@ status @publish_status@}}}
+
+
+ }]
+
+ $template set text $text
+ $template destroy_on_cleanup
+ $template save
+ $template initialize_loaded_object
+ }
+}
+
+
+
+ad_proc -public content_category::page_order {
+ -tree_id
+ -category_id
+ -wiki_folder_id
+} {
+ set tree_list [content_category::get_tree_levels \
+ -subtree_id $category_id $tree_id]
+ set tree_list [linsert $tree_list 0 $category_id]
+ foreach cat_tree $tree_list {
+ set cat_id [lindex $cat_tree 0]
+ set page_list [db_list_of_lists select_content {}]
+
+ if {[llength $page_list] > 0} {
+ #set next_list [lindex $order_page 0]
+ #set nexturl "${wiki_url}[lindex $next_list 2]\\\#cont1"
+ break
+ }
+ }
+ return $page_list
+}
+
+
+ad_proc -public content_category::category_childs {
+ -tree_id
+ -category_id
+ -wiki_folder_id
+} {
+
+ set tree_list [content_category::get_tree_levels -subtree_id $category_id $tree_id]
+ set tree_list [linsert $tree_list 0 [list $category_id "n"]]
+ foreach category $tree_list {
+ set cat_id [lindex $category 0]
+ set count [db_string select_cat {*SQL*} -default 0]
+ if {$count > 0} {
+ return 1
+ }
+ }
+ return 0
+}
+
+
+ad_proc -public content_category::category_delete {
+ tree_id
+ category_ids
+ {locale ""}
+} {
+
+ set user_id [auth::get_user_id]
+ permission::require_permission \
+ -object_id $tree_id \
+ -privilege category_tree_write
+
+ set result 1
+ db_transaction {
+ foreach category_id [db_list order_categories_for_delete ""] {
+ category::delete $category_id
+ }
+ category_tree::flush_cache $tree_id
+ } on_error {
+ set result 0
+ }
+ return $result
+}
+
+ad_proc -private content_category::valid_level_and_count {
+ -tree_id
+ -category_id
+} {
+ set tree_list [content_category::get_tree_levels $tree_id]
+ set my_level [lindex \
+ [lindex $tree_list \
+ [lsearch -regexp \
+ $tree_list $category_id]] \
+ 3]
+
+ if {$my_level > 2} {
+ return 0
+ }
+ set sub_tree_list [content_category::get_tree_levels -only_level 1 \
+ -subtree_id $category_id $tree_id]
+
+ if {[llength $sub_tree_list] >= 5} {
+ return 0
+ }
+ return 1
+}
+
+
+ad_proc -private content_category::map_new_tree {
+ -object_id
+ -tree_name
+ {-user_id ""}
+} {
+
+ if {[empty_string_p $user_id]} {
+ set user_id [ad_conn user_id]
+ }
+
+ db_transaction {
+ set tree_id [category_tree::add -name $tree_name -user_id $user_id]
+ content_category::new_subtree -tree_id $tree_id -user_id $user_id
+ category_tree::map -tree_id $tree_id \
+ -object_id $object_id \
+ -assign_single_p t \
+ -require_category_p t
+ }
+ return $tree_id
+}
+
+
+ad_proc -private content_category::new_subtree {
+ -tree_id
+ {-language "es_GT"}
+ {-user_id ""}
+} {
+
+ if {[empty_string_p $user_id]} {
+ set user_id [ad_conn user_id]
+ }
+ set description "New unit for content"
+ set parent_id [db_null]
+ set unit_id [category::add -tree_id $tree_id \
+ -parent_id $parent_id \
+ -locale $language \
+ -name "Unidad N" \
+ -user_id $user_id \
+ -description $description]
+
+ category::add -tree_id $tree_id \
+ -parent_id $unit_id \
+ -locale $language \
+ -name "Introduccion" -description $description
+
+ category::add -tree_id $tree_id \
+ -parent_id $unit_id \
+ -locale $language \
+ -name "Contenido" \
+ -user_id $user_id \
+ -description $description
+
+ category::add -tree_id $tree_id \
+ -parent_id $unit_id \
+ -locale $language \
+ -name "Actividades" \
+ -user_id $user_id \
+ -description $description
+
+ category::add -tree_id $tree_id \
+ -parent_id $unit_id \
+ -locale $language \
+ -name "Glosario" \
+ -user_id $user_id \
+ -description $description
+
+ category::add -tree_id $tree_id \
+ -parent_id $unit_id \
+ -locale $language \
+ -name "Anexo" \
+ -user_id $user_id \
+ -description $description
+ return $unit_id
+}
+
+ad_proc -private content_category::category_parent {
+ -category_id
+ -tree_id
+ {-level 0}
+} {
+
+
+ if {[db_0or1row select_parent {
+ select parent_id, category_id as category from categories
+ where category_id = :category_id
+ and tree_id = :tree_id
+ }]} {
+
+ if {![empty_string_p $parent_id] && $level eq 0} {
+ return [content_category::category_parent -category_id $parent_id -tree_id $tree_id]
+ } elseif {![empty_string_p $parent_id] && $level ne 0} {
+ return $parent_id
+ } else {
+ return $category
+ }
+ }
+}
+
+
+
+
+ad_proc -private content_page::facultad {
+ {-community_id ""}
+} {
+ if {[empty_string_p $community_id]} {
+ set community_id [dotlrn_community::get_community_id]
+ }
+ set ges_pk [ug::get_ges_pk $community_id]
+ if {![empty_string_p $ges_pk]} {
+ set fac [soap_db::db_string -dbn udb select_facultad {
+ select distinct gn.nombre_corto
+ from camainhorariostb mh, cacurshoratb ch,
+ cacarrerastb cc, gnentidadestb gn
+ where mh.horario = ch.horario
+ and ch.carrera = cc.carrera
+ and cc.entidad = gn.entidad
+ and cc.facultad = gn.facultad
+ and mh.ges_pk = '$ges_pk'} -default "No Facultad"]
+
+ set facultad [string range $fac 2 end]
+ } else {
+ set facultad "Facultad"
+ }
+ return $facultad
+}
+
+ad_proc -private content_page::carrera {
+ {-community_id ""}
+} {
+ if {[empty_string_p $community_id]} {
+ set community_id [dotlrn_community::get_community_id]
+ }
+ set ges_pk [ug::get_ges_pk $community_id]
+ if {![empty_string_p $ges_pk]} {
+
+ set carrera [soap_db::db_list -dbn udb select_carrera {
+ select distinct cc.nombre_corto
+ from camainhorariostb mh, cacurshoratb ch,
+ cacarrerastb cc
+ where mh.horario = ch.horario
+ and ch.carrera = cc.carrera
+ and mh.ges_pk = '$ges_pk'}]
+ if {[llength $carrera] > 0} {
+ return [lindex $carrera 0]
+ } else {
+ return "Carrera"
+ }
+ }
+ return "Carrera"
+}
+
+ad_proc -private content_page::cours_name {
+ {-community_id ""}
+} {
+ if {[empty_string_p $community_id]} {
+ set community_id [dotlrn_community::get_community_id]
+ }
+ set ges_pk [ug::get_ges_pk $community_id]
+ ns_log notice "byron $ges_pk"
+ if {![empty_string_p $ges_pk]} {
+
+ set cours_name [soap_db::db_string -dbn udb select_name {
+ select distinct cc.nombre
+ from camainhorariostb mh, cacurshoratb ch,
+ cacursostb cc
+ where mh.horario = ch.horario
+ and ch.curso = cc.curso
+ and mh.ges_pk = '$ges_pk'} -default "Curso"]
+
+ return $cours_name
+ }
+ return "Curso"
+}
+
+ad_proc -public content_compare::value_compare {
+ x
+ y
+ def
+} {
+ set xp [string first . $x]
+ set yp [string first . $y]
+ if {$xp == -1 && $yp == -1} {
+ if {$x < $y} {
+ return -1
+ } elseif {$x > $y} {
+ return 1
+ } else {
+ return $def
+ }
+ } elseif {$xp == -1} {
+ set yh [string range $y 0 [expr {$yp-1}]]
+ return [value_compare $x $yh -1]
+ } elseif {$yp == -1} {
+ set xh [string range $x 0 [expr {$xp-1}]]
+ return [value_compare $xh $y 1]
+ } else {
+ set xh [string range $x 0 $xp]
+ set yh [string range $y 0 $yp]
+ if {$xh < $yh} {
+ return -1
+ } elseif {$xh > $yh} {
+ return 1
+ } else {
+ incr xp
+ incr yp
+ #puts "rest [string range $x $xp end] [string range $y $yp
+ # end]"
+ return [value_compare [string range $x $xp end] [string range $y $yp end] $def]
+ }
+ }
+}
+
+ad_proc -public content_compare::compare {
+ a
+ b
+} {
+ set x [lindex $a 1]
+ set y [lindex $b 1]
+ return [content_compare::value_compare $x $y 0]
+}
+
+ad_proc -public content_compare::simple_compare {
+ a
+ b
+
+} {
+ return [content_compare::value_compare $a $b 0]
+}
+
+ad_proc -public content_category::get_tree_levels {
+ -all:boolean
+ {-subtree_id ""}
+ {-to_level 0}
+ {-only_level 0}
+ tree_id
+ {locale ""}
+} {
+ Get all categories of a category tree from the cache.
+
+ @option all Indicates that phased_out categories should be included.
+ @option subtree_id Return only categories of the given subtree.
+ @param tree_id category tree to get the categories of.
+ @param locale language in which to get the categories. [ad_conn locale] used by default.
+ @return tcl list of lists: category_id category_name deprecated_p level
+} {
+ if {[catch {set tree [nsv_get category_trees $tree_id]}]} {
+ return
+ }
+ if {$to_level ne 0 && $only_level ne 0} {
+ set only_level 0
+ }
+ set result ""
+ if {[empty_string_p $subtree_id]} {
+ foreach category $tree {
+ util_unlist $category category_id deprecated_p level
+ if {$all_p || $deprecated_p == "f"} {
+ if {$to_level < $level && $to_level ne 0} {
+ continue
+ }
+ if {$only_level ne $level && $only_level ne 0} {
+ continue
+ }
+ lappend result [list $category_id [category::get_name $category_id $locale] $deprecated_p $level]
+ }
+ }
+ } else {
+ set in_subtree_p 0
+ set subtree_level 0
+ foreach category $tree {
+ util_unlist $category category_id deprecated_p level
+ if {$level == $subtree_level || $level < $subtree_level} {
+ set in_subtree_p 0
+ }
+ if {$in_subtree_p && $deprecated_p == "f"} {
+ if {$to_level < [expr $level - $subtree_level] && $to_level ne 0} {
+ continue
+ }
+
+ if {$only_level ne [expr $level - $subtree_level] && $only_level ne 0} {
+ continue
+ }
+
+ lappend result [list $category_id [category::get_name $category_id $locale] $deprecated_p [expr $level - $subtree_level]]
+ }
+ if {$category_id == $subtree_id} {
+ set in_subtree_p 1
+ set subtree_level $level
+ }
+ }
+ }
+
+ return $result
+}
Index: openacs-4/packages/content-portlet/tcl/content-portlet-compare-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/tcl/content-portlet-compare-procs.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/tcl/content-portlet-compare-procs.xql 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select category_id
+ from categories
+ where tree_id = :tree_id
+ and category_id in ([join $category_ids ,])
+ order by left_ind desc
+
+
+
+
+
+
+ select count(ci.item_id)
+ from category_object_map c, cr_items ci,
+ cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id
+ and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ and c.category_id = :cat_id
+ group by category_id
+ order by category_id desc
+
+
+
+
+
+
+ select ci.item_id, p.page_order, ci.name, ci.content_type, category_id, xpi.page_instance_id
+ from category_object_map c, cr_items ci, xowiki_page p, xowiki_page_instance xpi
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and p.page_id = xpi.page_instance_id
+ and category_id in ([join $cat_id ","])
+ and xpi.page_instance_id = ci.live_revision
+ order by p.page_order
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/tcl/content-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/tcl/content-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/tcl/content-portlet-procs.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,82 @@
+#
+
+ad_library {
+
+ Procedures to supports content portlets.
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-07-04
+ @arch-tag: 16A7A29A-271C-49B1-8787-935755BF5583
+ @cvs-id $Id: content-portlet-procs.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+}
+
+namespace eval content_portlet {
+
+ ad_proc -private get_my_name {
+ } {
+ return "content_portlet"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ return [parameter::get_from_package_key \
+ -package_key [my_package_key] \
+ -parameter content_portlet_pretty_name]
+ }
+
+ ad_proc -private my_package_key {
+ } {
+ return "content-portlet"
+ }
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+ ad_proc -public add_self_to_page {
+ {-portal_id:required}
+ {-package_id:required}
+ {-param_action:required}
+ {-force_region ""}
+ {-page_name "" }
+ } {
+ Adds a static PE to the given page
+ } {
+ # ns_log notice "content_portlet::add_self_to_page -
+ # Don't call me. Use static_portal_content:: instead"
+ return [portal::add_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -value $package_id \
+ -force_region [parameter::get_from_package_key -package_key [my_package_key] -parameter content_portal_force_region] \
+ -page_name [parameter::get_from_package_key -package_key [my_package_key] -parameter content_portal_page_name] \
+ -pretty_name [get_pretty_name] \
+ -param_action $param_action]
+ # error
+ }
+
+ ad_proc -public remove_self_from_page {
+ {-portal_id:required}
+ {-package_id:required}
+ } {
+ Removes static PE from the given page
+ } {
+ # This is easy since there's one and only one instace_id
+ portal::remove_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -value $package_id
+ }
+
+ ad_proc -public show {
+ cf
+ } {
+ } {
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "content-portlet"
+ }
+}
+
Index: openacs-4/packages/content-portlet/www/.DS_Store
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/.DS_Store,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/.DS_Store 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1 @@
+ Bud1 � u r c e sfw r e s o u r c e sfwi0blob icnv r e s o u r c e sfwswlong � @ � @ � @ � @ E � DSDB ` @ � @ � @
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/complete-navbar-bac.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/complete-navbar-bac.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/complete-navbar-bac.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,95 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-07-04
+ @arch-tag: D0597C30-DD00-4D59-BD57-56ED6E0F16A7
+ @cvs-id $Id: complete-navbar-bac.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+
+ page_pos:optional
+ page_id:optional
+ content_id:optional
+ type:optional
+ index:optional
+
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+
+set title "navbar"
+set cat_index [list]
+set index1 100
+set index2 100
+set index3 100
+set index4 100
+set index5 100
+set index6 100
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+if {![string match $page_pos "@page_order@"]} {
+ set show 1
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set my_cat_id [category::get_mapped_categories $item_id]
+ set tree_id [category::get_tree $my_cat_id]
+ set my_parent_id [content_category::category_parent -category_id $my_cat_id -tree_id $tree_id]
+ if {$my_parent_id eq $my_cat_id} {
+ set tree_list [category_tree::get_tree -all $tree_id]
+ } else {
+ set tree_list [category_tree::get_tree_levels -subtree_id $my_parent_id -to_level 1 $tree_id]
+ }
+ if {[llength $tree_list] < 1} {
+ set show 0
+ set my_parent_id [content_d_return_template]
+ }
+
+ set my_cat_index [expr [lsearch -regexp $tree_list $my_cat_id] + 1]
+
+ ns_log notice "------------ $tree_list ::: $my_cat_index"
+
+ set categories_objects [db_list_of_lists select_cat {
+ select count(ci.item_id), c.category_id
+ from category_object_map c, cr_items ci, cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ group by category_id
+ order by category_id desc}]
+
+ ns_log notice "--------- $categories_objects"
+ foreach category $categories_objects {
+ if {[lsearch -regexp $tree_list [lindex $category 1]] >= 0} {
+ lappend cat_index [lsearch -regexp $tree_list [lindex $category 1]]
+ }
+ }
+
+ ns_log notice " -------- cat index $cat_index"
+ for {set i 0} {$i < 6} {incr i} {
+ set adp_index [expr $i + 1]
+ if {$i < [llength $cat_index]} {
+ set index$adp_index [expr [lindex $cat_index $i] + 1]
+ } elseif {$i eq [llength $cat_index]} {
+ set index$adp_index 0
+ } else {
+ set index$adp_index 100
+ }
+ }
+ if {$index1 eq $my_cat_index} {
+ set img_rigth "xop005"
+ } else {
+ set img_rigth "op005"
+ }
+ ns_log notice "navbar $img_rigth $index1 :: $my_cat_index"
+} else {
+ set show 0
+}
+
+ns_log notice " --------- $index5 : $index4 : $index3 : $index2 : $index1 "
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/complete-navbar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/complete-navbar.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/complete-navbar.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/complete-navbar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/complete-navbar.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/complete-navbar.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,93 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-07-04
+ @arch-tag: D0597C30-DD00-4D59-BD57-56ED6E0F16A7
+ @cvs-id $Id: complete-navbar.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+
+ page_pos:optional
+ page_id:optional
+ content_id:optional
+ type:optional
+ index:optional
+
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+
+set title "navbar"
+set cat_index [list]
+set index1 100
+set index2 100
+set index3 100
+set index4 100
+set index5 100
+set index6 100
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+if {![string match $page_pos "@page_order@"]} {
+ set show 1
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set my_cat_id [category::get_mapped_categories $item_id]
+ set tree_id [category::get_tree $my_cat_id]
+ set my_parent_id [content_category::category_parent -category_id $my_cat_id -tree_id $tree_id]
+ set tree_list [content_category::get_tree_levels -subtree_id $my_parent_id -to_level 1 $tree_id]
+
+ if {[llength $tree_list] < 1} {
+ set show 0
+ ad_return_template
+ }
+
+ set my_cat_index [expr [lsearch -regexp $tree_list $my_cat_id] + 1]
+
+ set categories_objects [db_list_of_lists select_cat {
+ select count(ci.item_id), c.category_id
+ from category_object_map c, cr_items ci, cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ group by category_id
+ order by category_id desc}]
+
+ for {set i [expr [llength $tree_list] -1]} {$i >= 0} {incr i -1} {
+ set category [lindex $tree_list $i]
+ if {[content_category::category_childs \
+ -tree_id $tree_id \
+ -category_id [lindex $category 0] \
+ -wiki_folder_id $wiki_folder_id]} {
+ lappend cat_index [lsearch -regexp $tree_list [lindex $category 1]]
+ }
+ }
+
+ if {[llength $cat_index] < 1} {
+ set show 0
+ }
+ for {set i 0} {$i < 6} {incr i} {
+ set adp_index [expr $i + 1]
+ if {$i < [llength $cat_index]} {
+ set index$adp_index [expr [lindex $cat_index $i] + 1]
+ } elseif {$i eq [llength $cat_index]} {
+ set index$adp_index 0
+ } else {
+ set index$adp_index 100
+ }
+ }
+ if {$index1 eq $my_cat_index} {
+ set img_rigth "xop005"
+ } else {
+ set img_rigth "op005"
+ }
+} else {
+ set show 0
+}
+
Index: openacs-4/packages/content-portlet/www/complete-subnavbar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/complete-subnavbar.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/complete-subnavbar.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/complete-subnavbar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/complete-subnavbar.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/complete-subnavbar.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,109 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-09-03
+ @arch-tag: F2D1E4AE-0574-49E8-BF98-396A5685C20A
+ @cvs-id $Id: complete-subnavbar.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+
+ page_pos:optional
+ page_id:optional
+ content_id:optional
+ type:optional
+ index:optional
+
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+set title "navbar"
+set cat_index [list]
+set index1 100
+set index2 100
+set index3 100
+set index4 100
+set index5 100
+set index6 100
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+if {![string match $page_pos "@page_order@"]} {
+ set show 1
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set my_cat_id [category::get_mapped_categories $item_id]
+ set tree_id [category::get_tree $my_cat_id]
+ set my_parent_id [content_category::category_parent -category_id $my_cat_id -tree_id $tree_id]
+ set my_parent_id1 [content_category::category_parent -category_id $my_cat_id -level 1 -tree_id $tree_id]
+
+ set level_2_list [content_category::get_tree_levels -only_level 2 $tree_id]
+ set level_3_list [content_category::get_tree_levels -only_level 3 $tree_id]
+
+ if {[llength $level_2_list] < 1 || ([lsearch -regexp $level_2_list $my_cat_id] < 0 && [lsearch -regexp $level_3_list $my_cat_id] < 0)} {
+ set show 0
+ return
+ }
+
+ set tree_list [content_category::get_tree_levels -subtree_id $my_cat_id -to_level 1 $tree_id]
+ if {[lsearch -regexp $level_3_list $my_cat_id] >= 0} {
+ set tree_list [content_category::get_tree_levels -subtree_id $my_parent_id1 -to_level 1 $tree_id]
+ }
+
+ if {[llength $tree_list] < 1} {
+ set show 0
+ ad_return_template
+ }
+
+
+ set parent_tree_list [content_category::get_tree_levels -subtree_id $my_parent_id -to_level 1 $tree_id]
+
+ if {[llength $parent_tree_list] < 1} {
+ set show 0
+ ad_return_template
+ }
+
+ set parent_cat_index [expr [lsearch -regexp $parent_tree_list $my_cat_id] + 1]
+ if {$parent_cat_index eq 0} {
+ set parent_cat_index [expr [lsearch -regexp $parent_tree_list $my_parent_id1] + 1]
+ }
+
+ set categories_objects [db_list_of_lists select_cat {
+ select count(ci.item_id), c.category_id
+ from category_object_map c, cr_items ci, cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ group by category_id
+ order by category_id desc}]
+
+
+ foreach category $categories_objects {
+ if {[lsearch -regexp $tree_list [lindex $category 1]] >= 0} {
+ lappend cat_index [lsearch -regexp $tree_list [lindex $category 1]]
+ }
+ }
+
+ if {[llength $cat_index] < 1} {
+ set show 0
+ ad_return_template
+ }
+
+ for {set i 0} {$i < 6} {incr i} {
+ set adp_index [expr $i + 1]
+ if {$i < [llength $cat_index]} {
+ set index$adp_index [expr [lindex $cat_index $i] + 1]
+ } elseif {$i eq [llength $cat_index]} {
+ set index$adp_index 0
+ } else {
+ set index$adp_index 100
+ }
+ }
+} else {
+ set show 0
+}
Index: openacs-4/packages/content-portlet/www/complete-titlebar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/complete-titlebar.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/complete-titlebar.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+ @my_title@
+
+
+
+
+
+
Index: openacs-4/packages/content-portlet/www/complete-titlebar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/complete-titlebar.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/complete-titlebar.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,81 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-07-18
+ @arch-tag: 8085F7B0-7E09-43A8-BDEF-B42D9C90D5CC
+ @cvs-id $Id: complete-titlebar.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+ page_pos:optional
+ page_id:optional
+ content_id:optional
+ my_title:optional
+ type:optional
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+
+
+set title "title bar"
+
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+if {![string match $page_pos "@page_order@"]} {
+ set show 1
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set my_cat_id [category::get_mapped_categories $item_id]
+ set cat_name [category::get_name $my_cat_id]
+ set tree_id [category::get_tree $my_cat_id]
+ set my_parent_id [content_category::category_parent -category_id $my_cat_id -tree_id $tree_id]
+ set my_parent_id1 [content_category::category_parent -category_id $my_cat_id -level 1 -tree_id $tree_id]
+ set tree_list [content_category::get_tree_levels -subtree_id $my_parent_id -to_level 1 $tree_id]
+
+ if {[llength $tree_list] < 1} {
+ set show 0
+ ad_return_template
+ }
+
+ set cat_index [expr [lsearch -regexp $tree_list $my_cat_id] + 1]
+ if {$cat_index eq 0} {
+ set cat_index [expr [lsearch -regexp $tree_list $my_parent_id1] + 1]
+ }
+ set cat_name [lindex [lindex $tree_list [expr $cat_index -1 ]] 1]
+
+set show_img 0
+ switch $cat_index {
+ "2" {
+ if {[string match $cat_name "Contenido"]} {
+ set show_img 1
+ }
+ }
+ "4" {
+ if {[string match $cat_name "Glosario"]} {
+ set show_img 1
+ }
+ }
+ "1" {
+ if {[string match $cat_name "Introduccion"]} {
+ set show_img 1
+ }
+ }
+ "3" {
+ if {[string match $cat_name "Actividades"]} {
+ set show_img 1
+ }
+ }
+ default {
+ set show_img 0
+ }
+
+ }
+
+
+} else {
+ set show 0
+}
Index: openacs-4/packages/content-portlet/www/content-admin-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/content-admin-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/content-admin-portlet.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,21 @@
+
+Ver Páginas de #content-portlet.content#
+
+Administrar Páginas de #content-portlet.content#
+
+#xowiki.edit_content_index# Editar
+
+ No community specified
+
+
+
Index: openacs-4/packages/content-portlet/www/content-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/content-admin-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/content-admin-portlet.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,79 @@
+ad_page_contract {
+ The display logic for the content admin portlet
+
+ @author Byron Linares bhlr@galileo.edu
+} {
+ package_id:optional
+ template_portal_id:optional
+ referer:optional
+ return_url:optional
+}
+set admin_p [acs_user::site_wide_admin_p]
+
+if {![exists_and_not_null package_id]} {
+ set package_id [dotlrn_community::get_community_id]
+}
+
+if { $package_id ne "" } {
+
+ if {![exists_and_not_null template_portal_id]} {
+ set template_portal_id [dotlrn_community::get_portal_id]
+ }
+
+ if {[exists_and_not_null return_url]} {
+ set referer $return_url
+ }
+
+ if {![exists_and_not_null referer]} {
+ set referer [ad_conn url]
+ }
+
+ set element_pretty_name [parameter::get \
+ -parameter admin_portlet_element_pretty_name \
+ -default [_ content-portlet.admin_portlet_element_pretty_name]]
+
+ db_multirow content select_content \
+ "select m.element_id, m.pretty_name, pep.value as name
+ from portal_element_map m, portal_pages p, portal_element_parameters pep
+ where m.page_id = p.page_id
+ and p.portal_id = $template_portal_id
+ and m.datasource_id = [portal::get_datasource_id [content_portlet::get_my_name]]
+ and pep.element_id = m.element_id and pep.key = 'page_name'" {}
+
+ # don't ask to insert same page twice
+ template::multirow foreach content {set used_page_id($name) 1}
+
+ array set config $cf
+ set options ""
+ ::xowiki::Package initialize -package_id $config(package_id)
+ db_foreach instance_select \
+ [::xowiki::Page instance_select_query \
+ -folder_id [::$package_id folder_id] \
+ -with_subtypes true \
+ -from_clause ", xowiki_page P" \
+ -where_clause "P.page_id = cr.revision_id" \
+ -order_clause "order by ci.name" \
+ ] {
+ if {[regexp {^::[0-9]} $name]} continue
+ if {[info exists used_page_id($name)]} continue
+ append options "$name "
+ }
+
+ if {$options ne ""} {
+ set form [subst {
+
+ }]
+ set form ""
+ } else {
+ set form "All pages already used"
+ }
+
+ set applet_url [$package_id package_url]
+}
Index: openacs-4/packages/content-portlet/www/content-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/content-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/content-portlet.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1 @@
+
Index: openacs-4/packages/content-portlet/www/content-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/content-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/content-portlet.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,13 @@
+array set config $cf
+set user_id [ad_conn user_id]
+
+set wiki_url [site_node::get_url_from_object_id -object_id $config(package_id)]
+
+
+if {![empty_string_p [lindex $config(page_name) 0]]} {
+# regsub {/[^/]+$} [ad_conn url] "/xowiki/$config(page_name)" url
+ set url "${wiki_url}$config(page_name)"
+} else {
+# regsub {/[^/]+$} [ad_conn url] "/xowiki/es:index" url
+ set url "${wiki_url}es:index"
+}
Index: openacs-4/packages/content-portlet/www/home.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/home.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/home.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/home.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/home.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/home.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,83 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-06-20
+ @arch-tag: 71F81219-A45B-4B17-BF48-22942B62A7AC
+ @cvs-id $Id: home.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+ page_pos:optional
+ page_id:optional
+ content_id:optional
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+set page_list [list]
+set show 0
+set nexturl ""
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+if {![string match $page_pos "@page_order@"]} {
+ set show 1
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set cat_id [category::get_mapped_categories $item_id]
+ set tree_id [category::get_tree $cat_id]
+ set my_parent_id [content_category::category_parent -category_id $cat_id -tree_id $tree_id]
+ set my_parent_id1 [content_category::category_parent -category_id $cat_id -level 1 -tree_id $tree_id]
+ set tree_list [content_category::get_tree_levels -subtree_id $my_parent_id -to_level 1 $tree_id]
+
+ if {[llength $tree_list] < 1} {
+ set show 0
+ ad_return_template
+ }
+
+ set cat_index [lsearch -regexp $tree_list $cat_id]
+ if {$cat_index < 0} {
+ set cat_index [expr [lsearch -regexp $tree_list $my_parent_id1] + 0]
+ }
+
+ set img_name "homeID"
+ append img_name "[expr $cat_index + 1]"
+
+ set home_cat [db_string select_home {
+ select distinct c.category_id
+ from category_object_map c, cr_items ci, cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ order by category_id asc
+ limit 1} -default 0]
+
+ db_foreach select_page {
+ select ci.item_id, r.revision_id, ci.name, ci.content_type, r.title, category_id,p.page_order
+ from category_object_map c, cr_items ci, cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ and category_id = :home_cat
+ order by p.page_order} {
+
+ lappend page_list [list $item_id $page_order $name $revision_id]
+ }
+
+ set order_page [lsort -increasing -command content_compare::compare $page_list]
+ set home_list [lindex $order_page 0]
+ set home_name [lindex $home_list 2]
+ set nexturl "${wiki_url}$home_name"
+
+
+} else {
+ set show 0
+}
+
+
Index: openacs-4/packages/content-portlet/www/index-page.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/index-page.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/index-page.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+#content-portlet.welcome#
+
+
+#content-portlet.welcome_body#
+
+Editar pagina de Header
+
+
+
+#content-portlet.e_welcome#
+
+
+#content-portlet.e_welcome_body#
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/index-page.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/index-page.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/index-page.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,22 @@
+#
+
+ad_page_contract {
+
+ page_id:optional
+ content_id:optional
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-07-25
+ @arch-tag: 93F019A8-44A6-4CA1-BDD6-1C105BA21B05
+ @cvs-id $Id: index-page.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+
+} -properties {
+} -validate {
+} -errors {
+}
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+set user_id [ad_conn user_id]
+set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id [dotlrn_community::get_community_id]]
+set headerurl "${wiki_url}header_page"
+
Index: openacs-4/packages/content-portlet/www/navbar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/navbar.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/navbar.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ @cat_name@
+
+
+
+
+
+
+
+ @cat_name@
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/navbar.bac.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/navbar.bac.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/navbar.bac.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,144 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-06-20
+ @arch-tag: 71F81219-A45B-4B17-BF48-22942B62A7AC
+ @cvs-id $Id: navbar.bac.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+ page_pos:optional
+ page_id:optional
+ content_id:optional
+ type:optional
+ template:optional
+ index:optional
+} -properties {
+} -validate {
+} -errors {
+}
+
+set page_list [list]
+set next_list [list]
+set show 0
+set width 78
+set cat_id 0
+set list_categories [list]
+
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+if {![string match $page_pos "@page_order@"]} {
+ set show 1
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set my_cat_id [category::get_mapped_categories $item_id]
+ set tree_id [category::get_tree $my_cat_id]
+
+ set cat_parent_id [db_string select_parent {
+ select parent_id
+ from categories
+ where tree_id = :tree_id
+ and category_id = :my_cat_id} -default 0]
+
+
+ db_foreach categories {
+ select category_id
+ from categories
+ where tree_id = :tree_id
+ and parent_id = :cat_parent_id} {
+ set all_cat_name [category::get_name $category_id]
+ lappend list_categories [list $category_id $all_cat_name]
+ }
+
+ switch $index {
+ "2" {
+ set template_name "es:Template_de_contenido"
+ set cat_name "Contenido"
+ }
+ "4" {
+ set template_name "es:Template_de_glosario"
+ set cat_name "Glosario"
+ }
+ "1" {
+ set template_name "es:Template_de_introduccion"
+ set cat_name "Introduccion"
+ }
+ "3" {
+ set template_name "es:Template_de_actividades"
+ set cat_name "Actividades"
+ }
+ default {
+ set template_name ""
+ set cat_name ""
+ }
+
+ }
+
+ foreach category $list_categories {
+ if {[string match [lindex $category 1] $cat_name]} {
+ set cat_id [lindex $category 0]
+ break
+ }
+ }
+
+ if {$cat_id eq 0 && $index ne 4 && ![empty_string_p $cat_parent_id]} {
+ set cat_id $my_cat_id
+ } elseif {($cat_id eq 0 && $index eq 4) || ([empty_string_p $cat_parent_id])} {
+ set cat_id [db_list select_all {
+ select category_id
+ from categories where tree_id = :tree_id}]
+ }
+
+ if {[empty_string_p $cat_id]} {
+ set cat_id 0
+ }
+
+ set template_id [db_string select_temp {
+ select ci.item_id
+ from cr_items ci, xowiki_page_template p
+ where ci.parent_id = :wiki_folder_id
+ and ci.content_type in ('::xowiki::PageTemplate')
+ and p.page_template_id = ci.live_revision
+ and ci.name = :template_name
+ } -default "0"]
+
+ set page_list [db_list_of_lists select_content "
+ select ci.item_id, p.page_order, ci.name, ci.content_type, category_id, xpi.page_instance_id
+ from category_object_map c, cr_items ci, xowiki_page p, xowiki_page_instance xpi
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and p.page_id = xpi.page_instance_id
+ and category_id in ([join $cat_id ","])
+ and xpi.page_template = :template_id
+ and xpi.page_instance_id = ci.live_revision
+ order by p.page_order
+ "]
+
+ set order_page [lsort -increasing -command content_compare::compare $page_list]
+ set count 0
+
+ if {[llength $order_page] > 0} {
+ set next_list [lindex $order_page 0]
+ set nexturl "${wiki_url}[lindex $next_list 2]\#cont1"
+ if {[lindex $next_list 5] eq $page_id} {
+ set img_name "xop$index"
+ } elseif {$template == $template_id} {
+ set img_name "xop${index}"
+ } else {
+ set img_name "op$index"
+ }
+
+ } else {
+ set show 1
+ set nexturl "0"
+ set img_name "op${index}_"
+ if {$index eq 0} {
+ set width 11
+ }
+ }
+} else {
+ set show 0
+}
+
+
Index: openacs-4/packages/content-portlet/www/navbar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/navbar.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/navbar.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,154 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-06-20
+ @arch-tag: 71F81219-A45B-4B17-BF48-22942B62A7AC
+ @cvs-id $Id: navbar.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+ page_pos:optional
+ page_id:optional
+ content_id:optional
+ type:optional
+ index:optional
+} -properties {
+} -validate {
+} -errors {
+}
+
+set page_list [list]
+set next_list [list]
+set show 0
+set width 76
+set styleb ""
+set cat_id 0
+set list_categories [list]
+
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+if {![string match $page_pos "@page_order@"]} {
+ set show 1
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set my_cat_id [category::get_mapped_categories $item_id]
+ set tree_id [category::get_tree $my_cat_id]
+ set my_parent_id [content_category::category_parent -category_id $my_cat_id -tree_id $tree_id]
+ set my_parent_id1 [content_category::category_parent -category_id $my_cat_id -level 1 -tree_id $tree_id]
+ set tree_list [content_category::get_tree_levels -subtree_id $my_parent_id -to_level 1 $tree_id]
+
+ if {[llength $tree_list] < 1} {
+ set show 0
+ ad_return_template
+ }
+
+ set bar_category [lindex $tree_list [expr $index - 1]]
+ set cat_name [lindex $bar_category 1]
+
+ set show_img 0
+ switch $index {
+ "2" {
+ if {[string match $cat_name "Contenido"]} {
+ set show_img 1
+ }
+ }
+ "4" {
+ if {[string match $cat_name "Glosario"]} {
+ set show_img 1
+ }
+ }
+ "1" {
+ if {[string match $cat_name "Introduccion"]} {
+ set show_img 1
+ }
+ }
+ "3" {
+ if {[string match $cat_name "Actividades"]} {
+ set show_img 1
+ }
+ }
+ default {
+ set show_img 0
+ }
+
+ }
+
+
+ set img_name3 "ico${index}_16.png"
+
+
+ set cat_id [lindex $bar_category 0]
+
+ if {[empty_string_p $cat_id]} {
+ set cat_id 0
+ }
+
+# set page_list [db_list_of_lists select_content "
+# select ci.item_id, p.page_order, ci.name, ci.content_type, category_id, xpi.page_instance_id
+# from category_object_map c, cr_items ci, xowiki_page p, xowiki_page_instance xpi
+# where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+# and ci.content_type not in ('::xowiki::PageTemplate')
+# and ci.name not in ('es:header_page','es:index','es:indexe')
+# and p.page_id = xpi.page_instance_id
+# and category_id in ([join $cat_id ","])
+# and xpi.page_instance_id = ci.live_revision
+# order by p.page_order
+# "]
+
+# if {[llength $page_list] < 1} {
+
+ set page_list [content_category::page_order -tree_id $tree_id -category_id $cat_id -wiki_folder_id $wiki_folder_id]
+# }
+ set order_page [lsort -increasing -command content_compare::compare $page_list]
+ set count 0
+
+ if {[llength $order_page] > 0} {
+ set next_list [lindex $order_page 0]
+ set nexturl "${wiki_url}[lindex $next_list 2]\#cont1"
+ if {([lindex $next_list 5] eq $page_id) || ($cat_id eq $my_cat_id) || ($my_parent_id1 eq $cat_id)} {
+ set img_name "xop$index"
+ set img_name2 "xop_"
+ set styleb "style=\"background-image:url(/resources/content-portlet/template/imagenes/xop1_.gif); background-repeat:repeat-x; \""
+ } else {
+ set img_name "op$index"
+ set img_name2 "op1_"
+ }
+ } else {
+ set show 0
+ set nexturl "0"
+ set img_name "op${index}_"
+ set img_name2 "op1_"
+ set img_name3 ""
+ if {$index eq 0} {
+ set show 1
+ set categories_objects [db_list select_home {
+ select distinct c.category_id
+ from category_object_map c, cr_items ci, cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ order by category_id asc
+ }]
+
+ foreach category $categories_objects {
+ if {[lsearch -regexp $tree_list $category] >= 0} {
+ lappend cat_index [lsearch -regexp $tree_list $category]
+ }
+ }
+ set home_cat [lindex [lindex $tree_list [lindex $cat_index 0]] 0]
+ if {$home_cat eq $my_cat_id} {
+ set img_name xop${index}_
+ set img_name2 ""
+ set img_name3 ""
+ }
+ set width 11
+ }
+ }
+} else {
+ set show 0
+}
+
+
Index: openacs-4/packages/content-portlet/www/next.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/next.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/next.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/next.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/next.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/next.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,96 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-06-20
+ @arch-tag: 71F81219-A45B-4B17-BF48-22942B62A7AC
+ @cvs-id $Id: next.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+ page_pos:optional
+ page_id:optional
+ content_id:optional
+ wiki_folder_id:optional
+ dir:optional
+} -properties {
+} -validate {
+} -errors {
+}
+
+set page_list [list]
+set show 0
+set next_list [list]
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+if {![string match $page_pos "@page_order@"]} {
+ set show 1
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set cat_id [category::get_mapped_categories $item_id]
+ set tree_id [category::get_tree $cat_id]
+ set my_parent_id [content_category::category_parent -category_id $cat_id -tree_id $tree_id]
+ set my_parent_id1 [content_category::category_parent -category_id $cat_id -level 1 -tree_id $tree_id]
+ set tree_list [content_category::get_tree_levels -subtree_id $my_parent_id -to_level 1 $tree_id]
+
+ if {[llength $tree_list] < 1} {
+ set show 0
+ ad_return_template
+ }
+
+ set cat_index [lsearch -regexp $tree_list $cat_id]
+
+ if {$cat_index < 0} {
+ set cat_index [expr [lsearch -regexp $tree_list $my_parent_id1] + 0]
+ }
+
+ db_foreach select_page {
+ select ci.item_id, r.revision_id, ci.name, ci.content_type, r.title, category_id,p.page_order
+ from category_object_map c, cr_items ci, cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ and category_id = :cat_id
+ order by p.page_order} {
+
+ lappend page_list [list $item_id $page_order $name $revision_id]
+ }
+
+
+ set order_page [lsort -$dir -command content_compare::compare $page_list]
+ set count 0
+ foreach pages $order_page {
+ set current_pos [lsearch -exact $pages $page_id]
+ if {$current_pos >= 0} {
+ incr count
+ set next_list [lindex $order_page $count]
+ break
+ }
+ incr count
+ }
+
+ if {[llength $next_list] > 0} {
+ set nexturl "${wiki_url}[lindex $next_list 2]"
+ switch $dir {
+ "decreasing" {
+ set img_name "backID"
+ set alt "[_ content-portlet.back]"
+ }
+ "increasing" {
+ set img_name "nextID"
+ set alt "[_ content-portlet.next]"
+ }
+ }
+ append img_name "[expr $cat_index + 1]"
+ } else {
+ set show 0
+ set nexturl "index"
+ set img_name ""
+ }
+} else {
+ set show 0
+}
+
+
Index: openacs-4/packages/content-portlet/www/subnavbar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/subnavbar.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/subnavbar.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,8 @@
+
+
+
+
+
+ @cat_name@
+
+
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/subnavbar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/subnavbar.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/subnavbar.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,105 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-09-03
+ @arch-tag: FB935097-E914-4127-B7D5-9FCBA7EDDE2F
+ @cvs-id $Id: subnavbar.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+
+ page_pos:optional
+ page_id:optional
+ content_id:optional
+ type:optional
+ index:optional
+
+
+} -properties {
+} -validate {
+} -errors {
+}
+
+
+set page_list [list]
+set next_list [list]
+set show 0
+set width 76
+set cat_id 0
+set list_categories [list]
+
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+if {![string match $page_pos "@page_order@"]} {
+ set show 1
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set my_cat_id [category::get_mapped_categories $item_id]
+ set tree_id [category::get_tree $my_cat_id]
+ set my_parent_id [content_category::category_parent -category_id $my_cat_id -tree_id $tree_id]
+ set my_parent_id1 [content_category::category_parent -category_id $my_cat_id -level 1 -tree_id $tree_id]
+
+ set tree_list [content_category::get_tree_levels -subtree_id $my_cat_id -to_level 1 $tree_id]
+ set level_2_list [content_category::get_tree_levels -only_level 2 $tree_id]
+ set level_3_list [content_category::get_tree_levels -only_level 3 $tree_id]
+
+ if {[llength $level_3_list] < 1 || ([lsearch -regexp $level_2_list $my_cat_id] < 0 && [lsearch -regexp $level_3_list $my_cat_id] < 0)} {
+ set show 0
+ ad_return_template
+ } elseif {[lsearch -regexp $level_3_list $my_cat_id] >= 0} {
+ set tree_list [content_category::get_tree_levels -subtree_id $my_parent_id1 -to_level 1 $tree_id]
+ }
+
+ if {[llength $tree_list] < 1} {
+ set show 0
+ ad_return_template
+ }
+
+ set parent_tree_list [content_category::get_tree_levels -subtree_id $my_parent_id -to_level 1 $tree_id]
+ if {[llength $parent_tree_list] < 1} {
+ set show 0
+ ad_return_template
+ }
+
+ set parent_cat_index [expr [lsearch -regexp $parent_tree_list $my_cat_id] + 1]
+ if {$parent_cat_index eq 0} {
+ set parent_cat_index [expr [lsearch -regexp $parent_tree_list $my_parent_id1] + 1]
+ }
+
+ set bar_category [lindex $tree_list [expr $index - 1]]
+ set cat_name [lindex $bar_category 1]
+ set cat_id [lindex $bar_category 0]
+ if {[empty_string_p $cat_id]} {
+ set cat_id 0
+ }
+
+ set page_list [db_list_of_lists select_content "
+ select ci.item_id, p.page_order, ci.name, ci.content_type, category_id, xpi.page_instance_id
+ from category_object_map c, cr_items ci, xowiki_page p, xowiki_page_instance xpi
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and p.page_id = xpi.page_instance_id
+ and category_id in ([join $cat_id ","])
+ and xpi.page_instance_id = ci.live_revision
+ order by p.page_order
+ "]
+
+ set order_page [lsort -increasing -command content_compare::compare $page_list]
+
+ if {[llength $order_page] > 0} {
+ set next_list [lindex $order_page 0]
+ set nexturl "${wiki_url}[lindex $next_list 2]\#cont1"
+ if {([lindex $next_list 5] eq $page_id) || ($cat_id eq $my_cat_id) || ($my_parent_id1 eq $cat_id)} {
+ append parent_cat_index "_"
+ } else {
+ set img_name "op$index"
+ set img_name2 "op1_"
+ }
+
+ } else {
+ set nexturl "0"
+ set show 0
+ }
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/unit-navbar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/unit-navbar.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/unit-navbar.adp 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,4 @@
+
+
+
+
Index: openacs-4/packages/content-portlet/www/unit-navbar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/unit-navbar.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/unit-navbar.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,97 @@
+#
+
+ad_page_contract {
+
+
+
+ @author byron Haroldo Linares Roman (bhlr@byronLs-Computer.local)
+ @creation-date 2007-09-06
+ @arch-tag: D9C9886F-7A0B-46DA-8A52-71713DEDC859
+ @cvs-id $Id: unit-navbar.tcl,v 1.1 2007/10/24 22:50:26 victorg Exp $
+} {
+
+ page_pos:optional
+ page_id:optional
+ content_id:optional
+ index:optional
+
+
+} -properties {
+} -validate {
+} -errors {
+}
+set show 0
+set wiki_url [site_node::get_url_from_object_id -object_id $content_id]
+if {![string match $page_id "@revision_id@"]} {
+ set show 1
+
+ set form_tree_list [list]
+
+ set wiki_folder_id [::xowiki::Page require_folder -name xowiki -package_id $content_id]
+ set item_id [content::revision::item_id -revision_id $page_id]
+ set my_cat_id [category::get_mapped_categories $item_id]
+ set tree_id [category::get_tree $my_cat_id]
+ set my_parent_id [content_category::category_parent -category_id $my_cat_id -tree_id $tree_id]
+ set my_parent_id1 [content_category::category_parent -category_id $my_cat_id -level 1 -tree_id $tree_id]
+
+ set tree_list [content_category::get_tree_levels -only_level 1 $tree_id]
+
+ set categories_objects [db_list_of_lists select_cat {
+ select count(ci.item_id), c.category_id
+ from category_object_map c, cr_items ci, cr_revisions r, xowiki_page p
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and r.revision_id = ci.live_revision
+ and p.page_id = r.revision_id
+ group by category_id
+ order by category_id asc}]
+
+
+
+ foreach tree_level $categories_objects {
+ set unit_parent [content_category::category_parent \
+ -category_id [lindex $tree_level 1] \
+ -tree_id $tree_id]
+ set unit_index [lsearch -regexp $tree_list $unit_parent]
+
+ if {$unit_index >= 0 && [lsearch -regexp $form_tree_list $unit_parent] < 0} {
+ lappend form_tree_list [list [lindex [lindex $tree_list $unit_index] 1] [lindex [lindex $tree_list $unit_index] 0]]
+ }
+ }
+ ad_form -name unidad -has_submit 1 -export {tree_id} -form {
+ {category:integer(select)
+ {label "Capitulo"}
+ {options $form_tree_list}
+ {value $my_parent_id}
+ {html {onChange document.unidad.submit()}}
+ }
+ } -on_submit {
+ set nexturl "\#"
+ set tree_list2 [content_category::get_tree_levels -subtree_id $category $tree_id]
+ set tree_list2 [linsert $tree_list2 0 $category]
+ foreach cat_tree $tree_list2 {
+ set cat_id [lindex $cat_tree 0]
+
+ set page_list [db_list_of_lists select_content "
+ select ci.item_id, p.page_order, ci.name, ci.content_type, category_id, xpi.page_instance_id
+ from category_object_map c, cr_items ci, xowiki_page p, xowiki_page_instance xpi
+ where c.object_id = ci.item_id and ci.parent_id = :wiki_folder_id
+ and ci.content_type not in ('::xowiki::PageTemplate')
+ and ci.name not in ('es:header_page','es:index','es:indexe')
+ and p.page_id = xpi.page_instance_id
+ and category_id in ([join $cat_id ","])
+ and xpi.page_instance_id = ci.live_revision
+ order by p.page_order"]
+
+ set order_page [lsort -increasing -command content_compare::compare $page_list]
+
+ if {[llength $order_page] > 0} {
+ set next_list [lindex $order_page 0]
+ set nexturl "${wiki_url}[lindex $next_list 2]\#cont1"
+ break
+ }
+ }
+ ad_returnredirect $nexturl
+ }
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateIndex.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateIndex.page,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateIndex.page 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,7 @@
+::xowiki::Page new -title "[_ content-portlet.index_page]" -text {
+{{es:o_index -decoration plain }}
+{{adp portlets/ges-categories {skin plain-include} }}
+}
+
+
+
Index: openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateIndexe.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateIndexe.page,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateIndexe.page 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,62 @@
+::xowiki::Object new -title "Object index" -text {
+proc content {} {
+
+set community_id [dotlrn_community::get_community_id]
+set com_package_id [dotlrn_community::get_package_id $community_id]
+set package_id [site_node_apm_integration::get_child_package_id \
+ -package_id $com_package_id \
+ -package_key "xowiki"]
+
+set wk_folder_id [::xowiki::Page require_folder -name xowiki -package_id $package_id]
+
+if { ![db_0or1row select_instance [::xowiki::PageInstance instance_select_query \
+ -folder_id $wk_folder_id -select_attributes {name} \
+ -where_clause "name = 'es:header_page'"]]} {
+
+if { ![db_0or1row select_instance [::xowiki::PageTemplate instance_select_query \
+ -folder_id $wk_folder_id -select_attributes {name} \
+ -where_clause "name = 'es:Template_de_header'"]]} {
+
+set tmp_item_id $item_id
+
+set fn "[get_server_root]/packages/content-portlet/www/prototypes/gestemplate/GesTemplateheaderpage.page"
+ set standard_page "es:header_page"
+ if {[file readable $fn]} {
+ set page [source $fn]
+ $page configure -name $standard_page -parent_id $wk_folder_id -package_id $package_id
+ if {![$page exists title]} {
+ $page set title $template1
+ }
+ $page set page_template $tmp_item_id
+ $page destroy_on_cleanup
+ $page set instance_attributes "Curso Curso Carrera Carrera Facultad Facultad"
+ $page initialize_loaded_object
+ $page save_new
+ }
+ }
+}
+
+set user_id [ad_conn user_id]
+set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id [dotlrn_community::get_community_id]]
+if {$admin_p} {
+ return {
+
+ #content-portlet.welcome#
+
+
+ #content-portlet.welcome_body#
+
+ [[es:header_page|#content-portlet.edit_header#]]
+ }
+} else {
+ return {
+
+ #content-portlet.e_welcome#
+
+
+ #content-portlet.e_welcome_body#
+
+ }
+ }
+}
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateactividades.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateactividades.page,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateactividades.page 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,74 @@
+::xowiki::PageTemplate new -title "Template Actividades" -text {
+
+{{adp /packages/xowiki/www/admin/order {page_pos @page_order@ page_id @revision_id@ content_id @package_id@ type @object_type@ dir "decreasing" action 0 page_name @name@ status @publish_status@}}}
+
+
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplatebody.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplatebody.page,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplatebody.page 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,45 @@
+::xowiki::PageTemplate new -title "Template Actividades" -text {
+
+
+{{adp /packages/xowiki/www/admin/order {page_pos @page_order@ page_id @revision_id@ content_id @package_id@ type @object_type@ dir "decreasing" action 0 page_name @name@ status @publish_status@} }}
+
+
+
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplatecontenido.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplatecontenido.page,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplatecontenido.page 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,77 @@
+::xowiki::PageTemplate new -title "Template Contenido" -text {
+
+{{adp /packages/xowiki/www/admin/order {page_pos @page_order@ page_id @revision_id@ content_id @package_id@ type @object_type@ dir "decreasing" action 0 page_name @name@ status @publish_status@}}}
+
+
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateglosario.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateglosario.page,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateglosario.page 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,76 @@
+::xowiki::PageTemplate new -title "Template Glosario" -text {
+
+{{adp /packages/xowiki/www/admin/order {page_pos @page_order@ page_id @revision_id@ content_id @package_id@ type @object_type@ dir "decreasing" action 0 page_name @name@ status @publish_status@}}}
+
+
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateheader.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateheader.page,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateheader.page 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,24 @@
+::xowiki::PageTemplate new -title "Template de Header" -text {
+
+
+
+
+
+
+
+
+ @Facultad@
+ @Carrera@
+ @Curso@
+
+
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateheaderpage.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateheaderpage.page,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateheaderpage.page 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,3 @@
+::xowiki::PageInstance new -title "Pagina de Header" -text {
+ Header
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateintroduccion.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateintroduccion.page,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateintroduccion.page 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,73 @@
+::xowiki::PageTemplate new -title "Template Introduccion" -text {
+
+{{adp /packages/xowiki/www/admin/order {page_pos @page_order@ page_id @revision_id@ content_id @package_id@ type @object_type@ dir "decreasing" action 0 page_name @name@ status @publish_status@}}}
+
+
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateintroduccion3.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateintroduccion3.page,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/prototypes/gestemplate/GesTemplateintroduccion3.page 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,123 @@
+::xowiki::PageTemplate new -title "Ges Template i1" -text {
+
+
+ {{adp /packages/xowiki/www/admin/toggle-page-order {page_pos @page_order@ page_id @revision_id@ content_id @package_id@ type @object_type@ dir "decreasing" action 0 page_name @name@ status @publish_status@}}}
+ {{adp /packages/xowiki/www/admin/toggle-page-order {page_pos @page_order@ page_id @revision_id@ content_id @package_id@ type @object_type@ dir "increasing" action 0 page_name @name@ status @publish_status@}}}
+
+
+
+}
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/resources/.DS_Store
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/resources/.DS_Store,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/resources/.DS_Store 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1 @@
+ Bud1 % @ � @ � @ � @ E % DSDB ` � @ � @ � @
\ No newline at end of file
Index: openacs-4/packages/content-portlet/www/resources/calendar-full-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/content-portlet/www/resources/Attic/calendar-full-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/content-portlet/www/resources/calendar-full-portlet.tcl 24 Oct 2007 22:50:26 -0000 1.1
@@ -0,0 +1,27 @@
+�PNG
+
+
+IHDR , �]� pHYs ��
+OiCCPPhotoshop ICC profile xڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q,�
+��!���������{�kּ������>�����H3Q5��B�������.@�
+$p �d!s�# �~<<+"�� x� �M��0���B�\���t�8K� @z�B� @F���&S