Файл: onlinepoisk.wm-scripts.ru/controller/u.php
Строк: 38
<?php if ( $app['user']::get('id') ): ?>
<div class="opdiv">
<div>
<?php if ( $pls ): ?>
<h3>Плейлисты пользователя</h3>
<div id="plcntbl">
<?php foreach ( $pls as $pl ): ?>
<div class="pl" data-id="<?php echo $pl->id ?>" data-name="<?php echo $pl->name ?>">
<div class="pl-head">
<?php
$className = ( 0 == $pl->status ) ? "x-icon-expand" : "x-icon-collapse";
?>
<a class="x-icons x-plname <?php echo $className ?>" href="javascript:">
<strong><?php echo $pl->name ?></strong>
</a>
</div>
<div class="pl-body" <?php if ( 0 == $pl->status ): ?> style="display:none"<?php endif ?>>
<?php if ( $pltrs && isset($pltrs[$pl->id]) ): ?>
<?php foreach ( $pltrs[$pl->id] as $ptrack ): ?>
<?php
$track = array(
'vkid' => $ptrack->vkid,
'lyrics_id' => $ptrack->lyricsid,
'artist' => $ptrack->artist,
'title' => $ptrack->name,
'duration' => $ptrack->duration,
'pl' => true
);
?>
<?php include 'track.phtml' ?>
<?php endforeach ?>
<?php endif ?>
</div>
</div>
<?php endforeach ?>
</div>
<?php endif ?>
</div>
<script type="text/javascript">
$('.x-plname').click(function() {
var id = $(this).parents('.pl').data('id');
var plbody = $(this).parents('.pl').find('.pl-body');
var status = ('none' == $(plbody).css('display'));
if ( status ) {
$(plbody).show();
} else {
$(plbody).hide();
}
$.ajax({
url: "/user/expandpl",
type: "post",
data: {
id: id,
status: status*1
},
success: function() {}
});
$(this).toggleClass('x-icon-expand');
$(this).toggleClass('x-icon-collapse');
});
</script>
</div>
<?php endif ?>