private function indexMusicTag(FinderIndexerResult &$item, MusicTag $musicTag)
 {
     $musicTag->addConfiguration($this->configuration);
     $musicFolder = new MusicFolder($musicTag);
     if ($musicFolder->isExists()) {
         $sortByAsc = $musicTag->getConfiguration()->isSortByAsc();
         $maxRows = $musicTag->getConfiguration()->getMaxRows();
         $offset = $musicTag->getOffset();
         $page = $musicTag->getPageNumber();
         $totaloffset = $page * $maxRows + $offset;
         $musicItems = $musicFolder->getMusicItems($sortByAsc, $maxRows, $totaloffset);
         $baseUrl = $item->url . "#";
         foreach ($musicItems as $musicItem) {
             $this->indexMusicItem($item, $baseUrl, $musicItem);
         }
     }
 }
Beispiel #2
0
 private function handleSingleMusicTag($article, MusicTag $musicTag)
 {
     $musicTag->addConfiguration($this->configuration);
     $musicFolder = new MusicFolder($musicTag);
     $htmlTableString = $this->getHtmlTableString($musicTag, $musicFolder);
     if ($musicTag->getConfiguration()->includeSubdirectories()) {
         $path = $musicTag->getPathTrail();
         // Retrieve All subdirs relative to $path...
         $directories = $this->getAllSubdirectories($path);
         foreach ($directories as $directory) {
             $musicFolder = new MusicFolder($musicTag);
             $musicFolder->setOverridePath($path . DIRECTORY_SEPARATOR . $directory);
             $subHtmlTable = $this->getHtmlTableString($musicTag, $musicFolder);
             if ($subHtmlTable) {
                 $title = str_replace(DIRECTORY_SEPARATOR, " — ", $directory);
                 $htmlTableString = $htmlTableString . "<h3>{$title}</h3>" . $subHtmlTable;
             }
         }
     }
     $musicTag->setReplacementContent($htmlTableString);
     MusicTagsHelper::replaceTagsWithReplacementContent($article, $musicTag);
 }