Exemple #1
0
 function getNextToPatrolHTML()
 {
     global $wgOut;
     if (!$this->mResult) {
         // nothing to patrol
         return null;
     }
     // construct the HTML to reply
     // load the page
     $t = $this->mTitle;
     // Title::newFromID($this->mResult->qc_page);
     if (!$t) {
         $this->deleteBad($this->mResult->qc_page);
         return "<!--{$this->mResult->qc_page}-->error creating title, oops, please <a href='#' onclick='window.location.reload()'>refresh</a>";
     }
     // get current revsion
     $r = Revision::newFromTitle($t);
     if (!$r) {
         return "Error creating revision";
     }
     $html = "";
     //grab all that good tip stuff
     $tipData = TipsPatrol::getTipData($this->mResult->qc_extra, $this->mResult->qc_user);
     $the_tip = $tipData['tw_tip'];
     $tip_page = $tipData['tw_page'];
     $approvedby = self::getChangedBy("Tip approved by: ", "qc_approvedby", $tip_user);
     $html = '<h3>New Tip</h3><br />' . '<div class="wh_block"><ul><li>' . $the_tip . '</li></ul></div>';
     $html = "<div id='qc_box'>" . $addedby . $approvedby . $html . "</div>";
     $wgOut->clearHTML();
     $html .= "<div id='quickeditlink'></div>";
     $popts = $wgOut->parserOptions();
     $popts->setTidy(true);
     $magic = WikihowArticleHTML::grabTheMagic($r->getText());
     $html .= WikihowArticleHTML::processArticleHTML($wgOut->parse($r->getText(), $t, $popts), array('no-ads' => 1, 'ns' => $t->getNamespace(), 'magic-word' => $magic));
     $html .= "<input type='hidden' name='qc_id' value='{$this->mResult->qc_id}'/>";
     $html .= "<div id='numqcusers'>{$this->mUsers}</div>";
     return $html;
 }