FHEM > Codeschnipsel

Delete Icon um definierte Objekte zu löschen

<< < (3/3)

ChrisW:
Cool hoffe das wird mal fest eingebaut ;)

Volker:
Hier mal einige Verbesserungen.


--- Code: ---
        } elsif($type eq "FileLog") {
 $icon = FW_makeImage('del') . "&nbsp;";
 FW_pO "<td><a href='/fhem?cmd=delete%20$devName'><div class='Del'>$icon</div></a></td>";
          $row = FW_dumpFileLog($d, 1, $row);

        }
      }
#      FW_pO "</td>";
if ($type ne "FileLog") {
$icon = FW_makeImage('del') . "&nbsp;";
FW_pO "<td><a href='/fhem?cmd=delete%20$devName'><div class='Del'>$icon</div></a></td>";
}
    }
    FW_pO "</table>";
    FW_pO "</td></tr>";
  }
  FW_pO "</table><br>";

  # Now the weblinks
***** Funktion für Logzeilen auch ändern
sub
FW_dumpFileLog($$$)
{
  my ($d, $oneRow,$row) = @_;

  foreach my $f (FW_fileList($defs{$d}{logfile})) {
    my $nr;

    if($oneRow) {
      pF "<tr class=\"%s\">", ($row&1)?"odd":"even";
      pF "<td><div class=\"dname\">$f</div></td>";
    }
    foreach my $ln (split(",", AttrVal($d, "logtype", "text"))) {
      my ($lt, $name) = split(":", $ln);
      $name = $lt if(!$name);
      if(!$oneRow) {
        pF "<tr class=\"%s\">", ($row&1)?"odd":"even";
        pF "<td><div class=\"dname\">%s</div></td>", ($nr ? "" : $f);
      }
      FW_pH "cmd=logwrapper $d $lt $f",
              "<div class=\"dval\">$name</div>", 1, "dval";
pF "<td><div class=\"dname\"></div></td>", ($nr ? "" : $f);
      if(!$oneRow) {
        FW_pO "</tr>";
        $row++;
      }
      $nr++;
    }
    if($oneRow) {
      FW_pO "</tr>";
      $row++;
    }
  }
  return $row;
}

*************************

--- Ende Code ---


Zum ausrichten der Buttons am rechten Rand des table folgende Zeile in eurer *.CSS Datei einfügen

--- Code: ---
/*Delete Button*/
.Del  img {float: right;}

--- Ende Code ---

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln