$("#announcements").jqGrid(
         "navGrid",
         "#announcements_pager",
         { edit: false, add: false, del: true },
         { height:280, reloadAfterSubmit:false }, // edit options
         { height:280, reloadAfterSubmit:false }, // add options
         { reloadAfterSubmit:false, url: "' . $deleteUrl . '" }, // del options
         { width:500 } // search options
     );
     ';
 }
 $content = '<script>
 $(function() {' . Display::grid_js('announcements', $url, $columns, $columnModel, $extra_params, array(), '', true) . $editOptions . '
 });
 </script>';
 $count = AnnouncementManager::getAnnouncements($stok, $announcement_number, true);
 if (empty($count)) {
     $html = '';
     if ((api_is_allowed_to_edit(false, true) || api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous()) && (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath')) {
         $html .= '<div id="no-data-view">';
         $html .= '<h3>' . get_lang('Announcements') . '</h3>';
         $html .= Display::return_icon('valves.png', '', array(), 64);
         $html .= '<div class="controls">';
         $html .= Display::url(get_lang('AddAnnouncement'), api_get_self() . "?" . api_get_cidreq() . "&action=add", array('class' => 'btn btn-primary'));
         $html .= '</div>';
         $html .= '</div>';
     } else {
         $html = Display::return_message(get_lang('NoAnnouncements'), 'warning');
     }
     $content = $html;
 } else {
                     $count_skill_by_course[$course_item['code']] = $skill->get_count_skills_by_course($course_item['code']);
                     $skills_in_course[$course_item['code']] = $count_skill_by_course[$course_item['code']];
                 } else {
                     $count_skill_by_course[$course_item['code']] = $skills_in_course[$course_item['code']];
                 }
             }
             $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');
     }
             // STEP 1 : FIND THE ORDER OF THE ANNOUNCEMENT
             if ($announcementId == $thisAnnouncementId) {
                 $thisAnnouncementOrder = $announcementOrder;
                 $thisAnnouncementOrderFound = true;
             }
         }
         Display::addFlash(Display::return_message(get_lang('AnnouncementMoved')));
         header('Location: ' . $homeUrl);
         exit;
     }
     break;
 case 'view':
     $content = AnnouncementManager::display_announcement($announcement_id);
     break;
 case 'list':
     $content = AnnouncementManager::getAnnouncements($stok, $announcement_number);
     break;
 case 'delete':
     /* Delete announcement */
     $id = intval($_GET['id']);
     if (api_get_session_id() != 0 && api_is_allowed_to_session_edit(false, true) == false) {
         api_not_allowed();
     }
     if (!api_is_course_coach() || api_is_element_in_the_session(TOOL_ANNOUNCEMENT, $id)) {
         // tooledit : visibility = 2 : only visible for platform administrator
         if ($ctok == $_GET['sec_token']) {
             AnnouncementManager::delete_announcement($_course, $id);
             Display::addFlash(Display::return_message(get_lang('AnnouncementDeleted')));
         }
     }
     header('Location: ' . $homeUrl);