Juan Carlos Raña 14 years ago
parent
commit
5e4500f5f3

+ 13 - 13
main/admin/sub_language.class.php

@@ -1,22 +1,19 @@
-<?php
-/* For licensing terms, see /license.txt */
+<?php /* For licensing terms, see /license.txt */
 /**
-==================================================================================
-	@author Isaac flores paz <florespaz@bidsoftperu.com> - Added 9 july of 2009
-==================================================================================
-*/
-/*
-==============================================================================
-		Class SubLanguageManager
-==============================================================================
-*/
+ * SubLanguageManager class definition file
+ * @package chamilo.admin.sublanguage 
+ */
+/**
+ * SubLanguageManager class manages the edition
+ * @class SubLanguageManager
+ */
 class SubLanguageManager {
 
     private function __construct() {
     	//void
     }
     /**
-     * Get all data of lang folder (forum.inc.php,gradebook.inc.php,notebook.inc.php)
+     * Get all files of lang folder (forum.inc.php,gradebook.inc.php,notebook.inc.php)
      * @param String The lang path folder  (/var/www/my_lms/main/lang/spanish)
      * @param bool true if we only want the "subname" trad4all instead of  trad4all.inc.php
      * @return Array All file of lang folder
@@ -79,7 +76,7 @@ class SubLanguageManager {
      * @param String The chamilo path file (/var/www/chamilo/main/lang/spanish/gradebook.inc.php)
      * @return Array Contains all information of chamilo file
      */
-   public static function get_all_language_variable_in_file ($system_path_file) {
+   public static function get_all_language_variable_in_file ($system_path_file,$get_as_string_index=false) {
    		$res_list = array();
    		if (!is_readable($system_path_file)) {
    			return $res_list;
@@ -89,6 +86,9 @@ class SubLanguageManager {
 	        if (substr($line,0,1)!='$') { continue; }
 	    	list($var,$val) = split('=',$line,2);
 	        $var = trim($var); $val = trim($val);
+            if ($get_as_string_index) { //remove the prefix $
+            	$var = substr($var,1);
+            }
 	        $res_list[$var] = $val;
 	    }
         return $res_list;

+ 3 - 3
main/admin/system_announcements.php

@@ -234,9 +234,9 @@ if ($show_announcement_list) {
         $row[] = $announcement->title;        
         $row[] = api_convert_and_format_date($announcement->date_start);
         $row[] = api_convert_and_format_date($announcement->date_end);
-        $row[] = "<a href=\"?id=".$announcement->id."&amp;person=".VISIBLE_TEACHER."&amp;action=". ($announcement->visible_teacher ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_teacher  ? 'visible.gif' : 'invisible.gif'), get_lang('show_hide'))."</a>";
-        $row[] = "<a href=\"?id=".$announcement->id."&amp;person=".VISIBLE_STUDENT."&amp;action=". ($announcement->visible_student  ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student  ? 'visible.gif' : 'invisible.gif'), get_lang('show_hide'))."</a>";
-        $row[] = "<a href=\"?id=".$announcement->id."&amp;person=".VISIBLE_GUEST."&amp;action=". ($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest  ? 'visible.gif' : 'invisible.gif'), get_lang('show_hide'))."</a>";
+        $row[] = "<a href=\"?id=".$announcement->id."&amp;person=".VISIBLE_TEACHER."&amp;action=". ($announcement->visible_teacher ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_teacher  ? 'visible.gif' : 'invisible.gif'), get_lang('ShowOrHide'))."</a>";
+        $row[] = "<a href=\"?id=".$announcement->id."&amp;person=".VISIBLE_STUDENT."&amp;action=". ($announcement->visible_student  ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student  ? 'visible.gif' : 'invisible.gif'), get_lang('ShowOrHide'))."</a>";
+        $row[] = "<a href=\"?id=".$announcement->id."&amp;person=".VISIBLE_GUEST."&amp;action=". ($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest  ? 'visible.gif' : 'invisible.gif'), get_lang('ShowOrHide'))."</a>";
         
         $row[] = $announcement->lang;
         $row[] = "<a href=\"?action=edit&id=".$announcement->id."\">".Display::return_icon('edit.png', get_lang('Edit'), array(), 22)."</a> <a href=\"?action=delete&id=".$announcement->id."\"  onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."')) return false;\">".Display::return_icon('delete.png', get_lang('Delete'), array(), 22)."</a>";

+ 77 - 0
main/cron/lang/list_undefined_langvars.php

