diff options
author | Jakob Sack <kde@jakobsack.de> | 2011-08-08 23:14:47 +0200 |
---|---|---|
committer | Jakob Sack <kde@jakobsack.de> | 2011-08-08 23:14:47 +0200 |
commit | 4b967a941426dbc7994105208e2226524651bf6d (patch) | |
tree | b78411e04a9f1ab8588621ad8c11c90612da97d2 /lib/template.php | |
parent | ded97de8915975d169025fd8d3a8ebab8cbfa513 (diff) | |
download | nextcloud-server-4b967a941426dbc7994105208e2226524651bf6d.tar.gz nextcloud-server-4b967a941426dbc7994105208e2226524651bf6d.zip |
Minor improvements
Diffstat (limited to 'lib/template.php')
-rw-r--r-- | lib/template.php | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/lib/template.php b/lib/template.php index 124343bd85b..37da1919556 100644 --- a/lib/template.php +++ b/lib/template.php @@ -202,15 +202,12 @@ class OC_Template{ * * This function proceeds the template and prints its output. */ - public function printPage() - { + public function printPage(){ $data = $this->fetchPage(); - if( $data === false ) - { + if( $data === false ){ return false; } - else - { + else{ print $data; return true; } @@ -223,18 +220,15 @@ class OC_Template{ * This function proceeds the template. If $this->renderas is set, it will * will produce a full page. */ - public function fetchPage() - { + public function fetchPage(){ // global Data we need global $WEBROOT; global $SERVERROOT; $data = $this->_fetch(); - if( $this->renderas ) - { + if( $this->renderas ){ // Decide which page we show - if( $this->renderas == "user" ) - { + if( $this->renderas == "user" ){ $page = new OC_Template( "core", "layout.user" ); $search=new OC_Template( 'core', 'part.searchbox'); $search->assign('searchurl',OC_Helper::linkTo( 'search', 'index.php' )); @@ -243,8 +237,7 @@ class OC_Template{ // Add navigation entry $page->assign( "navigation", OC_App::getNavigation()); } - elseif( $this->renderas == "admin" ) - { + elseif( $this->renderas == "admin" ){ $page = new OC_Template( "core", "layout.admin" ); $search=new OC_Template( 'core', 'part.searchbox'); $search->assign('searchurl',OC_Helper::linkTo( 'search', 'index.php' )); @@ -256,8 +249,7 @@ class OC_Template{ } $page->assign( "settingsnavigation", OC_App::getSettingsNavigation()); } - else - { + else{ $page = new OC_Template( "core", "layout.guest" ); } @@ -295,8 +287,7 @@ class OC_Template{ $page->assign( "content", $data ); return $page->fetchPage(); } - else - { + else{ return $data; } } @@ -329,9 +320,14 @@ class OC_Template{ * Includes another template. use <?php echo $this->inc('template'); ?> to * do this. */ - public function inc( $file ){ + public function inc( $file, $additionalparams = null ){ // $_ erstellen $_ = $this->vars; + $l = $this->l10n; + + if( !is_null($additionalparams)){ + $_ = array_merge( $additionalparams, $this->vars ); + } // Einbinden ob_start(); |