Ejemplo n.º 1
0
                 }
             }
             $item['photo'] = Display::img($user_info['avatar_small'], $user_info['complete_name'], [], false);
             $item['currently_learning'] = !empty($count_skill_by_course) ? array_sum($count_skill_by_course) : 0;
         }
     }
     break;
 case 'get_course_announcements':
     $columns = array('title', 'username', 'insert_date', 'actions');
     $titleToSearch = isset($_REQUEST['title_to_search']) ? $_REQUEST['title_to_search'] : '';
     $userIdToSearch = isset($_REQUEST['user_id_to_search']) ? $_REQUEST['user_id_to_search'] : 0;
     $result = AnnouncementManager::getAnnouncements(null, null, false, $start, $limit, $sidx, $sord, $titleToSearch, $userIdToSearch);
     break;
 case 'get_work_teacher':
     $columns = array('type', 'title', 'sent_date', 'expires_on', 'amount', 'actions');
     $result = getWorkListTeacher($start, $limit, $sidx, $sord, $whereCondition);
     break;
 case 'get_work_student':
     $columns = array('type', 'title', 'expires_on', 'feedback', 'last_upload', 'others');
     $result = getWorkListStudent($start, $limit, $sidx, $sord, $whereCondition);
     break;
 case 'get_work_user_list_all':
     if (isset($_GET['type']) && $_GET['type'] == 'simple') {
         $columns = array('firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'correction', 'actions');
     } else {
         $columns = array('firstname', 'lastname', 'title', 'qualification', 'sent_date', 'correction', 'actions');
     }
     $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
     break;
 case 'get_work_user_list_others':
     if (isset($_GET['type']) && $_GET['type'] == 'simple') {
Ejemplo n.º 2
0
 /**
  * Creates a list with all the student publications in it
  * @return string
  */
 public function get_student_publications()
 {
     $return = '<ul class="lp_resource" >';
     $return .= '<li class="lp_resource_element">';
     $return .= Display::return_icon('works_new.gif');
     $return .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=add_item&type=' . TOOL_STUDENTPUBLICATION . '&lp_id=' . $this->lp_id . '">' . get_lang('AddAssignmentPage') . '</a>';
     $return .= '</li>';
     $sessionId = api_get_session_id();
     if (empty($sessionId)) {
         require_once api_get_path(SYS_CODE_PATH) . 'work/work.lib.php';
         $works = getWorkListTeacher(0, 100, null, null, null);
         if (!empty($works)) {
             foreach ($works as $work) {
                 $link = Display::url(Display::return_icon('preview_view.png', get_lang('Preview')), api_get_path(WEB_CODE_PATH) . 'work/work_list_all.php?' . api_get_cidreq() . '&id=' . $work['iid'], ['target' => '_blank']);
                 $return .= '<li class="lp_resource_element" data_id="' . $work['iid'] . '" data_type="' . TOOL_STUDENTPUBLICATION . '" title="' . Security::remove_XSS(cut(strip_tags($work['title']), 80)) . '">';
                 $return .= '<a class="moved" href="#">';
                 $return .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY);
                 $return .= '</a> ';
                 $return .= Display::return_icon('works.gif');
                 $return .= ' <a class="moved" href="' . api_get_self() . '?' . api_get_cidreq() . '&action=add_item&type=' . TOOL_STUDENTPUBLICATION . '&file=' . $work['iid'] . '&lp_id=' . $this->lp_id . '">' . Security::remove_XSS(cut(strip_tags($work['title']), 80)) . ' ' . $link . '
                 </a>';
                 $return .= '</li>';
             }
         }
     }
     $return .= '</ul>';
     return $return;
 }