public function _getPageLabel($page)
{
$res = $this->compiler->getSetting('title');
- dd($this->compiler->getSetting('chapters'));
- foreach ($this->compiler->getSetting('chapters') as $chapter) {
- if (trim($chapter->label, "\t\r\n\0\x0B-+") == '') {
+ foreach ($this->compiler->getFluidbook()->chapters as $chapter) {
+ if (trim($chapter['label'], "\t\r\n\0\x0B-+") == '') {
continue;
}
- if ($chapter->page == '') {
+ if ($chapter['page'] == '') {
continue;
}
- $p = $this->compiler->virtualToPhysical($chapter->page);
+ $p = $this->compiler->virtualToPhysical($chapter['page']);
if ($p == '') {
continue;
}
continue;
}
if ($page >= $p) {
- $res = $chapter->label;
+ $res = $chapter['label'];
}
}
return $res;
}
}
+ /**
+ * @throws \Exception
+ */
protected function writeSounds()
{
if ($this->fluidbookSettings->soundTheme == '') {
return;
}
- $this->config->simpleSoundTheme = file_exists(WS_SOUNDS . '/' . $this->fluidbookSettings->soundTheme . '/flip.mp3');
- $this->vdir->copyDirectory(WS_SOUNDS . '/' . $this->fluidbookSettings->soundTheme, 'data/sounds');
+ $dir = resource_path('fluidbookpublication/sounds/' . $this->fluidbookSettings->soundTheme);
+ $this->setSetting('simpleSoundTheme', file_exists($dir . '/flip.mp3'));
+ $this->vdir->copyDirectory($dir, 'data/sounds');
}
protected function writeAccessibility()