Dokeos PHP Cross Reference Learning Management Systems

Source: /main/group/group_space.php - 636 lines - 28634 bytes - Summary - Text - Print

   1  <?php
   2  
   3  /* For licensing terms, see /dokeos_license.txt */
   4  
   5  /**
   6  ==============================================================================
   7  *    @package dokeos.group
   8  ==============================================================================
   9  */
  10  
  11  // name of the language file that needs to be included
  12  $language_file = array('group','userInfo','work');
  13  
  14  // including the global Dokeos file
  15  require_once  ('../inc/global.inc.php');
  16  
  17  // including additional libraries
  18  require_once api_get_path(LIBRARY_PATH).'course.lib.php';
  19  require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
  20  require_once api_get_path(LIBRARY_PATH).'message.lib.php';
  21  require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php';
  22  require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
  23  require_once api_get_path(SYS_CODE_PATH).'forum/forumconfig.inc.php';
  24  
  25  // the section (for the tabs)
  26  $this_section = SECTION_COURSES;
  27  
  28  // current group
  29  $current_group = GroupManager :: get_group_properties($_SESSION['_gid']);
  30  
  31  // tracking
  32  event_access_tool(TOOL_GROUP);
  33  
  34  $nameTools = get_lang('GroupSpace');
  35  
  36  // breadcrumbs
  37  $interbreadcrumb[] = array ("url" => "group.php", "name" => get_lang("Groups"));
  38  
  39  //Add new chat invitation when users of same group are online
  40  if(!api_is_allowed_to_edit() && !api_is_grouptutor($_course,api_get_session_id(),api_get_user_id())){
  41  $track_online_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ONLINE);
  42  $users_list = GroupManager::get_users($current_group['id']);
  43  foreach($users_list as $user_id){    
  44      $sql = "SELECT * FROM $track_online_table WHERE login_user_id = $user_id AND login_user_id <> ".api_get_user_id();
  45      $res = Database::query($sql,__FILE__,__LINE__);
  46      if(Database::num_rows($res) > 0){        
  47          MessageManager::add_new_chat_invitation(api_get_user_id(),$user_id);
  48      }
  49  }
  50  }
  51  
  52  
  53  if(isset($_REQUEST['action'])){
  54      change_tool_visibility($_REQUEST['action'],$_REQUEST['tool'],$_REQUEST['group_id']);
  55          header('Location:'.api_get_self().'?'.api_get_cidReq().'&gidReq='.$_SESSION['_gid'].'&group_id='.Security::remove_XSS($_REQUEST['group_id']));
  56  }
  57  
  58  // display the header
  59  Display::display_tool_header($nameTools.' '.$current_group['name'],'Group');
  60  
  61  
  62  function change_tool_visibility($visible,$tool,$group_id){
  63      $table_group         = Database::get_course_table(TABLE_GROUP);
  64  
  65      if($visible == 'invisible'){
  66          $visible = 0;
  67      }
  68      else {
  69          $visible = 1;
  70      }
  71  
  72      $sql = "UPDATE $table_group SET ".$tool." = $visible WHERE id = ".$group_id;
  73      Database::query($sql,__FILE__,__LINE__);
  74  }
  75  
  76  // Actions
  77  display_actions($current_group);
  78  
  79  /*
  80   * Edit the group
  81   */
  82  /*if (api_is_allowed_to_edit(false,true) or GroupManager :: is_tutor($_user['user_id'])) {
  83      isset($origin)?$my_origin = $origin:$my_origin='';
  84      echo Display::return_icon('edit_link.png', get_lang("EditGroup"))."<a href=\"group_edit.php?".api_get_cidreq()."&origin=$my_origin\">".get_lang("EditGroup")."</a>";
  85  }*/
  86  
  87  echo '&nbsp;</div>';
  88  
  89  if( isset($_GET['action'])) {
  90      switch( $_GET['action']) {
  91          case 'show_msg':
  92              Display::display_normal_message(Security::remove_XSS($_GET['msg']));
  93              break;
  94      }
  95  }
  96  
  97  //start the content div
  98  echo '<div id="content">';
  99  
 100  /*
 101  -----------------------------------------------------------
 102      Main Display Area
 103  -----------------------------------------------------------
 104  */
 105  $course_code = $_course['sysCode'];
 106  $is_course_member = CourseManager :: is_user_subscribed_in_real_or_linked_course($_SESSION['_user']['user_id'], $course_code);
 107  
 108  /*
 109   * Group title and comment
 110   */
 111  //api_display_tool_title($nameTools.' '.stripslashes($current_group['name']));
 112  
 113  /*
 114   * list all the tutors of the current group
 115   */
 116  $tutors = GroupManager::get_subscribed_tutors($current_group['id']);
 117  
 118  $tutor_info = '';
 119  if (count($tutors) == 0)
 120  {
 121      $tutor_info = get_lang("GroupNoneMasc");
 122  }
 123  else
 124  {
 125      isset($origin)?$my_origin = $origin:$my_origin='';
 126      foreach($tutors as $index => $tutor)
 127      {
 128          $image_path = UserManager::get_user_picture_path_by_id($tutor['user_id'],'web',false, true);
 129          $image_repository = $image_path['dir'];
 130          $existing_image = $image_path['file'];
 131          $photo= '<img src="'.$image_repository.$existing_image.'" align="absbottom" alt="'.api_get_person_name($tutor['firstname'], $tutor['lastname']).'"  width="32" height="32" title="'.api_get_person_name($tutor['firstname'], $tutor['lastname']).'" />';
 132          $tutor_info .= "<div style='margin-bottom: 5px;'><a href='../user/userInfo.php?origin=".$my_origin."&amp;uInfo=".$tutor['user_id']."'>".$photo."&nbsp;".api_get_person_name($tutor['firstname'], $tutor['lastname'])."</a></div>";
 133      }
 134  }
 135  // Group tutor always is empty due that this feature was removed by this changeset : 19453fe512c3 , see group_edit.php file
 136  
 137  /*echo '<div class="actions-message" style="margin-bottom:4px;"><b>'.get_lang("GroupTutors").':</b></div>';
 138  if (!empty($tutor_info)) {
 139      echo '<div style="margin-left:5px;">'.$tutor_info.'</div>';
 140  }*/
 141  //echo '<br/>';
 142  
 143  /*
 144   * list all the members of the current group
 145   */
 146  
 147  echo '<div class="row"><div class="form_header">'.get_lang("GroupTutors").'</div></div>';
 148  
 149  $table = new SortableTable('group_tutors', 'get_number_of_group_tutors', 'get_group_tutor_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
 150  $my_cidreq=isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : '';
 151  $my_origin=isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
 152  $my_gidreq=isset($_GET['gidReq']) ? Security::remove_XSS($_GET['gidReq']) : '';
 153  $parameters = array('cidReq' => $my_cidreq, 'origin'=> $my_origin, 'gidReq' => $my_gidreq);
 154  $table->set_additional_parameters($parameters);
 155  $table->set_header(0, '');
 156  if (api_is_western_name_order()) {
 157      $table->set_header(1, get_lang('FirstName'));
 158      $table->set_header(2, get_lang('LastName'));
 159  } else {
 160      $table->set_header(1, get_lang('LastName'));
 161      $table->set_header(2, get_lang('FirstName'));
 162  }
 163  $table->set_header(3, get_lang('Email'),false);
 164  $table->set_header(4, get_lang('Correction'),false);
 165  $table->set_header(5, get_lang('Messages'),false);
 166  $table->set_column_filter(0, 'user_icon_filter');
 167  $table->set_column_filter(3, 'email_filter');
 168  $table->set_column_filter(4, 'assignment_filter');
 169  $table->set_column_filter(5, 'message_filter');
 170  $table->display();
 171  
 172  if(api_is_allowed_to_edit() || api_is_grouptutor($_course,api_get_session_id(),api_get_user_id()) || $current_group['category_id'] <> 1){
 173  
 174  echo '<div class="row"><div class="form_header">'.get_lang("GroupMembers").'</div></div>';
 175  
 176  $table = new SortableTable('group_users', 'get_number_of_group_users', 'get_group_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
 177  $my_cidreq=isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : '';
 178  $my_origin=isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
 179  $my_gidreq=isset($_GET['gidReq']) ? Security::remove_XSS($_GET['gidReq']) : '';
 180  $parameters = array('cidReq' => $my_cidreq, 'origin'=> $my_origin, 'gidReq' => $my_gidreq);
 181  $table->set_additional_parameters($parameters);
 182  $table->set_header(0, '');
 183  if (api_is_western_name_order()) {
 184      $table->set_header(1, get_lang('FirstName'));
 185      $table->set_header(2, get_lang('LastName'));
 186  } else {
 187      $table->set_header(1, get_lang('LastName'));
 188      $table->set_header(2, get_lang('FirstName'));
 189  }
 190  $table->set_header(3, get_lang('Email'),false);
 191  $table->set_header(4, get_lang('Papers'),false);
 192  $table->set_header(5, get_lang('Messages'),false);
 193  $table->set_column_filter(3, 'email_filter');
 194  $table->set_column_filter(4, 'paper_filter');
 195  $table->set_column_filter(5, 'mess_filter');
 196  $table->set_column_filter(0, 'user_icon_filter');
 197  $table->display();
 198  }
 199  
 200  // close the content div
 201  echo '</div>';
 202  
 203  // Actions bar
 204  echo '<div class="actions">';
 205  echo '</div>';
 206  // footer
 207  Display::display_footer();
 208  
 209  /**
 210   * Get the number of subscribed users to the group
 211   *
 212   * @return integer
 213   *
 214   * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
 215   * @version April 2008
 216   */
 217  function get_number_of_group_users()
 218  {
 219      global $current_group;
 220  
 221      // Database table definition
 222      $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
 223  
 224      // query
 225      $sql = "SELECT count(id) AS number_of_users
 226                  FROM ".$table_group_user."
 227                  WHERE group_id='".Database::escape_string($current_group['id'])."'";
 228      $result = Database::query($sql,__FILE__,__LINE__);
 229      $return = Database::fetch_array($result,'ASSOC');
 230      return $return['number_of_users'];
 231  }
 232  
 233  /**
 234   * Get the details of the users in a group
 235   *
 236   * @param integer $from starting row
 237   * @param integer $number_of_items number of items to be displayed
 238   * @param integer $column sorting colum
 239   * @param integer $direction sorting direction
 240   * @return array
 241   *
 242   * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
 243   * @version April 2008
 244   */
 245  function get_group_user_data($from, $number_of_items, $column, $direction)
 246  {
 247      global $current_group;
 248  
 249      // Database table definition
 250      $table_group_user     = Database :: get_course_table(TABLE_GROUP_USER);
 251      $table_user         = Database :: get_main_table(TABLE_MAIN_USER);
 252  
 253      // query
 254  
 255      $sql = "SELECT
 256                          user.user_id     AS col0,
 257                          ".(api_is_western_name_order() ?
 258                          "user.firstname     AS col1,
 259                          user.lastname     AS col2,"
 260                          :
 261                          "user.lastname     AS col1,
 262                          user.firstname     AS col2,"
 263                          )."
 264                          user.user_id        AS col3,
 265                          user.user_id    AS col4,
 266                          user.user_id    AS col5
 267                          FROM ".$table_user." user, ".$table_group_user." group_rel_user
 268                          WHERE group_rel_user.user_id = user.user_id
 269                          AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
 270              $sql .= " ORDER BY col$column $direction ";
 271              $sql .= " LIMIT $from,$number_of_items";
 272  
 273      $return = array ();
 274      $result = Database::query($sql,__FILE__,__LINE__);
 275      while ($row = Database::fetch_row($result))
 276      {
 277          $return[] = $row;
 278      }
 279      return $return;
 280  }
 281  
 282  /**
 283   * Get the number of subscribed users to the group
 284   *
 285   * @return integer
 286   *
 287   * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
 288   * @version April 2008
 289   */
 290  function get_number_of_group_tutors()
 291  {
 292      global $current_group;
 293  
 294      // Database table definition
 295      $table_group_tutor = Database :: get_course_table(TABLE_GROUP_TUTOR);
 296  
 297      // query
 298      $sql = "SELECT count(id) AS number_of_tutors
 299                  FROM ".$table_group_tutor."
 300                  WHERE group_id='".Database::escape_string($current_group['id'])."'";
 301      $result = Database::query($sql,__FILE__,__LINE__);
 302      $return = Database::fetch_array($result,'ASSOC');
 303      return $return['number_of_tutors'];
 304  }
 305  
 306  /**
 307   * Get the details of the users in a group
 308   *
 309   * @param integer $from starting row
 310   * @param integer $number_of_items number of items to be displayed
 311   * @param integer $column sorting colum
 312   * @param integer $direction sorting direction
 313   * @return array
 314   *
 315   * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
 316   * @version April 2008
 317   */
 318  function get_group_tutor_data($from, $number_of_items, $column, $direction)
 319  {
 320      global $current_group;
 321  
 322      // Database table definition
 323      $table_group_tutor     = Database :: get_course_table(TABLE_GROUP_TUTOR);
 324      $table_user         = Database :: get_main_table(TABLE_MAIN_USER);
 325  
 326      // query
 327  
 328      $sql = "SELECT
 329                          user.user_id     AS col0,
 330                          ".(api_is_western_name_order() ?
 331                          "user.firstname     AS col1,
 332                          user.lastname     AS col2,"
 333                          :
 334                          "user.lastname     AS col1,
 335                          user.firstname     AS col2,"
 336                          )."
 337                          user.user_id        AS col3,
 338                          group_rel_tutor.group_id        AS col4,
 339                          user.user_id        AS col5
 340                          FROM ".$table_user." user, ".$table_group_tutor." group_rel_tutor
 341                          WHERE group_rel_tutor.user_id = user.user_id
 342                          AND group_rel_tutor.group_id = '".Database::escape_string($current_group['id'])."'";
 343              $sql .= " ORDER BY col$column $direction ";
 344              $sql .= " LIMIT $from,$number_of_items";    
 345          
 346  
 347      $return = array ();
 348      $result = Database::query($sql,__FILE__,__LINE__);
 349      while ($row = Database::fetch_row($result))
 350      {
 351          $return[] = $row;
 352      }
 353      return $return;
 354  }
 355  
 356  /**
 357  * Returns a mailto-link
 358  * @param string $email An email-address
 359  * @return string HTML-code with a mailto-link
 360  */
 361  function email_filter($user_id)
 362  {
 363      $table_user         = Database :: get_main_table(TABLE_MAIN_USER);
 364  
 365      $sql = "SELECT email FROM $table_user WHERE user_id = ".$user_id;
 366      $rs = Database::query($sql,__FILE__,__LINE__);
 367      $row = Database::fetch_array($rs);
 368  //    return Display :: encrypted_mailto_link($email, $email);
 369      return '<a href="new_message.php?'.api_get_cidReq().'&id_session='.api_get_session_id().'&send_to_user='.$user_id.'">'.$row['email'].'</a>';
 370  }
 371  
 372  /**
 373  * Returns a mailto-link
 374  * @param string $email An email-address
 375  * @return string HTML-code with a mailto-link
 376  */
 377  function assignment_filter($group_id)
 378  {
 379      $tbl_work       = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
 380      $tbl_item_property       = Database::get_course_table(TABLE_ITEM_PROPERTY);
 381          
 382      $users = GroupManager :: get_subscribed_users($group_id);
 383      foreach($users as $user){
 384          $userids[] = $user['user_id'];        
 385      }
 386      $users_list = implode(",",$userids);    
 387      $sql = "SELECT * FROM $tbl_work wrk,$tbl_item_property ip where wrk.id = ip.ref and wrk.filetype='file' and wrk.session_id = ".api_get_session_id()." and ip.insert_user_id IN (".$users_list.")";
 388      $result = Database::query($sql,__FILE__,__LINE__);
 389      $num_papers = Database::num_rows($result);
 390      $corrected = 0;
 391      while($row = Database::fetch_array($result)){
 392          if($row['qualificator_id'] == '1'){
 393              $corrected++;
 394          }
 395      }
 396      
 397      if(empty($num_papers))$num_papers = 0;
 398      $assignment = $corrected.'/'.$num_papers;
 399  
 400      return '<center>'.$assignment.'</center>';
 401  }
 402  
 403  /**
 404  * Returns a mailto-link
 405  * @param string $email An email-address
 406  * @return string HTML-code with a mailto-link
 407  */
 408  function message_filter($user_id)
 409  {
 410      // Database table definition
 411      $table_message = Database::get_main_table(TABLE_MESSAGE);
 412      $tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD);
 413  
 414      $sql = "SELECT * FROM $table_message WHERE user_sender_id = ".$user_id." AND msg_status = 4";
 415      $res = Database::query($sql,__FILE__,__LINE__);
 416      $num_messages = Database::num_rows($res);
 417  
 418      $forums_of_groups = get_forums_of_group($_SESSION['_gid']);
 419      foreach ($forums_of_groups as $key => $value) {
 420          $forum_id = $value['forum_id'];
 421          $sql = "SELECT * FROM $tbl_forum_thread WHERE forum_id = $forum_id AND thread_poster_id = $user_id";
 422          $res = Database::query($sql,__FILE__,__LINE__);
 423          $num_threads = Database::num_rows($res);
 424      }
 425      $num_messages = $num_messages + $num_threads;
 426  
 427      return '<center>'.$num_messages.'</center>';    
 428  }
 429  
 430  /**
 431  * Returns a mailto-link
 432  * @param string $email An email-address
 433  * @return string HTML-code with a mailto-link
 434  */
 435  function paper_filter($user_id)
 436  {
 437      $tbl_work       = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
 438      $tbl_item_property       = Database::get_course_table(TABLE_ITEM_PROPERTY);
 439      
 440      $sql = "SELECT * FROM $tbl_work WHERE filetype='folder' and session_id = ".api_get_session_id();
 441      $result = Database::query($sql,__FILE__,__LINE__);
 442      $num_assignment = Database::num_rows($result);    
 443  
 444      $sql = "SELECT * FROM $tbl_work wrk,$tbl_item_property ip where wrk.id = ip.ref and wrk.filetype='file' and wrk.session_id = ".api_get_session_id()." and ip.insert_user_id = ".$user_id;    
 445      $result = Database::query($sql,__FILE__,__LINE__);
 446      $paper_submitted = Database::num_rows($result);
 447      
 448      $papers = $paper_submitted.'/'.$num_assignment;
 449  
 450      return '<center>'.$papers.'</center>';
 451  }
 452  
 453  /**
 454  * Returns a mailto-link
 455  * @param string $email An email-address
 456  * @return string HTML-code with a mailto-link
 457  */
 458  function mess_filter($user_id)
 459  {
 460      // Database table definition
 461      $table_message = Database::get_main_table(TABLE_MESSAGE);
 462      $tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD);
 463  
 464      $sql = "SELECT * FROM $table_message WHERE user_sender_id = ".$user_id." AND msg_status = 4";
 465      $res = Database::query($sql,__FILE__,__LINE__);
 466      $num_messages = Database::num_rows($res);
 467  
 468      $forums_of_groups = get_forums_of_group($_SESSION['_gid']);
 469      foreach ($forums_of_groups as $key => $value) {
 470          $forum_id = $value['forum_id'];
 471          $sql = "SELECT * FROM $tbl_forum_thread WHERE forum_id = $forum_id AND thread_poster_id = $user_id";
 472          $res = Database::query($sql,__FILE__,__LINE__);
 473          $num_threads = Database::num_rows($res);
 474      }
 475      $num_messages = $num_messages + $num_threads;
 476  
 477      return '<center>'.$num_messages.'</center>';
 478  }
 479  
 480  /**
 481   * Display a user icon that links to the user page
 482   *
 483   * @param integer $user_id the id of the user
 484   * @return html code
 485   *
 486   * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
 487   * @version April 2008
 488   */
 489  function user_icon_filter($user_id)
 490  {
 491      global $origin;
 492  
 493      $userinfo=Database::get_user_info_from_id($user_id);
 494      $image_path = UserManager::get_user_picture_path_by_id($user_id,'web',false, true);
 495      $image_repository = $image_path['dir'];
 496      $existing_image = $image_path['file'];
 497      $photo= '<center><img src="'.$image_repository.$existing_image.'" alt="'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'"  width="22" height="22" title="'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'" /></center>';
 498      return "<a href='../user/userInfo.php?origin=".$origin."&amp;uInfo=".$user_id."'>".$photo;
 499  }
 500  
 501  function display_actions($current_group){
 502      echo '<div class="actions">';
 503      echo '<a href="group.php?'.api_get_cidreq().'">'.Display::return_icon('pixel.gif', get_lang('List'), array('class' => 'toolactionplaceholdericon toolactionback')).get_lang('List').'</a>';
 504      display_work_action($current_group);
 505      display_message_action($current_group);
 506      if($current_group['category_id'] <> 1){
 507      display_document_action($current_group);
 508      display_forum_action($current_group);
 509      display_wiki_action($current_group);
 510      display_chat_action($current_group);
 511      }    
 512  }
 513  
 514  function display_work_action($current_group){
 515      if($current_group['work_state'] == 1){
 516          if(api_is_allowed_to_edit()){
 517  //            echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible','onclick' => 'change_visibility(\'invisible\',\'work_state\')'));
 518                     echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=invisible&tool=work_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible'))."</a>";
 519          }
 520          echo '<a href="../work/work.php?'.api_get_cidreq().'">'.Display::return_icon('pixel.gif',get_lang('Work'),array('class' => 'toolactionplaceholdericon toolactionassignment')).get_lang('Work').'</a>';
 521      }
 522      else {
 523          if(api_is_allowed_to_edit()){
 524  //            echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible','onclick' => 'change_visibility(\'visible\',\'work_state\')'));
 525                     echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=visible&tool=work_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible'))."</a>";
 526              echo '<a href="../work/work.php?'.api_get_cidreq().'">'.Display::return_icon('pixel.gif',get_lang('Work'),array('class' => 'toolactionplaceholdericon toolactionassignment invisible')).get_lang('Work').'</a>';
 527          }
 528      }
 529  }
 530  
 531  function display_message_action($current_group){
 532      if($current_group['calendar_state'] == 1){
 533          if(api_is_allowed_to_edit()){
 534                  echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=invisible&tool=calendar_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible'))."</a>";
 535          }
 536          //else {
 537  //        echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible','onclick' => 'change_visibility(\'visible\',\'calendar_state\')'));
 538               echo '<a href="inbox.php?'.api_get_cidreq().'&group_id='.$current_group['id'].'">'.Display::return_icon('pixel.gif',get_lang('Messages'),array('class' => 'toolactionplaceholdericon toolactionmessages')).get_lang('Messages').'</a>';
 539          //}
 540      }
 541      else{
 542      if(api_is_allowed_to_edit() || GroupManager::is_user_in_group(api_get_user_id(),$current_group['id'])){
 543          echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=visible&tool=calendar_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible'))."</a>";
 544      echo '<a href="javascript:">'.Display::return_icon('pixel.gif',get_lang('Messages'),array('class' => 'toolactionplaceholdericon toolactionmessages invisible')).get_lang('Messages').'</a>';
 545      }
 546  
 547      }
 548      
 549  }
 550  function display_document_action($current_group){
 551      if($current_group['doc_state'] == 1){
 552          if(api_is_allowed_to_edit()){
 553  //            echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible','onclick' => 'change_visibility(\'invisible\',\'doc_state\')'));
 554                           echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=invisible&tool=doc_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible'))."</a>";
 555          }
 556      echo '<a href="../document/document.php?'.api_get_cidreq().'&amp;gidReq='.$current_group['id'].'">'.Display::return_icon('pixel.gif',get_lang('Documents'),array('class' => 'toolactionplaceholdericon toolactiondocument')).get_lang('Documents').'</a>';    
 557      }
 558      else {
 559          if(api_is_allowed_to_edit()){
 560  //        echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible','onclick' => 'change_visibility(\'visible\',\'doc_state\')'));
 561                echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=visible&tool=doc_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible'))."</a>";
 562          echo '<a href="../document/document.php?'.api_get_cidreq().'&amp;gidReq='.$current_group['id'].'">'.Display::return_icon('pixel.gif',get_lang('Documents'),array('class' => 'toolactionplaceholdericon toolactiondocument invisible')).get_lang('Documents').'</a>';
 563          }
 564      }
 565  }
 566  
 567  function display_forum_action($current_group){
 568      if($current_group['forum_state'] == 1){
 569      $forums_of_groups = get_forums_of_group($current_group['id']);
 570      foreach ($forums_of_groups as $key => $value) {
 571  
 572          if(api_is_allowed_to_edit()){
 573  //            echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible','onclick' => 'change_visibility(\'invisible\',\'forum_state\')'));
 574                           echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=invisible&tool=forum_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible'))."</a>";
 575          }
 576      echo '<a href="../forum/viewforum.php?forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'">'.Display::return_icon('pixel.gif',get_lang('Forum'),array('class' => 'toolactionplaceholdericon toolactionforum')).get_lang('Forum').'</a>';
 577      }
 578      }
 579      else {
 580          if(api_is_allowed_to_edit()){
 581              $forums_of_groups = get_forums_of_group($current_group['id']);
 582              foreach ($forums_of_groups as $key => $value) {
 583  //            echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible','onclick' => 'change_visibility(\'visible\',\'forum_state\')'));
 584                             echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=visible&tool=forum_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible'))."</a>";
 585              echo '<a href="../forum/viewforum.php?forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'">'.Display::return_icon('pixel.gif',get_lang('Forum'),array('class' => 'toolactionplaceholdericon toolactionforum invisible')).get_lang('Forum').'</a>';            }
 586          }
 587      }
 588  }
 589  
 590  function display_wiki_action($current_group){
 591      if($current_group['wiki_state'] == 1){
 592          if(api_is_allowed_to_edit()){
 593  //    echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible','onclick' => 'change_visibility(\'invisible\',\'wiki_state\')'));
 594          echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=invisible&tool=wiki_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible'))."</a>";
 595          }
 596      echo '<a href="../wiki/index.php?'.api_get_cidreq()."&amp;toolgroup=".$current_group['id'].'">'.Display::return_icon('pixel.gif',get_lang('Wiki'),array('class' => 'toolactionplaceholdericon toolactionwiki')).get_lang('Wiki').'</a>';
 597      }
 598      else {
 599          if(api_is_allowed_to_edit()){
 600  //        echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible','onclick' => 'change_visibility(\'visible\',\'wiki_state\')'));
 601                       echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=visible&tool=wiki_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible'))."</a>";
 602          echo '<a href="../wiki/index.php?'.api_get_cidreq()."&amp;toolgroup=".$current_group['id'].'">'.Display::return_icon('pixel.gif',get_lang('Wiki'),array('class' => 'toolactionplaceholdericon toolactionwiki invisible')).get_lang('Wiki').'</a>';
 603          }
 604      }
 605  }
 606  
 607  function display_chat_action($current_group){
 608      if($current_group['chat_state'] == 1){
 609          if(api_is_allowed_to_edit()){
 610  //        echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible','onclick' => 'change_visibility(\'invisible\',\'chat_state\')'));
 611                  
 612                    echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=invisible&tool=chat_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible'))."</a>";
 613          }
 614          if(api_get_course_setting('allow_open_chat_window')==true) {
 615  
 616          echo '<a href="javascript: void(0);" onclick="window.open(\'../chat/chat.php?'.api_get_cidreq().'&amp;toolgroup='.$current_group['id'].'\',\'window_chat_group_'.$_SESSION['_cid'].'_'.$_SESSION['_gid'].'\',\'height=500, width=930, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')">'.Display::return_icon('pixel.gif',get_lang('Chat'),array('class' => 'toolactionplaceholdericon toolactionchat')).get_lang('Chat').'</a>';
 617          }
 618          else {
 619              echo '<a href="../chat/chat.php?'.api_get_cidreq().'&amp;toolgroup='.$current_group['id'].'">'.Display::return_icon('pixel.gif',get_lang('Chat'),array('class' => 'toolactionplaceholdericon toolactionchat')).get_lang('Chat').'</a>';
 620          }
 621      }
 622      else {
 623          if(api_is_allowed_to_edit()){
 624  //        echo Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible','onclick' => 'change_visibility(\'visible\',\'chat_state\')'));
 625                       echo "<a class='eyes' href='".api_get_self()."?".api_get_cidReq()."&gidReg=".$_SESSION['_gid']."&group_id=".$current_group['id']."&action=visible&tool=chat_state'>".Display::return_icon('pixel.gif','',array('class' => 'actionplaceholdericon actiongrouptoolvisible invisible'))."</a>";
 626      if(api_get_course_setting('allow_open_chat_window')==true) {
 627          echo '<a href="javascript: void(0);" onclick="window.open(\'../chat/chat.php?'.api_get_cidreq().'&amp;toolgroup='.$current_group['id'].'\',\'window_chat_group_'.$_SESSION['_cid'].'_'.$_SESSION['_gid'].'\',\'height=500, width=930, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')">'.Display::return_icon('pixel.gif',get_lang('Chat'),array('class' => 'toolactionplaceholdericon toolactionchat invisible')).get_lang('Chat').'</a>';
 628      }
 629      else {
 630          echo '<a href="../chat/chat.php?'.api_get_cidreq().'&amp;toolgroup='.$current_group['id'].'">'.Display::return_icon('pixel.gif',get_lang('Chat'),array('class' => 'toolactionplaceholdericon toolactionchat invisible')).get_lang('Chat').'</a>';
 631      }
 632          }
 633      }
 634  }
 635  
 636  ?>

title

Description

title

Description

title

Description

title

title

Body