function getPageHeader() { global $wgLang, $wgContLang; $link = ""; if ( $this->pid !== null ) { $pollStore = new qp_PollStore( array( 'from' => 'pid', 'pid' => $this->pid ) ); if ( $pollStore->pid !== null ) { $pollStore->loadQuestions(); $poll_title = Title::makeTitle( intval( $this->ns ), $this->title, qp_AbstractPoll::s_getPollTitleFragment( $this->poll_id, '' ) ); $pagename = qp_Setup::specialchars( $wgContLang->convert( $poll_title->getPrefixedText() ) ); $pollname = qp_Setup::specialchars( $this->poll_id ); $head = array(); $head[] = $this->showPollActionsList( $pollStore->pid, $pollStore->mPollId, $poll_title ); $head[] = wfMsg( 'qp_header_line_qpul', wfMsg( 'qp_users_link' ), $pagename, $pollname ); $ques_found = false; foreach ( $pollStore->Questions as $qdata ) { if ( $qdata->question_id == $this->question_id ) { $ques_found = true; break; } } if ( $ques_found ) { $qpa = wfMsg( 'qp_header_line_qucl', $this->question_id, qp_Setup::entities( $qdata->CommonQuestion ) ); if ( array_key_exists( $this->cat_id, $qdata->Categories ) ) { $categ = &$qdata->Categories[ $this->cat_id ]; $proptext = $qdata->ProposalText[ $this->proposal_id ]; $cat_name = $categ['name']; if ( array_key_exists( 'spanId', $categ ) ) { $cat_name = wfMsg( 'qp_full_category_name', $cat_name, $qdata->CategorySpans[ $categ['spanId'] ]['name'] ); } $head[] = wfMsg( 'qp_header_line_qucl', $this->question_id, qp_Setup::entities( $qdata->CommonQuestion ), qp_Setup::entities( $proptext ), qp_Setup::entities( $cat_name ) ); qp_Renderer::applyAttrsToRow( $head, array( '__tag' => 'li', '__end' => "\n" ) ); $head = array( '__tag' => 'ul', 'class' => 'head', $head ); $link = PollResults::getPollsLink() . PollResults::getUsersLink() . qp_Renderer::renderTagArray( $head ); } } } } return $link; }
/** * Get full title (with fragment part) of the current poll. * To get an URI path, use Title::getFullText()/getPrefixedText() on it. * @return Title object */ function getTitle() { if ( $this->mArticleId === 0 ) { throw new MWException( __METHOD__ . ' cannot be called for unsaved new pages' ); } if ( is_null( $this->mArticleId ) ) { throw new MWException( 'Unknown article id in ' . __METHOD__ ); } if ( is_null( $this->mPollId ) ) { throw new MWException( 'Unknown poll id in ' . __METHOD__ ); } $res = Title::newFromID( $this->mArticleId ); if ( !( $res instanceof Title ) ) { throw new MWException( 'Cannot create poll title in ' . __METHOD__ ); } $res->setFragment( qp_AbstractPoll::s_getPollTitleFragment( $this->mPollId ) ); return $res; }