Source for file vote.php
Documentation is available at vote.php
* @subpackage Content.vote
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @subpackage Content.vote
* Load the language file on instantiation.
* Displays the voting area if in an article
* @param string $context The context of the content being passed to the plugin
* @param object &$row The article object
* @param object &$params The article params
* @param integer $page The 'page' number
* @return mixed html string containing code for the votes if in com_content else boolean false
if ($parts[0] !=
'com_content')
if (!empty($params) &&
$params->get('show_vote', null))
$rating = (int)
@$row->rating;
// Look for images in template if available
$starImageOn =
JHtml::_('image', 'system/rating_star.png', JText::_('PLG_VOTE_STAR_ACTIVE'), null, true);
$starImageOff =
JHtml::_('image', 'system/rating_star_blank.png', JText::_('PLG_VOTE_STAR_INACTIVE'), null, true);
for ($i =
0; $i <
$rating; $i++
)
for ($i =
$rating; $i <
5; $i++
)
$html .=
'<div class="content_rating">';
$html .=
'<p class="unseen element-invisible">' .
JText::sprintf('PLG_VOTE_USER_RATING', $rating, '5') .
'</p>';
if ($view ==
'article' &&
$row->state ==
1)
$uri->setQuery($uri->getQuery() .
'&hitcount=0');
// Create option list for voting select box
for ($i =
1; $i <
6; $i++
)
$html .=
'<form method="post" action="' .
htmlspecialchars($uri->toString()) .
'" class="form-inline">';
$html .=
'<span class="content_vote">';
$html .=
'<label class="unseen element-invisible" for="content_vote_' .
$row->id .
'">' .
JText::_('PLG_VOTE_LABEL') .
'</label>';
$html .=
JHtml::_('select.genericlist', $options, 'user_rating', null, 'value', 'text', '5', 'content_vote_' .
$row->id);
$html .=
' <input class="btn btn-mini" type="submit" name="submit_vote" value="' .
JText::_('PLG_VOTE_RATE') .
'" />';
$html .=
'<input type="hidden" name="task" value="article.vote" />';
$html .=
'<input type="hidden" name="hitcount" value="0" />';
$html .=
'<input type="hidden" name="url" value="' .
htmlspecialchars($uri->toString()) .
'" />';
$html .=
JHtml::_('form.token');
Documentation generated on Tue, 19 Nov 2013 15:18:18 +0100 by phpDocumentor 1.4.3