Example #1
0
 public function getOverviewContent($echo = true)
 {
     $html = "";
     $i = 0;
     $header = false;
     $AC = anyC::get("RSSParser", "RSSParserOnCall", "1");
     while ($RSS = $AC->getNextEntry()) {
         if (!$header) {
             $html .= "<div class=\"touchHeader\"><p>RSS</p></div><div style=\"padding:10px;\">";
             $header = true;
         }
         $B = new Button($RSS->A("RSSParserName"), "rss", "touch");
         $B->popup("", $RSS->A("RSSParserName"), "RSSParser", $RSS->getID(), "showFeed");
         $html .= $B;
     }
     if ($header) {
         $html .= "</div>";
     }
     $this->addAssocV3("RSSParserOnCall", "=", "0");
     while ($RSS = $this->getNextEntry()) {
         $html .= "<div class=\"touchHeader\">\n\t\t\t\t<span class=\"lastUpdate\" id=\"lastUpdatemRSSParserGUI\"></span>\n\t\t\t\t<p>" . $RSS->A("RSSParserName") . "</p></div>\n\t\t\t\t\t<div id=\"RSSParserItemText\" class=\"backgroundColor4\" style=\"padding:10px;display:none;font-size:10px;\" onclick=\"\$j(this).hide(); \$j('#RSSParserItemList').show();\">asd</div>\n\t\t\t\t\t<div id=\"RSSParserItemList\" style=\"padding:10px;\">";
         $list = new HTMLList();
         $list->addListStyle("list-style-type:none;");
         $E = $RSS->parseFeed();
         foreach ($E as $item) {
             if ($RSS->A("RSSParserCount") > 0 and $RSS->A("RSSParserCount") <= $i) {
                 break;
             }
             #$B = new Button("", "empty", "icon");
             #
             $B = "";
             if ($item->icon != null) {
                 $B = $item->icon;
                 $B->style($B->getStyle() . "float:left;margin-right:10px;margin-top:-5px;margin-bottom:10px;");
             }
             $list->addItem($B . "<div id=\"RSSParserItem{$i}\" style=\"display:none;\">" . $item->description . "</div>" . ($item->description != "" ? "<a href=\"#\" onclick=\"\$j('#RSSParserItemList').hide(); \$j('#RSSParserItemText').html(\$j('#RSSParserItem{$i}').html()).show();\" >" : "") . $item->title . ($item->description != "" ? "</a>" : ""));
             $list->addItemStyle("clear:both;display:block;margin-left:0px;");
             $i++;
         }
         $html .= $list . "</div>";
     }
     if ($echo) {
         echo $html;
     }
     return $html;
 }
