|
1 | 1 | ################################################################# |
2 | | -# $Id: 66_EPG.pm 15699 2019-12-18 00:01:50Z HomeAuto_User $ |
| 2 | +# $Id: 66_EPG.pm 15699 2019-12-19 00:01:50Z HomeAuto_User $ |
3 | 3 | # |
4 | 4 | # Github - FHEM Home Automation System |
5 | 5 | # https://github.com/fhem/EPG |
|
14 | 14 | # *.xz -> ohne Dateiendung nach unpack |
15 | 15 | ################################################################# |
16 | 16 | # Note´s |
17 | | -# - check define Sort in FAV and restart FHEM |
| 17 | +# - |
18 | 18 | # |
19 | 19 | # Features: |
20 | 20 | # - definierbare CommandFunktion bei Onklick |
@@ -272,7 +272,7 @@ sub EPG_Define($$) { |
272 | 272 | CommandAttr($hash,"$name room $typ") if (!defined AttrVal($name, "room", undef)); # set room, if only undef --> new def |
273 | 273 | } |
274 | 274 |
|
275 | | - $hash->{VERSION} = "20191218"; |
| 275 | + $hash->{VERSION} = "20191219"; |
276 | 276 |
|
277 | 277 | ### default value´s ### |
278 | 278 | readingsBeginUpdate($hash); |
@@ -760,17 +760,28 @@ sub EPG_FW_Popup_Channels { |
760 | 760 | my $name = shift; |
761 | 761 | my $html_site_ch = ""; |
762 | 762 | my $Ch_select = AttrVal($name, "Ch_select", undef); |
763 | | - my $Ch_sort = ""; |
| 763 | + my $Ch_sort = AttrVal($name, "Ch_sort", undef); |
| 764 | + my @Ch_sort = split(",",$Ch_sort) if (AttrVal($name, "Ch_sort", undef)); |
| 765 | + $Ch_sort = ""; |
764 | 766 | my $checked = ""; |
| 767 | + my $checked_cnt = -1; |
765 | 768 |
|
766 | 769 | Log3 $name, 4, "$name: FW_Channels is running"; |
767 | 770 |
|
768 | 771 | $html_site_ch.= "<div id=\"table_ch\"><table class=\"block wide\">"; |
769 | 772 | $html_site_ch.= "<tr class=\"even\" style=\"text-decoration-line: underline;\"><th>".$EPG_tt->{"no"}."</th><th>".$EPG_tt->{"active"}."</th><th>".$EPG_tt->{"tv_name"}."</th><th>".$EPG_tt->{"tv_fav"}."</th></tr>"; |
770 | 773 |
|
771 | 774 | for (my $i=0; $i<scalar(@channel_available); $i++) { |
772 | | - $checked = "checked" if ($Ch_select && index($Ch_select,$channel_available[$i]) >= 0); |
773 | | - $Ch_sort = $HTML->{$channel_available[$i]}{ch_wish} if($HTML->{$channel_available[$i]}{ch_wish} && $HTML->{$channel_available[$i]}{ch_wish} < 999); |
| 775 | + if ($Ch_select && index($Ch_select,$channel_available[$i]) >= 0) { |
| 776 | + $checked_cnt++; |
| 777 | + $checked = "checked"; |
| 778 | + if($HTML->{$channel_available[$i]}{ch_wish} && $HTML->{$channel_available[$i]}{ch_wish} < 999) { |
| 779 | + $Ch_sort = $HTML->{$channel_available[$i]}{ch_wish}; |
| 780 | + } else { |
| 781 | + $Ch_sort = $Ch_sort[$checked_cnt] if ($Ch_sort[$checked_cnt] && $Ch_sort[$checked_cnt] ne 0); |
| 782 | + } |
| 783 | + } |
| 784 | + |
774 | 785 | $html_site_ch.= sprintf("<tr class=\"%s\">", ($i & 1)?"even":"odd"); |
775 | 786 | $html_site_ch.= "<td align=\"center\">".($i + 1)."</td><td align=\"center\"><input type=\"checkbox\" id=\"".$i."\" name=\"".$channel_available[$i]."\" onclick=\"Checkbox(".$i.")\" $checked></td><td>". $channel_available[$i] ."</td><td> <input type=\"text\" pattern=\"[0-9]+\" id=\"".$i."\" value=\"$Ch_sort\" maxlength=\"3\" size=\"3\"> </td></tr>"; |
776 | 787 | $checked = ""; |
|
0 commit comments