In order to display the categories mapped to a package in the ad_form i use:
set category_ids [list]
foreach {category_id category_name} [videos::get_categories -package_id $package_id] {
ad_form -extend -name video -form [list \
[list "${category_id}:integer(select)" \
[list label $category_name] \
[list options [videos::category_get_options -parent_id $category_id]] \
[list value ""] \
] \
]
}
Moreover, how would be the approach to actually map the categories to the new object_id
i tried to write in the ad_form block "-new_data" the following code.
foreach {category_id category_name} [videos::get_categories -package_id $package_id] {
set cat_label $category_id
category::map_object -remove_old -object_id $video_id ${$cat_label}
In another words, how would i get the data the user filled out in the category's fields and map them to the new item inserted?
cheers,