예제 #1
0
<?php

require_once $pluginManager->getController('tools');
if (!empty($pluginManager->getCommand(0)) && $pluginManager->getCommand(0) == "reload") {
    FileManager::updateUserFileList();
}
$jUI->add(new JUI\Heading('Musik'));
$reload = new JUI\Button("Musik aktualisieren");
$reload->setClick(new JUI\Click(JUI\Click::openPlugin, $pluginManager, "home", "reload"));
$jUI->add($reload);
$remote = new JUI\Button("Musik-Remote öffnen");
$remote->setClick(new JUI\Click(JUI\Click::openPlugin, $pluginManager, "remote"));
$jUI->add($remote);
$audio = $pluginManager->fileManager->getAudioList();
if (!empty($audio) && is_array($audio)) {
    $list = new JUI\ListView();
    $musicArray = null;
    foreach ($audio as $path) {
        if (is_string($path) && $pluginManager->fileManager->fileExists($path, TRUE, FileManager::FILESYSTEM_PRIVATE)) {
            $name = FileManager::getBaseName($path);
            $array['name'] = $name;
            $array['click'] = new JUI\Click(JUI\Click::openMedia, 'music', $path);
            $array['longclick'] = new JUI\Click(JUI\Click::openPlugin, $pluginManager, 'remote', encode($path));
            if (empty($musicArray[strtolower($name)])) {
                $musicArray[strtolower($name)] = $array;
            } else {
                $musicArray[strtolower($name) . '_' . count($musicArray)] = $array;
            }
        }
    }
    ksort($musicArray);
 function triggerHourly()
 {
     global $loginManager;
     if (constant('WEBSOCKET') == 1) {
         $users = $loginManager->getUserList();
         if (!empty($users) && is_array($users)) {
             foreach ($users as $id => $user) {
                 if (empty($loginManager->getPermissions($id)['access_files'])) {
                     continue;
                 }
                 $filesystem = $loginManager->getPermissions($id)['access_files'];
                 if (!empty($filesystem) && $filesystem != '0' && file_exists($this->basedir . '/data/user_' . $id . '/files/')) {
                     FileManager::updateUserFileList($id);
                 }
             }
         }
         return true;
     }
     return false;
 }