public function __construct() { parent::__construct( 'PollResults', 'read' ); # for MW 1.15 (still being used by many customers) # please do not remove until 2012 if ( qp_Setup::mediaWikiVersionCompare( '1.16' ) ) { wfLoadExtensionMessages( 'QPoll' ); } }
public function __construct() { parent::__construct( 'QPollWebInstall', 'read' ); }
/** * @return string html representation of question statistics */ public function displayStats( qp_SpecialPage $page, $pid ) { $ctrl = $this->ctrl; $current_title = $page->getTitle(); $output = $this->displayHeader() . "<div class=\"qpoll\">\n" . "<table class=\"qdata\">\n" . qp_Renderer::displayRow( array_map( array( $this, 'categoryentities' ), $ctrl->CategorySpans ), array( 'class' => 'spans' ), 'th', array( 'count' => 'colspan', 'name' => 0 ) ) . qp_Renderer::displayRow( array_map( array( $this, 'categoryentities' ), $ctrl->Categories ), array(), 'th', array( 'name' => 0 ) ); # multiple choice polls doesn't use real spans, instead, every column is like "span" $spansUsed = count( $ctrl->CategorySpans ) > 0 || $ctrl->type == "multipleChoice"; foreach ( $ctrl->ProposalText as $propkey => &$proposal_text ) { if ( isset( $ctrl->Votes[ $propkey ] ) ) { if ( $ctrl->Percents === null ) { $row = $ctrl->Votes[ $propkey ]; } else { $row = $ctrl->Percents[ $propkey ]; foreach ( $row as $catkey => &$cell ) { # Replace spaces with en spaces $formatted_cell = str_replace( " ", " ", sprintf( '%3d%%', intval( round( 100 * $cell ) ) ) ); # only percents !=0 are displayed as link if ( $cell == 0.0 && $ctrl->question_id !== null ) { $cell = array( 0 => $formatted_cell, "style" => "color:gray" ); } else { $cell = array( 0 => $page->qpLink( $current_title, $formatted_cell, array( "title" => wfMsgExt( 'qp_votes_count', array( 'parsemag' ), $ctrl->Votes[ $propkey ][ $catkey ] ) ), array( "action" => "qpcusers", "id" => $pid, "qid" => $ctrl->question_id, "pid" => $propkey, "cid" => $catkey ) ) ); } if ( $spansUsed ) { if ( $ctrl->type == "multipleChoice" ) { $cell[ "class" ] = ( ( $catkey & 1 ) === 0 ) ? "spaneven" : "spanodd"; } else { $cell[ "class" ] = ( ( $ctrl->Categories[ $catkey ][ "spanId" ] & 1 ) === 0 ) ? "spaneven" : "spanodd"; } } else { $cell[ "class" ] = "stats"; } } } } else { # this proposal has no statistics (no votes) $row = array_fill( 0, count( $ctrl->Categories ), '' ); } $row[] = array( 0 => qp_Setup::entities( $proposal_text ), "style" => "text-align:left;" ); $output .= qp_Renderer::displayRow( $row ); } $output .= "</table>\n" . "</div>\n"; return $output; }
public function __construct() { parent::__construct($this->queryPageName()); }
public function __construct() { parent::__construct('PollResults', 'read'); }