Julio Montoya 10 лет назад
Родитель
Сommit
b07512dc75
2 измененных файлов с 31 добавлено и 20 удалено
  1. 15 16
      main/admin/user_information.php
  2. 16 4
      main/inc/lib/display.lib.php

+ 15 - 16
main/admin/user_information.php

@@ -5,9 +5,7 @@
  * @author Bart Mollet
  * @package chamilo.admin
  */
-/**
- * INIT SECTION
- */
+
 // name of the language file that needs to be included
 $language_file = 'admin';
 $cidReset = true;
@@ -84,7 +82,7 @@ $onclick = $window_name."=window.open('".$fullurl."','".$window_name
     ."resizable=no,width=".$width.",height=".$height.",left=200,top=20');"
     ." return false;";
 echo '<a href="javascript: void(0);" onclick="'.$onclick.'" >'
-    .'<img src="'.$fullurl.'" '.$resizing.' alt="'.$alt.'"/></a><br />';
+    .'<img src="'.$fullurl.'" '.$resizing.' /></a><br />';
 echo '<p>'.($user['status'] == 1 ? get_lang('Teacher') : get_lang('Student'))
     .'</p>';
 echo '<p>'.Display :: encrypted_mailto_link($user['mail'], $user['mail']).'</p>';
@@ -166,16 +164,17 @@ if (count($sessions) > 0) {
             array($session_item['date_start'], $session_item['date_end'])
         );
         echo Display::page_subheader(
-            '<a href="'.api_get_path(WEB_CODE_PATH).'admin/resume_session.php?id_session='.$id_session.'">'.$session_item['session_name'].'</a>',
+            '<a href="'.api_get_path(WEB_CODE_PATH).'admin/resume_session.php?id_session='.$id_session.'">'.
+            $session_item['session_name'].'</a>',
             ' '.implode(' - ', $dates)
         );
 
         Display :: display_sortable_table(
             $header,
             $data,
-            array (),
             array(),
-            array ('user_id' => intval($_GET['user_id']))
+            array(),
+            array('user_id' => intval($_GET['user_id']))
         );
     }
 } else {
@@ -191,11 +190,11 @@ $sql = 'SELECT * FROM '.$table_course_user.' cu, '.$table_course.' c'.
     ' AND cu.relation_type <> '.COURSE_RELATION_TYPE_RRHH.' ';
 $res = Database::query($sql);
 if (Database::num_rows($res) > 0) {
-    $header=array();
-    $header[] = array (get_lang('Code'), true);
-    $header[] = array (get_lang('Title'), true);
-    $header[] = array (get_lang('Status'), true);
-    $header[] = array ('', false);
+    $header = array();
+    $header[] = array(get_lang('Code'), true);
+    $header[] = array(get_lang('Title'), true);
+    $header[] = array(get_lang('Status'), true);
+    $header[] = array('', false);
     $data = array ();
     while ($course = Database::fetch_object($res)) {
         $row = array ();
@@ -229,7 +228,7 @@ if (api_is_multiple_url_enabled()) {
     $url_list= UrlManager::get_access_url_from_user($user['user_id']);
     if (count($url_list) > 0) {
         $header = array();
-        $header[] = array ('URL', true);
+        $header[] = array('URL', true);
         $data = array ();
         foreach ($url_list as $url) {
             $row = array();
@@ -240,9 +239,9 @@ if (api_is_multiple_url_enabled()) {
         Display :: display_sortable_table(
             $header,
             $data,
-            array (),
-            array (),
-            array ('user_id' => intval($_GET['user_id']))
+            array(),
+            array(),
+            array('user_id' => intval($_GET['user_id']))
         );
     } else {
         echo '<p>'.get_lang('NoUrlForThisUser').'</p>';

+ 16 - 4
main/inc/lib/display.lib.php

@@ -200,20 +200,32 @@ class Display
      * @param string The style that the table will show. You can set 'table' or 'grid'
      * @author bart.mollet@hogent.be
      */
-    public static function display_sortable_table($header, $content, $sorting_options = array(), $paging_options = array(), $query_vars = null, $form_actions = array(), $style = 'table') {
+    public static function display_sortable_table(
+        $header,
+        $content,
+        $sorting_options = array(),
+        $paging_options = array(),
+        $query_vars = null,
+        $form_actions = array(),
+        $style = 'table'
+    ) {
         global $origin;
         $column = isset($sorting_options['column']) ? $sorting_options['column'] : 0;
         $default_items_per_page = isset($paging_options['per_page']) ? $paging_options['per_page'] : 20;
-
         $table = new SortableTableFromArray($content, $column, $default_items_per_page);
-
         if (is_array($query_vars)) {
             $table->set_additional_parameters($query_vars);
         }
         if ($style == 'table') {
             if (is_array($header) && count($header) > 0) {
                 foreach ($header as $index => $header_item) {
-                    $table->set_header($index, $header_item[0], $header_item[1], $header_item[2], $header_item[3]);
+                    $table->set_header(
+                        $index,
+                        $header_item[0],
+                        $header_item[1],
+                        isset($header_item[2]) ? $header_item[2] : null,
+                        isset($header_item[3]) ? $header_item[3] : null
+                    );
                 }
             }
             $table->set_form_actions($form_actions);