Dokeos PHP Cross Reference Learning Management Systems

Source: /main/user/userInfo.php - 574 lines - 21129 bytes - Summary - Text - Print

   1  <?php
   2  
   3  /* For licensing terms, see /dokeos_license.txt */
   4  
   5  /**
   6  ==============================================================================
   7  *    @package dokeos.user
   8  *     @todo cleanup the variables and the duplicates of the variables: 
   9  *            $uInfo = $editMainUserInfo = Security::remove_XSS($_REQUEST['editMainUserInfo']) 
  10  *             $currentCourse = $currentCourseID = $courseCode = $currentCourseID = $_course['sysCode'];
  11  ==============================================================================
  12  */
  13  
  14  // name of the language file that needs to be included
  15  $language_file = array ('registration', 'userInfo');
  16  
  17  // including the global Dokeos file
  18  require_once  '../inc/global.inc.php';
  19  
  20  // the section (for the tabs)
  21  $this_section = SECTION_COURSES;
  22  
  23  // including additional libraries
  24  require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  25  require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
  26  require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
  27  
  28  // Additional javascript
  29  $htmlHeadXtra[] = '<script type="text/javascript">
  30  function show_image(image,width,height) {
  31      width = parseInt(width) + 20;
  32      height = parseInt(height) + 20;
  33      window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
  34  }
  35  </script>';
  36  
  37  $editMainUserInfo = Security::remove_XSS($_REQUEST['editMainUserInfo']);
  38  $uInfo = $editMainUserInfo;
  39  
  40  api_protect_course_script(true);
  41  if(api_is_anonymous())
  42  {
  43      api_not_allowed(true);
  44  }
  45  
  46  //prepare variables used in userInfoLib.php functions
  47  $TBL_USERINFO_DEF     = Database :: get_course_table(TABLE_USER_INFO);
  48  $TBL_USERINFO_CONTENT     = Database :: get_course_table(TABLE_USER_INFO_CONTENT);
  49  
  50  // breadcrumbs
  51  $interbreadcrumb[] = array ('url' => 'user.php', 'name' => get_lang('Users'));
  52  
  53  // display the header
  54  Display :: display_header($nameTools, "User");
  55  
  56  // display the tool title
  57  // api_display_tool_title(get_lang("Users"));
  58  
  59  
  60  $currentCourse = $currentCourseID;
  61  
  62  /*
  63   * data  found  in settings  are :
  64   *    $uid
  65   *    $isAdmin
  66   *    $isAdminOfCourse
  67   *    $_configuration['main_database']
  68   *    $currentCourseID
  69   */
  70  
  71  //$userIdViewed = $uInfo; // Id of the user we want to view coming from the user.php
  72  
  73  //get information about one user
  74  $userIdViewed = Security::remove_XSS($_REQUEST['uInfo']);
  75  
  76  /*
  77  -----------------------------------------------------------
  78      Connection layer between Dokeos and the current script
  79  -----------------------------------------------------------
  80  */
  81  
  82  $mainDB = $_configuration['main_database'];
  83  $courseCode = $currentCourseID = $_course['sysCode'];
  84  $tbl_coursUser = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
  85  
  86  $userIdViewer = $_user['user_id']; // id fo the user currently online
  87  //$userIdViewed = $_GET['userIdViewed']; // Id of the user we want to view
  88  
  89  $allowedToEditContent = ($userIdViewer == $userIdViewed) || $is_platformAdmin;
  90  $allowedToEditDef = api_is_allowed_to_edit();
  91  $is_allowedToTrack = api_is_allowed_to_edit() && $_configuration['tracking_enabled'];
  92  
  93  // Library connection
  94  include  ("userInfoLib.php");
  95  
  96  /*
  97  ==============================================================================
  98         FUNCTIONS
  99  ==============================================================================
 100  */
 101  
 102  /*
 103  ==============================================================================
 104         COMMANDS SECTION
 105  ==============================================================================
 106  */
 107  
 108  $displayMode = "viewContentList";
 109  $removeDef =  Security::remove_XSS($_GET['removeDef']);
 110  $editDef = Security::remove_XSS($_GET['editDef']);
 111  $moveUpDef = Security::remove_XSS($_GET['moveUpDef']);
 112  $moveDownDef = Security::remove_XSS($_GET['moveDownDef']);
 113  
 114  if ($allowedToEditDef)
 115  {
 116      if (!empty($_POST['submitDef']))
 117      {
 118          if (!empty($_POST['id']))
 119          {
 120              edit_cat_def($_POST['id'], $_POST['title'], $_POST['comment'], $_POST['nbline']);
 121          }
 122          else
 123          {
 124              create_cat_def($_POST['title'], $_POST['comment'], $_POST['nbline']);
 125          }
 126  
 127          $displayMode = "viewDefList";
 128      }
 129      elseif (!empty($_GET['removeDef']))
 130      {
 131          remove_cat_def($_GET['removeDef'], true);
 132          $displayMode = "viewDefList";
 133      }
 134      elseif (!empty($_GET['editDef']))
 135      {
 136          $displayMode = "viewDefEdit";
 137      }
 138      elseif (!empty ($_POST['addDef']))
 139      {
 140          $displayMode = "viewDefEdit";
 141      }
 142      elseif (!empty($_GET['moveUpDef']))
 143      {
 144          move_cat_rank($_GET['moveUpDef'], "up");
 145          $displayMode = "viewDefList";
 146      }
 147      elseif (!empty($_GET['moveDownDef']))
 148      {
 149          move_cat_rank($_GET['moveDownDef'], "down");
 150          $displayMode = "viewDefList";
 151      }
 152      elseif (!empty($_POST['viewDefList']))
 153      {
 154          $displayMode = "viewDefList";
 155      }
 156      elseif (!empty($_GET['editMainUserInfo']))
 157      {
 158          $userIdViewed = strval(intval($_GET['editMainUserInfo']));
 159          $displayMode = "viewMainInfoEdit";
 160      }
 161      elseif (!empty($_REQUEST['submitMainUserInfo']))
 162      {
 163          /*
 164          if (isset ($_REQUEST['submitMainUserInfo']))
 165          {
 166          */
 167              $userIdViewed = strval(intval($_REQUEST['submitMainUserInfo']));
 168  
 169              if(!empty($_POST['promoteCourseAdmin']) && $_POST['promoteCourseAdmin']){
 170                  $userProperties['status'] = 1;
 171              }else{
 172                  $userProperties['status'] = 5;
 173              }
 174  
 175              if(!empty($_POST['promoteTutor']) && $_POST['promoteTutor']){
 176                  $userProperties['tutor'] = 1;
 177              }else{
 178                  $userProperties['tutor'] = 0;
 179              }
 180  
 181              $userProperties['role'] = $_POST['role'];
 182  
 183              update_user_course_properties($userIdViewed, $courseCode, $userProperties);
 184  
 185              $displayMode = "viewContentList";
 186      }
 187  }
 188  
 189  // COMMON COMMANDS
 190  
 191  if ($allowedToEditContent)
 192  {
 193      if (isset($_POST['submitContent']))
 194      {
 195          if ($_POST['cntId']) // submit a content change
 196          {
 197              edit_cat_content($_POST['catId'], $userIdViewed, $_POST['content'], $_SERVER['REMOTE_ADDR']);
 198  
 199          }
 200          else // submit a totally new content
 201          {
 202              fill_new_cat_content($_POST['catId'], $userIdViewed, $_POST['content'], $_SERVER['REMOTE_ADDR']);
 203  
 204          }
 205  
 206          $displayMode = "viewContentList";
 207      }
 208      elseif (!empty($_GET['editContent']))
 209      {
 210          $displayMode = "viewContentEdit";
 211          $userIdViewed = $userIdViewed;
 212      }
 213  }
 214  
 215  // Actions
 216  echo '<div class="actions">';
 217  $return_back = '<a href="user.php?'.api_get_cidreq().'&amp;origin='.$origin.'">'.Display::return_icon('pixel.gif',get_lang('BackUser'),array('class'=>'toolactionplaceholdericon toolactionback')).get_lang('BackUser').'</a>';
 218  if (isset($_GET['from_page']) && $_GET['from_page']=='wiki') {
 219    $return_back = '<a href="../wiki/index.php?'.api_get_cidreq().'&action=allpages&group_id=">'.Display::return_icon('wiki.png',get_lang('Back')).get_lang('Back').'</a>';
 220  }
 221  echo $return_back;
 222  if (api_is_allowed_to_edit()) {
 223      if (!is_numeric($_GET['editMainUserInfo'])) {
 224          echo '<a href="userInfo.php?'.api_get_cidreq().'&amp;origin='.$origin.'&amp;editMainUserInfo='.$userIdViewed.'">'.Display::return_icon('pixel.gif',get_lang('EditUser'),array('class'=>'toolactionplaceholdericon tooledithome')).get_lang('EditUser').'</a>';
 225      } else {
 226          echo '<a href="userInfo.php?'.api_get_cidreq().'&amp;origin='.$origin.'&amp;uInfo='.$userIdViewed.'">'.Display::return_icon('pixel.gif',get_lang('ViewUser'),array('class'=>'toolactionplaceholdericon toolactionunknown')).get_lang('ViewUser').'</a>';
 227      }
 228      echo '<a href="../mySpace/myStudents.php?'.api_get_cidreq().'&amp;origin=user_course&amp;student='.$userIdViewed.'&amp;details=true&amp;course='.$_course['id'].'">'.Display::return_icon('pixel.gif',get_lang('UserStatistics'),array('class'=>'toolactionplaceholdericon toolactionstatistics')).get_lang('UserStatistics').'</a>';
 229  }
 230  echo '</div>';
 231  
 232  echo '<div id="content">';
 233  
 234  if ($displayMode == "viewDefEdit")
 235  {
 236      /*>>>>>>>>>>>> CATEGORIES DEFINITIONS : EDIT <<<<<<<<<<<<*/
 237  
 238      $catToEdit = get_cat_def($_GET['editDef']);
 239      $edit_heading_form = new FormValidator('edit_heading_form');
 240      $edit_heading_form->addElement('hidden', 'id');
 241      $edit_heading_form->add_textfield('title', get_lang('Title'));
 242      $edit_heading_form->addElement('textarea', 'comment', get_lang('Comment'), array ('cols' => 60, 'rows' => 4));
 243      $possible_line_nrs[1] = '1 '.get_lang('Line');
 244      $possible_line_nrs[3] = '3 '.get_lang('Lines');
 245      $possible_line_nrs[5] = '5 '.get_lang('Lines');
 246      $possible_line_nrs[10] = '10 '.get_lang('Lines');
 247      $possible_line_nrs[15] = '15 '.get_lang('Lines');
 248      $edit_heading_form->addElement('select', 'nbline', get_lang('LineNumber'), $possible_line_nrs);
 249      $edit_heading_form->addElement('submit', 'submitDef', get_lang('Ok'));
 250      $edit_heading_form->setDefaults($catToEdit);
 251      $edit_heading_form->display();
 252  }
 253  elseif ($displayMode == "viewDefList")
 254  {
 255      /*>>>>>>>>>>>> CATEGORIES DEFINITIONS : LIST <<<<<<<<<<<<*/
 256  
 257      $catList = get_cat_def_list();
 258  
 259      if ($catList)
 260      {
 261  
 262          foreach ($catList as $thisCat)
 263          {
 264              // displays Title and comments
 265  
 266              echo "<p>", "<b>".htmlize($thisCat['title'])."</b><br>\n", "<i>".htmlize($thisCat['comment'])."</i>\n", "</p>";
 267  
 268              // displays lines
 269  
 270              echo "<blockquote>\n", "<font color=\"gray\">\n";
 271  
 272              for ($i = 1; $i <= $thisCat['nbline']; $i ++)
 273              {
 274                  echo "<br>__________________________________________\n";
 275              }
 276  
 277              echo "</font>\n", "</blockquote>\n";
 278  
 279              // displays commands
 280  
 281              echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&removeDef=", $thisCat['catId'], "\">", "<img src=\"../img/delete.png\" border=\"0\" alt=\"".get_lang('Remove')."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset))."')) return false;\">", "</a>", "<a href=\"".api_get_self()."?".api_get_cidreq()."&editDef=", $thisCat['catId'], "\">", Display::return_icon('pixel.gif',get_lang('Edit'),array('class'=>'actionplaceholdericon actionedit')).get_lang('Edit')."\" />", "</a>", "<a href=\"".api_get_self()."?".api_get_cidreq()."&moveUpDef=", $thisCat['catId'], "\">", "<img src=\"../img/up.gif\" border=\"0\" alt=\"".get_lang('MoveUp')."\">", "</a>", "<a href=\"".api_get_self()."?".api_get_cidreq()."&moveDownDef=", $thisCat['catId'], "\">", "<img src=\"../img/down.gif\" border=\"0\" alt=\"".get_lang('MoveDown')."\">", "</a>\n";
 282          } // end for each
 283  
 284      } // end if ($catList)
 285  
 286      echo "<center>\n",
 287              "<form method=\"post\" action=\"".api_get_self()."\">",
 288              "<input type=\"submit\" name=\"addDef\" value=\"".get_lang('AddNewHeading')."\" />",
 289              "</form>\n",
 290              "<center>\n";
 291  }
 292  elseif ($displayMode == "viewContentEdit")
 293  {
 294      /*>>>>>>>>>>>> CATEGORIES CONTENTS : EDIT <<<<<<<<<<<<*/
 295  
 296      $catToEdit = get_cat_content($userIdViewed, $_GET['editContent']);
 297      $content_heading_form = new FormValidator('content_heading_form');
 298      $content_heading_form->addElement('hidden', 'cntId');
 299      $content_heading_form->addElement('hidden', 'catId');
 300      $content_heading_form->addElement('hidden', 'uInfo');
 301      $content_heading_form->addElement('static', null, $catToEdit['title'], htmlize($catToEdit['comment']));
 302      if ($catToEdit['nbline'] == 1)
 303      {
 304          $content_heading_form->addElement('text', 'content', null, array ('size' => 80));
 305      }
 306      else
 307      {
 308          $content_heading_form->addElement('textarea', 'content', null, array ('cols' => 60, 'rows' => $catToEdit['nbline']));
 309      }
 310      $content_heading_form->addElement('submit', 'submitContent', get_lang('Ok'));
 311      $defaults = $catToEdit;
 312      $defaults['cntId'] = $catToEdit['contentId'];
 313      $defaults['uInfo'] = $userIdViewed;
 314      $content_heading_form->setDefaults($defaults);
 315      $content_heading_form->display();
 316  }
 317  elseif ($displayMode == "viewMainInfoEdit")
 318  {
 319  
 320      /*>>>>>>>>>>>> CATEGORIES MAIN INFO : EDIT <<<<<<<<<<<<*/
 321  
 322      $mainUserInfo = get_main_user_info($userIdViewed, $courseCode);
 323  
 324      if ($mainUserInfo)
 325      {
 326          ($mainUserInfo['status'] == 1) ? $courseAdminChecked = "checked" : $courseAdminChecked = "";
 327          ($mainUserInfo['tutor_id'] == 1) ? $tutorChecked = "checked" : $tutorChecked = "";
 328  
 329          $image_array=UserManager::get_user_picture_path_by_id($userIdViewed,'web',false,true);
 330          // get the path,width and height from original picture
 331          $big_image = $image_array['dir'].'big_'.$image_array['file'];
 332          $big_image_size = api_getimagesize($big_image);
 333          $big_image_width= $big_image_size[0];
 334          $big_image_height= $big_image_size[1];
 335          $url_big_image = $big_image.'?rnd='.time();
 336  
 337          if ($image_array['file']=='unknown.jpg') {
 338          echo '<img src="'.$image_array['dir'].$image_array['file'].'" border="1">';
 339          } else {
 340          echo '<input type="image" src="'.$image_array['dir'].$image_array['file'].'" onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
 341          }
 342  
 343          //"<td>", get_lang('Tutor'), "</td>\n",
 344          echo "<form action=\"".api_get_self()."\" method=\"post\">\n",
 345                  "<input type=\"hidden\" name=\"submitMainUserInfo\" value=\"$userIdViewed\" />\n",
 346                  "<table width=\"80%\" border=\"0\">",
 347                      "<tr align=\"center\" bgcolor=\"#E6E6E6\">\n",
 348                          "<td align=\"left\">", get_lang('Name'), "</td>\n",
 349                          "<td width=\"100px\" align=\"left\">", get_lang('Description'), "</td>\n",
 350                          //"<td>", get_lang('Tutor'), "</td>\n",
 351                          "<td>", get_lang('CourseManager'), "</td>\n",
 352                      "</tr>\n",
 353                      "<tr align=\"center\">",
 354                          "<td align=\"left\"><b>", htmlize(api_get_person_name($mainUserInfo['firstName'], $mainUserInfo['lastName'])), "</b></td>\n",
 355                          "<td align=\"left\"><input type=\"text\" name =\"role\" value=\"", $mainUserInfo['role'], "\" maxlength=\"40\" /></td>";
 356                          //"<td><input class=\"checkbox\" type=\"checkbox\" name=\"promoteTutor\" value=\"1\" ", $tutorChecked, " /></td>";
 357  
 358          if (!($is_courseAdmin && $_user['user_id'] == $userIdViewed))
 359          {
 360              echo "<td><input class=\"checkbox\" type=\"checkbox\" name=\"promoteCourseAdmin\" value=\"1\"", $courseAdminChecked, " /></td>\n";
 361          }
 362          else
 363          {
 364              echo "<td>", get_lang('CourseManager'), "</td>\n";
 365  
 366          }
 367  
 368          echo "<td><button class=\"save\" type=\"submit\" name=\"submit\">".get_lang('SaveChanges')."</button></td>\n", "</tr>", "</table>", "</form>\n";
 369  
 370          echo "<p>".Display :: encrypted_mailto_link($mainUserInfo['email'], $mainUserInfo['email'])."</p>";
 371  
 372                  if (api_get_setting('extended_profile') == 'true')
 373                  {
 374                      echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyCompetences').'</strong></div><div>'.$mainUserInfo['competences'].'</div>';
 375                      echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div><div>'.$mainUserInfo['diplomas'].'</div>';
 376                      echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyTeach').'</strong></div><div>'.$mainUserInfo['teach'].'</div>';
 377                      echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div><div>'.$mainUserInfo['openarea'].'</div>';
 378                      echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyProductions').'</strong></div><div>'.UserManager::build_production_list($mainUserInfo['user_id']).'</div>';
 379                  }
 380  
 381      }
 382      else
 383      {
 384          Display :: display_normal_message(get_lang('ThisStudentIsSubscribeThroughASession'));
 385      }
 386  }
 387  elseif ($displayMode == "viewContentList") // default display
 388  {
 389      /*>>>>>>>>>>>> CATEGORIES CONTENTS : LIST <<<<<<<<<<<<*/
 390  
 391      $virtual_course_code = $_GET["virtual_course"];
 392      if (isset ($virtual_course_code))
 393      {
 394          $courseCode = $virtual_course_code;
 395          //not supported yet: editing users of virtual courses
 396          $allowedToEditDef = false;
 397      }
 398  
 399      $mainUserInfo = get_main_user_info($userIdViewed, $courseCode);
 400  
 401      if ($mainUserInfo)
 402      {
 403          $image_array=UserManager::get_user_picture_path_by_id($userIdViewed,'web',false,true);
 404          // get the path,width and height from original picture
 405          $big_image = $image_array['dir'].'big_'.$image_array['file'];
 406          $big_image_size = api_getimagesize($big_image);
 407          $big_image_width= $big_image_size[0];
 408          $big_image_height= $big_image_size[1];
 409          $url_big_image = $big_image.'?rnd='.time();
 410  
 411          if ($image_array['file']=='unknown.jpg') {
 412          echo '<img src="'.$image_array['dir'].$image_array['file'].'" border="1">';
 413          } else {
 414          echo '<input type="image" src="'.$image_array['dir'].$image_array['file'].'" onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
 415          }
 416  
 417          // is the user online ?
 418          $statistics_database = Database :: get_statistic_database();    
 419          $users_online = WhoIsOnline($userIdViewed, $statistics_database, 30);
 420          foreach ($users_online as $online) {
 421              if (in_array($userIdViewed, $online)) {    
 422                  
 423                  
 424                  $online = Display::return_icon('online.gif', get_lang('OnLine'),array('style'=>'with="8"; height="8"'));
 425                  break;
 426              }
 427              else
 428              {
 429                  $online ='';
 430              }
 431                  
 432          }
 433  
 434          //DISPLAY TABLE HEADING
 435          if ($origin == 'learnpath') { $allowedToEditDef=false; $is_allowedToTrack=false; }
 436  
 437                  //"<td>",get_lang('Tutor'),"</td>\n",
 438          echo    "<table width=\"80%\" border=\"0\">",
 439  
 440                  "<tr align=\"center\" bgcolor=\"#E6E6E6\">\n",
 441                  "<td align=\"left\">",get_lang('Name'),"</td>\n",
 442                  "<td width=\"100px\" align=\"left\">",get_lang('Description'),"</td>\n",
 443                  //"<td>",get_lang('Tutor'),"</td>\n",
 444                  "<td>",get_lang('CourseManager'),"</td>\n",
 445                  ($allowedToEditDef?"<td>".get_lang('Edit')."</td>\n":""),
 446                  ($is_allowedToTrack?"<td>".get_lang('Tracking')."</td>\n":""),
 447                  "</tr>\n",
 448  
 449                  "<tr align=\"center\">\n",
 450  
 451                  "<td  align=\"left\"><b>".$online.' '.htmlize(api_get_person_name($mainUserInfo['firstName'], $mainUserInfo['lastName']))."</b></td>\n",
 452                  "<td  align=\"left\">".htmlize($mainUserInfo['role'])."</td>";
 453  
 454                  //DISPLAY TABLE CONTENT
 455  
 456                  // deprecated feature
 457                  if ($mainUserInfo['tutor_id'] == 1)
 458                  {
 459                      //echo "<td>",get_lang('Tutor'),"</td>\n";
 460                  }
 461                  else
 462                  {
 463                      echo "<td> - </td>\n";
 464                  }
 465  
 466                  if ($mainUserInfo['status'] == 1)
 467                  {
 468                      echo "<td>",get_lang('CourseManager'),"</td>";
 469                  }
 470                  else
 471                  {
 472                      echo "<td> - </td>\n";
 473                  }
 474  
 475                  if ($allowedToEditDef)
 476                  {
 477                      echo    "<td>",
 478                              "<a href=\"".api_get_self()."?".api_get_cidreq()."&editMainUserInfo=$userIdViewed\">",
 479                              Display::return_icon('pixel.gif',get_lang('Edit'),array('class'=>'actionplaceholdericon actionedit')),
 480                              "</a>",
 481                              "</td>";
 482                  }
 483                                  if ($is_allowedToTrack) {
 484                                     echo    "<td>",
 485                                      "<a href=\"../mySpace/myStudents.php?".api_get_cidreq()."&origin=user_course&student=$userIdViewed&details=true&course=".$_course['id']."\">",
 486                                      Display::return_icon('pixel.gif',get_lang('Tracking').' : '.$userIdViewed,array('class'=>'actionplaceholdericon actiontracking')),             
 487                                      "</a>",
 488                                      "</td>";
 489                                    
 490                                  }
 491                  echo "</tr>",
 492                  "</table>";
 493  
 494                  if (api_get_setting("show_email_addresses") == "true")
 495                  {
 496                      echo "<p>". Display::encrypted_mailto_link($mainUserInfo['email'],$mainUserInfo['email']). "</p>";
 497                  }
 498                  else
 499                  {
 500                      if (api_is_allowed_to_edit())
 501                      {
 502                          echo "<p>". Display::encrypted_mailto_link($mainUserInfo['email'],$mainUserInfo['email']). "</p>";
 503                      }
 504                  }
 505  
 506                  if (api_get_setting('extended_profile') == 'true')
 507                  {
 508                      echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyCompetences').'</strong></div><div>'.$mainUserInfo['competences'].'</div>';
 509                      echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div><div>'.$mainUserInfo['diplomas'].'</div>';
 510                      echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyTeach').'</strong></div><div>'.$mainUserInfo['teach'].'</div>';
 511                      echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div><div>'.$mainUserInfo['openarea'].'</div>';
 512                      echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyProductions').'</strong></div><div>'.UserManager::build_production_list($mainUserInfo['user_id']).'</div>';
 513                  }
 514      }
 515      else{
 516          Display :: display_normal_message(get_lang('ThisStudentIsSubscribeThroughASession'));
 517      }
 518  
 519      if (api_get_setting('allow_user_headings') == 'true' && $allowedToEditDef) // only course administrators see this line
 520      {
 521          echo    "<div align=right>",
 522                  "<form method=\"post\" action=\"".api_get_self()."\">",
 523                  get_lang('CourseAdministratorOnly')," : ",
 524                  "<input type=\"submit\" name=\"viewDefList\" value=\"".get_lang('DefineHeadings')."\" />",
 525                  "</form>",
 526                  "<hr noshade size=\"1\" style=\"color:#99CCFF\">",
 527                  "</div>\n";
 528      }
 529  
 530      $catList = get_course_user_info($userIdViewed);
 531  
 532      if ($catList)
 533      {
 534          foreach ($catList as $thisCat)
 535          {
 536              // Category title
 537  
 538              echo    "<p><b>",$thisCat['title'],"</b></p>\n";
 539  
 540              // Category content
 541  
 542              echo    "<blockquote>\n";
 543  
 544              if ($thisCat['content'])
 545              {
 546                  echo htmlize($thisCat['content'])."\n";
 547              }
 548              else
 549              {
 550                  echo "....";
 551              }
 552  
 553              // Edit command
 554  
 555              if ($allowedToEditContent)
 556              {
 557                  echo    "<br><br>\n",
 558                          "<a href=\"".api_get_self()."?".api_get_cidreq()."&editContent=",$thisCat['catId'],"&uInfo=",$userIdViewed,"\">",
 559                          //"<img src=\"../img/edit.png\" border=\"0\" alt=\"edit\">",
 560                          Display::return_icon('pixel.gif',get_lang('Edit'),array('class'=>'actionplaceholdericon actionedit')),
 561                          "</a>\n";
 562              }
 563  
 564              echo    "</blockquote>\n";
 565          }
 566      }
 567  }
 568  
 569  // End main content
 570  echo '</div>';
 571  
 572  // Display the footer
 573  Display :: display_footer();
 574  ?>

title

Description

title

Description

title

Description

title

title

Body