コード例 #1
0
	private function showUserVote( $pid, $uid ) {
		if ( $pid === null || $uid === null ) {
			return '';
		}
		$pollStore = new qp_PollStore( array( 'from' => 'pid', 'pid' => $pid ) );
		if ( $pollStore->pid === null ) {
			return '';
		}
		$pollStore->loadQuestions();
		$userName = qp_PollStore::getUserName( $uid );
		if ( $userName === false ) {
			return '';
		}
		$userTitle = Title::makeTitleSafe( NS_USER, $userName );
		$user_link = $this->qpLink( $userTitle, $userName );
		$pollStore->setLastUser( $userName );
		if ( !$pollStore->loadUserVote() ) {
			return '';
		}
		$head = array();
		$head[] = $this->showPollActionsList(
				$pollStore->pid,
				$pollStore->mPollId,
				$pollStore->getTitle()
		);
		$head[] = wfMsg( 'qp_browse_to_user', $user_link );
		$head[] = $this->getAnswerHeader( $pollStore );
		qp_Renderer::applyAttrsToRow( $head, array( '__tag' => 'li', '__end' => "\n" ) );
		$head = array( '__tag' => 'ul', 'class' => 'head', '__end' => "\n", $head );
		$output = qp_Renderer::renderTagArray( $head );
		foreach ( $pollStore->Questions as $qdata ) {
			if ( $pollStore->isUsedQuestion( $qdata->question_id ) ) {
				$qview = $qdata->getView();
				$output .= $qview->displayUserVote();
			}
		}
		return $output;
	}