Changeset 13589
- Timestamp:
- 11/22/07 17:37:52 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/midcom.helper.datamanager2/exec/chooser_handler.php
r13560 r13589 45 45 '_renderer_callback_class', '_renderer_callback_args', 46 46 'constraints', 'searchfields', 'orders', 47 'result_headers', 47 'result_headers', 'generate_path_for', 48 48 'auto_wildcards', 49 49 'reflector_key' … … 293 293 $value = @$object->$item_name; 294 294 295 if ( $class == 'midcom_db_topic' 296 && $item_name == 'extra' ) 295 if ( $generate_path_for == $item_name 296 || ( $class == 'midcom_db_topic' 297 && $item_name == 'extra') ) 297 298 { 298 299 $value = resolve_path_title($object->id, $value); branches/MidCOM_2_8/midcom.helper.datamanager2/widget/chooser.php
r13060 r13589 143 143 */ 144 144 var $result_headers = array(); 145 146 /** 147 * In search results replaces given field with full path to the object 148 * 149 * Example: (in topics) 150 * 'generate_path_for' => 'extra', 151 * 152 * @var array 153 */ 154 var $generate_path_for = null; 145 155 146 156 /** … … 253 263 254 264 var $allow_multiple = true; 265 var $require_corresponding_option = true; 255 266 256 267 var $reflector_key = null; … … 259 270 var $creation_handler = null; 260 271 var $creation_default_key = null; 261 272 273 var $js_format_items = array(); 274 262 275 /** 263 276 * The initialization event handler post-processes the maxlength setting. … … 281 294 282 295 $this->allow_multiple = $this->_type->allow_multiple; 296 $this->require_corresponding_option = $this->_type->require_corresponding_option; 283 297 284 298 if ( empty($this->class) … … 316 330 return false; 317 331 } 318 319 // if (empty($this->class))320 // {321 // debug_push_class(__CLASS__, __FUNCTION__);322 // debug_add("Warning, the field {$this->name} does not have class defined.",323 // MIDCOM_LOG_WARN);324 // debug_pop();325 // return false;326 // }327 328 // if (empty($this->component))329 // {330 // debug_push_class(__CLASS__, __FUNCTION__);331 // debug_add("Warning, the field {$this->name} does not have component the class {$this->class} belongs to defined.",332 // MIDCOM_LOG_WARN);333 // debug_pop();334 // return false;335 // }336 332 337 333 if ( empty($this->searchfields) … … 633 629 array('metadata.published' => 'ASC'), 634 630 ), 631 'generate_path_for' => 'extra', 635 632 ), 636 633 'group' => array … … 680 677 $this->result_headers[] = $header; 681 678 } 679 } 680 if ( is_null($this->generate_path_for) 681 && isset($clever_classes[$this->clever_class]['generate_path_for'])) 682 { 683 $this->generate_path_for = $clever_classes[$this->clever_class]['generate_path_for']; 682 684 } 683 685 if (empty($this->constraints)) … … 873 875 $this->_js_widget_options['allow_multiple'] = 'true'; 874 876 $this->_js_widget_options['id_field'] = "'$this->id_field'"; 877 $this->_js_widget_options['format_items'] = 'null'; 875 878 876 879 if ($this->creation_mode_enabled) … … 897 900 $this->_js_widget_options['allow_multiple'] = 'true'; 898 901 } 902 } 903 if (! empty($this->js_format_items)) 904 { 905 $format_items = "{ "; 906 $fi_count = count($this->js_format_items); 907 $i = 0; 908 foreach ($this->js_format_items as $k => $formatter) 909 { 910 $i++; 911 $format_items .= "'{$k}': '{$formatter}'"; 912 913 if ($i == $fi_count) 914 { 915 $format_items .= " "; 916 } 917 else 918 { 919 $format_items .= ", "; 920 } 921 } 922 $format_items .= "}"; 923 $this->_js_widget_options['format_items'] = $format_items; 899 924 } 900 925 … … 1183 1208 $item_name = $header_item['name']; 1184 1209 $value = @$object->$item_name; 1185 $value = rawurlencode( $value);1210 $value = rawurlencode(utf8_decode($value)); 1186 1211 // debug_add("adding header item: name={$item_name} value={$value}"); 1187 1212 $jsdata .= "{$item_name}: '{$value}'";
