diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/show_album.inc.php | 41 | ||||
-rw-r--r-- | templates/show_object_rating.inc.php | 23 |
2 files changed, 28 insertions, 36 deletions
diff --git a/templates/show_album.inc.php b/templates/show_album.inc.php index 4282b20c..4f90aabc 100644 --- a/templates/show_album.inc.php +++ b/templates/show_album.inc.php @@ -26,7 +26,7 @@ $ajax_url = Config::get('ajax_url'); $title = scrub_out($album->name) . ' (' . $album->year . ') -- ' . $album->f_artist; ?> <?php show_box_top($title); ?> - <div style="float:left;display:table-cell;width:140px;"> +<div style="float:left;display:table-cell;width:140px;"> <?php if ($album_name != _('Unknown (Orphaned)')) { $aa_url = $web_path . "/image.php?id=" . $album->id . "&type=popup&sid=" . session_id(); @@ -37,29 +37,26 @@ $title = scrub_out($album->name) . ' (' . $album->year . ') -- ' . $album->f_ar ?> </div> <div style="display:table-cell;vertical-align:top;"> - <?php - if (Config::get('ratings')) { - echo "<div style=\"float:left; display:inline;\" id=\"rating_" . $album->id . "_album\">"; - show_rating($album->id, 'album');} // end if ratings - echo "</div>"; - echo "<br />\n"; - ?> - <strong><?php echo _('Actions'); ?>:</strong><br /> - <div style="padding-left:5px;"> - <a href="#" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=basket&type=album&id=<?php echo $album->id; ?>');"><?php echo _('Play Album'); ?></a><br /> - <a href="#" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=basket&type=album_random&id=<?php echo $album->id; ?>');"><?php echo _('Play Random from Album'); ?></a><br /> - <?php if ( ($GLOBALS['user']->has_access('75')) || (!Config::get('use_auth'))) { ?> - <a href="<?php echo $web_path; ?>/albums.php?action=clear_art&album_id=<?php echo $album->id; ?>"><?php echo _('Reset Album Art'); ?></a><br /> - <?php } ?> - <a href="<?php echo $web_path; ?>/albums.php?action=find_art&album_id=<?php echo $album->id; ?>"><?php echo _('Find Album Art'); ?></a><br /> - <?php if (($GLOBALS['user']->has_access('75')) || (!Config::get('use_auth'))) { ?> - <a href="<?php echo $web_path; ?>/albums.php?action=update_from_tags&album_id=<?php echo $album->id; ?>"><?php echo _('Update from tags'); ?></a><br /> - <?php } ?> - <?php if (Access::check_function('batch_download')) { ?> - <a href="<?php echo $web_path; ?>/batch.php?action=alb&id=<?php echo $album->id; ?>"><?php echo _('Download'); ?></a><br /> - <?php } ?> + <div style="float:left; display:inline;" id="rating_<?php echo $album->id; ?>_album"> + <?php Rating::show($album->id,'album'); ?> </div> </div> + <strong><?php echo _('Actions'); ?>:</strong><br /> + <div style="padding-left:5px;"> + <span class="text-action"><?php echo Ajax::text('?action=basket&type=album&id=' . $album->id,_('Play Album'),'play_full_' . $album->id); ?></span> + <span class="text-action"><?php echo Ajax::text('?action=basket&type=album_random&id=' . $album->id,_('Play Random from Album'),'play_random_' . $album->id); ?></span> + <?php if ($GLOBALS['user']->has_access('75')) { ?> + <a href="<?php echo $web_path; ?>/albums.php?action=clear_art&album_id=<?php echo $album->id; ?>"><?php echo _('Reset Album Art'); ?></a><br /> + <?php } ?> + <a href="<?php echo $web_path; ?>/albums.php?action=find_art&album_id=<?php echo $album->id; ?>"><?php echo _('Find Album Art'); ?></a><br /> + <?php if (($GLOBALS['user']->has_access('75')) || (!Config::get('use_auth'))) { ?> + <a href="<?php echo $web_path; ?>/albums.php?action=update_from_tags&album_id=<?php echo $album->id; ?>"><?php echo _('Update from tags'); ?></a><br /> + <?php } ?> + <?php if (Access::check_function('batch_download')) { ?> + <a href="<?php echo $web_path; ?>/batch.php?action=alb&id=<?php echo $album->id; ?>"><?php echo _('Download'); ?></a><br /> + <?php } ?> + </div> +</div> <?php show_box_bottom(); ?> <?php show_box_top($album->name . ' ' . _('Songs')); diff --git a/templates/show_object_rating.inc.php b/templates/show_object_rating.inc.php index 9de4c0b8..6e5bf185 100644 --- a/templates/show_object_rating.inc.php +++ b/templates/show_object_rating.inc.php @@ -20,22 +20,17 @@ /* Create some variables we are going to need */ $web_path = Config::get('web_path'); -$base_url = Config::get('ajax_url') . '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id . Config::get('ajax_info'); +$base_url = '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id; //set the background to no stars echo "<ul class=\"star-rating\">\n"; -/* Handle the "Not rated" possibility */ -if ($rating->rating == '-1') { - echo "<li class=\"zero-stars\"><span onclick=\"ajaxPut('" . $base_url . "&rating=-1');return true;\" title=\"don't play\" class=\"zero-stars\"></span></li>\n"; -} -else { - echo "<li class=\"zero-stars\"><span onclick=\"ajaxPut('" . $base_url . "&rating=-1');return true;\" title=\"remove rating\" class=\"zero-stars\"></span></li>\n"; -} +// Add in the 0 / Remove rating level +echo "<li class=\"zero-stars\">" . Ajax::text($base_url . '&rating=-1','','rating0_' . $rating->id,'','zero-stars') . "</li>"; + // decide width of rating. image is 16 px wide $width = $rating->rating*16; -if ($width < 0) $width = 0; //set the current rating background echo "<li class=\"current-rating\" style=\"width:${width}px\" >Current rating: "; @@ -47,19 +42,19 @@ else echo "$rating->rating of 5</li>\n"; //it did not like my "1-star", "2-star" ... css styles, and I changed it to this after I realized star1... would have worked :\ ?> <li> - <span onclick="ajaxPut('<?php echo $base_url; ?>&rating=1');return true;" class="one-stars" title="1 <?php echo _('out of'); ?> 5"></span> + <?php echo Ajax::text($base_url . '&rating=1','','rating1_' . $rating->id,'','one-stars'); ?> </li> <li> - <span onclick="ajaxPut('<?php echo $base_url; ?>&rating=2');return true;" class="two-stars" title="2 <?php echo _('out of'); ?> 5"></span> + <?php echo Ajax::text($base_url . '&rating=2','','rating2_' . $rating->id,'','two-stars'); ?> </li> <li> - <span onclick="ajaxPut('<?php echo $base_url; ?>&rating=3');return true;" class="three-stars" title="3 <?php echo _('out of'); ?> 5"></span> + <?php echo Ajax::text($base_url . '&rating=3','','rating3_' . $rating->id,'','three-stars'); ?> </li> <li> - <span onclick="ajaxPut('<?php echo $base_url; ?>&rating=4');return true;" class="four-stars" title="4 <?php echo _('out of'); ?> 5"></span> + <?php echo Ajax::text($base_url . '&rating=4','','rating4_' . $rating->id,'','four-stars'); ?> </li> <li> - <span onclick="ajaxPut('<?php echo $base_url; ?>&rating=5');return true;" class="five-stars" title="5 <?php echo _('out of'); ?> 5"></span> + <?php echo Ajax::text($base_url . '&rating=5','','rating5_' . $rating->id,'','five-stars'); ?> </li> </ul> |