@@ -0,0 +1,77 @@
+<?php /* For licensing terms, see /license.txt */
+/**
+ * Cron script to list used, but undefined, language variables
+ * @package chamilo.cron
+ */
+/**
+ * Includes and declarations
+ */
+if (PHP_SAPI!='cli') { die('Run this script through the command line or comment this line in the code'); }
+require_once '../../inc/global.inc.php';
+require_once api_get_path(SYS_CODE_PATH).'admin/sub_language.class.php';
+$path = api_get_path(SYS_LANG_PATH).'english';
+ini_set('memory_limit','128M');
+/**
+ * Main code
+ */
+$terms = array();
+$list = SubLanguageManager::get_lang_folder_files_list($path);
+foreach ($list as $entry) {
+    $file = $path.'/'.$entry;
+    if (is_file($file)) {
+        $terms = array_merge($terms,SubLanguageManager::get_all_language_variable_in_file($file,true));
+	}
+}
+// get only the array keys (the language variables defined in language files)
+$defined_terms = array_flip(array_keys($terms));
+$terms = null;
+
+// now get all terms found in all PHP files of Chamilo (this takes some time and memory)
+$undefined_terms = array();
+$l = strlen(api_get_path(SYS_PATH));
+$files = get_all_php_files(api_get_path(SYS_PATH));
+foreach ($files as $file) {
+    //echo 'Analyzing '.$file."<br />";
+    $shortfile = substr($file,$l);
+	$lines = file($file);
+    foreach ($lines as $line) {
+    	$myterms = array();
+        $res = preg_match_all('/get_lang\(\'(\\w*)\'\)/',$line,$myterms);
+        if ($res > 0) {
+            foreach($myterms[1] as $term) {
+                if (!isset($defined_terms[$term]) && !isset($defined_terms['lang'.$term])) {
+                	$undefined_terms[$term] = $shortfile;
+                    //echo "Undefined: $term<br />";
+                }
+            }
+        }
+    }
+    flush();
+}
+//$undefined_terms = array_flip($undefined_terms);
+if (count($undefined_terms)<1) { die("No missing terms<br />\n"); } else { echo "The following terms were nowhere to be found: <br />\n<table>"; }
+foreach ($undefined_terms as $term => $file) {
+	echo "<tr><td>$term</td><td>in $file</td></tr>\n";
+}
+echo "</table>\n";
+
+
+function get_all_php_files($base_path) {
+    $list = scandir($base_path);
+    $files = array();
+    foreach ($list as $item) {
+    	if (substr($item,0,1)=='.') {continue;}
+        $special_dirs = array(api_get_path(SYS_TEST_PATH),api_get_path(SYS_COURSE_PATH),api_get_path(SYS_LANG_PATH),api_get_path(SYS_ARCHIVE_PATH));
+        if (in_array($base_path.$item.'/',$special_dirs)) {continue;}
+        if (is_dir($base_path.$item)) {
+        	$files = array_merge($files,get_all_php_files($base_path.$item.'/'));
+        } else {
+            //only analyse php files
+        	if (substr($item,-4) == '.php') {
+                $files[] = $base_path.$item;
+        	}
+        } 
+    }
+    $list = null;
+    return $files;
+}

+ 1 - 1
main/css/baby_orange/default.css

@@ -1579,7 +1579,7 @@ div.system_announcement {
 .menusectioncaption {
 	position: relative;
 	top: -9px;
-	background-color: #E5EDF9;
+	/* background-color: #E5EDF9; */
 	font-size: 12px;
 	padding: 0 8px 0 4px;
 }

+ 16 - 10
main/css/base.css

@@ -181,21 +181,21 @@ input.maininput:focus {
     width:95px;
     height:95px;
     float:left;
-    -moz-border-radius-topleft:4px;
-    -moz-border-radius-topright:4px;
-    -webkit-border-top-left-radius: 4px;
-    -webkit-border-top-right-radius: 4px;
-    border-top-left-radius: 4px;
-    border-top-right-radius: 4px;
+	overflow:hidden;
+	
+	border-radius:4px;
+    -moz-border-radius:4px;
+    -webkit-border-radius:4px;
+    
+	box-shadow:0 -1px 5px 2px #CCCCCC;
     -moz-box-shadow:0 -1px 5px 2px #CCCCCC;
     -Webkit-box-shadow: 0 -1px 5px 2px  #CCCCCC;
     box-shadow: 0 -1px 5px 2px #CCCCCC;
     margin-left: 8px;
 }
 
-.categories-course-picture img {
-    width: 95px;
-    height: 95px;
+.categories-course-picture img {    
+    height: 95px;	    
     background-color: #eeeeee;
 }
 
@@ -607,4 +607,10 @@ button:hover {
 #menu {
     margin-top: 8px;
 	margin-bottom: 10px;
-}
+}
+
+.social-background-content {
+    margin-left: -15px;
+	width:auto;	
+}
+

+ 27 - 0
main/css/base_classic.css

@@ -0,0 +1,27 @@
+/*
+ * CSS that only will be called in classic chamilo themes (everything except the chamilo_XXX themes)
+ */
+ 
+#Header2Right ul {
+	 /*width: 80% */
+}
+
+#header2 {
+    min-height: 15px;
+} 
+
+#header3 {
+    width: 100%;	
+	padding-left:0px;
+    padding-right:0px;  
+	float:left;
+}
+
+#header4 {
+    width: 100%;
+	float:left;
+	color:#aaa;	
+	padding-left:0px;
+    padding-right:0px;	
+}
+

