本文整理匯總了PHP中Button::image方法的典型用法代碼示例。如果您正苦於以下問題:PHP Button::image方法的具體用法?PHP Button::image怎麽用?PHP Button::image使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Button
的用法示例。
在下文中一共展示了Button::image方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: icon
public static function icon($data, Fhem $F, Button $B)
{
switch ($F->A("FhemHMModel")) {
case "HM-Sec-RHS":
if ($data->attributes()->state == "open") {
$B->image("warning");
}
if ($data->attributes()->state == "closed") {
$B->image("bestaetigung");
}
if ($data->attributes()->state == "tilted") {
$B->image("notice");
}
break;
}
}
示例2: process
public function process(Fhem $F, $xml)
{
$state = $xml->attributes()->state;
$stateText = "";
$event = "\$j('#FhemControlID_" . $F->getID() . "').removeClass('highlight');";
$FS = new Button("", "./images/i2/empty.png", "icon");
$FS->style("float:left;margin-right:5px;width:32px;height:32px;");
if ($state != "off" && $state != "aus") {
$FS->image("./fheME/SieHabenPost/SieHabenPost.png");
$stateText = "Sie haben Post!";
$event = "\$j('#FhemControlID_" . $F->getID() . "').addClass('highlight');";
}
return "{$FS}<b>" . ($F->A("FhemAlias") == "" ? $F->A("FhemName") : $F->A("FhemAlias")) . "</b><br /><small style=\"color:grey;\">{$stateText}</small><div style=\"clear:both;\"></div>" . OnEvent::script($event);
}
示例3: updateGUI
public function updateGUI($ID = null)
{
$result = array();
$S = new mFhemServerGUI();
$S->addAssocV3("FhemServerType", "=", "0");
while ($s = $S->getNextEntry()) {
try {
$x = simplexml_load_string($s->getListXML());
} catch (NoServerConnectionException $e) {
continue;
}
if (isset($x->dummy_LIST->dummy) and count($x->dummy_LIST->dummy) > 0) {
foreach ($x->dummy_LIST->dummy as $k => $v) {
$F = new mFhemGUI();
$F->addAssocV3("FhemServerID", "=", $s->getID());
$F->addAssocV3("FhemName", "=", $v->attributes()->name);
$F = $F->getNextEntry();
if ($F == null) {
continue;
}
if ($ID and $F->getID() != $ID) {
continue;
}
$state = $v->attributes()->state;
#if($F->A("FhemModel") == "fs20irf") $state = "off";
#$state = strtolower(str_replace("dim", "", $state));
$FS = new Button("", "./fheME/Fhem/off.png", "icon");
$FS->style("float:left;margin-right:5px;");
if ($state != "off" && $state != "aus") {
$FS->image("./fheME/Fhem/on.png");
}
if (!is_numeric(str_replace("%", "", $state))) {
$state = "";
}
$return = "{$FS}<b>" . ($F->A("FhemAlias") == "" ? $F->A("FhemName") : $F->A("FhemAlias")) . "</b> <small style=\"color:grey;\">{$state}</small><div style=\"clear:both;\"></div>";
if ($F->A("FhemExtension") != "none" and $F->A("FhemExtension") != "") {
$c = $F->A("FhemExtension");
$c = new $c(-1);
$return = $c->process($F, $v);
}
$result[$F->getID()] = array("model" => $F->A("FhemModel"), "state" => $return);
}
}
if (isset($x->FS20_LIST->FS20) and count($x->FS20_LIST->FS20) > 0) {
foreach ($x->FS20_LIST->FS20 as $k => $v) {
$F = new mFhemGUI();
$F->addAssocV3("FhemServerID", "=", $s->getID());
$F->addAssocV3("FhemName", "=", $v->attributes()->name);
$F = $F->getNextEntry();
if ($F == null) {
continue;
}
if ($ID and $F->getID() != $ID) {
continue;
}
$state = $v->attributes()->state;
if ($F->A("FhemModel") == "fs20irf") {
$state = "off";
}
$state = strtolower(str_replace("dim", "", $state));
$FS = new Button("", "./fheME/Fhem/off.png", "icon");
$FS->style("float:left;margin-right:5px;");
if ($state != "off" && $state != "aus") {
$FS->image("./fheME/Fhem/on.png");
}
if (!is_numeric(str_replace("%", "", $state))) {
$state = "";
}
$result[$F->getID()] = array("model" => $F->A("FhemModel"), "state" => "{$FS}<b>" . ($F->A("FhemAlias") == "" ? $F->A("FhemName") : $F->A("FhemAlias")) . "</b> <small style=\"color:grey;\">{$state}</small><div style=\"clear:both;\"></div>");
}
}
if (isset($x->IT_LIST->IT) and count($x->IT_LIST->IT) > 0) {
foreach ($x->IT_LIST->IT as $k => $v) {
$F = new mFhemGUI();
$F->addAssocV3("FhemServerID", "=", $s->getID());
$F->addAssocV3("FhemName", "=", $v->attributes()->name);
$F = $F->getNextEntry();
if ($F == null) {
continue;
}
if ($ID and $F->getID() != $ID) {
continue;
}
$state = $v->attributes()->state;
$state = strtolower(str_replace("dim", "", $state));
$IT = new Button("", "./fheME/Fhem/off.png", "icon");
$IT->style("float:right;margin-right:-10px;margin-top:-13px;margin-left:3px;");
if ($state != "off" && $state != "aus") {
$IT->image("./fheME/Fhem/on.png");
}
$result[$F->getID()] = array("model" => $F->A("FhemITModel"), "state" => "{$IT}<b>" . ($F->A("FhemAlias") == "" ? $F->A("FhemName") : $F->A("FhemAlias")) . "</b> ");
}
}
if (isset($x->CUL_HM_LIST->CUL_HM) and count($x->CUL_HM_LIST->CUL_HM) > 0) {
foreach ($x->CUL_HM_LIST->CUL_HM as $k => $v) {
$F = new mFhemGUI();
$F->addAssocV3("FhemServerID", "=", $s->getID());
$F->addAssocV3("FhemName", "=", $v->attributes()->name);
$F = $F->getNextEntry();
if ($F == null) {
//.........這裏部分代碼省略.........
示例4: showFeed
public function showFeed()
{
$list = new HTMLList();
$list->addListStyle("list-style-type:none;padding:5px;max-height:400px;overflow:auto;");
$E = $this->parseFeed();
$i = 0;
foreach ($E as $item) {
if ($this->A("RSSParserCount") > 0 and $this->A("RSSParserCount") <= $i) {
break;
}
$B = new Button("", "empty", "icon");
$B->style("float:left;margin-right:10px;margin-top:-5px;");
if ($item->icon != null) {
$B->image($item->icon);
} else {
$B = "";
}
$list->addItem($B . "<div id=\"RSSParserItemSF{$i}\" style=\"margin-top:33px;position:absolute;width:400px;display:none;border-width:1px;border-style:solid;padding:5px;border-radius:5px;\" onclick=\"\$j(this).toggle();\" class=\"backgroundColor0 borderColor1 RSSParserItemSF\"><small>" . $item->description . "</small></div>\n\t\t\t\t" . ($item->description != "" ? "<a href=\"#\" onclick=\"\$j('.RSSParserItemSF').hide(); \$j('#RSSParserItemSF{$i}').toggle();\" >" : "") . $item->title . ($item->description != "" ? "</a>" : "") . "<br /><small style=\"color:grey;\">" . Util::CLDateTimeParser($item->pubDate) . "</small>");
$list->addItemStyle("clear:both;display:block;margin-left:0px;");
$i++;
}
echo $list;
}
示例5: getWindow
public function getWindow($redo = false)
{
register_shutdown_function('BackupManagerGUIFatalErrorShutdownHandler');
$F = new File(Util::getRootPath() . "system/Backup");
if (!$F->A("FileIsWritable")) {
$B = new Button("Achtung", "restrictions");
$B->type("icon");
$B->style("float:left;margin-right:10px;");
$T = new HTMLTable(1);
$T->addRow($B . "Es können keine Backups von Ihrer Datenbank angelegt werden, da das Verzeichnis /system/Backup nicht durch den Webserver beschreibbar ist.");
$T->addRow("Machen Sie das Verzeichnis mit einem FTP-Programm beschreibbar. Klicken Sie dazu mit der rechten Maustaste auf das Verzeichnis auf dem Server, wählen Sie \"Eigenschaften\", und geben Sie den Modus 777 an, damit es durch den Besitzer, die Gruppe und alle Anderen les- und schreibbar ist.");
$BRefresh = new Button("Aktualisieren", "refresh");
$BRefresh->rmePCR("BackupManager", "", "getWindow", "", "Popup.displayNamed('BackupManagerGUI','Backup-Manager',transport);");
$BRefresh->style("float:right;");
$T->addRow($BRefresh);
$T->addRow("");
$T->addRowClass("backgroundColor0");
$T->addRow($this->noBackupButton());
die($T);
}
$html = "";
if (!BackupManagerGUI::checkForTodaysBackup() or $redo) {
$T = new HTMLTable(1);
if ($redo) {
unlink(BackupManagerGUI::getNewBackupName());
}
$BOK = $this->makeBackupOfToday();
$F = new File(BackupManagerGUI::getNewBackupName());
$F->loadMe();
if ($BOK === basename(BackupManagerGUI::getNewBackupName()) and $F->A("FileSize") > 100) {
$B = new Button("Backup abgeschlossen", "okCatch");
$B->type("icon");
$B->style("float:left;margin-right:10px;");
$T->addRow($B . "Das Backup wurde erfolgreich abgeschlossen!<br />Die Größe der Sicherungsdatei beträgt <strong>" . Util::formatByte($F->A("FileSize"), 2) . "</strong>");
$T->addRowClass("backgroundColor0");
try {
$ftpUpload = $this->FTPUpload(Util::getRootPath() . "system/Backup/{$BOK}");
if ($ftpUpload === true) {
$B = new Button("FTP-Upload erfolgreich", "okCatch");
$B->type("icon");
$B->style("float:left;margin-right:10px;");
$T->addRow(array($B . "Das Backup wurde erfolgreich auf den FTP-Server hochgeladen"));
}
$sftpUpload = $this->SFTPUpload(Util::getRootPath() . "system/Backup/{$BOK}");
if ($sftpUpload === true) {
$B = new Button("SFTP-Upload erfolgreich", "okCatch");
$B->type("icon");
$B->style("float:left;margin-right:10px;");
$T->addRow(array($B . "Das Backup wurde erfolgreich auf den SFTP-Server hochgeladen"));
}
} catch (Exception $e) {
$B->image("warning");
$T->addRow(array($B . $e->getMessage()));
}
$html .= $T;
} else {
$B = new Button("Es ist ein Fehler aufgetreten", "stop");
$B->type("icon");
$B->style("float:left;margin-right:10px;");
$T->addRow($B . "Beim Erstellen des Backups ist ein Fehler aufgetreten: {$BOK}");
$html .= $T;
}
$html .= OnEvent::script(OnEvent::frame("desktopLeft", "Desktop", "2"));
#"<script type=\"text/javascript\">contentManager.reloadFrame('contentLeft');</script>";
}
$gesamt = 0;
$data = $this->getBackupsList();
$i = 0;
$maxD = 5;
if (count($data) < $maxD) {
$maxD = count($data);
}
$TF = new HTMLTable(2, "Backups ({$maxD}/" . count($data) . ")");
$TF->addColStyle(2, "text-align:right;");
$TF->setColWidth(2, "80px");
foreach ($data as $name => $size) {
if ($i < 5) {
if ($name == basename(BackupManagerGUI::getNewBackupName())) {
$name = "<span style=\"color:green;\">{$name}</span>";
}
$TF->addRow(array($name, Util::formatByte($size, 2)));
}
$i++;
$gesamt += $size;
}
$TF->addRow("");
$TF->addRowClass("backgroundColor0");
$TF->addRow(array("<b>Gesamt:</b>", "<b>" . Util::formatByte($gesamt, 2) . "</b>"));
$TF->addCellStyle(1, "text-align:right");
$TF->addRow(array("Diese Backups können als Admin-Benutzer im Installation-Plugin heruntergeladen und wiederhergestellt werden."));
$TF->addRowColspan(1, 2);
$TF->addRow("");
$TF->addRowClass("backgroundColor0");
$TF->addRow(array($this->noBackupButton()));
$TF->addRowColspan(1, 2);
$BC = new Button("Fenster\nschließen", "bestaetigung");
$BC->onclick(OnEvent::closePopup("", "BackupManagerGUI"));
$BC->style("float:right;margin:10px;");
$BD = new Button("Details\nanzeigen", "down");
$BD->onclick("\$j('#BMMoreDetails').slideToggle();");
//.........這裏部分代碼省略.........