Example #2
0
 public function getOverviewContent($echo = true)
 {
     $time = mktime(0, 0, 1);
     $Datum = new Datum($time);
     $Datum->addMonth();
     $lastTime = $Datum->time();
     $Datum->subMonth();
     $Woche = date("W");
     $K = $this->getData($time, $lastTime);
     $hasEvent = array();
     $html = "<div class=\"touchHeader\"><span class=\"lastUpdate\" id=\"lastUpdatemKalenderGUI\"></span><p>Kalender</p></div><div style=\"padding:10px;padding-left:0px;\">";
     $html .= "<div style=\"width:25px;float:left;margin-right:5px;color:grey;font-size:11px;\">%%SMALLCALCONTENT%%</div>";
     $html .= "<div style=\"border-bottom-width:1px;border-bottom-style:dashed;padding:3px;margin-left:30px;\" class=\"borderColor1\">Heute</div>";
     $list = new HTMLList();
     $list->addListStyle("list-style-type:none;margin-left:30px;");
     $events = $K->getEventsOnDay(date("dmY", $Datum->time()));
     if ($events != null and count($events) > 0) {
         foreach ($events as $ev) {
             foreach ($ev as $KE) {
                 $hasEvent[date("d", $K->parseDay($KE->getDay()))] = true;
                 $B = new Button("", $KE->icon(), "icon");
                 $B->style("float:left;margin-right:5px;margin-bottom:10px;");
                 $list->addItem("{$B}<b style=\"font-size:15px;\">" . $KE->title() . "</b><br /><small>" . Datum::getGerWeekArray(date("w", $K->parseDay($KE->getDay()))) . ", " . Util::CLDateParser($K->parseDay($KE->getDay())) . " " . Util::CLTimeParser($K->parseTime($KE->getTime())) . "</small>");
             }
         }
     }
     if (count($events) == 0) {
         $list->addItem("<span style=\"color:grey;\">Kein Eintrag</span>");
     }
     $html .= $list;
     $Datum->addDay();
     $html .= "<div style=\"border-bottom-width:1px;border-bottom-style:dashed;padding:3px;margin-top:15px;margin-left:30px;\" class=\"borderColor1\">Morgen</div>";
     $list = new HTMLList();
     $list->addListStyle("list-style-type:none;margin-left:30px;");
     $events = $K->getEventsOnDay(date("dmY", $Datum->time()));
     if ($events != null and count($events) > 0) {
         foreach ($events as $ev) {
             foreach ($ev as $KE) {
                 $hasEvent[date("d", $K->parseDay($KE->getDay()))] = true;
                 $B = new Button("", $KE->icon(), "icon");
                 $B->style("float:left;margin-right:5px;margin-bottom:10px;");
                 $list->addItem("{$B}<b style=\"font-size:15px;\">" . $KE->title() . "</b><br /><small>" . Datum::getGerWeekArray(date("w", $K->parseDay($KE->getDay()))) . ", " . Util::CLDateParser($K->parseDay($KE->getDay())) . " " . Util::CLTimeParser($K->parseTime($KE->getTime())) . "</small>");
             }
         }
     }
     if (count($events) == 0) {
         $list->addItem("<span style=\"color:grey;\">Kein Eintrag</span>");
     }
     $html .= $list;
     $Datum->addDay();
     $html .= "<div style=\"border-bottom-width:1px;border-bottom-style:dashed;padding:3px;margin-top:15px;margin-left:30px;\" class=\"borderColor1\">Später</div>";
     $list = new HTMLList();
     $list->addListStyle("list-style-type:none;margin-left:30px;");
     $c = 0;
     while ($Datum->time() < $lastTime) {
         $events = $K->getEventsOnDay(date("dmY", $Datum->time()));
         if ($events != null and count($events) > 0) {
             foreach ($events as $ev) {
                 foreach ($ev as $KE) {
                     $hasEvent[date("d", $K->parseDay($KE->getDay()))] = true;
                     $B = new Button("", $KE->icon(), "icon");
                     $B->style("float:left;margin-right:5px;margin-bottom:10px;");
                     $list->addItem("{$B}<b style=\"font-size:15px;\">" . $KE->title() . "</b><br /><small>" . Datum::getGerWeekArray(date("w", $K->parseDay($KE->getDay()))) . ", " . Util::CLDateParser($K->parseDay($KE->getDay())) . "</small>");
                     if (date("W", $K->parseDay($KE->getDay())) > $Woche + 1) {
                         $list->addItemStyle("color:grey;");
                     }
                     $c++;
                 }
             }
         }
         $Datum->addDay();
     }
     if ($c == 0) {
         $list->addItem("<span style=\"color:grey;\">Kein Eintrag</span>");
     }
     $html .= $list . "</div>";
     $smallCal = "";
     $DatumC = clone $Datum;
     for ($i = 0; $i < 14; $i++) {
         $smallCal .= "<div style=\"padding:5px;text-align:right;" . (isset($hasEvent[date("d", $DatumC->time())]) ? "color:black;" : "") . "\" " . (isset($hasEvent[date("d", $DatumC->time())]) ? "class=\"backgroundColor3\"" : "") . "\">" . date("d", $DatumC->time()) . "</div>";
         $DatumC->addDay();
     }
     $html = str_replace("%%SMALLCALCONTENT%%", $smallCal, $html);
     if ($echo) {
         echo $html;
     }
     return $html;
 }
