Browse Source

Minnor cleaning file

Julio Montoya 12 years ago
parent
commit
c309b38d57
1 changed files with 27 additions and 41 deletions
  1. 27 41
      plugin/dashboard/block_teacher/block_teacher.class.php

+ 27 - 41
plugin/dashboard/block_teacher/block_teacher.class.php

@@ -70,48 +70,39 @@ class BlockTeacher extends Block {
 			$teacher_content_html = $this->get_teachers_content_html_for_drh();
 		//}
 		
-		$html = '        		
-			            <li class="widget color-blue" id="intro">
-			                <div class="widget-head">
-			                    <h3>'.get_lang('TeachersInformationsList').'</h3>
-			                    <div class="widget-actions"><a onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">'.Display::return_icon('close.gif',get_lang('Close')).'</a></div>
-			                </div>
-			                <div class="widget-content">
-								'.$teacher_content_html.'
-			                </div>
-			            </li>		            			    
-				'; 
+		$html = '<li class="widget color-blue" id="intro">
+                    <div class="widget-head">
+                        <h3>'.get_lang('TeachersInformationsList').'</h3>
+                        <div class="widget-actions"><a onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">'.Display::return_icon('close.gif',get_lang('Close')).'</a></div>
+                    </div>
+                    <div class="widget-content">
+                        '.$teacher_content_html.'
+                    </div>
+                </li>';
     	
     	$data['column'] = $column;
     	$data['content_html'] = $html;
-    	    	    	    	
-    	return $data;    	    	
-    	
+    	return $data;    	
     }
     
     /**
  	 * This method return a content html, it's used inside get_block method for showing it inside dashboard interface
  	 * @return string  content html
  	 */
-    public function get_teachers_content_html_for_platform_admin() {
- 	
-	 	$teachers = $this->teachers;
-		$content = ''; 		
+    public function get_teachers_content_html_for_platform_admin() {	 	
 		$content = '<div style="margin:10px;">';
-		$content .= '<h3><font color="#000">'.get_lang('YourTeachers').'</font></h3>';
-		 		
-		if (count($teachers) > 0) {
-	 		$teachers_table = '<table class="data_table" width:"95%">'; 		
-	 		$teachers_table .= '
-								<tr>		
+		$content .= '<h3><font color="#000">'.get_lang('YourTeachers').'</font></h3>';		 		
+		if (count($this->teachers) > 0) {
+	 		$teachers_table = '<table class="data_table">';
+	 		$teachers_table .= '<tr>		
 									<th>'.get_lang('User').'</th>
-									<th>'.get_lang('TimeSpentOnThePlatform').'</th>					
+									<th>'.get_lang('TimeSpentOnThePlatform').'</th>			
 									<th>'.get_lang('LastConnexion').'</th>													
 								</tr>								
 							';
 	 		
 	 		$i = 1;
-	 		foreach ($teachers as $teacher) {
+	 		foreach ($this->teachers as $teacher) {
 	 			
 	 			$teacher_id = $teacher['user_id'];
 	 			$firstname 	= $teacher['firstname'];
@@ -121,34 +112,29 @@ class BlockTeacher extends Block {
 	 			$time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id));
 	 			$last_connection = Tracking :: get_last_connection_date($teacher_id);	 			
 				
-				if ($i%2 == 0) $class_tr = 'row_odd';
-			    else $class_tr = 'row_even';
-			    		
-				$teachers_table .= '
-									<tr class="'.$class_tr.'">		
+				if ($i%2 == 0) {
+                    $class_tr = 'row_odd';
+                } else {
+                    $class_tr = 'row_even';
+                }			    		
+				$teachers_table .= '<tr class="'.$class_tr.'">		
 										<td>'.api_get_person_name($firstname,$lastname).' ('.$username.')</td>
 										<td align="right">'.$time_on_platform.'</td>					
 										<td align="right">'.$last_connection.'</td>															
-									</tr>								
-									';				
+									</tr>';				
 	 			$i++;
 	 		}
 	 		$teachers_table .= '</table>';
 		} else {
 			$teachers_table .= get_lang('ThereIsNoInformationAboutYourTeachers');
 		}
-	 	
-	 	
 	 	$content .= $teachers_table;
  		
- 		if (count($teachers) > 0) {
+ 		if (count($this->teachers) > 0) {
 			$content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=admin">'.get_lang('SeeMore').'</a></div>';
 		}
-
-		$content .= '</div>';	
- 	
- 		return $content;
- 	
+		$content .= '</div>';
+ 		return $content; 	
 	}
 	
 	public function get_teachers_content_html_for_drh() {