aboutsummaryrefslogtreecommitdiffstats
path: root/lib/template.php
diff options
context:
space:
mode:
authorBart Visscher <bart@thisnet.nl>2011-09-18 19:37:54 +0200
committerBart Visscher <bart@thisnet.nl>2011-09-18 19:37:54 +0200
commit82c7598861db175617694891bb9f21b426426225 (patch)
treefce8fb4717b4cc2a5dc6da8835bdb51b5fb40054 /lib/template.php
parentd5656716f69caa6a1eb98706994ffcb9a08553a7 (diff)
downloadnextcloud-server-82c7598861db175617694891bb9f21b426426225.tar.gz
nextcloud-server-82c7598861db175617694891bb9f21b426426225.zip
Remove global vars and use the OC static version.
Removed global vars are DOCUMENTROOT, SERVERROOT, SUBURI, WEBROOT and CONFIG_DATADIRECTORY
Diffstat (limited to 'lib/template.php')
-rw-r--r--lib/template.php34
1 files changed, 14 insertions, 20 deletions
diff --git a/lib/template.php b/lib/template.php
index adedd4f901a..a293e63b437 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -124,18 +124,15 @@ class OC_Template{
* "admin".
*/
public function __construct( $app, $name, $renderas = "" ){
- // Global vars we need
- global $SERVERROOT;
-
// Get the right template folder
- $template = "$SERVERROOT/core/templates/";
+ $template = OC::$SERVERROOT."/core/templates/";
if( $app != "" ){
// Check if the app is in the app folder
- if( file_exists( "$SERVERROOT/apps/$app/templates/" )){
- $template = "$SERVERROOT/apps/$app/templates/";
+ if( file_exists( OC::$SERVERROOT."/apps/$app/templates/" )){
+ $template = OC::$SERVERROOT."/apps/$app/templates/";
}
else{
- $template = "$SERVERROOT/$app/templates/";
+ $template = OC::$SERVERROOT."/$app/templates/";
}
}
@@ -222,9 +219,6 @@ class OC_Template{
* will produce a full page.
*/
public function fetchPage(){
- // global Data we need
- global $WEBROOT;
- global $SERVERROOT;
$data = $this->_fetch();
if( $this->renderas ){
@@ -247,25 +241,25 @@ class OC_Template{
// Add the css and js files
foreach(OC_Util::$scripts as $script){
- if(is_file("$SERVERROOT/apps/$script.js" )){
- $page->append( "jsfiles", "$WEBROOT/apps/$script.js" );
+ if(is_file(OC::$SERVERROOT."/apps/$script.js" )){
+ $page->append( "jsfiles", OC::$WEBROOT."/apps/$script.js" );
}
- elseif(is_file("$SERVERROOT/$script.js" )){
- $page->append( "jsfiles", "$WEBROOT/$script.js" );
+ elseif(is_file(OC::$SERVERROOT."/$script.js" )){
+ $page->append( "jsfiles", OC::$WEBROOT."/$script.js" );
}
else{
- $page->append( "jsfiles", "$WEBROOT/core/$script.js" );
+ $page->append( "jsfiles", OC::$WEBROOT."/core/$script.js" );
}
}
foreach(OC_Util::$styles as $style){
- if(is_file("$SERVERROOT/apps/$style.css" )){
- $page->append( "cssfiles", "$WEBROOT/apps/$style.css" );
+ if(is_file(OC::$SERVERROOT."/apps/$style.css" )){
+ $page->append( "cssfiles", OC::$WEBROOT."/apps/$style.css" );
}
- elseif(is_file("$SERVERROOT/$style.css" )){
- $page->append( "cssfiles", "$WEBROOT/$style.css" );
+ elseif(is_file(OC::$SERVERROOT."/$style.css" )){
+ $page->append( "cssfiles", OC::$WEBROOT."/$style.css" );
}
else{
- $page->append( "cssfiles", "$WEBROOT/core/$style.css" );
+ $page->append( "cssfiles", OC::$WEBROOT."/core/$style.css" );
}
}