category::ad_form::get_categories (public)

 category::ad_form::get_categories \
    -container_object_id container_object_id \
    [ -element_name element_name ]

Defined in packages/categories/tcl/category-form-procs.tcl

Collects categories from the category widget in the format compatible with category::add_ad_form_elements. To be used in the -on_submit clause of ad_form.

Switches:
-container_object_id (required)
-element_name (optional, defaults to "category_id")
Author:
Branimir Dolicki <bdolicki@branimir.com>

Partial Call Graph (max 5 caller/called nodes):
%3 Class ::Generic::Form Class ::Generic::Form (public) category::ad_form::get_categories category::ad_form::get_categories Class ::Generic::Form->category::ad_form::get_categories Generic::Form instproc generate Generic::Form instproc generate (public) Generic::Form instproc generate->category::ad_form::get_categories packages/categories/lib/map.tcl packages/categories/ lib/map.tcl packages/categories/lib/map.tcl->category::ad_form::get_categories packages/faq/www/admin/q-and-a-add-edit.tcl packages/faq/ www/admin/q-and-a-add-edit.tcl packages/faq/www/admin/q-and-a-add-edit.tcl->category::ad_form::get_categories packages/file-storage/www/file-add.tcl packages/file-storage/ www/file-add.tcl packages/file-storage/www/file-add.tcl->category::ad_form::get_categories category_tree::get_mapped_trees category_tree::get_mapped_trees (public) category::ad_form::get_categories->category_tree::get_mapped_trees template::adp_level template::adp_level (public) category::ad_form::get_categories->template::adp_level

Testcases:
No testcase defined.
Source code:
    set category_trees [category_tree::get_mapped_trees $container_object_id]
    set category_ids [list]
    foreach tree $category_trees {
    lassign $tree tree_id name subtree_id assign_single_p require_category_p widget
        upvar #[template::adp_level]  __category__ad_form__$element_name\_${tree_id} my_category_ids
        if {[info exists my_category_ids]} {
            lappend category_ids {*}$my_category_ids
        } else {
            ns_log Warning "category::ad_form::get_categories: __category__ad_form__$element_name\_${tree_id} for tree $tree_id not found"
        }
    }
    return $category_ids
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: