if ($page == '' || $text == '') {
continue;
}
- $data=['text' => $text];
- if($voice){
- $data['voice']=$voice;
+ $data = ['text' => $text];
+ if ($voice) {
+ $data['voice'] = $voice;
}
$this->audioDescriptionTextsList[$page] = $data;
}
}
- protected function _writeIndex($page)
+ protected function _writeIndex($page, $iv = [])
{
if (!isset($this->seo->pages[$page])) {
return;
}
$seo = $this->seo->pages[$page];
- $html = $seo->getHTML();
+ $html = $seo->getHTML($iv);
if ($this->book->parametres->seoVersion) {
$seo->writePage($html, $this->vdir);
$res = [];
foreach ($vars as $v) {
- if (isset($$v)) {
- $res['<!-- $' . $v . ' -->'] = $$v;
- } else {
- $res['<!-- $' . $v . ' -->'] = '';
- }
+ $res[$v] = $$v ?? '';
+
}
$this->_indexVars = $res;
$this->log('Got index vars 6');
protected function writeIndex()
{
-
-
$iv = $this->getIndexVars();
$this->log('Got index vars');
- foreach ($iv as $k => $v) {
- $this->seo->html = str_replace($k, $v, $this->seo->html);
- }
+
if ($this->book->parametres->seoVersion) {
foreach ($this->pages as $page => $infos) {
- $this->_writeIndex($page);
+ $this->_writeIndex($page, $iv);
}
} else {
- $this->_writeIndex(1);
+ $this->_writeIndex(1, $iv);
}
}
\r
foreach ($a as $item) {\r
$page = $item['page'] + $offsetPage;\r
- $item['url'] = trim(CubeIT_Text::removeAccents($item['url'])," '");\r
+ $item['url'] = trim(CubeIT_Text::removeAccents($item['url']), " '");\r
if (!$item['url']) {\r
continue;\r
}\r
}\r
}\r
\r
+\r
$this->html = file_get_contents($this->compiler->assets . '/_index.html');\r
}\r
\r
$this->_container = $container;\r
}\r
\r
- public function getHTML()\r
+ public function getHTML($iv = [])\r
{\r
$html = $this->_container->html;\r
\r
$vars['canonical'] = $vars['next'] = $vars['prev'] = '';\r
}\r
\r
+ $vars = array_merge($iv, $vars);\r
+\r
foreach ($vars as $k => $var) {\r
$html = str_replace('<!-- $' . $k . ' -->', $var, $html);\r
}\r
-\r
return $html;\r
}\r
\r