+ 1 - 1
main/css/public_admin/default.css

@@ -488,7 +488,7 @@ select, input[type=checkbox], input[type=radio], input[type=button], input[type=
     PADDING-RIGHT: 15px;
     DISPLAY: block;
     PADDING-LEFT: 6px;
-    BACKGROUND:  url(images/tab_right.gif) no-repeat right top;
+    /* BACKGROUND:  url(images/tab_right.gif) no-repeat right top; */
     PADDING-BOTTOM: 0px;
     COLOR: #fff;
     PADDING-TOP: 5px;

+ 1 - 1
main/dashboard/index.php

@@ -39,7 +39,7 @@ $dashboar_plugin_styles = DashboardManager::get_links_for_styles_from_dashboard_
 $htmlHeadXtra[] = $dashboar_plugin_styles;
 
 // interbreadcrumb
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('Dashboard'));
+//$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('Dashboard'));
 
 // course description controller object
 $dashboard_controller = new DashboardController();

+ 1 - 1
main/dropbox/dropbox_functions.inc.php

@@ -795,7 +795,7 @@ function store_add_dropbox() {
 	// we are doing a just upload but an additional recipient is selected.
 	// note: why can't this be valid? It is like sending a document to yourself AND to a different person (I do this quite often with my e-mails)
 	if ($thisIsJustUpload && (count($_POST['recipients']) != 1)) {
-		return get_lang('mailingJustUploadSelectNoOther');
+		return get_lang('MailingJustUploadSelectNoOther');
 	}
 
 	if (empty($_FILES['file']['name'])) {

+ 1 - 1
main/exercice/exercice_submit.php

@@ -653,7 +653,7 @@ if ($objExercise->type == ONE_PER_PAGE) {
   	if (empty($exercise_stat_info)) {
         $total_weight = 0; 	    
   	    foreach($questionList as $question_id) {
-  	        $objQuestionTmp = Question::read($questionId);  	        
+  	        $objQuestionTmp = Question::read($question_id);  	        
   	        $total_weight += floatval($objQuestionTmp->weighting);
   	    }
   		$objExercise->save_stat_track_exercise_info($clock_expired_time, $safe_lp_id, $safe_lp_item_id, $safe_lp_item_view_id, $questionList, $total_weight);

+ 45 - 58
main/exercice/question_pool.php

@@ -21,7 +21,6 @@ require_once '../inc/global.inc.php';
 require_once api_get_path(LIBRARY_PATH).'course.lib.php';
 require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
 
-
 $this_section=SECTION_COURSES;
 
 $is_allowedToEdit=api_is_allowed_to_edit(null,true);
@@ -48,7 +47,6 @@ $page = 0;
 if(!empty($_GET['page'])){
 	$page = intval($_GET['page']);
 }
-
 $copy_question = 0;
 if(!empty($_GET['copy_question'])){
 	$copy_question = intval($_GET['copy_question']);
@@ -67,19 +65,19 @@ $selected_course = intval($_GET['selected_course']);
 $limitQuestPage=50;
 
 // document path
-$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
+$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
 // picture path
-$picturePath=$documentPath.'/images';
-
+$picturePath = $documentPath.'/images';
 
 if(!($objExcercise instanceOf Exercise) && !empty($fromExercise)) {
     $objExercise = new Exercise();    
     $objExercise->read($fromExercise);
 }
-if(!($objExcercise instanceOf Exercise) && !empty($exerciseId)) {
-    $objExercise = new Exercise();
-    $objExercise->read($exerciseId);
-}
+
+$nameTools = get_lang('QuestionPool');
+$interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
+$interbreadcrumb[]=array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->exercise);
+
 
 if ($is_allowedToEdit) {
 	
@@ -89,7 +87,7 @@ if ($is_allowedToEdit) {
         $origin_course_id   = intval($_GET['course_id']);
         $origin_course_info = api_get_course_info_by_id($origin_course_id);
         $current_course     = api_get_course_info();     
-        $old_question_id = $copy_question;       
+        $old_question_id    = $copy_question;       
         
         //Reading the source question
 		$old_question_obj = Question::read($old_question_id, $origin_course_id);
@@ -113,7 +111,7 @@ if ($is_allowedToEdit) {
 		unset($new_question_obj);
 		unset($old_question_obj);
 
-        if(!$objExcercise instanceOf Exercise) {
+        if (!$objExcercise instanceOf Exercise) {
         	$objExercise = new Exercise();
             $objExercise->read($fromExercise);
         }
@@ -150,7 +148,7 @@ if ($is_allowedToEdit) {
 		// destruction of the Question object
 		unset($objQuestionTmp);
 
-        if(!$objExcercise instanceOf Exercise) {
+        if (!$objExcercise instanceOf Exercise) {
         	$objExercise = new Exercise();
             $objExercise->read($fromExercise);
         }
@@ -191,8 +189,8 @@ if (!empty($gradebook) && $gradebook=='view') {
 	$interbreadcrumb[]= array ('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('ToolGradebook'));
 }
 
-$nameTools=get_lang('QuestionPool');
-$interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
+
+
 // if admin of course
 if (!$is_allowedToEdit) {
     api_not_allowed(true);
@@ -443,8 +441,7 @@ if ($exerciseId > 0) {
                     }                    
                 }
             }           	
-        }    
-      
+        }      
     } else {
         //By default
     	$sql="SELECT qu.id, question, qu.type, level, q.session_id FROM $TBL_QUESTIONS as qu, $TBL_EXERCICE_QUESTION as qt, $TBL_EXERCICES as q
@@ -453,8 +450,7 @@ if ($exerciseId > 0) {
 	// forces the value to 0
 	$exerciseId=0;
 }
-$result=Database::query($sql);
-$nbrQuestions=count($main_question_list);
+$nbrQuestions = count($main_question_list);
 
 echo '<tr>',
   '<td colspan="',($fromExercise?4:4),'">',
@@ -508,19 +504,11 @@ $i=1;
 $session_id  = api_get_session_id();
 if (!empty($main_question_list))
 foreach ($main_question_list as $row) {
-    
-	
 	// if we come from the exercise administration to get a question,
     // don't show the questions already used by that exercise
 
-    /*if (!$fromExercise) {echo '1'; }
-    if (!isset($objExercise)){echo '2';}
-    if (!($objExercise instanceOf Exercise)){echo '3';}
-    if (!$objExercise->isInList($row['id'])) {echo '4';}
-    */
-
     // original recipe -
-  //if (!$fromExercise || !isset($objExercise) || !($objExercise instanceOf Exercise) || (!$objExercise->isInList($row['id'])))
+    //if (!$fromExercise || !isset($objExercise) || !($objExercise instanceOf Exercise) || (!$objExercise->isInList($row['id'])))
 	if (!$fromExercise || !isset($objExercise) || !($objExercise instanceOf Exercise) || (is_array($objExercise->questionList)) ) {
         echo '<tr ',($i%2==0?'class="row_odd"':'class="row_even"'),'>';
         if (api_get_session_id() == 0 ){
@@ -535,39 +523,38 @@ foreach ($main_question_list as $row) {
                 '<a href="',api_get_self(),'?',api_get_cidreq(),'&exerciseId=',$exerciseId,'&delete=',$row['id'],'" onclick="javascript:if(!confirm(\'',addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)),'\')) return false;"><img src="../img/delete.gif" border="0" alt="',get_lang('Delete'),'"></a>';
                 //'<a href="',api_get_self(),'?',api_get_cidreq(),'&exerciseId=',$exerciseId,'&delete=',$row['id'],'" onclick="javascript:if(!confirm(\'',addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)),'\')) return false;"><img src="../img/delete.gif" border="0" alt="',get_lang('Delete'),'"></a>';
 		} else {
-				echo $row['level'],'</td>',
-					 '<td align="center">';
-				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;copy_question='.$row['id'].'&course_id='.$selected_course.'&fromExercise=',$fromExercise,'">';                
-                echo ' '.Display::return_icon('cd.gif', get_lang('ReUseACopyInCurrentTest'));
-                echo '</a> ';
-				if ($row['session_id'] == $session_id) {
-				    if ($selected_course == api_get_course_int_id()) {
-					    echo '<a href="',api_get_self(),'?',api_get_cidreq(),'&recup=',$row['id'],'&fromExercise=',$fromExercise,'"><img src="../img/view_more_stats.gif" border="0" title="'.get_lang('InsertALinkToThisQuestionInTheExercise').'" alt="'.get_lang('InsertALinkToThisQuestionInTheExercise').'"></a>';
-				    }
-				}                							
-				
+			echo $row['level'],'</td>',
+				 '<td align="center">';
+			echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;copy_question='.$row['id'].'&course_id='.$selected_course.'&fromExercise=',$fromExercise,'">';                
+            echo ' '.Display::return_icon('cd.gif', get_lang('ReUseACopyInCurrentTest'));
+            echo '</a> ';
+			if ($row['session_id'] == $session_id) {
+			    if ($selected_course == api_get_course_int_id()) {
+				    echo '<a href="',api_get_self(),'?',api_get_cidreq(),'&recup=',$row['id'],'&fromExercise=',$fromExercise,'"><img src="../img/view_more_stats.gif" border="0" title="'.get_lang('InsertALinkToThisQuestionInTheExercise').'" alt="'.get_lang('InsertALinkToThisQuestionInTheExercise').'"></a>';
+			    }
 			}
-            echo '</td>';
-            echo '</tr>';
+		}
+        echo '</td>';
+        echo '</tr>';
 
-			// skips the last question, that is only used to know if we have or not to create a link "Next page"
-			if($i == $limitQuestPage) {
-				break;
-			}
-			$i++;
+		// skips the last question, that is only used to know if we have or not to create a link "Next page"
+		if($i == $limitQuestPage) {
+			break;
 		}
+		$i++;
 	}
+}
 
-	if (!$nbrQuestions) {
-        echo '<tr>',
-            '<td colspan="',($fromExercise?4:4),'">',get_lang('NoQuestion'),'</td>',
-            '</tr>';
-	}
-    echo '</table>';
-    
-    if (api_get_session_id() == 0 ){
-    	echo '<div style="width:100%; border-top:1px dotted #4171B5;">
-    		  <button class="save" type="submit">'.get_lang('Reuse').'</button>
-    	  	</div></form>';
-    }
-	Display::display_footer();
+if (!$nbrQuestions) {
+    echo '<tr>',
+        '<td colspan="',($fromExercise?4:4),'">',get_lang('NoQuestion'),'</td>',
+        '</tr>';
+}
+echo '</table>';
+
+if (api_get_session_id() == 0 ){
+	echo '<div style="width:100%; border-top:1px dotted #4171B5;">
+		  <button class="save" type="submit">'.get_lang('Reuse').'</button>
+	  	</div></form>';
+}
+Display::display_footer();

+ 6 - 6
main/inc/banner.inc.php

@@ -14,9 +14,7 @@ require_once api_get_path(LIBRARY_PATH).'banner.lib.php';
 $session_id     = api_get_session_id();
 $session_name   = api_get_session_name($my_session_id);
 echo '<div id="wrapper">';
-?>
-<ul id="navigation">
-<?php  
+echo '<ul id="navigation">';
 if (!empty($help)) { 
 ?>
     <li class="help"><a href="<?php echo api_get_path(WEB_CODE_PATH); ?>help/help.php?open=Home&height=400&width=600" class="thickbox" title="<?php echo get_lang('Help'); ?>"><img src="<?php echo api_get_path(WEB_IMG_PATH);?>help.large.png" alt="<?php echo get_lang('Help');?>" title="<?php echo get_lang('Help');?>" /></a> </li>
@@ -24,11 +22,13 @@ if (!empty($help)) {
 }
 if (api_get_setting('show_link_bug_notification') == 'true') { 
 ?>
-    <li class="report"><a href="http://support.chamilo.org/projects/chamilo-18/wiki/How_to_report_bugs" target="_blank"><img src="<?php echo api_get_path(WEB_IMG_PATH) ?>bug.large.png" style="vertical-align: middle;" alt="<?php echo get_lang('ReportABug') ?>" title="<?php echo get_lang('ReportABug');?>"/></a></li>
-    </ul>
+    <li class="report">
+        <a href="http://support.chamilo.org/projects/chamilo-18/wiki/How_to_report_bugs" target="_blank">
+        <img src="<?php echo api_get_path(WEB_IMG_PATH) ?>bug.large.png" style="vertical-align: middle;" alt="<?php echo get_lang('ReportABug') ?>" title="<?php echo get_lang('ReportABug');?>"/></a>
+    </li>
 <?php
 }
-
+echo'</ul>';
 echo '<div id="header">';
 
 show_header_1($language_file, $nameTools);

+ 2 - 0
main/inc/header.inc.php

@@ -104,6 +104,8 @@ echo '@import "'.api_get_path(WEB_CSS_PATH).'base.css";';
 //Global chamilo CSS
 if (in_array(api_get_visual_theme(), array('chamilo','chamilo_red','chamilo_blue','chamilo_orange','chamilo_green','chamilo_electric_blue'))) {
     echo '@import "'.api_get_path(WEB_CSS_PATH).'base_chamilo.css";';
+} else {
+    echo '@import "'.api_get_path(WEB_CSS_PATH).'base_classic.css";';
 }
 
 if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {

+ 1 - 1
main/inc/lib/career.lib.php

@@ -81,7 +81,7 @@ class Career extends Model {
 		
         $form = new FormValidator('career', 'post', $url);
         // Settting the form elements
-        $header = get_lang('add');
+        $header = get_lang('Add');
         if ($action == 'edit') {
             $header = get_lang('Modify');
         }

+ 1 - 1
main/inc/lib/diagnoser.lib.php

@@ -54,7 +54,7 @@ class Diagnoser
         echo $html;
         $table = new SortableTableFromArray($data, 1, 100);
 
-        $table->set_header(0,get_lang(''), false);
+        $table->set_header(0,'', false);
         $table->set_header(1,get_lang('Section'), false);
         $table->set_header(2,get_lang('Setting'), false);
         $table->set_header(3,get_lang('Current'), false);

+ 8 - 3
main/inc/lib/fileUpload.lib.php

@@ -813,9 +813,12 @@ function filter_extension(&$filename) {
  * @return id if inserted document
  */
 function add_document($_course, $path, $filetype, $filesize, $title, $comment = null, $readonly = 0) {
-	$session_id = api_get_session_id();
-	$readonly = intval($readonly);
-	$comment = Database::escape_string($comment);
+	$session_id    = api_get_session_id();
+	$readonly      = intval($readonly);
+	$comment       = Database::escape_string($comment);
+	$path          = Database::escape_string($path);
+	$filetype      = Database::escape_string($filetype);
+	$filesize      = intval($filesize);
 	
 	$table_document = Database::get_course_table(TABLE_DOCUMENT, $_course['dbName']);
 	$sql = "INSERT INTO $table_document (path, filetype, size, title, comment, readonly, session_id)
@@ -866,6 +869,8 @@ function item_property_update_on_folder($_course, $path, $user_id) {
 	if ($path == '/') {
 		return;
 	}
+	
+	$user_id = intval($user_id);
 
 	// If the given path ends with a / we remove it
 	$endchar = substr($path, strlen($path) - 1, 1);

File diff suppressed because it is too large
+ 526 - 516
main/inc/lib/link.lib.php


+ 1 - 1
main/inc/lib/main_api.lib.php

@@ -1718,7 +1718,7 @@ function api_get_setting($variable, $key = null) {
     global $_setting;
     //return is_null($key) ? (!empty($_setting[$variable]) ? $_setting[$variable] : null) : $_setting[$variable][$key];  does not allow "0" values
     //Allowing "0" values
-    return is_null($key) ? (($_setting[$variable] != '') ? $_setting[$variable] : null) : $_setting[$variable][$key];
+    return is_null($key) ? ((isset($_setting[$variable]) && $_setting[$variable] != '') ? $_setting[$variable] : null) : $_setting[$variable][$key];
 }
 
 /**

+ 2 - 2
main/inc/lib/sessionmanager.lib.php

@@ -465,10 +465,10 @@ class SessionManager {
 				            $access_url_id = api_get_current_access_url_id();
 				            if ($access_url_id != -1 ){
 				            	$url 		= api_get_access_url($access_url_id);
-				            	$emailbody	= get_lang('Dear')." ".stripslashes(api_get_person_name($firstname, $lastname)).",\n\n".get_lang('YouAreRegisterToSession')." : ". $session_name  ." \n\n" .get_lang('Address') ." ". get_setting('siteName') ." ". get_lang('Is') ." : ". $url['url'] ."\n\n". get_lang('Problem'). "\n\n". get_lang('Formula').",\n\n".get_setting('administratorName')." ".get_setting('administratorSurname')."\n". get_lang('Manager'). " ".get_setting('siteName')."\nT. ".get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".get_setting('emailAdministrator');
+				            	$emailbody	= get_lang('Dear')." ".stripslashes(api_get_person_name($firstname, $lastname)).",\n\n".sprintf(get_lang('YouAreRegisterToSessionX'),$session_name)  ." \n\n" .get_lang('Address') ." ". get_setting('siteName') ." ". get_lang('Is') ." : ". $url['url'] ."\n\n". get_lang('Problem'). "\n\n". get_lang('Formula').",\n\n".get_setting('administratorName')." ".get_setting('administratorSurname')."\n". get_lang('Manager'). " ".get_setting('siteName')."\nT. ".get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".get_setting('emailAdministrator');
 				            }
 					    } else {
-					    	$emailbody	= get_lang('Dear')." ".stripslashes(api_get_person_name($firstname, $lastname)).",\n\n".get_lang('YouAreRegisterToSession')." : ". $session_name ." \n\n" .get_lang('Address') ." ". get_setting('siteName') ." ". get_lang('Is') ." : ". $_configuration['root_web'] ."\n\n". get_lang('Problem'). "\n\n". get_lang('Formula').",\n\n".get_setting('administratorName')." ".get_setting('administratorSurname')."\n". get_lang('Manager'). " ".get_setting('siteName')."\nT. ".get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".get_setting('emailAdministrator');
+					    	$emailbody	= get_lang('Dear')." ".stripslashes(api_get_person_name($firstname, $lastname)).",\n\n".sprintf(get_lang('YouAreRegisterToSessionX'),$session_name) ." \n\n" .get_lang('Address') ." ". get_setting('siteName') ." ". get_lang('Is') ." : ". $_configuration['root_web'] ."\n\n". get_lang('Problem'). "\n\n". get_lang('Formula').",\n\n".get_setting('administratorName')." ".get_setting('administratorSurname')."\n". get_lang('Manager'). " ".get_setting('siteName')."\nT. ".get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".get_setting('emailAdministrator');
 					    }
 
 					    @api_send_mail($emailto, $emailsubject, $emailbody, $emailheaders);

+ 1 - 1
main/inc/lib/social.lib.php

@@ -37,7 +37,7 @@ class SocialManager extends UserManager {
 		}
 		$count_list=count($friend_relation_list);
 		if ($count_list==0) {
-			$friend_relation_list[]=get_lang('UnkNow');
+			$friend_relation_list[]=get_lang('Unknown');
 		} else {
 			return $friend_relation_list;
 		}

+ 2 - 2
main/messages/new_message.php

@@ -227,7 +227,7 @@ function manage_form ($default, $select_from_user_list = null) {
 
 		//adding reply mail
 		$user_reply_info = UserManager::get_user_info_by_id($message_reply_info['user_sender_id']);
-		$default['content']='<p></p>'.api_get_person_name($user_reply_info['firstname'],$user_reply_info['lastname']).' '.get_lang('Wrote').' :<i> <br />'.api_html_entity_decode($message_reply_info['content'],ENT_QUOTES,$charset).'</i>';
+		$default['content']='<p></p>'.sprintf(get_lang('XWroteY'),api_get_person_name($user_reply_info['firstname'],$user_reply_info['lastname']), api_html_entity_decode($message_reply_info['content'],ENT_QUOTES,$charset));
 
 	}
 	if (empty($group_id)) {
@@ -403,4 +403,4 @@ echo '<div id="social-content">';
 echo '</div>';
 
 /*		FOOTER */
-Display::display_footer();
+Display::display_footer();

+ 0 - 2
main/mySpace/user_add.php

@@ -63,8 +63,6 @@ if (!empty($_GET['message'])) {
 $id_session='';
 if (isset($_GET["id_session"]) && $_GET["id_session"] != "") {
  	$id_session = Security::remove_XSS($_GET["id_session"]);
-	//$interbreadcrumb[] = array ("url" => "session.php", "name" => get_lang('Sessions'));
-	//$interbreadcrumb[] = array ("url" => "course.php?id_session=".$_GET["id_session"]."", "name" => get_lang('Cours'));
 }
 
 $interbreadcrumb[] = array ('url' => '../admin/index.php', 'name' => get_lang('PlatformAdmin'));

+ 1 - 1
main/newscorm/learnpath_functions.inc.php

@@ -475,7 +475,7 @@ function display_learnpath_chapters($parent_item_id = 0, $tree = array (), $leve
                             $result_items2 = Database::query($sql_items2);
                             $number_items2 = Database::num_rows($result_items2);
                             if ($number_items2 == 0) {
-                                echo get_lang('prereq_deleted_error');
+                                echo get_lang('PrerequisiteDeletedError');
                             }
                             $row_items2 = Database::fetch_array($result_items2);
                             display_addedresource_link_in_learnpath($row_items2['item_type'], $row_items2['ref'], '', $row_items2['id'], 'builder', '', 0);

+ 1 - 1
main/newscorm/resourcelinker.php

@@ -220,7 +220,7 @@ if ($add) {
                     case 'Drop':
                         //$addedresource_item = 'Dropbox';
                         $addedresource_item = TOOL_DROPBOX;
-                        $title = get_lang('dropbox');
+                        $title = get_lang('Dropbox');
                         break;
                     case 'Intro':
                         $addedresource_item = 'Introduction_text';

+ 2 - 2
main/reservation/m_item_origineel.php

@@ -281,7 +281,7 @@ switch ($_GET['action']) {
 			case 'delete' :
 				Rsys :: delete_item_right($_GET['item_id'], $_GET['class_id']);
 				ob_start();
-				Display :: display_normal_message(get_lang('itemRightDeleted'),false);
+				Display :: display_normal_message(get_lang('ItemRightDeleted'),false);
 				$msg = ob_get_contents();
 				ob_end_clean();
 			case 'switch' :
@@ -394,7 +394,7 @@ switch ($_GET['action']) {
 		$msg = ob_get_contents();
 		ob_end_clean();
 	default :
-		$NoSearchResults = get_lang('noItems');
+		$NoSearchResults = get_lang('NoItem');
 		Display :: display_header($tool_name);
 		api_display_tool_title($tool_name);
 

+ 1 - 1
main/reservation/m_reservation.php

@@ -147,7 +147,7 @@ switch ($_GET['action']) {
 		$table->set_header(4, get_lang('SubscribedEndDate'), false);
 		$table->set_header(5, get_lang('Accept'), false, array ('style' => 'width:30px;'));
 		$table->set_header(6, get_lang('Delete'), false, array ('style' => 'width:30px;'));
-		$table->set_form_actions(array ('accept_users' => get_lang('AcceptUsers'), 'unaccept_users' => get_lang('UnacceptedUsers'), 'delete_subscriptions' => get_lang('Delete_subscriptions')), 'accepting');
+		$table->set_form_actions(array ('accept_users' => get_lang('AcceptUsers'), 'unaccept_users' => get_lang('UnacceptedUsers'), 'delete_subscriptions' => get_lang('DeleteSubscriptions')), 'accepting');
 		//$table->set_form_actions(array ('accept_users' => get_lang('AcceptUsers'), 'unaccept_users' => get_lang('UnacceptedUsers')), 'accepting');
 		$table->display();
 		break;

+ 1 - 1
main/resourcelinker/resourcelinker.inc.php

@@ -654,7 +654,7 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
 			}
 			if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; }
 
-			if ($myrow["forum_name"]=='') { $type="Forum"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('step_deleted2')."</span>"; return(true); }
+			if ($myrow["forum_name"]=='') { $type="Forum"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); }
 
 			if ($icon == 'nolink') { return(shorten($myrow["forum_name"],$length)); }
 			if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; }

+ 3 - 3
main/social/groups.php

@@ -135,7 +135,9 @@ if (isset($_GET['view']) && in_array($_GET['view'],$allowed_views)) {
 	}
 } else {
 	$interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
-	$interbreadcrumb[]= array ('url' =>'#','name' => get_lang('GroupList'));
+	if (!isset($_GET['id'])) {
+        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('GroupList'));
+	}
 }
 
 Display :: display_header($tool_name, 'Groups');
@@ -184,7 +186,6 @@ if (isset($_POST['token']) && $_POST['token'] === $_SESSION['sec_token']) {
 				@api_mail_html($recipient_name, $recipient_email, stripslashes($subject), $message, $sender_name, $sender_email);
 			}
 		}
-
 		Security::clear_token();
 	}
 }
@@ -204,7 +205,6 @@ if ($group_id != 0 ) {
 		if (api_get_user_id() == $user_leaved) {
 			GroupPortalManager::delete_user_rel_group($user_leaved, $group_id);
 			$user_leave_message = true;
-
 		}
 	}
 	// add a user to a group if its open

+ 1 - 2
main/social/home.php

@@ -19,7 +19,6 @@ $show_full_profile = true;
 //social tab
 $this_section = SECTION_SOCIAL;
 unset($_SESSION['this_section']);//for hmtl editor repository
-$interbreadcrumb[]= array ('url' => 'home.php','name' => get_lang('Social'));
 
 api_block_anonymous_users();
 //jquery thickbox already called from main/inc/header.inc.php
@@ -65,7 +64,7 @@ if (api_get_setting('profile', 'picture') == 'true') {
 	}
 }
 
-Display :: display_header(get_lang('SocialNetwork'));
+Display :: display_header(get_lang('Social'));
 $user_info = UserManager :: get_user_info_by_id(api_get_user_id());
 $user_online_list = who_is_online(api_get_setting('time_limit_whosonline'),true);
 $user_online_count = count($user_online_list);

+ 4 - 5
main/social/profile.php

@@ -180,7 +180,7 @@ function register_friend(element_input) {
 }
 
 </script>';
-$nametool = get_lang('Social');
+$nametool = get_lang('ViewMySharedProfile');
 if (isset($_GET['shared'])) {
 	$my_link='../social/profile.php';
 	$link_shared='shared='.Security::remove_XSS($_GET['shared']);
@@ -189,18 +189,17 @@ if (isset($_GET['shared'])) {
 	$link_shared='';
 }
 $interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social') );
-$interbreadcrumb[]= array ('url' => 'profile.php?u='.api_get_user_id(), 'name' => get_lang('ViewMySharedProfile'));
 
 if (isset($_GET['u']) && is_numeric($_GET['u']) && $_GET['u'] != api_get_user_id()) {
-	$info_user=api_get_user_info($_GET['u']);
+	$info_user =   api_get_user_info($_GET['u']);
 	$interbreadcrumb[]= array ('url' => '#','name' => api_get_person_name($info_user['firstName'], $info_user['lastName']));
 	$nametool = '';
 }
 if (isset($_GET['u'])) {
 	$param_user='u='.Security::remove_XSS($_GET['u']);
 }else {
-	$info_user=api_get_user_info(api_get_user_id());
-	$param_user='';
+	$info_user = api_get_user_info(api_get_user_id());
+	$param_user = '';
 }
 $_SESSION['social_user_id'] = intval($user_id);
 

+ 2 - 2
main/template/default/auth/courses_categories.php

@@ -135,8 +135,8 @@ $stok = Security::get_token();
                                 <div class="course-block-main-item"><div class="left">'.get_lang('Teacher').'</div><div class="course-block-teacher right">'.$tutor_name.'</div></div>
                                 <div class="course-block-main-item"><div class="left">'.get_lang('CreationDate').'</div><div class="course-block-date">'.api_format_date($creation_date,DATE_FORMAT_SHORT).'</div></div>
                             </div>
-                            <div class="categories-course-picture">
-                                <img src="'.$course_medium_image.'" />
+                            <div class="categories-course-picture"><center>
+                                <img src="'.$course_medium_image.'" /></center>
                             </div>
                             <div class="course-block-popularity"><span>'.get_lang('ConnectionsLastMonth').'</span><div class="course-block-popularity-score">'.$count_connections.'</div></div>';
                 echo '</div>';

+ 1 - 1
main/upload/upload.document.php

@@ -214,7 +214,7 @@ if(api_get_setting('use_document_title')=='true')
 </tr>
 </table>
 
-<input type="submit" value="<?php echo(get_lang('Oki'));?>">
+<input type="submit" value="<?php echo(get_lang('Ok'));?>">
 </form>
 <!-- end upload form -->
 

Some files were not shown because too many files changed in this diff