Example #3
0
 public function manage($DeviceID)
 {
     echo "<style type=\"text/css\">\n\t\t\t\t.dropPlaceholder {\n\t\t\t\t\tborder:1px dashed green;\n\t\t\t\t\tpadding:3px;\n\t\t\t\t\theight: 1.5em;\n\t\t\t\t\tmargin-left:5px;\n\t\t\t\t\tmargin-right:5px;\n\t\t\t\t} \n\t\t\t\t</style>";
     $O = anyC::getFirst("fheOverview", "fheOverviewDeviceID", $DeviceID);
     $cols = array();
     if ($O != null) {
         for ($i = 1; $i < 5; $i++) {
             $cols[$i] = array();
             if ($O->A("fheOverviewCol{$i}") == "") {
                 continue;
             }
             $cols[$i] = explode(";", $O->A("fheOverviewCol{$i}"));
         }
     }
     $Plugins = array();
     $L = new HTMLList();
     $L->addListStyle("list-style-type:none;min-height:50px;");
     $L->addListClass("OverviewPlugins");
     $L->sortable("", "", ".OverviewCol1, .OverviewCol2, .OverviewCol3, .OverviewCol4", "dropPlaceholder", "");
     while ($callback = Registry::callNext("Overview")) {
         $Plugins[$callback->className()] = $callback;
         $continue = false;
         for ($i = 1; $i < 5; $i++) {
             if (in_array("P" . $callback->className(), $cols[$i])) {
                 $continue = true;
             }
         }
         if ($continue) {
             continue;
         }
         $L->addItem($callback->name());
         $L->addItemStyle("background-color:#ddd;padding:3px;min-height:" . $callback->minHeight() . "px;cursor:move;");
         $L->setItemID("P_" . $callback->className());
     }
     Registry::reset("Overview");
     echo "<div style=\"display:inline-block;width:149px;margin-right:50px;\"><p>Plugins</p><div style=\"overflow:auto;height:500px;\">{$L}</div></div>";
     #print_r($Plugins);
     $Lists = array();
     for ($i = 1; $i < 5; $i++) {
         $List = new HTMLList();
         $List->addListClass("OverviewCol{$i}");
         $List->addListStyle("list-style-type:none;min-height:50px;");
         #$List->addItem("TEST");
         $List->addItemStyle("padding:3px;min-height: 1.5em;cursor:move;");
         foreach ($cols[$i] as $class) {
             $callback = $Plugins[substr($class, 1)];
             if (!is_object($callback)) {
                 continue;
             }
             #if(!in_array("P".$callback->className(), $cols[$i]))
             #	continue;
             #$List->addItem($class);
             $List->addItem($callback->name());
             $List->addItemStyle("background-color:#ddd;padding:3px;min-height: " . $callback->minHeight() . "px;cursor:move;");
             $List->setItemID("P_" . $callback->className());
         }
         Registry::reset("Overview");
         $Lists[] = $List;
     }
     foreach ($Lists as $k => $List) {
         $group = ".OverviewPlugins";
         for ($i = 0; $i < 4; $i++) {
             if ($k == $i) {
                 continue;
             }
             $group .= ", .OverviewCol" . ($i + 1);
         }
         #echo $group."<br />";
         $List->sortable("", "mfheOverviewGUI::saveCols", $group, "dropPlaceholder", "", array($DeviceID, $k + 1));
         echo "<div style=\"vertical-align:top;display:inline-block;width:149px;border-left-style:solid;border-left-width:1px;\" class=\"borderColor1\"><p>Spalte " . ($k + 1) . "</p><div style=\"overflow:auto;height:500px;\">{$List}</div></div>";
     }
     echo "<div style=\"clear:both;\"></div>";
 }
