Replacing the $app variable to $_s variable when calling system information in templates

skala
Julio Montoya 14 years ago
parent d98d8804c5
commit 13317a6d98
  1. 9
      index-smarty.php
  2. 2
      main/exercice/exercise.lib.php
  3. 6
      main/inc/lib/template.lib.php
  4. 2
      main/inc/lib/userportal.lib.php
  5. 2
      main/template/default/layout/footer.tpl

@ -40,15 +40,12 @@ $(document).ready(function(){
$index = new IndexManager($header_title);
if (api_get_user_id()) {
$tpl = $index->tpl->get_template('layout/layout_3_col.tpl');
} else {
$tpl = $index->tpl->get_template('layout/layout_2_col.tpl');
}
$tpl = $index->tpl->get_template('layout/layout_2_col.tpl');
//@todo move this inside the IndexManager
//@todo move this inside the IndexManager
$index->tpl->assign('login_block', $index->set_login_form());
$index->tpl->assign('announcements_block', $index->return_announcements());
$index->tpl->assign('teacher_block', $index->return_teacher_link());
$index->tpl->assign('home_page_block', $index->return_home_page());

@ -1526,7 +1526,7 @@ function get_best_average_score_by_exercise($exercise_id, $course_code, $session
function get_exercises_to_be_end($course_code, $session_id) {
function get_exercises_to_be_taken($course_code, $session_id) {
$course_info = api_get_course_info($course_code);
$exercises = get_all_exercises($course_info, $session_id);
$result = array();

@ -6,7 +6,7 @@ require_once api_get_path(LIBRARY_PATH).'smarty/Smarty.class.php';
class Template extends Smarty {
var $style = 'air'; //see the template folder
var $style = 'experimental'; //see the template folder
function __construct($title = '') {
$this->title = $title;
@ -64,13 +64,13 @@ class Template extends Smarty {
$this->assign('_p', $_p);
//Here we can add system parameters that can be use in any template
$app = array(
$_s = array(
'software_name' => $_configuration['software_name'],
'system_version' => $_configuration['system_version'],
'site_name' => api_get_setting('siteName'),
'institution' => api_get_setting('Institution'),
);
$this->assign('app', $app);
$this->assign('_s', $_s);
}

@ -90,7 +90,7 @@ class IndexManager {
$course_code = $course_item['c'];
$session_id = $course_item['id_session'];
$exercises = get_exercises_to_be_end($course_code, $session_id);
$exercises = get_exercises_to_be_taken($course_code, $session_id);
foreach($exercises as $exercise_item) {
$exercise_item['course_code'] = $course_code;

@ -7,7 +7,7 @@
</div>
{/if}
<div align="right">
{"Platform"|get_lang} <a href="{$_p.web}" target="_blank">{$app.software_name} {$app.version} </a> &copy; {$smarty.now|date_format:"%Y"}
{"Platform"|get_lang} <a href="{$_p.web}" target="_blank">{$_s.software_name} {$_s.system_version}</a> &copy; {$smarty.now|date_format:"%Y"}
</div>
</div>

Loading…
Cancel
Save