Minor - fixing icons in Subscribe to training

skala
Julio Montoya 17 years ago
parent ef514cd7d4
commit 49e5c7f8ac
  1. 62
      main/auth/courses.php
  2. 20
      main/inc/global.inc.php
  3. 4
      main/inc/lib/add_course.lib.inc.php

@ -1,27 +1,5 @@
<?php // $Id: courses.php 20565 2009-05-12 20:39:59Z aportugal $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2009 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
<?php
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
* @package dokeos.auth
@ -926,27 +904,23 @@ function display_subscribe_icon($current_course, $user_coursecodes)
{
global $stok;
// we display the icon to subscribe or the text already subscribed
if (in_array($current_course['code'],$user_coursecodes))
{
echo get_lang("AlreadySubscribed");
}
else
{
if (in_array($current_course['code'],$user_coursecodes)) {
Display::display_icon('enroll_na.gif', get_lang('AlreadySubscribed'));
} else {
if ($current_course['subscribe'] == SUBSCRIBE_ALLOWED)
{
echo "<form action=\"".$_SERVER["REQUEST_URI"]."\" method=\"post\">";
echo '<input type="hidden" name="sec_token" value="'.$stok.'">';
echo "<input type=\"hidden\" name=\"subscribe\" value=\"".$current_course['code']."\" />";
if(!empty($_POST['search_term']))
{
if(!empty($_POST['search_term'])) {
echo '<input type="hidden" name="search_course" value="1" />';
echo '<input type="hidden" name="search_term" value="'.Security::remove_XSS($_POST['search_term']).'" />';
}
echo "<input type=\"image\" name=\"unsub\" src=\"../img/enroll.gif\" alt=\"".get_lang("Subscribe")."\" />".get_lang("Subscribe")."</form>";
}
else
{
echo get_lang("SubscribingNotAllowed");
echo "<input style=\"border-color:#fff\" type=\"image\" name=\"unsub\" src=\"../img/enroll.gif\" title=\"".get_lang("Subscribe")."\" alt=\"".get_lang("Subscribe")."\" /></form>";
} else {
// echo get_lang("SubscribingNotAllowed");
Display::display_icon('enroll_na.gif', get_lang('SubscribingNotAllowed'));
}
}
}
@ -987,17 +961,15 @@ function display_course_icons($key, $number_of_courses, $course)
echo "</a></td>";
}
echo "<td rowspan=\"2\" valign=\"top\" class=\"invisible\">";
if ($course['status'] != 1)
{
if ($course['unsubscr'] == 1)
{ // changed link to submit to avoid action by the search tool indexer
if ($course['status'] != 1) {
if ($course['unsubscr'] == 1) {
// changed link to submit to avoid action by the search tool indexer
echo "<form action=\"".api_get_self()."\" method=\"post\" onsubmit=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("ConfirmUnsubscribeFromCourse"),ENT_QUOTES,$charset))."')) return false;\">";
echo '<input type="hidden" name="sec_token" value="'.$stok.'">';
echo "<input type=\"hidden\" name=\"unsubscribe\" value=\"".$course['code']."\" />";
echo "<input type=\"image\" name=\"unsub\" src=\"../img/delete.gif\" alt=\"".get_lang("_unsubscribe")."\" /></form>";
}
else
{display_info_text(get_lang("UnsubscribeNotAllowed"));}
echo '<input type="image" name="unsub" style="border-color:#fff" src="../img/delete.gif" title="'.get_lang("_unsubscribe").'" alt="'.get_lang("_unsubscribe").'" /></form>';
} else {
display_info_text(get_lang("UnsubscribeNotAllowed"));}
}
else
{

@ -491,18 +491,23 @@ if (!empty($_POST["language_list"])) {
$user_language = str_replace("index.php?language=","",$_POST["language_list"]);
}
// Include all files (first english and then current interface language)
$langpath = api_get_path(SYS_CODE_PATH).'lang/';
/* This will only work if we are in the page to edit a sub_language */
if (api_get_self() == '/main/admin/sub_language.php' || api_get_self() == '/main/admin/sub_language_ajax.inc.php' ) {
require_once '../admin/sub_language.class.php';
// getting the arrays of files to load i.e notification, trad4all, etc
// getting the arrays of files i.e notification, trad4all, etc
$language_files_to_load = SubLanguageManager::get_all_data_of_dokeos_folder(api_get_path(SYS_LANG_PATH).'english',true);
//getting parent info
$parent_language = SubLanguageManager::get_all_information_of_language(intval($_REQUEST['id']));
//getting sub language info
$sub_language = SubLanguageManager::get_all_information_of_language(intval($_REQUEST['sub_language_id']));
$langpath = api_get_path(SYS_CODE_PATH).'lang/';
//echo '<pre>';
$english_language_array = $parent_language_array= $sub_language_array=array();
foreach ($language_files_to_load as $language_file_item) {
$lang_list_pre = array_keys($GLOBALS);
include $langpath.'english/'.$language_file_item.'.inc.php'; //loading english
@ -513,7 +518,7 @@ if (api_get_self() == '/main/admin/sub_language.php' || api_get_self() == '/main
// ------ english language array
$english_language_array[$language_file_item]= compact($lang_list_result);
//cleaning the $GLOBALS
//cleaning the variables
foreach($lang_list_result as $item) {
unset(${$item});
}
@ -524,7 +529,7 @@ if (api_get_self() == '/main/admin/sub_language.php' || api_get_self() == '/main
// ------ parent language array
$parent_language_array[$language_file_item]= compact($lang_list_result);
//cleaning the $GLOBALS
//cleaning the variables
foreach($lang_list_result as $item) {
unset(${$item});
}
@ -534,7 +539,7 @@ if (api_get_self() == '/main/admin/sub_language.php' || api_get_self() == '/main
// ------ sub language array
$sub_language_array[$language_file_item]= compact($lang_list_result);
//cleaning the $GLOBALS
//cleaning the variables
foreach($lang_list_result as $item) {
unset(${$item});
}
@ -609,8 +614,7 @@ if( isset($language_file) )
$language_files = array_merge($language_files,$language_file);
}
}
// Include all files (first english and then current interface language)
$langpath = api_get_path(SYS_CODE_PATH).'lang/';
if (is_array($language_files)) {
if (api_get_setting('allow_use_sub_language')=='true') {

@ -1940,7 +1940,9 @@ function fill_Db_course($courseDbName, $courseRepository, $language,$default_doc
$prenom = $_user['firstName'];
include (api_get_path(SYS_CODE_PATH) . "lang/english/create_course.inc.php");
include (api_get_path(SYS_CODE_PATH) . "lang/".$language . "/create_course.inc.php");
$file_to_include = "lang/".$language . "/create_course.inc.php";
if (file_exists($file_to_include))
include (api_get_path(SYS_CODE_PATH) . $file_to_include);
mysql_select_db("$courseDbName");

Loading…
Cancel
Save