kirby/branches/multilang/page.php
/**
   * Private method to simplify content fetching
   *
   * @return Content
   */
Private method to simplify content fetching
@return Content
Private method to simplify content fetching @return Content
protected function _content($lang) {
    $inventory = $this->inventory();
    $content = isset($inventory['content'][$lang]) ? $inventory['content'][$lang] : null;
    if(empty($content) and isset($inventory['content'][$this->site->defaultLanguage->code])) {
      $content = $inventory['content'][$this->site->defaultLanguage->code];
    }
    return new Content($this, $this->root() . DS . $content, $lang);
  }
protected function _content ( $ lang ) { $ inventory = $ this -> inventory ( ) ; $ content = isset ( $ inventory [ 'content' ] [ $ lang ] ) ? $ inventory [ 'content' ] [ $ lang ] : null ; if ( empty ( $ content ) and isset ( $ inventory [ 'content' ] [ $ this -> site -> defaultLanguage -> code ] ) ) { $ content = $ inventory [ 'content' ] [ $ this -> site -> defaultLanguage -> code ] ; } return new Content ( $ this , $ this -> root ( ) . DS . $ content , $ lang ) ; }
Private method to simplify content fetching
 @return Content
Private method to simplify content fetching @return Content
// get the inventory // try to fetch the content for this language // try to replace empty content with the default language content // find and cache the content for this language