Example #4
0
 public function remoteRadio()
 {
     $this->addAssocV3("UPnPAVTransport", "=", "1");
     $LR = new HTMLList();
     $LR->addListStyle("font-size:30px;font-family:Roboto;margin-left:10px;");
     $LR->noDots();
     while ($T = $this->getNextEntry()) {
         $LR->addItem("<span class=\"iconic iconicL x\" id=\"radioTarget" . $T->getID() . "\" style=\"color:#bbb;margin-right:10px;float:left;margin-top:5px;\"></span>" . $T->A("UPnPName"));
         $LR->addItemEvent("onclick", "UPnP.toggleRadioTarget('" . $T->getID() . "', '" . $T->A("UPnPName") . "');");
         $LR->addItemStyle("cursor:pointer;padding:10px;");
     }
     $AC = anyC::get("UPnPRadioStation");
     $AC->addOrderV3("UPnPRadioStationName");
     $LS = new HTMLList();
     $LS->addListStyle("font-size:30px;font-family:Roboto;margin-left:10px;");
     $LS->noDots();
     while ($T = $AC->getNextEntry()) {
         $LS->addItem("<span class=\"iconic iconicL arrow_right radioSource\" id=\"radioSource" . $T->getID() . "\" style=\"display:none;color:#bbb;margin-right:10px;float:left;margin-top:5px;\"></span>" . $T->A("UPnPRadioStationName"));
         $LS->addItemEvent("onclick", "UPnP.selectRadioSource('" . $T->getID() . "');");
         $LS->addItemStyle("cursor:pointer;padding:10px;");
     }
     $LA = new HTMLList();
     $LA->addListStyle("font-size:30px;font-family:Roboto;margin-left:10px;");
     $LA->noDots();
     $LA->addItem("<span class=\"iconic iconicL play\" style=\"color:#bbb;margin-right:10px;float:left;margin-top:5px;\"></span>Abspielen");
     $LA->addItemEvent("onclick", "UPnP.actionRadio('play');");
     $LA->addItemStyle("cursor:pointer;padding:10px;");
     $LA->addItem("<span class=\"iconic iconicL stop\" style=\"color:#bbb;margin-right:10px;float:left;margin-top:5px;\"></span>Stoppen");
     $LA->addItemEvent("onclick", "UPnP.actionRadio('stop');");
     $LA->addItemStyle("cursor:pointer;padding:10px;");
     #$L->addItem("Liste aktualisieren...");
     #$L->addItemEvent("onclick", OnEvent::popup("Abspielgeräte aktualisieren", "mUPnP", "-1", "discover", array("'targets'"), "", "{hPosition: 'center'}"));
     #$L->addItemStyle("cursor:pointer;padding:10px;");
     echo "\n\t\t<div style=\"width:100%;margin-bottom:20px;position:fixed;top:0;left:0;background-color:black;\" id=\"UPnPSelection\">\n\t\t\t<div style=\"float:right;margin-right:20px;\">\n\t\t\t\t<div onclick=\"UPnP.hide();\" style=\"cursor:pointer;float:left;font-family:Roboto;font-size:30px;padding:10px;\">\n\t\t\t\t\t<span style=\"margin-left:10px;float:right;margin-top:5px;color:#bbb;\" class=\"iconic iconicL x\"></span> <span>Schließen</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\n\n\t\t\t<div style=\"clear:both;height:15px;\">\n\t\t\t</div>\n\t\t\t\n\t\t\t<div style=\"display:inline-block;width:33%;vertical-align:top;\">{$LR}</div>\n\t\t\t<div style=\"display:inline-block;width:33%;vertical-align:top;\">{$LS}</div>\n\t\t\t<div style=\"display:inline-block;width:33%;vertical-align:top;\">{$LA}</div>\n\t\t\t\n\t\t</div>" . OnEvent::script("UPnP.updateRadioTargets(); UPnP.updateRadioSource();");
 }
Example #5
0
 private function getListReAddTable()
 {
     $AC = anyC::get("Gericht");
     $AC->addAssocV3("GerichtAdded", "=", "0");
     $AC->addOrderV3("GerichtName");
     $L = new HTMLList();
     $L->noDots();
     $L->addListStyle("padding-top:10px;width:370px;padding-left:0px;");
     while ($B = $AC->getNextEntry()) {
         $L->addItem($B->A("GerichtName"));
         $L->addItemStyle("margin-left:5px;height:24px;white-space:nowrap;font-size:20px;padding-left:10px;padding-top:10px;padding-bottom:10px;margin-top:0px;cursor:move;-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;");
         $L->addItemClass("swipe");
         $L->addItemData("itemid", $B->getID());
     }
     return $L . $this->js("reAddItem");
 }
