Example #1
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 #2
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 #3
0
 private function getFrozenListReAddTable()
 {
     $AC = anyC::get("Gefrierschrank");
     $AC->addAssocV3("GefrierschrankAdded", "=", "0");
     $AC->addOrderV3("GefrierschrankName");
     $L = new HTMLList();
     $L->noDots();
     $L->addListStyle("padding-top:10px;padding-left:0px;");
     while ($B = $AC->getNextEntry()) {
         $L->addItem($B->A("GefrierschrankName"));
         $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->setItemID("Gefriere" . $B->getID());
         $L->addItemEvent("onclick", OnEvent::rme($this, "reAddFrozenItem", array("\$j(this).data('maxid')"), "function(transport){ \$j('#Gefriere" . $B->getID() . "').remove(); \$j('#currentList').html(transport.responseText); }"));
     }
     return $L . OnEvent::script("\$j('#reAddList').css('height', contentManager.maxHeight()).css('overflow', 'auto');");
 }
Example #4
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>';
    }