Changeset 12893
- Timestamp:
- 10/19/07 09:16:50 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/midcom.helper.datamanager2/exec/chooser_handler.php
r12271 r12893 11 11 12 12 debug_push_class('midcom_helper_datamanager2_widget_chooser_handler', 'initialize'); 13 14 debug_print_r('_REQUEST', $_REQUEST); 13 // debug_print_r('_REQUEST', $_REQUEST); 15 14 16 15 // Common variables … … 37 36 38 37 $query = $_REQUEST["query"]; 38 $query = str_replace("*","%", $query); 39 39 40 40 $map = array … … 51 51 foreach ($map as $map_key) 52 52 { 53 debug_add("map extras :: checking map_key {$map_key}");53 // debug_add("map extras :: checking map_key {$map_key}"); 54 54 if ( isset($extra_params[$map_key]) 55 55 && !empty($extra_params[$map_key])) 56 56 { 57 debug_add("found");57 // debug_add("found"); 58 58 $$map_key = $extra_params[$map_key]; 59 59 } 60 60 else 61 61 { 62 debug_add("Not found");62 // debug_add("Not found"); 63 63 $$map_key = false; 64 64 } 65 65 } 66 66 67 if (! empty($reflector_key))67 if (! empty($reflector_key)) 68 68 { 69 69 $_MIDCOM->componentloader->load_graceful('midgard.admin.asgard'); … … 72 72 debug_pop(); 73 73 debug_push_class('midcom_helper_datamanager2_widget_chooser_handler', 'search'); 74 75 // Handle automatic wildcards 76 if ( !empty($auto_wildcards) 77 && strpos($query, '%') === false) 78 { 79 switch($auto_wildcards) 80 { 81 case 'both': 82 $query = "%{$query}%"; 83 break; 84 case 'start': 85 $query = "%{$query}"; 86 break; 87 case 'end': 88 $query = "{$query}%"; 89 break; 90 default: 91 debug_add("Don't know how to handle auto_wildcards value '{$auto_wildcards}'", MIDCOM_LOG_WARN); 92 break; 93 } 94 } 74 95 75 96 if (!empty($_callback_class)) … … 101 122 else 102 123 { 103 debug_add("Using component: {$component}");104 debug_add("Using class: {$class}");124 // debug_add("Using component: {$component}"); 125 // debug_add("Using class: {$class}"); 105 126 106 127 // Load component if required … … 128 149 exit(); 129 150 } 130 131 // Handle automatic wildcards132 if ( !empty($auto_wildcards)133 && strpos($query, '%') === false)134 {135 switch($auto_wildcards)136 {137 case 'both':138 $query = "%{$query}%";139 break;140 case 'start':141 $query = "%{$query}";142 break;143 case 'end':144 $query = "{$query}%";145 break;146 default:147 debug_add("Don't know how to handle auto_wildcards value '{$auto_wildcards}'", MIDCOM_LOG_WARN);148 break;149 }150 }151 152 // if (!empty($reflector_key))153 // {154 // $qb = new midgard_query_builder($class);155 // }156 // else157 // {158 // $qb = call_user_func(array($class, 'new_query_builder'));159 // }160 151 161 152 $qb = @call_user_func(array($class, 'new_query_builder'));