Example #6
0
 public function getSortable($echo)
 {
     $entries = $_SESSION["CurrentAppPlugins"]->getMenuEntries();
     #$appMenuHidden = MenuGUI::getAppMenuOrder("appMenuHidden");
     $appMenuDisplayed = MenuGUI::getAppMenuOrder("appMenuDisplayed");
     if ($appMenuDisplayed == "") {
         $appMenuDisplayed = implode(";", $_SESSION["CurrentAppPlugins"]->getMenuEntries());
     }
     $es = MenuGUI::sort($entries, $appMenuDisplayed);
     #, $appMenuHidden);
     $appMenuDisplayed = explode(";", $appMenuDisplayed);
     $L = new HTMLList();
     $L->addListStyle("list-style-type:none;margin-left:0px;margin-top:10px;");
     $es = array_reverse($es, true);
     foreach ($es as $key => $value) {
         if (!in_array($value, $appMenuDisplayed)) {
             continue;
         }
         $L->addItem($key);
         $L->addItemClass("containerSortTabsHandle");
         $L->addItemStyle("padding:5px;cursor:move;margin:0px;");
         $L->setItemID("appMenu_{$value}");
     }
     #$I = new HTMLInput("showAgain", "checkbox");
     #$I->style("float:left;margin-right:5px;");
     #$I->onclick(addslashes(OnEvent::rme(new mUserdata(-1), "setUserdata", array("'hideTooltipDashboard'", "'1'"))));
     $L .= OnEvent::script(OnEvent::sortable("#containerSortTabs ul", ".containerSortTabsHandle", "Spellbook::updateOrder", "y", null, null, "Menu.refresh();") . "\$j('#containerSortTabs ul li').hover(function() {\n      \$j(this).addClass('backgroundColor2');\n    }, function() {\n      \$j(this).removeClass('backgroundColor2');\n    });\n\t" . ((mUserdata::getUDValueS("hideTooltipDashboard", "0") == "0" and mUserdata::getUDValueS("hideTooltips", "0") == "0") ? "\n\t\$j('#SpellbookMenuEntry img').qtip(\$j.extend({}, qTipSharedRed, {\n\t\tcontent: {\n\t\t\ttext: 'Klicken Sie auf die Weltkugel, um die angezeigten Plugins und ihre Reihenfolge zu ändern.<br /><div style=\"margin-top:10px;\"><a href=\"#\" style=\"color:grey;\" onclick=\"" . addslashes(OnEvent::rme(new mUserdata(-1), "setUserdata", array("'hideTooltipDashboard'", "'1'", "''", "0", "1"))) . " return false;\">Diesen Tipp nicht mehr anzeigen</a></div><div style=\"clear:both;margin-top:5px;\"><a href=\"#\" style=\"color:grey;\" onclick=\"" . addslashes(OnEvent::rme(new mUserdata(-1), "setUserdata", array("'hideTooltips'", "'1'", "''", "0", "1"))) . " return false;\">Keine Tipps mehr anzeigen</a></div>', \n\t\t\ttitle: {\n\t\t\t\ttext: 'Dashboard',\n\t\t\t\tbutton: true\n\t\t\t}\n\t\t}\n\t}));" : ""));
     $L = "<h2 style=\"padding-left:0px;\">Reihenfolge</h2>{$L}";
     if ($echo) {
         echo $L;
     }
     return $L;
 }
Example #7
0
 public function discoverNow($reloadWhat = null, $force = false, $quiet = false)
 {
     $last = mUserdata::getGlobalSettingValue("UPnPLastDiscover", 0);
     if (time() - $last < 3600 * 3.5 and !$force) {
         return;
     }
     $C = new phpUPnP();
     $result = $C->mSearch();
     #print_r($result);
     if (!$quiet) {
         echo "<p>Gefundene Geräte:</p>";
     }
     #$locations = array();
     $L = new HTMLList();
     $L->addListStyle("list-style-type:none;");
     $foundLocations = array();
     #echo "<pre style=\"padding:5px;font-size:9px;overflow:auto;height:400px;\">";
     #print_r($result);
     #echo "</pre>";
     foreach ($result as $r) {
         if (isset($foundLocations[$r["location"]])) {
             continue;
         }
         $info = file_get_contents($r["location"]);
         if ($info === false) {
             continue;
         }
         $xml = new SimpleXMLElement($info);
         $services = array();
         foreach ($xml->device->serviceList->service as $service) {
             foreach (self::$desiredServices as $k => $S) {
                 if ($service->serviceId[0] == $S) {
                     $services[$k] = $service;
                 }
             }
         }
         #echo "<pre>";
         #print_r($xml->device->UDN);
         #echo "</pre>";
         $F = new Factory("UPnP");
         $F->sA("UPnPUDN", $xml->device->UDN);
         $L->addItem($xml->device->friendlyName);
         $U = $F->exists(true);
         if ($U !== false) {
             $U->changeA("UPnPLocation", $r["location"]);
             #$U->changeA("UPnPName", $xml->device->friendlyName);
             $U->changeA("UPnPModelName", $xml->device->modelName);
             $U->changeA("UPnPUDN", $xml->device->UDN);
             foreach (self::$desiredServices as $S => $nil) {
                 $U->changeA("UPnP{$S}", 0);
             }
             foreach ($services as $S => $service) {
                 $U->changeA("UPnP{$S}", 1);
                 $U->changeA("UPnP" . $S . "SCPDURL", $service->SCPDURL[0] . "");
                 $U->changeA("UPnP" . $S . "controlURL", $service->controlURL[0] . "");
             }
             #echo "save";
             $U->saveMe();
         } else {
             $F->sA("UPnPLocation", $r["location"]);
             $F->sA("UPnPName", $xml->device->friendlyName);
             $F->sA("UPnPModelName", $xml->device->modelName);
             foreach (self::$desiredServices as $S => $nil) {
                 $F->sA("UPnP{$S}", 0);
             }
             foreach ($services as $S => $service) {
                 $F->sA("UPnP{$S}", 1);
                 $F->sA("UPnP" . $S . "SCPDURL", $service->SCPDURL[0] . "");
                 $F->sA("UPnP" . $S . "controlURL", $service->controlURL[0] . "");
             }
             #echo "store";
             $F->store();
         }
         $foundLocations[$r["location"]] = true;
     }
     $AC = anyC::get("UPnP");
     while ($U = $AC->getNextEntry()) {
         if (!isset($foundLocations[$U->A("UPnPLocation")])) {
             $U->deleteMe();
         }
     }
     if (!$quiet) {
         echo $L;
     }
     $B = new Button("OK", "bestaetigung");
     $B->style("float:right;margin:10px;");
     if ($reloadWhat == "targets") {
         $B->onclick(OnEvent::closePopup("mUPnP") . " UPnP.targetSelection();");
     }
     if ($reloadWhat == "sources") {
         $B->onclick(OnEvent::closePopup("mUPnP") . " UPnP.sourceSelection();");
     }
     if ($reloadWhat) {
         echo $B . "<div style=\"clear:both;\"></div>";
     }
     mUserdata::setUserdataS("UPnPLastDiscover", time(), "", -1);
     #echo "</pre>";
 }
