Browse Source

Add new variables to template arrays

Yannick Warnier 11 years ago
parent
commit
bd88ff3ec7
1 changed files with 6 additions and 0 deletions
  1. 6 0
      main/inc/lib/template.lib.php

+ 6 - 0
main/inc/lib/template.lib.php

@@ -354,6 +354,8 @@ class Template
             'language' => $course['language'],
             'directory' => $course['directory'],
             'session_id' => api_get_session_id(),
+            'user_is_teacher' => api_is_course_admin(),
+            'student_view' => (!empty($_GET['isStudentView']) && $_GET['isStudentView'] == 'true'),
         );
         $this->assign('_c',$_c);
     }
@@ -395,6 +397,10 @@ class Template
             'web_img'    => api_get_path(WEB_IMG_PATH),
             'web_plugin' => api_get_path(WEB_PLUGIN_PATH),
             'web_lib'    => api_get_path(WEB_LIBRARY_PATH),
+            'web_self' => api_get_self(),
+            'web_query_vars' => api_htmlentities($_SERVER['QUERY_STRING']),
+            'web_self_query_vars' => api_htmlentities($_SERVER['REQUEST_URI']),
+            'web_cid_query' => api_get_cidreq(),
         );
         $this->assign('_p', $_p);