2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

98_weekprofile: attribute widgetEditDaysInRow to control visible days in one row

git-svn-id: https://svn.fhem.de/fhem/trunk@10893 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
risiko79 2016-02-20 16:37:34 +00:00
parent 470a296b55
commit 82fb97daad
2 changed files with 18 additions and 4 deletions

View File

@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: 98_weekprofile: attribute widgetEditDaysInRow to control
visible days in one row
- feature 49_SSCAM: function "get ... eventlist" added,
Reading "CamEventNum" added which containes total
number of camera events,

View File

@ -386,7 +386,7 @@ sub weekprofile_Initialize($)
$hash->{StateFn} = "weekprofile_State";
$hash->{NotifyFn} = "weekprofile_Notify";
$hash->{AttrFn} = "weekprofile_Attr";
$hash->{AttrList} = "useTopics:0,1 widgetWeekdays widgetEditOnNewPage:0,1 configFile ".$readingFnAttributes;
$hash->{AttrList} = "useTopics:0,1 widgetWeekdays widgetEditOnNewPage:0,1 widgetEditDaysInRow:1,2,3,4,5,6,7 configFile ".$readingFnAttributes;
$hash->{FW_summaryFn} = "weekprofile_SummaryFn";
@ -1013,6 +1013,7 @@ sub weekprofile_SummaryFn()
my $iconName = AttrVal($d, "icon", "edit_settings");
my $editNewpage = AttrVal($d, "widgetEditOnNewPage", 0);
my $useTopics = AttrVal($d, "useTopics", 0);
my $editDaysInRow = AttrVal($d, "widgetEditDaysInRow", undef);
my $editIcon = FW_iconName($iconName) ? FW_makeImage($iconName,$iconName,"icon") : "";
$editIcon = "<a name=\"$d.edit\" onclick=\"weekprofile_DoEditWeek('$d','$editNewpage')\" href=\"javascript:void(0)\">$editIcon</a>";
@ -1025,6 +1026,7 @@ sub weekprofile_SummaryFn()
my $args = "weekprofile,MODE:SHOW";
$args .= ",USETOPICS:$useTopics";
$args .= ",MASTERDEV:$masterDev" if (defined($masterDev));
$args .= ",DAYINROW:$editDaysInRow" if (defined($editDaysInRow));
my $curr = "";
if (@{$hash->{PROFILES}} > 0)
@ -1057,10 +1059,14 @@ sub weekprofile_SummaryFn()
##############################################
sub weekprofile_editOnNewpage(@)
{
my ($device, $prf) = @_;
my ($device, $prf, $daysInRow) = @_;
my $hash = $defs{$device};
my $args = "weekprofile,MODE:EDIT,JMPBACK:1";
my $editDaysInRow = AttrVal($device, "widgetEditDaysInRow", undef);
$editDaysInRow = $daysInRow if (defined($daysInRow));
my $args = "weekprofile,MODE:EDIT,JMPBACK:1";
$args .= ",DAYINROW:$editDaysInRow" if (defined($editDaysInRow));
my $html;
$html .= "<html>";
@ -1248,7 +1254,10 @@ sub weekprofile_getEditLNK_MasterDev($$)
<li>widgetEditOnNewPage<br>
Editing the profile on a new html page if it is set to '1'
</li>
<li>configFile<br>
<li>widgetEditDaysInRow<br>
Count of visible days in on row during Edit. Default 2.<br>
</li>
<li>configFile<br>
Path and filename of the configuration file where the profiles will be stored
Default: ./log/weekprofile-<name>.cfg
</li>
@ -1385,6 +1394,9 @@ sub weekprofile_getEditLNK_MasterDev($$)
Beginnend bei Montag. z.B.
<code>attr name widgetWeekdays Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag</code>
</li>
<li>widgetEditDaysInRow<br>
Anzahl in der in einer Reihe dargestellten Tage während der Bearbeitung. Default 2.<br>
</li>
<li>widgetEditOnNewPage<br>
Wenn gesetzt ('1'), dann wird die Bearbeitung auf einer separaten\neuen Webseite gestartet.
</li>