diff --git a/index-smarty.php b/index-smarty.php index ce39dc8100..82860a9a99 100644 --- a/index-smarty.php +++ b/index-smarty.php @@ -40,8 +40,11 @@ $(document).ready(function(){ $index = new IndexManager($header_title); - -$tpl = $index->tpl->get_template('layout/layout_two_col.tpl'); +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'); +} //@todo move this inside the IndexManager diff --git a/main/admin/index.php b/main/admin/index.php index 06d5df6c16..553ebc7b40 100755 --- a/main/admin/index.php +++ b/main/admin/index.php @@ -14,8 +14,6 @@ $cidReset = true; // Including some necessary chamilo files. require_once '../inc/global.inc.php'; -require_once api_get_path(LIBRARY_PATH).'security.lib.php'; -require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php'; require_once api_get_path(SYS_CODE_PATH).'admin/statistics/statistics.lib.php'; require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php'; diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index 2838cddb3e..a5eab5cbdf 100644 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -45,18 +45,34 @@ class Template extends Smarty { $this->caching = true; $this->cache_lifetime = Smarty::CACHING_OFF; // no caching //$this->cache_lifetime = 120; - - $this->set_header_parameters(); + + $this->set_user_parameters(); + + $this->set_header_parameters(); + $this->set_footer_parameters(); + //Now we can call the get_lang from a template!!! Just use {"MyString"|get_lang} $this->registerPlugin("modifier","get_lang", "get_lang"); //$this->loadPlugin('smarty_function_get_lang'); //$this->caching = Smarty::CACHING_LIFETIME_CURRENT; - $this->assign('style', $this->style); - + $this->assign('style', $this->style); + } + + function set_user_parameters() { + if (api_get_user_id()) { + $user_info = api_get_user_info(); + //$this->assign('user_info', $user_info); + $this->assign('user_complete_name', api_get_person_name($user_info['firstname'], $user_info['lastname'])); + + + } else { + + } } + function get_template($name) { return $this->style.'/'.$name; } diff --git a/main/template/default/layout/layout_one_col.tpl b/main/template/default/layout/layout_1_col.tpl similarity index 100% rename from main/template/default/layout/layout_one_col.tpl rename to main/template/default/layout/layout_1_col.tpl diff --git a/main/template/default/layout/layout_two_col.tpl b/main/template/default/layout/layout_2_col.tpl similarity index 100% rename from main/template/default/layout/layout_two_col.tpl rename to main/template/default/layout/layout_2_col.tpl diff --git a/main/template/default/layout/layout_3_col.tpl b/main/template/default/layout/layout_3_col.tpl new file mode 100644 index 0000000000..8e141b80e6 --- /dev/null +++ b/main/template/default/layout/layout_3_col.tpl @@ -0,0 +1,31 @@ +{extends file="default/layout/main.tpl"} + +{block name=header} + {include file="default/layout/header.tpl"} +{/block} + +{block name=body} +