diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index 5ea3b5c7e4..28c15ed272 100755 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -128,6 +128,11 @@ class Template 'get_lang', 'api_get_path', 'api_get_local_time', + 'api_convert_and_format_date', + 'api_is_allowed_to_edit', + 'api_get_user_info', + 'api_get_configuration_value', + 'api_get_setting', [ 'name' => 'return_message', 'callable' => 'Display::return_message_and_translate' @@ -155,26 +160,6 @@ class Template [ 'name' => 'icon', 'callable' => 'Template::get_icon_path' - ], - [ - 'name' => 'isAllowedToEdit', - 'callable' => 'api_is_allowed_to_edit' - ], - [ - 'name' => 'local_format_date', - 'callable' => 'api_convert_and_format_date' - ], - [ - 'name' => 'user_info', - 'callable' => 'api_get_user_info' - ], - [ - 'name' => 'get_configuration_value', - 'callable' => 'api_get_configuration_value' - ], - [ - 'name' => 'get_setting', - 'callable' => 'api_get_setting' ] ]; @@ -186,21 +171,20 @@ class Template } } - //Setting system variables + // Setting system variables $this->set_system_parameters(); - //Setting user variables + // Setting user variables $this->set_user_parameters(); - //Setting course variables + // Setting course variables $this->set_course_parameters(); - //Setting administrator variables + // Setting administrator variables $this->setAdministratorParams(); - $this->setCSSEditor(); - //header and footer are showed by default + // Header and footer are showed by default $this->set_footer($show_footer); $this->set_header($show_header); diff --git a/main/template/default/course_progress/progress.tpl b/main/template/default/course_progress/progress.tpl index abbc30f7ce..73e57a5e6b 100644 --- a/main/template/default/course_progress/progress.tpl +++ b/main/template/default/course_progress/progress.tpl @@ -2,7 +2,7 @@ {{ message }} {{ flash_messages }} {% if data is not empty %} -{% set tutor = false | isAllowedToEdit(true) %} +{% set tutor = false | api_convert_and_format_date(true) %}
@@ -40,7 +40,7 @@
- {% endif %} + {% endif %}
{% if item.thematic_plan is empty %}
@@ -64,7 +64,7 @@ {% endif %}
- {% if item.thematic_advance is not empty %} + {% if item.thematic_advance is not empty %} {% for advance in item.thematic_advance %} {% endfor %} - {% else %} + {% else %} {% endif %}
@@ -107,7 +107,7 @@ {% endif %}
@@ -115,7 +115,7 @@ {% endfor %} - +
diff --git a/main/template/default/create_course/add_course.tpl b/main/template/default/create_course/add_course.tpl index c1770c563d..300511d20c 100755 --- a/main/template/default/create_course/add_course.tpl +++ b/main/template/default/create_course/add_course.tpl @@ -38,7 +38,7 @@
- {% if ("allow_user_course_subscription_by_course_admin" | get_setting) == 'true' or _u.is_admin == 1 %} + {% if ("allow_user_course_subscription_by_course_admin" | api_get_setting) == 'true' or _u.is_admin == 1 %}
diff --git a/main/template/default/layout/login_form.tpl b/main/template/default/layout/login_form.tpl index 47d4606677..a67bddc52e 100755 --- a/main/template/default/layout/login_form.tpl +++ b/main/template/default/layout/login_form.tpl @@ -13,13 +13,13 @@ {{ login_failed }} {{ login_form }} - {% if "allow_lostpassword" | get_setting == 'true' or "allow_registration" | get_setting == 'true' %} + {% if "allow_lostpassword" | api_get_setting == 'true' or "allow_registration" | api_get_setting == 'true' %} diff --git a/main/template/default/layout/topbar.tpl b/main/template/default/layout/topbar.tpl index fa8647922d..54adbd1fa0 100755 --- a/main/template/default/layout/topbar.tpl +++ b/main/template/default/layout/topbar.tpl @@ -10,7 +10,7 @@ - +
{% if _u.logged %} diff --git a/main/template/default/layout/welcome_to_course.tpl b/main/template/default/layout/welcome_to_course.tpl index 0c00d5723d..babae3eac5 100755 --- a/main/template/default/layout/welcome_to_course.tpl +++ b/main/template/default/layout/welcome_to_course.tpl @@ -5,7 +5,7 @@ {{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|get_lang }} {% else %} - {% if "allow_students_to_browse_courses"|get_setting == 'true' %} + {% if "allow_students_to_browse_courses"|api_get_setting == 'true' %} {{ "GoAheadAndBrowseOurCourseCatalogXOnceRegisteredYouWillSeeTheCourseHereX"|get_lang|format(course_catalog_link, course_list_link) }} {{ "CourseCatalog"|get_lang }} diff --git a/main/template/default/session/about.tpl b/main/template/default/session/about.tpl index 8de519779f..2e88987a85 100644 --- a/main/template/default/session/about.tpl +++ b/main/template/default/session/about.tpl @@ -239,7 +239,7 @@ {% if _u.logged and not is_subscribed %} {{ subscribe_button }} {% elseif not _u.logged %} - {% if 'allow_registration'|get_setting == 'true' %} + {% if 'allow_registration'|api_get_setting == 'true' %} {{ 'SignUp'|get_lang }} diff --git a/main/template/default/social/user_block.tpl b/main/template/default/social/user_block.tpl index eec04f7590..333fae2f29 100644 --- a/main/template/default/social/user_block.tpl +++ b/main/template/default/social/user_block.tpl @@ -41,7 +41,7 @@ {% endif %} {% endfor %} - {% if 'allow_show_skype_account'|get_setting == 'true' and not skype_account is empty %} + {% if 'allow_show_skype_account'|api_get_setting == 'true' and not skype_account is empty %}
  • {{ 'Skype'|get_lang }} @@ -49,7 +49,7 @@
  • {% endif %} - {% if 'allow_show_linkedin_url'|get_setting == 'true' and not linkedin_url is empty %} + {% if 'allow_show_linkedin_url'|api_get_setting == 'true' and not linkedin_url is empty %}
  • {{ 'LinkedIn'|get_lang }} diff --git a/main/template/default/user_portal/grid_session.tpl b/main/template/default/user_portal/grid_session.tpl index 9ce36f1b00..798d8dd2ea 100644 --- a/main/template/default/user_portal/grid_session.tpl +++ b/main/template/default/user_portal/grid_session.tpl @@ -1,4 +1,4 @@ -{% set group_courses = 'view_grid_courses_grouped_categories_in_sessions'|get_configuration_value %} +{% set group_courses = 'view_grid_courses_grouped_categories_in_sessions'| api_get_configuration_value %} {% macro course_block(course, show_category) %}