category::ad_form::add_widgets (public)

 category::ad_form::add_widgets \
    -container_object_id container_object_id \
    [ -categorized_object_id categorized_object_id ] \
    -form_name form_name [ -element_name element_name ] \
    [ -excluded_trees excluded_trees ] [ -help_text help_text ]

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

For each category tree associated with this container_object_id (usually package_id) put a category widget into the ad_form. On form submission the procedure category::ad_form::get_categories should be called to collect the categories in which this object belongs.

Switches:
-container_object_id (required)
-categorized_object_id (optional)
-form_name (required)
-element_name (optional, defaults to "category_id")
-excluded_trees (optional)
-help_text (optional)
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::add_widgets category::ad_form::add_widgets Class ::Generic::Form->category::ad_form::add_widgets Generic::Form instproc generate Generic::Form instproc generate (public) Generic::Form instproc generate->category::ad_form::add_widgets packages/categories/lib/categorize.tcl packages/categories/ lib/categorize.tcl packages/categories/lib/categorize.tcl->category::ad_form::add_widgets packages/categories/lib/map.tcl packages/categories/ lib/map.tcl packages/categories/lib/map.tcl->category::ad_form::add_widgets 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::add_widgets ad_form ad_form (public) category::ad_form::add_widgets->ad_form category_tree::get_mapped_trees category_tree::get_mapped_trees (public) category::ad_form::add_widgets->category_tree::get_mapped_trees

Testcases:
No testcase defined.
Source code:
    set category_trees [category_tree::get_mapped_trees $container_object_id]

    foreach tree $category_trees {
    lassign $tree tree_id name subtree_id assign_single_p require_category_p widget
        if {$tree_id in $excluded_trees} {
            continue
        }
    set options ""
    if {$assign_single_p == "f"} {
        set options ",multiple"
    }
    if {$require_category_p == "f"} {
        append options ",optional"
    }
        ad_form -extend -name $form_name -form  [list [list __category__ad_form__$element_name\_${tree_id}:category$options  {label $name}  {category_tree_id $tree_id}  {category_subtree_id $subtree_id}  {category_object_id {[expr {[info exists categorized_object_id] ? $categorized_object_id : ""}]}}  {category_assign_single_p $assign_single_p}  {category_require_category_p $require_category_p}  {category_widget $widget}  {help_text $help_text}  ]]

    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: