$jUI->add(new JUI\Widget($pluginManager->getPluginName(), "settings")); $list = new JUI\ListView(); $list->addItem("Benutzer", new JUI\Click(JUI\Click::openPlugin, $pluginManager, 'user')); $list->addItem("Channel", new JUI\Click(JUI\Click::openPlugin, $pluginManager, 'channel')); $list->addItem("Broadcast senden", new JUI\Click(JUI\Click::openPlugin, $pluginManager, 'broadcast')); $list->addItem("Einstellungen", new JUI\Click(JUI\Click::openPlugin, $pluginManager, 'settings')); $jUI->add($list); $jUI->hline(); $userId = $pluginManager->getSimpleStorage('connected_user_id', '', FALSE); if (!empty($userId)) { require_once $pluginManager->getController('Ts3Viewer'); require_once $pluginManager->getController('userButtons'); $ts3viewer = new Ts3Viewer(); if ($ts3viewer->connect()) { $ts3viewer->setNickname("Vision (Webinterface)"); $userId = $pluginManager->getSimpleStorage('connected_user_id', '', FALSE); if (!empty($userId)) { $users = $ts3viewer->clientList(); if (!empty($users) && is_array($users)) { foreach ($users as $user) { if ($user['client_database_id'] == $userId) { $jUI->add(new JUI\Heading($user['client_nickname'])); addUserButtons($user['clid']); $jUI->newline(); } } } } $ts3viewer->close(); } }
<?php include $pluginManager->getController('Ts3Viewer'); $afkshort = 21; $afklong = 22; $ts3viewer = new Ts3Viewer(); if ($ts3viewer->connect()) { $ts3viewer->setNickname("Vision (Webinterface: " . $loginManager->getUsername() . ")"); $command = $pluginManager->getCommand(0); if (empty($command)) { $list = $ts3viewer->clientList(); $channellist = $ts3viewer->channelList(true); $nameArray = array(); $clickArray = array(); if (!empty($list)) { foreach ($list as $user) { if ($user['client_type'] == '0') { $cid = $user['cid']; $nameArray[] = $user['client_nickname'] . ' - ' . $channellist[$cid]['channel_name']; $clickArray[] = "openPlugin('" . $pluginManager->getPluginName() . "','user','" . $user['clid'] . "')"; } } } echo '[{"type":"list","value":' . json_encode($nameArray) . ',"click":' . json_encode($clickArray) . '}]'; } else { if (is_numeric($command)) { if (!empty($_POST['message'])) { $ts3viewer->writeMessage($command, $_POST['message']); die('{"redirect":["' . $pluginManager->getPluginName() . '", "user", ""]}'); } else { if (!empty($pluginManager->getCommand(1))) {