function NetPlayer_RefreshCategoryProfile() { $categoryList = NetPlayer_GetCategoryList(); $categoryCurr = GetValue(NP_ID_CDCATEGORYNAME); $categoryCurrIdx = 0; /*Root*/ $profileData = IPS_GetVariableProfile('NetPlayer_Category'); $associations = $profileData['Associations']; foreach ($categoryList as $idx=>$category) { $profileIdx = $idx + 2; if ($categoryCurr==$category) $categoryCurrIdx = $profileIdx; $category = substr($category, 1); if ((array_key_exists($profileIdx, $associations) and $associations[$profileIdx]<>$category) or !array_key_exists($profileIdx, $associations)) { IPS_SetVariableProfileAssociation('NetPlayer_Category', $profileIdx, $category, '', -1); } } foreach ($associations as $idx=>$name) { $categoryIdx = $idx - 2; if ($categoryIdx >= 0 and !array_key_exists($categoryIdx, $categoryList)) { IPS_SetVariableProfileAssociation('NetPlayer_Category', $idx, '', '', -1); } } if (GetValue(NP_ID_CATEGORYLIST) <> $categoryCurrIdx) { SetValue(NP_ID_CATEGORYLIST, $categoryCurrIdx); } }
NetPlayer_GetCDList(NP_COUNT_CDHTML, $directoryList, $interpretList, $albumList); foreach ($directoryList as $idx => $directory) { echo '<div id="rc_cd' . $idx . '" class="containerControlButton containerControlSelect" '; echo ' cd_name="' . convert($directory) . '">'; echo ' <div class="containerControlSelectInterpret">' . convert($interpretList[$idx]) . '</div>'; echo ' <div class="containerControlSelectAlbum">' . convert($albumList[$idx]) . '</div>'; echo '</div>'; } ?> </div> <div id="containerControlLine2" class="containerControlLineSeparator"></div> <div id="containerControlLine8" class="containerControlLineTop"> <div id="rc_mp_cdselectprev" class="containerControlButton"><<</div> <div id="rc_mp_cdselectnext" class="containerControlButton">>></div> <div id="rc_mp_cdselectback" class="containerControlButton">back</div> <?php if (GetValue(NP_ID_CDCATEGORYNAME) != "") { echo '<div id="rc_mp_cdselectroot" class="containerControlButton">Root</div>'; } $categoryList = NetPlayer_GetCategoryList(); foreach ($categoryList as $idx => $category) { echo '<div id="rc_cat' . $idx . '" class="containerControlButton" cd_cat="' . convert($category) . '">' . str_replace('_', '', $category) . '</div>'; } ?> </div> </div> </body> </html>