2011-10-09 18:35:17 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* AJAX Poll extension for MediaWiki
|
|
|
|
* Created by Dariusz Siedlecki, based on the work by Eric David.
|
|
|
|
* Licensed under the GFDL.
|
|
|
|
*
|
|
|
|
* <poll>
|
|
|
|
* [Option]
|
|
|
|
* Question
|
|
|
|
* Answer 1
|
|
|
|
* Answer 2
|
2012-02-16 22:55:06 +00:00
|
|
|
* Answer ...
|
2011-10-09 18:35:17 +00:00
|
|
|
* Answer n
|
|
|
|
* </poll>
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
|
|
|
* @author Dariusz Siedlecki <datrio@gmail.com>
|
|
|
|
* @author Jack Phoenix <jack@countervandalism.net>
|
2012-02-16 06:27:52 +00:00
|
|
|
* @author Thomas Gries
|
2012-02-16 22:55:06 +00:00
|
|
|
* @maintainer Thomas Gries
|
|
|
|
* @version 1.600
|
2011-10-09 18:35:17 +00:00
|
|
|
* @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation
|
|
|
|
*/
|
|
|
|
|
|
|
|
if( !defined( 'MEDIAWIKI' ) ) {
|
|
|
|
die( "This is not a valid entry point.\n" );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Extension credits that will show up on Special:Version
|
|
|
|
$wgExtensionCredits['parserhook'][] = array(
|
2012-02-15 07:44:34 +00:00
|
|
|
'path' => __FILE__,
|
2011-10-09 18:35:17 +00:00
|
|
|
'name' => 'AJAX Poll',
|
2012-02-19 17:25:22 +00:00
|
|
|
'version' => '1.602 20120219',
|
2012-02-17 14:57:54 +00:00
|
|
|
'author' => array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ),
|
|
|
|
'descriptionmsg' => 'ajaxpoll-desc',
|
2012-02-15 07:44:34 +00:00
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll',
|
2011-10-09 18:35:17 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
// Internationalization + AJAX function
|
|
|
|
$dir = dirname( __FILE__ ) . '/';
|
|
|
|
$wgExtensionMessagesFiles['AJAXPoll'] = $dir . 'AJAXPoll.i18n.php';
|
2012-02-19 17:24:15 +00:00
|
|
|
$wgAjaxExportList[] = 'AJAXPoll::submitVote';
|
|
|
|
$wgHooks['ParserFirstCallInit'][] = 'AJAXPoll::AJAXPollParserInit';
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
class AJAXPoll {
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
/**
|
|
|
|
* Register <poll> tag with the parser
|
|
|
|
*
|
|
|
|
* @param $parser Object: instance of Parser (not necessarily $wgParser)
|
|
|
|
* @return Boolean: true
|
|
|
|
*/
|
|
|
|
static function AJAXPollParserInit( $parser ) {
|
|
|
|
$parser->setHook( 'poll', array( __CLASS__, 'AJAXPollRender' ) );
|
|
|
|
return true;
|
|
|
|
}
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
# The callback function for converting the input text to HTML output
|
|
|
|
static function AJAXPollRender( $input ) {
|
|
|
|
global $wgParser, $wgUser, $wgOut, $wgTitle, $wgScriptPath;
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$wgParser->disableCache();
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
if ( $wgUser->getName() == '' ) {
|
|
|
|
$user = wfGetIP();
|
|
|
|
} else {
|
|
|
|
$user = $wgUser->getName();
|
|
|
|
}
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
// ID of the poll
|
|
|
|
$ID = strtoupper( md5( $input ) );
|
|
|
|
|
|
|
|
$par = new Parser();
|
|
|
|
$input = $par->parse( $input, $wgTitle, $wgOut->parserOptions() );
|
|
|
|
$input = trim( strip_tags( $input->getText() ) );
|
|
|
|
$lines = explode( "\n", trim( $input ) );
|
|
|
|
|
|
|
|
// Deprecating AJAX
|
|
|
|
/*if ( isset( $_POST['ajaxpoll-post-id'] ) && isset( $_POST['ajaxpoll-post-answer'] ) && $_POST['ajaxpoll-post-id'] == $ID ) {
|
|
|
|
AJAXPoll::submitVote( $_POST['ajaxpoll-post-id'], intval( $_POST['ajaxpoll-post-answer'] ) );
|
|
|
|
}*/
|
|
|
|
|
|
|
|
$dbw = wfGetDB( DB_MASTER );
|
|
|
|
$dbw->begin();
|
|
|
|
/**
|
|
|
|
* Register poll in the database
|
|
|
|
*/
|
|
|
|
$row = $dbw->selectRow(
|
|
|
|
array( 'poll_info' ),
|
|
|
|
array( 'COUNT(poll_id) AS count' ),
|
|
|
|
array( 'poll_id' => $ID ),
|
|
|
|
__METHOD__
|
|
|
|
);
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
if( empty( $row->count ) ) {
|
|
|
|
$dbw->insert(
|
|
|
|
'poll_info',
|
|
|
|
array(
|
|
|
|
'poll_id' => $ID,
|
|
|
|
'poll_txt' => $input,
|
|
|
|
'poll_date' => wfTimestampNow(),
|
|
|
|
'poll_title' => $wgParser->mTitle->getText()
|
|
|
|
),
|
|
|
|
__METHOD__
|
|
|
|
);
|
|
|
|
}
|
|
|
|
$dbw->commit();
|
|
|
|
|
|
|
|
// Add CSS
|
|
|
|
$wgOut->addExtensionStyle( $wgScriptPath . '/extensions/AJAXPoll/AJAXPoll.css' );
|
|
|
|
switch( $lines[0] ) {
|
|
|
|
case 'STATS':
|
|
|
|
$retVal = AJAXPoll::buildStats( $ID, $user );
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$retVal = '
|
|
|
|
<div id="ajaxpoll-container-' . $ID . '">' . AJAXPoll::buildHTML( $ID, $user, $lines ) . '</div>';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return $retVal;
|
|
|
|
}
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
private static function buildStats( $ID, $user ) {
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$dbw = wfGetDB( DB_MASTER );
|
|
|
|
|
|
|
|
$res = $dbw->select(
|
|
|
|
'poll_vote',
|
2011-10-09 18:35:17 +00:00
|
|
|
array(
|
2012-02-19 17:24:15 +00:00
|
|
|
'COUNT(*)',
|
|
|
|
'COUNT(DISTINCT poll_id)',
|
|
|
|
'COUNT(DISTINCT poll_user)',
|
|
|
|
'TIMEDIFF(NOW(), MAX(poll_date))'
|
2011-10-09 18:35:17 +00:00
|
|
|
),
|
2012-02-19 17:24:15 +00:00
|
|
|
array(),
|
2011-10-09 18:35:17 +00:00
|
|
|
__METHOD__
|
|
|
|
);
|
2012-02-19 17:24:15 +00:00
|
|
|
$tab = $dbw->fetchRow( $res );
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$clock = explode( ':', $tab[3] );
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
if ( $clock[0] == '00' && $clock[1] == '00' ) {
|
|
|
|
$x = $clock[2];
|
|
|
|
$y = 'second';
|
|
|
|
} elseif( $clock[0] == '00' ) {
|
|
|
|
$x = $clock[1];
|
|
|
|
$y = 'minute';
|
2011-10-09 18:35:17 +00:00
|
|
|
} else {
|
2012-02-19 17:24:15 +00:00
|
|
|
if ( $clock[0] < 24 ) {
|
|
|
|
$x = $clock[0];
|
|
|
|
$y = 'hour';
|
|
|
|
} else {
|
|
|
|
$x = floor( $hr / 24 );
|
|
|
|
$y = 'day';
|
|
|
|
}
|
2011-10-09 18:35:17 +00:00
|
|
|
}
|
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$clockago = $x . ' ' . $y . ( $x > 1 ? 's' : '' );
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$res = $dbw->select(
|
|
|
|
'poll_vote',
|
|
|
|
'COUNT(*)',
|
|
|
|
array( 'DATE_SUB(CURDATE(), INTERVAL 2 DAY) <= poll_date' ),
|
|
|
|
__METHOD__
|
|
|
|
);
|
|
|
|
$tab2 = $dbw->fetchRow( $res );
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
return "There are $tab[1] polls and $tab[0] votes given by $tab[2] different people.<br />
|
|
|
|
The last vote has been given $clockago ago.<br/>
|
|
|
|
During the last 48 hours, $tab2[0] votes have been given.";
|
2011-10-09 18:35:17 +00:00
|
|
|
}
|
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
public static function submitVote( $ID, $answer ) {
|
|
|
|
global $wgUser,$wgOut;
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$dbw = wfGetDB( DB_MASTER );
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
if ( $wgUser->getName() == '' ) {
|
|
|
|
$user = wfGetIP();
|
|
|
|
} else {
|
|
|
|
$user = $wgUser->getName();
|
|
|
|
}
|
2012-02-18 08:46:28 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
if ( $wgUser->isAllowed( 'bot' ) ) {
|
|
|
|
return AJAXPoll::buildHTML( $ID, $user );
|
|
|
|
}
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$answer = ++$answer;
|
|
|
|
|
|
|
|
$q = $dbw->select(
|
2011-10-09 18:35:17 +00:00
|
|
|
'poll_vote',
|
2012-02-19 17:24:15 +00:00
|
|
|
'COUNT(*) AS c',
|
2011-10-09 18:35:17 +00:00
|
|
|
array(
|
|
|
|
'poll_id' => $ID,
|
2012-02-16 06:27:52 +00:00
|
|
|
'poll_user' => $user
|
2011-10-09 18:35:17 +00:00
|
|
|
),
|
|
|
|
__METHOD__
|
|
|
|
);
|
2012-02-19 17:24:15 +00:00
|
|
|
$row = $dbw->fetchRow( $q );
|
|
|
|
|
|
|
|
if ( $row['c'] > 0 ) {
|
|
|
|
|
|
|
|
$updateQuery = $dbw->update(
|
|
|
|
'poll_vote',
|
|
|
|
array(
|
|
|
|
'poll_answer' => $answer,
|
|
|
|
'poll_date' => wfTimestampNow()
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'poll_id' => $ID,
|
|
|
|
'poll_user' => $user
|
|
|
|
),
|
|
|
|
__METHOD__
|
|
|
|
);
|
|
|
|
$dbw->commit();
|
|
|
|
$pollContainerText = ( $updateQuery ) ? 'ajaxpoll-vote-update' : 'ajaxpoll-vote-error';
|
|
|
|
|
|
|
|
} else {
|
2012-02-18 08:46:28 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$insertQuery = $dbw->insert(
|
|
|
|
'poll_vote',
|
|
|
|
array(
|
|
|
|
'poll_id' => $ID,
|
|
|
|
'poll_user' => $user,
|
|
|
|
'poll_ip' => wfGetIP(),
|
|
|
|
'poll_answer' => $answer,
|
|
|
|
'poll_date' => wfTimestampNow()
|
|
|
|
),
|
|
|
|
__METHOD__
|
|
|
|
);
|
|
|
|
$dbw->commit();
|
|
|
|
$pollContainerText = ( $insertQuery ) ? 'ajaxpoll-vote-add' : 'ajaxpoll-vote-error';
|
2012-02-18 08:46:28 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
}
|
2012-02-18 08:46:28 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
return AJAXPoll::buildHTML( $ID, $user, '', $pollContainerText );
|
2012-02-18 08:46:28 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
}
|
2012-02-18 08:46:28 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
private static function buildHTML( $ID, $user, $lines = '', $extra_from_ajax = '' ) {
|
|
|
|
global $wgTitle, $wgLang, $wgUseAjax;
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$dbw = wfGetDB( DB_SLAVE );
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$q = $dbw->select(
|
|
|
|
'poll_info',
|
|
|
|
array( 'poll_txt', 'poll_date' ),
|
|
|
|
array( 'poll_id' => $ID ),
|
|
|
|
__METHOD__
|
|
|
|
);
|
|
|
|
$row = $dbw->fetchRow( $q );
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
if ( empty( $lines ) ) {
|
|
|
|
$lines = explode( "\n", trim( $row['poll_txt'] ) );
|
|
|
|
}
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$start_date = $row['poll_date'];
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$q = $dbw->select(
|
|
|
|
'poll_vote',
|
|
|
|
array( 'poll_answer', 'COUNT(*)' ),
|
|
|
|
array( 'poll_id' => $ID ),
|
|
|
|
__METHOD__,
|
|
|
|
array( 'GROUP BY' => 'poll_answer' )
|
|
|
|
);
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$poll_result = array();
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
while ( $row = $q->fetchRow() ) {
|
|
|
|
$poll_result[$row[0]] = $row[1];
|
|
|
|
}
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$amountOfVotes = array_sum( $poll_result );
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
// Did we vote?
|
|
|
|
$q = $dbw->select(
|
|
|
|
'poll_vote',
|
|
|
|
array( 'poll_answer', 'poll_date' ),
|
|
|
|
array(
|
|
|
|
'poll_id' => $ID,
|
|
|
|
'poll_user' => $user
|
|
|
|
),
|
|
|
|
__METHOD__
|
2011-10-09 18:35:17 +00:00
|
|
|
);
|
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
if ( $row = $dbw->fetchRow( $q ) ) {
|
|
|
|
$ourLastVoteDate = wfMsg(
|
|
|
|
'ajaxpoll-your-vote',
|
|
|
|
$lines[$row[0] - 1],
|
|
|
|
$wgLang->timeanddate( wfTimestamp( TS_MW, $row[1] ), true /* adjust? */ )
|
|
|
|
);
|
2011-10-09 18:35:17 +00:00
|
|
|
}
|
2012-02-19 17:24:15 +00:00
|
|
|
|
|
|
|
if ( is_object( $wgTitle ) ) {
|
|
|
|
if( !empty( $extra_from_ajax ) ) {
|
|
|
|
$attributes = ' style="display: block;"';
|
|
|
|
$ajaxMessage = wfMsg( $extra_from_ajax );
|
|
|
|
} else {
|
|
|
|
$attributes = '';
|
|
|
|
$ajaxMessage = '';
|
|
|
|
}
|
|
|
|
// HTML output has to be on one line thanks to a MediaWiki bug
|
|
|
|
// @see https://bugzilla.wikimedia.org/show_bug.cgi?id=1319
|
|
|
|
$ret = '<div id="ajaxpoll-id-' . $ID . '" class="ajaxpoll">
|
2012-02-18 08:46:28 +00:00
|
|
|
<div id="ajaxpoll-ajax-' . $ID . '" class="ajaxpoll-ajax"' . $attributes . '>' . $ajaxMessage . '</div>
|
|
|
|
<script>var tmp;
|
2012-02-16 22:55:06 +00:00
|
|
|
function mover(x){
|
|
|
|
var sp=$(x).find("span");
|
|
|
|
tmp=sp.html();
|
|
|
|
sp.text(sp.attr("title"));
|
|
|
|
sp.attr("title","");
|
|
|
|
}
|
|
|
|
function mout(x){
|
|
|
|
var sp=$(x).find("span");
|
|
|
|
sp.attr("title",sp.text());
|
|
|
|
sp.text(tmp);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<div class="ajaxpoll-question">' . strip_tags( $lines[0] ) . '</div>';
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
// Different message depending on if the user has already voted or not.
|
|
|
|
$message = ( isset( $row[0] ) ) ? $ourLastVoteDate : wfMsg( 'ajaxpoll-no-vote' );
|
|
|
|
$ret .= '<div class="ajaxpoll-misc">' . $message . '
|
2012-02-18 08:46:28 +00:00
|
|
|
</div>';
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$ret .= '<form method="post" action="' . $wgTitle->getLocalURL() .
|
|
|
|
'" id="ajaxpoll-answer-id-' . $ID . '"><input type="hidden" name="ajaxpoll-post-id" value="' . $ID . '" />';
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
for ( $i = 1; $i < count( $lines ); $i++ ) {
|
|
|
|
$ans_no = $i - 1;
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
if ( $amountOfVotes == 0 ) {
|
|
|
|
$percent = 0;
|
|
|
|
} else {
|
|
|
|
$percent = $wgLang->formatNum( round( ( isset( $poll_result[$i + 1] ) ? $poll_result[$i + 1] : 0 ) * 100 / $amountOfVotes, 2 ) );
|
|
|
|
}
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$our = ( isset( $row[0] ) && ( $row[0] - 1 == $i ) );
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
// If AJAX is enabled, as it is by default in modern MWs, we can
|
|
|
|
// just use sajax library function here for that AJAX-y feel.
|
|
|
|
// If not, we'll have to submit the form old-school way...
|
|
|
|
if ( $wgUseAjax ) {
|
|
|
|
$submitJS = "sajax_do_call(\"AJAXPoll::submitVote\",[\"" . $ID . "\",\"" . $i . "\"], $(\"#ajaxpoll-container-" . $ID . "\")[0]);";
|
|
|
|
} else {
|
|
|
|
$submitJS = "$(\"#ajaxpoll-answer-id-" . $ID . "\").submit();";
|
|
|
|
}
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
// HTML output has to be on one line thanks to a MediaWiki bug
|
|
|
|
// @see https://bugzilla.wikimedia.org/show_bug.cgi?id=1319
|
|
|
|
$ret .= "
|
2012-02-16 22:55:06 +00:00
|
|
|
<div id='ajaxpoll-answer-" . $ans_no . "' class='ajaxpoll-answer'><div class='ajaxpoll-answer-name'><label for='ajaxpoll-answer-radio-" . $ans_no . "' onclick='$(\"#ajaxpoll-ajax-" . $ID . "\").html(\"" . wfMsg( 'ajaxpoll-submitting' ) . "\");$(\"#ajaxpoll-ajax-" . $ID . "\").css(\"display\",\"block\");$(this).addClass(\"ajaxpoll-checkevent\").prop(\"checked\",true); " . $submitJS . "'><input type='radio' id='ajaxpoll-post-answer-" . $ans_no . "' name='ajaxpoll-post-answer' value='" . $i . "'" . ( $our ? 'checked=true ' : '' ) . "/>" . strip_tags( $lines[$i] ) .
|
|
|
|
"</label></div><div class='ajaxpoll-answer-vote" . ( $our ? ' ajaxpoll-our-vote' : '' ) ."' onmouseover='mover(this)' onmouseout='mout(this);'><span title='" . wfMsg( 'ajaxpoll-percent-votes', sprintf( $percent ) ) . "'>" . ( ( isset( $poll_result ) && !empty( $poll_result[$i + 1] ) ) ? $poll_result[$i + 1] : 0 ) . "</span><div style='width: " . $percent . "%;" . ( $percent == 0 ? ' border:0;' : '' ) . "'></div></div>
|
2012-02-16 07:59:32 +00:00
|
|
|
</div>
|
|
|
|
";
|
2011-10-09 18:35:17 +00:00
|
|
|
}
|
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$ret .= '</form>';
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
// Display information about the poll (creation date, amount of votes)
|
|
|
|
$pollSummary = wfMsgExt(
|
|
|
|
'ajaxpoll-info',
|
|
|
|
'parsemag', // parse PLURAL
|
|
|
|
$amountOfVotes, // amount of votes
|
|
|
|
$wgLang->timeanddate( wfTimestamp( TS_MW, $start_date ), true /* adjust? */ )
|
|
|
|
);
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$ret .= '<div id="ajaxpoll-info-' . $ID . '" class="ajaxpoll-info">' . $pollSummary . '</div>';
|
2011-10-09 18:35:17 +00:00
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
$ret .= '</div>';
|
|
|
|
} else {
|
|
|
|
$ret = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
return $ret;
|
2011-10-09 18:35:17 +00:00
|
|
|
}
|
|
|
|
|
2012-02-19 17:24:15 +00:00
|
|
|
} /* class AJAXPoll */
|