forked from Cavemanon/cavepaintings
Only show image rater if user can rate
This commit is contained in:
@ -6,7 +6,7 @@ class RatingsTheme extends Themelet {
|
||||
* @param string $rating
|
||||
* @return string
|
||||
*/
|
||||
public function get_rater_html(/*int*/ $image_id, /*string*/ $rating) {
|
||||
public function get_rater_html(/*int*/ $image_id, /*string*/ $rating, /*bool*/ $can_rate) {
|
||||
$s_checked = $rating == 's' ? " checked" : "";
|
||||
$q_checked = $rating == 'q' ? " checked" : "";
|
||||
$e_checked = $rating == 'e' ? " checked" : "";
|
||||
@ -15,12 +15,16 @@ class RatingsTheme extends Themelet {
|
||||
<tr>
|
||||
<th>Rating</th>
|
||||
<td>
|
||||
".($can_rate ? "
|
||||
<span class='view'>$human_rating</span>
|
||||
<span class='edit'>
|
||||
<input type='radio' name='rating' value='s' id='s'$s_checked><label for='s'>Safe</label>
|
||||
<input type='radio' name='rating' value='q' id='q'$q_checked><label for='q'>Questionable</label>
|
||||
<input type='radio' name='rating' value='e' id='e'$e_checked><label for='e'>Explicit</label>
|
||||
</span>
|
||||
" : "
|
||||
$human_rating
|
||||
")."
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
|
Reference in New Issue
Block a user