Пример #1
0
 /**
  * @param  null|string $content
  * @return Node this
  */
 public final function setContent($content)
 {
     if (is_object($content) && method_exists($content, '__toString')) {
         $content = (string) $content;
     }
     if ($content === null || is_string($content) || is_int($content)) {
         $this->content = $content;
     } else {
         Logger::warning('ignored node content of type `' . gettype($content) . '`');
     }
     return $this;
 }
 /**
  * @return Bucket
  */
 protected final function getTextBucket()
 {
     $texts = new Bucket();
     if (isset($this->settings['multiLang']) && $this->settings['multiLang'] === true) {
         # additional lang-files
         if ($this->config->isArray('multiLang', 'loadList')) {
             $loadPathList = $this->config->get('multiLang', 'loadList');
         } else {
             $loadPathList = array();
         }
         # auto-loading lang-file
         if ($this->config->isTrue('multiLang', 'autoLoading')) {
             $language = $this->config->get('multiLang', 'language');
             $area = $this->request->getArea();
             $page = $this->request->getPage();
             $loadPathList[] = 'area/' . $area . '/text/' . $language . '/page/' . $page . '.ini';
         }
         foreach ($loadPathList as $loadPath) {
             $loadFile = (new File('private/src'))->attach($loadPath);
             if ($loadFile->isFile()) {
                 $texts->applyIni($loadFile);
             } else {
                 Logger::warning('lang-file `' . $loadFile . '` not found');
             }
         }
     }
     return $texts;
 }