aboutsummaryrefslogtreecommitdiff
path: root/www/ajaxVote.php
blob: f2572fbd7e79e2cb351b111fff284128c743e0fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
 * We re-use vote.php but set the ajax flag
 */
$httpContentType = 'text/xml';
$GLOBALS['ajaxRequest'] = true;
require 'vote.php';

$bs = SemanticScuttle_Service_Factory::get('Bookmark');
$ts = SemanticScuttle_Service_Factory::get('Template');
$bmrow = $bs->getBookmark($bookmark);

switch ($GLOBALS['votingMode']) {
case 2:
    $template = 'bookmarks-vote-horizontal.inc.tpl.php';
    break;
default:
    $template = 'bookmarks-vote.inc.tpl.php';
}

echo '<voteresult><bookmark>' . $bookmark . '</bookmark>'
    . '<html xmlns="http://www.w3.org/1999/xhtml">';
$ts->loadTemplate(
    $template, array('row' => $bmrow)
);

echo '</html></voteresult>';
?>