Example #8
0
 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;
 }
Example #9
0
    public function chatPopup($root = "")
    {
        $S = anyC::getFirst("Websocket", "WebsocketUseFor", "phim");
        $I = new HTMLInput("newMessage");
        $I->style("width:100%;background-color:white;");
        $I->onEnter("phimChat.send();");
        $IC = new HTMLInput("channel", "hidden", "0");
        $IC->id("channel");
        $B = new Button("Neue Nachricht", "star", "iconic");
        $B->style("color:orange;float:right;margin-top:-3px;");
        $B->className("newMessage");
        $BOn = new Button("Online", "{$root}../ubiquitous/phim/userOnline.png", "icon");
        $BOn->style("float:left;display:none;margin-right:3px;margin-top:-2px;");
        $BOn->className("online");
        $BOff = new Button("Offline", "{$root}../ubiquitous/phim/userOffline.png", "icon");
        $BOff->style("float:left;margin-right:3px;margin-top:-2px;");
        $BOff->className("offline");
        $AC = anyC::get("phimUserHidden");
        $hidden = array();
        while ($h = $AC->n()) {
            $hidden[$h->A("phimUserHiddenUserID")] = true;
        }
        $Users = Users::getUsersArray();
        $L = new HTMLList();
        $L->setListID("userList");
        $L->addListStyle("overflow:auto;box-sizing:border-box;");
        $L->noDots();
        $L->addItem($B . "Alle");
        $L->addItemEvent("onclick", "\$j(this).removeClass('highlight'); \$j('.chatWindow').hide(); \$j('#chatText0').show(); phimChat.scroll('chatText0'); \$j('#userList .backgroundColor0').removeClass('backgroundColor0'); \$j(this).addClass('backgroundColor0'); \$j('#channel').val('0');");
        $L->addItemStyle("cursor:pointer;margin-left:0;padding:5px;");
        $L->addItemClass("backgroundColor0");
        $L->setItemID("user0");
        $content = "";
        $AC = anyC::get("phim");
        $AC->addAssocV3("phimToUserID", "=", "0");
        $AC->addAssocV3("phimphimGruppeID", "=", "0");
        $AC->addOrderV3("phimID", "DESC");
        $AC->setLimitV3(50);
        while ($M = $AC->n()) {
            $content = "<div><span class=\"username\">" . (isset($Users[$M->A("phimFromUserID")]) ? $Users[$M->A("phimFromUserID")] : "Unbekannt") . ": </span>" . $M->A("phimMessage") . "</div>" . $content;
        }
        $chatAll = "<div class=\"chatWindow\" id=\"chatText0\">{$content}</div>";
        $AC = anyC::get("phimGruppe");
        $AC->addAssocV3("INSTR(phimGruppeMembers, ';" . Session::currentUser()->getID() . ";')", ">", "0");
        $groups = array();
        $chatGroups = "";
        while ($G = $AC->n()) {
            $L->addItem($B . $G->A("phimGruppeName"));
            $L->addItemEvent("onclick", "\$j(this).removeClass('highlight'); \$j('.chatWindow').hide(); \$j('#chatTextg" . $G->getID() . "').show(); phimChat.scroll('chatTextg" . $G->getID() . "'); \$j('#userList .backgroundColor0').removeClass('backgroundColor0'); \$j(this).addClass('backgroundColor0'); \$j('#channel').val('g" . $G->getID() . "');");
            $L->addItemStyle("cursor:pointer;margin-left:0;padding:5px;");
            #$L->addItemClass("backgroundColor0");
            $L->setItemID("groupg" . $G->getID());
            $content = "";
            $ACS = anyC::get("phim");
            $ACS->addAssocV3("phimToUserID", "=", "0");
            $ACS->addAssocV3("phimphimGruppeID", "=", $G->getID());
            $ACS->addOrderV3("phimID", "DESC");
            $ACS->setLimitV3(50);
            while ($M = $ACS->n()) {
                $content = "<div><span class=\"username\">" . $Users[$M->A("phimFromUserID")] . ": </span>" . $M->A("phimMessage") . "</div>" . $content;
            }
            $groups[] = $G->getID();
            $chatGroups .= "<div class=\"chatWindow\" style=\"display:none;\" id=\"chatTextg" . $G->getID() . "\">{$content}</div>";
        }
        asort($Users);
        $chatUsers = "";
        foreach ($Users as $ID => $U) {
            if ($ID == Session::currentUser()->getID()) {
                continue;
            }
            if (isset($hidden[$ID])) {
                continue;
            }
            $unread = false;
            $content = "";
            $AC = anyC::get("phim");
            $AC->addAssocV3("phimFromUserID", "=", Session::currentUser()->getID(), "AND", "1");
            $AC->addAssocV3("phimToUserID", "=", $ID, "AND", "1");
            $AC->addAssocV3("phimFromUserID", "=", $ID, "OR", "2");
            $AC->addAssocV3("phimToUserID", "=", Session::currentUser()->getID(), "AND", "2");
            $AC->addOrderV3("phimID", "DESC");
            $AC->setLimitV3(50);
            while ($M = $AC->n()) {
                $content = "<div><span class=\"username\">" . $Users[$M->A("phimFromUserID")] . ": </span>" . $M->A("phimMessage") . "</div>" . $content;
                if (!$M->A("phimRead") and $M->A("phimToUserID") == Session::currentUser()->getID()) {
                    $unread = true;
                }
            }
            $L->addItem($BOn . $BOff . $B . $U);
            $L->addItemEvent("onclick", OnEvent::rme("phim", "setRead", $ID) . "\$j(this).removeClass('highlight'); \$j('.chatWindow').hide(); \$j('#chatText{$ID}').show(); phimChat.scroll('chatText{$ID}'); \$j('#userList .backgroundColor0').removeClass('backgroundColor0'); \$j(this).addClass('backgroundColor0');\$j('#channel').val('{$ID}');");
            $L->addItemStyle("cursor:pointer;margin-left:0;padding:5px;");
            $L->setItemID("user{$ID}");
            if ($unread) {
                $L->addItemClass("highlight");
            }
            $chatUsers .= "<div style=\"display:none;\" class=\"chatWindow\" id=\"chatText{$ID}\">{$content}</div>";
        }
        $content = "<div style=\"width:68%;display:inline-block;vertical-align:top;\">\n\t\t\t\t{$chatAll}\n\t\t\t\t{$chatUsers}\n\t\t\t\t{$chatGroups}\n\t\t\t\t<div>{$I}</div>\n\t\t\t</div><div style=\"width:32%;display:inline-block;vertical-align:top;\">{$L}{$IC}</div>";
        $rp = str_replace("interface/rme.php", "", $_SERVER["SCRIPT_NAME"]);
        if (strpos($_SERVER["SCRIPT_NAME"], "phim.php") !== false) {
            $rp = "../../";
        }
        $physion = "default";
        if (isset($_GET["physion"])) {
            $physion = $_GET["physion"];
        }
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>phim</title>
		<script type="text/javascript" src="' . $root . '../libraries/jquery/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/jquery/jquery-ui-1.10.1.custom.min.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/iconic/iconic.min.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/jquery/jquery.qtip.min.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/P2J.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/Aspect.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/handler.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/contentManager.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/Interface.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/Overlay.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/webtoolkit.base64.js"></script>
		
		<script type="text/javascript" src="' . $root . '../ubiquitous/phim/autobahn.min.js"></script>
		<script type="text/javascript" src="' . $root . '../ubiquitous/phim/phimChat.js"></script>
		<script type="text/javascript">
			contentManager.setRoot("' . $rp . '");
			$j(function(){
				Ajax.physion = "' . $physion . '";
					
				phimChat.init(
					"ws' . ($S->A("WebsocketSecure") ? "s" : "") . '://' . $S->A("WebsocketServer") . ":" . $S->A("WebsocketServerPort") . '/",
					"' . $S->A("WebsocketRealm") . '", 
					' . Session::currentUser()->getID() . ', 
					"' . Session::currentUser()->A("name") . '",
					"' . $S->A("WebsocketToken") . '",
					[' . implode(",", $groups) . '],
					"' . $root . '");
						
				phimChat.scroll("chatText0");
				$j("#userList").css("height", $j(window).height());
			});
		</script>
		<link rel="stylesheet" type="text/css" href="' . $root . '../libraries/jquery/jquery.qtip.min.css" />
		<link rel="stylesheet" type="text/css" href="' . $root . '../styles/' . (isset($_COOKIE["phynx_color"]) ? $_COOKIE["phynx_color"] : "standard") . '/colors.css"></link>
		<link rel="stylesheet" type="text/css" href="' . $root . '../styles/standard/general.css"></link>
		<style type="text/css">
			p {
				padding:5px;
			}
			
			body {
				background-color:#ddd;
			}
			
			html {
				overflow-y: auto;
			}

			.username {
				font-weight:bold;
			}
			
			.chatWindow {
				padding:5px;
				box-sizing:border-box;
				overflow-y: auto;
				height:270px;
				background-color:white;
				border-bottom:3px solid grey;
			}
			
			.newMessage {
				display:none;
			}
			
			.highlight .newMessage {
				display:block;
			}
			
			#darkOverlay {
				position:fixed;
				top:0;
				left:0;
			}
			
			#userList li {
				white-space: nowrap;
				overflow:hidden;
				margin-top:0;
			}
		</style>
	</head>
	<body>
		<div id="darkOverlay" style="background-color:rgba(0,0,0,.7);color:white;"></div>
		' . $content . '
	</body>
