Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php |
— | — | @@ -110,27 +110,28 @@ |
111 | 111 | # JS to add an onSubmit method that adds the record forms contents to hidden values in the edit form |
112 | 112 | $wgOut->addScript( "<script type='$wgJsMimeType'> |
113 | 113 | function raRecordForms() { |
114 | | - forms = [ $jsFormsList ]; |
| 114 | + var forms = [ $jsFormsList ]; |
115 | 115 | for( i = 0; i < forms.length; i++ ) { |
116 | | - type = forms[i]; |
117 | | - form = document.getElementById( type + '-form' ); |
118 | | - tags = [ 'input', 'select', 'textarea' ]; |
| 116 | + var type = forms[i]; |
| 117 | + var form = document.getElementById( type + '-form' ); |
| 118 | + var tags = [ 'input', 'select', 'textarea' ]; |
119 | 119 | for( j = 0; j < tags.length; j++ ) { |
120 | | - inputs = form.getElementsByTagName( tags[j] ); |
| 120 | + var inputs = form.getElementsByTagName( tags[j] ); |
121 | 121 | for( k = 0; k < inputs.length; k++ ) { |
122 | | - input = inputs[k]; |
123 | | - key = type + ':' + input.getAttribute('name'); |
124 | | - hidden = document.createElement( 'input' ); |
125 | | - hidden.setAttribute( 'name', key ); |
126 | | - hidden.setAttribute( 'type', 'hidden' ); |
127 | | - hidden.value = input.value; |
128 | | - document.getElementById( 'editform' ).appendChild( hidden ); |
| 122 | + var multi = jQuery( inputs[k] ).val(); |
| 123 | + if( typeof( multi ) == 'object' ) multi = multi.join('\\n'); |
| 124 | + var key = type + ':' + inputs[k].getAttribute('name'); |
| 125 | + var hidden = jQuery( document.createElement( 'input' ) ); |
| 126 | + hidden.attr( 'name', key ); |
| 127 | + hidden.attr( 'type', 'hidden' ); |
| 128 | + hidden.val( multi ); |
| 129 | + jQuery( '#editform' ).append( hidden ); |
129 | 130 | } |
130 | 131 | } |
131 | 132 | } |
132 | 133 | } |
133 | 134 | function raAddToSubmit() { |
134 | | - document.getElementById( 'editform' ).setAttribute( 'onsubmit', 'raRecordForms()' ); |
| 135 | + jQuery( '#editform' ).attr( 'onsubmit', 'raRecordForms()' ); |
135 | 136 | } |
136 | 137 | addOnloadHook( raAddToSubmit ); |
137 | 138 | </script>" ); |
— | — | @@ -148,6 +149,8 @@ |
149 | 150 | |
150 | 151 | # Organise the posted record data |
151 | 152 | $data = array(); |
| 153 | +#print_r($_REQUEST); |
| 154 | +#die; |
152 | 155 | foreach( $_REQUEST as $key => $value ) { |
153 | 156 | if( preg_match( "|(.+):ra_(.+)|", $key, $m ) ) { |
154 | 157 | if( is_array( $value ) ) $value = join( "\n", $value ); |
Index: trunk/extensions/RecordAdmin/RecordAdmin.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | * @author Siebrand Mazeland |
12 | 12 | * @licence GNU General Public Licence 2.0 or later |
13 | 13 | */ |
14 | | -define( 'RECORDADMIN_VERSION', '1.2.2, 2011-06-08' ); |
| 14 | +define( 'RECORDADMIN_VERSION', '1.2.3, 2011-06-08' ); |
15 | 15 | |
16 | 16 | $dir = dirname( __FILE__ ) . '/'; |
17 | 17 | $wgExtensionMessagesFiles['RecordAdmin'] = $dir . 'RecordAdmin.i18n.php'; |