Ejemplo n.º 1
0
 /**
  * @return Config
  */
 public function getParams()
 {
     if ($this->tree && !$this->merged_tree) {
         $this->options['tree'] = $this->tree;
         $this->options['index'] = $this->tree->getIndexPage() ?: $this->tree->getFirstPage();
         if ($this->options->isMultilanguage()) {
             foreach ($this->options['languages'] as $key => $name) {
                 $this->options['entry_page'][$key] = $this->tree->getEntries()[$key]->getFirstPage();
             }
         } else {
             $this->options['entry_page'] = $this->tree->getFirstPage();
         }
         $this->merged_tree = true;
     }
     return $this->options;
 }
Ejemplo n.º 2
0
 /**
  * @return Config
  */
 public function getParams()
 {
     if (!$this->merged_defaults) {
         $default = ['multilanguage' => !empty($this->options['languages']), 'mode' => $this->mode, 'local_base' => $this->local_base, 'docs_path' => $this->docs_path, 'themes_path' => $this->themes_path, 'templates' => 'templates'];
         $this->options->conservativeMerge($default);
         $this->options['index_key'] = 'index.html';
         $this->options['base_page'] = $this->options['base_url'] = '';
         $this->merged_defaults = true;
     }
     if ($this->tree && !$this->merged_tree) {
         $this->options['tree'] = $this->tree;
         $this->options['index'] = $this->tree->getIndexPage() ?: $this->tree->getFirstPage();
         if ($this->options['multilanguage']) {
             foreach ($this->options['languages'] as $key => $name) {
                 $this->options['entry_page'][$key] = $this->tree->getEntries()[$key]->getFirstPage();
             }
         } else {
             $this->options['entry_page'] = $this->tree->getFirstPage();
         }
         $this->merged_tree = true;
     }
     return $this->options;
 }