</html>';
    }
Example #10
0
 private function getListReAddTable()
 {
     #$TB = new HTMLTable(2);
     #$TB->weight("lightColored");
     #$TB->maxHeight(400);
     #$TB->useForSelection();
     $AC = anyC::get("Einkaufszettel", "EinkaufszettelImmer", "1");
     $AC->setFieldsV3(array("EinkaufszettelName", "EinkaufszettelNameDetails", "EinkaufszettelKategorieName"));
     #, "MAX(EinkaufszettelID) AS maxID"));
     $AC->addJoinV3("EinkaufszettelKategorie", "EinkaufszettelEinkaufszettelKategorieID", "=", "EinkaufszettelKategorieID");
     #$AC->addAssocV3("EinkaufszettelBoughtTime", ">", time() - 3600 * 24 * 60);
     $AC->addAssocV3("EinkaufszettelEAN", "=", "");
     #$AC->addGroupV3("EinkaufszettelName");
     $AC->addOrderV3("EinkaufszettelKategorieName");
     $AC->addOrderV3("EinkaufszettelName");
     #$AC->addGroupV3("EinkaufszettelNameDetails");
     $LC = new HTMLList();
     $LC->noDots();
     $LC->addListStyle("padding-top:10px;padding-left:0px;");
     $L = "";
     $last = "";
     $html = "";
     while ($B = $AC->getNextEntry()) {
         if ($last != $B->A("EinkaufszettelKategorieName")) {
             $html .= $L;
             $html .= "<p class=\"prettySubtitle\">" . $B->A("EinkaufszettelKategorieName") . "</p>";
             $L = clone $LC;
         }
         $L->addItem($B->A("EinkaufszettelName") . ($B->A("EinkaufszettelNameDetails") != "" ? "<br /><small style=\"color:grey;\">" . $B->A("EinkaufszettelNameDetails") . "</small>" : ""));
         $L->addItemStyle("padding:10px;margin-bottom:10px;background-color:#eee;display:inline-block;margin-left:5px;height:24px;white-space:nowrap;font-size:20px;cursor:pointer;user-select: none;");
         $L->addItemData("maxid", $B->getID());
         $L->addItemEvent("onclick", OnEvent::rme($this, "reAddItem", array("\$j(this).data('maxid')"), "function(transport){ \$j('#currentList').html(transport.responseText); }"));
         $last = $B->A("EinkaufszettelKategorieName");
     }
     $html .= $L;
     return $html . OnEvent::script("\$j('#reAddList').css('height', contentManager.maxHeight()).css('overflow', 'auto');");
 }