function makeList($votes, $aorb) { global $I18N; $output = '<table><tr><td><p>{#considered_usernames#}:</p><ul style="padding-top:5px;">'; foreach ($votes["altnames"] as $i => $altname) { $output .= '<li><a href="//{$domain}/wiki/User:'******'" >' . $altname . '</a></li> '; } $output .= '</ul>'; $total = count($votes["support"]) + count($votes["oppose"]) + count($votes["neutral"]) + count($votes["unknown"]); $rfxpages = str_replace("_", " ", ucfirst($aorb)); $output .= ' <span>' . $I18N->msg('vote_msg', array("variables" => array($votes["altnames"][0], $total, $rfxpages))) . '</span><br /> <span> {#support#}: ' . count($votes["support"]) . ', {#oppose#}: ' . count($votes["oppose"]) . ', {#neutral#}: ' . count($votes["neutral"]) . ', {#unknown#}: ' . count($votes["unknown"]) . ' </span></td> '; $chdata[] = count($votes["support"]); $chdata[] = count($votes["oppose"]); $chdata[] = count($votes["neutral"]); $chdata[] = count($votes["unknown"]); $labels = array($I18N->msg('support'), $I18N->msg('oppose'), $I18N->msg('neutral'), $I18N->msg('unknown')); $colors = array('55FF55', 'FF5555', 'CEC7C7', 'E6E68A'); $output .= '<td><img height="" src="' . xGraph::makeMiniPie($chdata, $labels, $colors) . ' " alt="chart" /></td>'; $output .= '</tr></table><br />'; foreach ($votes as $type => $voteresults) { if ($type == "altnames") { continue; } $output .= ' <h4>' . $I18N->msg(ucfirst($type)) . '</h4> <table class="leantable tble-condensed, xt-table"> '; foreach ($voteresults as $i => $item) { $pagetitle = str_replace('_', ' ', preg_replace('/^.*\\/(.*)$/', '\\1', $item["page"])); $output .= ' <tr> <td>' . ($i + 1) . '. </td> <td style="font-size:90%; padding-right:1em" >' . $item["startdate"] . '</td> <td style="font-size:90%" >(<span style="color:green">' . $item["pro"] . '</span>, <span style="color:red">' . $item["contra"] . '</span>, <span style="color:gray">' . $item["neutral"] . '</span>)</td> <td style="padding-left:1em" ><a href="//{$domain}/wiki/' . $item["page"] . '" >' . $pagetitle . '</a></td> </tr> '; } $output .= '</table>'; } return $output; }
$graphMonths = xGraph::makeHorizontalBar("month", $cnt->getMonthTotals(), 800, $cnt->getNamespaces()); $graphYears = xGraph::makeHorizontalBar("year", $cnt->getMonthTotals(), 800, $cnt->getNamespaces()); $gcolor1 = '99CCFF'; $gcolor2 = '99CC00'; $msgBytes = $I18N->msg('bytes'); $gminorpct = $cnt->mMinorEditsByte / $cnt->mLive * 100; $mdata = array($cnt->mMinorEditsByte, $cnt->mLive - $cnt->mMinorEditsByte); $mlabels = array("< 20 {$msgBytes} · " . $wt->numFmt($gminorpct, 1) . '%', "≥ 20 {$msgBytes} · " . $wt->numFmt(100 - $gminorpct, 1) . '%'); $mcolors = is_numeric($cnt->mMinorEditsByte) ? array($gcolor1, $gcolor2) : array('cccccc', 'cccccc'); $graphminorbyte = '<img alt="bla" src="' . xGraph::makeMiniPie($mdata, $mlabels, $mcolors, $wi->lang) . '" />'; $wt->assign('graphminorbyte', $graphminorbyte); $gminorpct = $cnt->mEditsSummary / $cnt->mLive * 100; $mdata = array($cnt->mLive - $cnt->mEditsSummary, $cnt->mEditsSummary); $mlabels = array($I18N->msg('no_summary') . ' · ' . $wt->numFmt(100 - $gminorpct, 1) . '%', $I18N->msg('with_summary') . ' · ' . $wt->numFmt($gminorpct, 1) . '%'); $mcolors = array($gcolor1, $gcolor2); $graphminorbyte = '<img alt="bla" src="' . xGraph::makeMiniPie($mdata, $mlabels, $mcolors, $wi->lang) . '" />'; $wt->assign('grapheditsummary', $graphminorbyte); //Make list of TopEdited Pages $wgNamespaces = $cnt->getNamespaces(); $uniqueEdits = $cnt->getUniqueArticles(); ksort($uniqueEdits['namespace_specific']); $num_to_show = 15; $out = '<table class="table-condensed table-striped xt-table">'; foreach ($uniqueEdits['namespace_specific'] as $namespace_id => $articles) { $out .= '<tr><td colspan=22 ><h3>' . $wgNamespaces['names'][$namespace_id] . '</h3></td></tr>'; #asort( $articles ); #$articles = array_reverse( $articles ); #$perflog->stack[] = $articles; //$uniqueEdits['namespace_specific'][0]; $i = 0; foreach ($articles as $article => $count) { if ($i == $num_to_show) {