Index: branches/lqt-updates/extensions/LiquidThreads/classes/view/PostFormatter.php |
— | — | @@ -157,7 +157,23 @@ |
158 | 158 | if ( $showAnything && $this->runCallback( $object, $context ) ) { |
159 | 159 | $html .= Xml::openElement( 'div', array( 'class' => $divClass ) ); |
160 | 160 | |
161 | | - $text = $version->getContentHTML(); |
| 161 | + if ( $context->getActionFor( $object ) == 'edit' ) { |
| 162 | + $form = new LiquidThreadsPostEditForm( |
| 163 | + $context->get('user'), |
| 164 | + $object |
| 165 | + ); |
| 166 | + $formResult = $form->show(); |
| 167 | + |
| 168 | + if ( $formResult === true ) { |
| 169 | + $object = $form->getModifiedObject(); |
| 170 | + $version = $object->getCurrentVersion(); |
| 171 | + $text .= $version->getContentHTML(); |
| 172 | + } else { |
| 173 | + $text = $formResult; |
| 174 | + } |
| 175 | + } else { |
| 176 | + $text = $version->getContentHTML(); |
| 177 | + } |
162 | 178 | |
163 | 179 | $html .= $text; |
164 | 180 | |
Index: branches/lqt-updates/extensions/LiquidThreads/classes/view/PostEditForm.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | protected function getSummaryBox() { |
41 | 41 | $label = wfMsg( 'summary' ); |
42 | 42 | return Xml::inputLabel( $label, 'lqt-summary', |
43 | | - 'lqt-summary', 60, $subject ) . |
| 43 | + 'lqt-summary', 60 ) . |
44 | 44 | Xml::element( 'br' ); |
45 | 45 | } |
46 | 46 | |
Index: branches/lqt-updates/extensions/LiquidThreads/classes/view/PostToolbar.php |
— | — | @@ -124,7 +124,6 @@ |
125 | 125 | |
126 | 126 | $replyLink = wfAppendQuery( $context->get('base-url'), $replyQuery ); |
127 | 127 | |
128 | | - // TODO permissions checking, proper URL |
129 | 128 | $commands['reply'] = array( |
130 | 129 | 'label' => wfMsgExt( 'lqt_reply', 'parseinline' ), |
131 | 130 | 'href' => $replyLink, |
— | — | @@ -172,12 +171,18 @@ |
173 | 172 | $history = SpecialPage::getTitleFor( 'PostHistory', $post->getID() ); |
174 | 173 | $commands['history'] = array( |
175 | 174 | 'label' => wfMsgExt( 'history_short', 'parseinline' ), |
176 | | - 'href' => $history->getFullURL(), |
| 175 | + 'href' => $history->getLocalURL(), |
177 | 176 | 'enabled' => true, |
178 | 177 | ); |
179 | 178 | |
180 | 179 | // TODO permissions checking |
181 | | - $edit_url = SpecialPage::getTitleFor( 'EditPost', $post->getID() ); |
| 180 | + $editQuery = array( |
| 181 | + 'lqt_action' => 'edit', |
| 182 | + 'lqt_target' => $post->getUniqueIdentifier(), |
| 183 | + ); |
| 184 | + |
| 185 | + $edit_url = wfAppendQuery( $context->get('base-url'), $editQuery ); |
| 186 | + |
182 | 187 | $commands['edit'] = array( |
183 | 188 | 'label' => wfMsgExt( 'edit', 'parseinline' ), |
184 | 189 | 'href' => $edit_url, |
— | — | @@ -188,7 +193,7 @@ |
189 | 194 | $splitUrl = SpecialPage::getTitleFor( 'SplitThread', $post->getID() )->getFullURL(); |
190 | 195 | $commands['split'] = array( |
191 | 196 | 'label' => wfMsgExt( 'lqt-thread-split', 'parseinline' ), |
192 | | - 'href' => $splitUrl, |
| 197 | + 'href' => $splitUrl->getLocalURL(), |
193 | 198 | 'enabled' => true |
194 | 199 | ); |
195 | 200 | } |
— | — | @@ -210,9 +215,11 @@ |
211 | 216 | // ); |
212 | 217 | // } |
213 | 218 | |
| 219 | + $linkTarget = SpecialPage::getTitleFor( 'Post', $post->getID() ); |
| 220 | + |
214 | 221 | $commands['link'] = array( |
215 | 222 | 'label' => wfMsgExt( 'lqt_permalink', 'parseinline' ), |
216 | | - 'href' => SpecialPage::getTitleFor( 'Post', $post->getID() ), |
| 223 | + 'href' => $linkTarget->getLocalURL(), |
217 | 224 | 'enabled' => true, |
218 | 225 | 'showlabel' => true, |
219 | 226 | 'tooltip' => wfMsgExt( 'lqt_permalink', 'parseinline' ) |