Changeset 33203
- Timestamp:
- 11/11/11 19:02:56 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/dcReloadedFormExtraPlugin/trunk/lib/widget/crWidgetFormJsTreeAjaxPropel.class.php
r33202 r33203 34 34 * peer_class objects. Default value: ID 35 35 * * criteria: Criteria object. Default value: new Criteria() 36 * * root_nodes_criteria: If this option is set, it will be used to retrieve root nodes. 36 37 * * peer_method: method to retrieve objects: Default value doSelect 37 38 * * peer_count_method: method to count objects: Default value doCount … … 59 60 $this->addOption('peer_to_string_method', '__toString'); 60 61 $this->addOption('root_nodes_criteria', null); 62 $this->addOption('get_type_callback', null); 61 63 } 62 64 … … 110 112 peer_count_method: "%peer_count_method%", 111 113 peer_to_string_method: "%peer_to_string_method%", 114 get_type_callback: "%get_type_callback%", 112 115 }; 113 116 }',array( … … 128 131 "%peer_to_string_method%" => $this->encode($this->getOption('peer_to_string_method')), 129 132 "%root_nodes_criteria%" => $this->encode(serialize($this->getOption('root_nodes_criteria'))), 133 "%get_type_callback%" => $this->encode(serialize($this->getOption('get_type_callback'))), 130 134 )); 131 135 } plugins/dcReloadedFormExtraPlugin/trunk/modules/dc_ajax/actions/actions.class.php
r33202 r33203 327 327 $peer_method, 328 328 $peer_count_method, 329 $peer_to_string_method ) { 329 $peer_to_string_method, 330 $get_type_callback= null ) { 330 331 $ret=array(); 331 332 $tableMap = call_user_func(array($peer_class, 'getTableMap')); … … 340 341 $new ['state']= 'closed'; 341 342 } 343 if ( $get_type_callback != null && is_callable(array($o,$get_type_callback)) ) $new['attr']['type']= call_user_func(array($o,$get_type_callback)); 342 344 $ret[]=$new; 343 345 } … … 370 372 $peer_count_method, 371 373 $peer_to_string_method, 372 $related_by_column = null 374 $related_by_column = null, 375 $get_type_callback = null 373 376 ) { 374 377 … … 418 421 $peer_to_string_method = $this->decodeCrJsTreePropel( $request->getParameter('peer_to_string_method')); 419 422 $operation = $request->getParameter('operation'); 423 $get_type_callback = unserialize( $this->decodeCrJsTreePropel( $request->getParameter('get_type_callback'))); 420 424 421 425 switch ( $operation ) { … … 428 432 break; 429 433 } 430 $nodes = $this->getCrJsTreePropelAsOneLevelHierarchy($id, $peer_class, $peer_parent_id_column, $peer_id_column, $criteria, $root_nodes_criteria, $peer_method, $peer_count_method, $peer_to_string_method); 434 $nodes = $this->getCrJsTreePropelAsOneLevelHierarchy($id, $peer_class, $peer_parent_id_column, $peer_id_column, $criteria, $root_nodes_criteria, $peer_method, $peer_count_method, $peer_to_string_method, $get_type_callback); 435 431 436 return $this->renderText( json_encode($nodes)); 432 437 }