Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php |
— | — | @@ -52,8 +52,11 @@ |
53 | 53 | * Add record forms to page edit view |
54 | 54 | */ |
55 | 55 | function onEditPage( $editPage ) { |
56 | | - global $wgOut, $wgJsMimeType, $wgStylePath; |
| 56 | + global $wgOut, $wgJsMimeType, $wgStylePath, $wgRequest; |
57 | 57 | |
| 58 | + # Allow normal edit operation if 'nora' in request |
| 59 | + if( $wgRequest->getText( 'nora' ) ) return true; |
| 60 | + |
58 | 61 | # Extract each of the top-level template calls in the content that have associated forms |
59 | 62 | # - note multiple records are now allowed in an article, but only one of each type |
60 | 63 | $records = array(); |
— | — | @@ -78,7 +81,7 @@ |
79 | 82 | # Add the prefs JS for the tabset |
80 | 83 | #$wgOut->addScript( "<script src=\"$wgStylePath/common/prefs.js\"></script>" ); |
81 | 84 | |
82 | | - $editPage->textbox1 = str_replace( "\x07", "", $content ); |
| 85 | + $editPage->textbox1 = preg_replace( "|(<noinclude>)?\s*\x07+\s*(</noinclude>)?|", "", $content ); |
83 | 86 | |
84 | 87 | $jsFormsList = array(); |
85 | 88 | $tabset = "<div class=\"tabset\">"; |
— | — | @@ -149,6 +152,9 @@ |
150 | 153 | } |
151 | 154 | } |
152 | 155 | |
| 156 | + # Bail if no record data was posted |
| 157 | + if( count( $data ) == 0 ) return true; |
| 158 | + |
153 | 159 | # Build the template syntax for the posted record data |
154 | 160 | $templates = ''; |
155 | 161 | foreach( $data as $type => $values ) { |
— | — | @@ -158,7 +164,8 @@ |
159 | 165 | } |
160 | 166 | |
161 | 167 | # Prepend the template syntax to the posted wikitext (which had them removed by onEditPage) |
162 | | - $text = $templates . $text; |
| 168 | + # - wrap them in noincludes as these should never show in enbeded articles |
| 169 | + $text = "<noinclude>$templates</noinclude>$text"; |
163 | 170 | return true; |
164 | 171 | } |
165 | 172 | |
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.1.2, 2010-11-14' ); |
| 14 | +define( 'RECORDADMIN_VERSION', '1.1.3, 2010-11-16' ); |
15 | 15 | |
16 | 16 | $dir = dirname( __FILE__ ) . '/'; |
17 | 17 | $wgExtensionMessagesFiles['RecordAdmin'] = $dir . 'RecordAdmin.i18n.php'; |