Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php |
— | — | @@ -325,7 +325,10 @@ |
326 | 326 | . Html::closeElement( 'div' ); |
327 | 327 | ; |
328 | 328 | |
329 | | - $footer_links = Html::openElement( 'p', array( 'class' => 'articleFeedbackv5-comment-foot' ) ); |
| 329 | + $footer_links = Html::openElement( 'div', array( |
| 330 | + 'class' => 'articleFeedbackv5-vote-wrapper' |
| 331 | + ) ) |
| 332 | + . Html::openElement( 'p', array( 'class' => 'articleFeedbackv5-comment-foot' ) ); |
330 | 333 | |
331 | 334 | if( $can_vote ) { |
332 | 335 | $footer_links .= Html::element( 'span', array( |
— | — | @@ -350,7 +353,8 @@ |
351 | 354 | 'id' => "articleFeedbackv5-abuse-link-$id", |
352 | 355 | 'class' => 'articleFeedbackv5-abuse-link' |
353 | 356 | ), wfMessage( 'articlefeedbackv5-form-abuse', $record[0]->af_abuse_count )->text() ) ) : '' ) |
354 | | - . Html::closeElement( 'p' ); |
| 357 | + . Html::closeElement( 'p' ) |
| 358 | + . Html::closeElement( 'div' ); |
355 | 359 | |
356 | 360 | // Don't render the toolbox if they can't do anything with it. |
357 | 361 | $tools = null; |
— | — | @@ -436,11 +440,8 @@ |
437 | 441 | $class = 'negative'; |
438 | 442 | } |
439 | 443 | |
440 | | - $found = $this->feedbackHead( $msg, $class, $record[0] ); |
441 | | - |
442 | | - return "$found |
443 | | - <blockquote>" . htmlspecialchars( $record['comment']->aa_response_text ) |
444 | | - . '</blockquote>'; |
| 444 | + return $this->feedbackHead( $msg, $class, $record[0] ) |
| 445 | + . $this->renderComment( $record['comment']->aa_response_text ); |
445 | 446 | } |
446 | 447 | |
447 | 448 | |
— | — | @@ -453,8 +454,7 @@ |
454 | 455 | // * articlefeedbackv5-form2-header-question |
455 | 456 | // * articlefeedbackv5-form2-header-suggestion |
456 | 457 | return $this->feedbackHead( "articlefeedbackv5-form2-header-$type", $class, $record[0], $type ) |
457 | | - . '<blockquote>' . htmlspecialchars( $record['comment']->aa_response_text ) |
458 | | - . '</blockquote>'; |
| 458 | + . $this->renderComment( $record['comment']->aa_response_text ); |
459 | 459 | } |
460 | 460 | |
461 | 461 | private function renderBucket3( $record ) { |
— | — | @@ -463,8 +463,7 @@ |
464 | 464 | $class = $record['rating']->aa_response_rating >= 3 ? 'positive' : 'negative'; |
465 | 465 | |
466 | 466 | return $this->feedbackHead( 'articlefeedbackv5-form3-header', $class, $record[0], $record['rating']->aa_response_rating ) |
467 | | - . '<blockquote>' . htmlspecialchars( $record['comment']->aa_response_text ) |
468 | | - . '</blockquote>'; |
| 467 | + . $this->renderComment( $record['comment']->aa_response_text ); |
469 | 468 | } |
470 | 469 | |
471 | 470 | private function renderBucket4( $record ) { |
— | — | @@ -525,6 +524,18 @@ |
526 | 525 | ); |
527 | 526 | } |
528 | 527 | |
| 528 | + private function renderComment( $text ) { |
| 529 | + if( strlen( $text ) <= 500 ) { |
| 530 | + $rv = "<blockquote>" |
| 531 | + . htmlspecialchars( $record['comment']->aa_response_text ) |
| 532 | + . '</blockquote>'; |
| 533 | + } else { |
| 534 | + $rv = "<blockquote>" |
| 535 | + . htmlspecialchars( $record['comment']->aa_response_text ) |
| 536 | + . '</blockquote>'; |
| 537 | + } |
| 538 | + } |
| 539 | + |
529 | 540 | private function feedbackHead( $message, $class, $record, $extra = '' ) { |
530 | 541 | $gender = ''; #? |
531 | 542 | $name = htmlspecialchars( $record->user_name ); |