jmontoya 9 rokov pred
rodič
commit
ee60711f19

+ 3 - 1
main/admin/course_intro_pdf_import.php

@@ -127,7 +127,9 @@ function import_pdfs($file, $subDir = '/')
                 api_set_default_visibility($docId, TOOL_DOCUMENT);
                 $errors[] = array('Line' => 0, 'Code' => $course['code'], 'Title' => $course['title']);
                 // Now add a link to the file from the Course description tool
-                $link = '<p>Sílabo de la asignatura <a href="'.api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course['code'].'&id_session=0&gidReq=0&action=download&id='.$docId.'" target="_blank"><img src="'.api_get_path(WEB_IMG_PATH).'icons/32/pdf.png"></a></p>';
+                $link = '<p>Sílabo de la asignatura <a href="'.api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course['code'].'&id_session=0&gidReq=0&action=download&id='.$docId.'" target="_blank">
+                          '.Display::return_icon('pdf.png').'
+                          </a></p>';
                 $course_description = new CourseDescription();
                 $session_id = api_get_session_id();
                 $course_description->set_course_id($course['real_id']);

+ 79 - 36
main/announcements/announcements.php

@@ -7,8 +7,8 @@
  * @author Julio Montoya <gugli100@gmail.com>, MORE code cleaning 2011
  *
  * @abstract The task of the internship was to integrate the 'send messages to specific users' with the
- *			 Announcements tool and also add the resource linker here. The database also needed refactoring
- *			 as there was no title field (the title was merged into the content field)
+ *             Announcements tool and also add the resource linker here. The database also needed refactoring
+ *             as there was no title field (the title was merged into the content field)
  * @package chamilo.announcements
  * multiple functions
  */
@@ -24,7 +24,7 @@ require_once '../inc/global.inc.php';
 $ctok = Security::get_existing_token();
 $stok = Security::get_token();
 
-$current_course_tool  = TOOL_ANNOUNCEMENT;
+$current_course_tool = TOOL_ANNOUNCEMENT;
 $this_section = SECTION_COURSES;
 $nameTools = get_lang('ToolAnnouncement');
 
@@ -64,7 +64,8 @@ $action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'list
 $announcement_number = AnnouncementManager::getNumberAnnouncements();
 
 $homeUrl = api_get_self().'?action=list&'.api_get_cidreq();
-$content = null;
+$content = '';
+$searchFormToString = '';
 
 switch ($action) {
     case 'move':
@@ -82,7 +83,7 @@ switch ($action) {
 
         if (!empty($sortDirection)) {
             if (!in_array(trim(strtoupper($sortDirection)), array('ASC', 'DESC'))) {
-                $sortDirection='ASC';
+                $sortDirection = 'ASC';
             }
 
             $announcementInfo = AnnouncementManager::get_by_id($course_id, $thisAnnouncementId);
@@ -129,11 +130,43 @@ switch ($action) {
         $content = AnnouncementManager::display_announcement($announcement_id);
         break;
     case 'list':
-
         $htmlHeadXtra[] = api_get_jqgrid_js();
 
+        $searchForm = new FormValidator(
+            'search_simple',
+            'post',
+            api_get_self().'?'.api_get_cidreq(),
+            '',
+            array(),
+            FormValidator::LAYOUT_INLINE
+        );
+
+        $searchForm->addElement('text', 'keyword', get_lang('Title'));
+        $users = CourseManager::get_user_list_from_course_code(api_get_course_id(), api_get_session_id());
+        $userList = array('' => '');
+        if (!empty($users)) {
+            foreach ($users as $user) {
+                $userList[$user['user_id']] = api_get_person_name($user['firstname'], $user['lastname']);
+            }
+        }
+        $users = [];
+        $searchForm->addElement('select', 'user_id', get_lang('Users'), $userList);
+        $searchForm->addButtonSearch(get_lang('Search'));
+
+        $filterData = array();
+        $keyword = '';
+        $userIdToSearch = 0;
+
+        if ($searchForm->validate()) {
+            $filterData = $searchForm->getSubmitValues();
+            $keyword = $filterData['keyword'];
+            $userIdToSearch = $filterData['user_id'];
+        }
+
+        $searchFormToString = $searchForm->returnForm();
+
         // jqgrid will use this URL to do the selects
-        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_course_announcements&'.api_get_cidreq();
+        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_course_announcements&'.api_get_cidreq().'&title_to_search='.$keyword.'&user_id_to_search='.$userIdToSearch;
         $deleteUrl = api_get_path(WEB_AJAX_PATH).'announcement.ajax.php?a=delete_item&'.api_get_cidreq();
         $columns = array(get_lang('Title'), get_lang('By'), get_lang('LastUpdateDate'), get_lang('Actions'));
 
@@ -194,7 +227,16 @@ switch ($action) {
 
         $content = '<script>
         $(function() {'.
-        Display::grid_js('announcements', $url, $columns, $columnModel, $extra_params, array(), '', true).$editOptions.'
+            Display::grid_js(
+                'announcements',
+                $url,
+                $columns,
+                $columnModel,
+                $extra_params,
+                array(),
+                '',
+                true
+            ).$editOptions.'
         });
         </script>';
 
@@ -207,12 +249,12 @@ switch ($action) {
                 (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath')
             ) {
                 $html .= '<div id="no-data-view">';
-                $html .= '<h3>' . get_lang('Announcements') . '</h3>';
+                $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",
+                    api_get_self()."?".api_get_cidreq()."&action=add",
                     array('class' => 'btn btn-primary')
                 );
                 $html .= '</div>';
@@ -228,15 +270,13 @@ switch ($action) {
     case 'delete':
         /* Delete announcement */
         $id = intval($_GET['id']);
-        if (api_get_session_id()!=0 && api_is_allowed_to_session_edit(false, true) == false) {
+        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)) {
-
             AnnouncementManager::delete_announcement($_course, $id);
             Display::addFlash(Display::return_message(get_lang('AnnouncementDeleted')));
-
         }
         header('Location: '.$homeUrl);
         exit;
@@ -263,7 +303,8 @@ switch ($action) {
         if (!isset($_GET['isStudentView']) || $_GET['isStudentView'] != 'false') {
             if (isset($_GET['id']) && $_GET['id']) {
                 if (api_get_session_id() != 0 &&
-                    api_is_allowed_to_session_edit(false, true) == false) {
+                    api_is_allowed_to_session_edit(false, true) == false
+                ) {
                     api_not_allowed();
                 }
 
@@ -293,7 +334,7 @@ switch ($action) {
 
         // DISPLAY ADD ANNOUNCEMENT COMMAND
         $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
-        $url = api_get_self().'?action='.$action.'&id=' . $id . '&' . api_get_cidreq();
+        $url = api_get_self().'?action='.$action.'&id='.$id.'&'.api_get_cidreq();
 
         $form = new FormValidator(
             'f1',
@@ -334,7 +375,7 @@ switch ($action) {
                 );
                 // setting the variables for the form elements: the users who need to receive the message
                 foreach ($to as &$user) {
-                    $user = 'USER:' . $user;
+                    $user = 'USER:'.$user;
                 }
                 // setting the variables for the form elements: the message has to be sent by email
                 $email_ann = '1';
@@ -399,7 +440,7 @@ switch ($action) {
                 'title' => $announcementInfo['title'],
                 'content' => $announcementInfo['content'],
                 'id' => $announcementInfo['id'],
-                'users' => $to
+                'users' => $to,
             );
         } else {
             $defaults = array();
@@ -417,7 +458,9 @@ switch ($action) {
             $htmlTags .= "<b>".$tag."</b></br>";
         }
 
-        $form->addHtml("<div class='form-group'><div class='col-sm-2'></div><div class='col-sm-8'><div class='alert alert-info'>".$htmlTags."</div></div></div>");
+        $form->addHtml(
+            "<div class='form-group'><div class='col-sm-2'></div><div class='col-sm-8'><div class='alert alert-info'>".$htmlTags."</div></div></div>"
+        );
         $form->addHtmlEditor(
             'content',
             get_lang('Description'),
@@ -435,7 +478,6 @@ switch ($action) {
         }
 
         $form->addCheckBox('send_to_hrm_users', null, get_lang('SendAnnouncementCopyToDRH'));
-
         $form->addButtonSave(get_lang('ButtonPublishAnnouncement'));
         $form->setDefaults($defaults);
 
@@ -497,7 +539,7 @@ switch ($action) {
                         $insert_id = AnnouncementManager::add_group_announcement(
                             $data['title'],
                             $data['content'],
-                            array('GROUP:' . $group_id),
+                            array('GROUP:'.$group_id),
                             $data['users'],
                             $file,
                             $file_comment,
@@ -524,7 +566,6 @@ switch ($action) {
                 } // end condition token
             }
         }
-
         $content = $form->returnForm();
         break;
 }
@@ -534,7 +575,7 @@ if (!empty($_GET['remind_inactive'])) {
 }
 
 if (!empty($group_id)) {
-    $group_properties  = GroupManager :: get_group_properties($group_id);
+    $group_properties = GroupManager:: get_group_properties($group_id);
     $interbreadcrumb[] = array(
         "url" => api_get_path(WEB_CODE_PATH)."group/group.php?".api_get_cidreq(),
         "name" => get_lang('Groups'),
@@ -557,41 +598,43 @@ if (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath') {
 
 // Actions
 $show_actions = false;
+$actionsLeft = '';
 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')
 ) {
-    echo '<div class="actions">';
-    if (in_array($action, array('add', 'modify','view'))) {
-        echo "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>".
+    if (in_array($action, array('add', 'modify', 'view'))) {
+        $actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>".
             Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM)."</a>";
     } else {
-        echo "<a href='".api_get_self()."?".api_get_cidreq()."&action=add&origin=".$origin."'>".
+        $actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."&action=add&origin=".$origin."'>".
             Display::return_icon('new_announce.png', get_lang('AddAnnouncement'), '', ICON_SIZE_MEDIUM)."</a>";
     }
     $show_actions = true;
 } else {
     if (in_array($action, array('view'))) {
-        echo '<div class="actions">';
-        echo "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>".
+        $actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>".
             Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM)."</a>";
-        echo '</div>';
     }
 }
 
 if (api_is_allowed_to_edit() && $announcement_number > 1) {
-    if (api_get_group_id() == 0 ) {
-        if (!$show_actions)
-            echo '<div class="actions">';
+    if (api_get_group_id() == 0) {
         if (!isset($_GET['action'])) {
-            echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete_all\" onclick=\"javascript:if(!confirm('".get_lang("ConfirmYourChoice")."')) return false;\">".
-                Display::return_icon('delete_announce.png',get_lang('AnnouncementDeleteAll'),'',ICON_SIZE_MEDIUM)."</a>";
+            $actionsLeft .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete_all\" onclick=\"javascript:if(!confirm('".get_lang("ConfirmYourChoice")."')) return false;\">".
+                Display::return_icon(
+                    'delete_announce.png',
+                    get_lang('AnnouncementDeleteAll'),
+                    '',
+                    ICON_SIZE_MEDIUM
+                )."</a>";
         }
     }
 }
 
-if ($show_actions)
-    echo '</div>';
+if ($show_actions) {
+    echo Display::toolbarAction('toolbar', array($actionsLeft, $searchFormToString), 2, false);
+}
 
 echo $content;
 

+ 28 - 23
main/attendance/attendance_sheet.php

@@ -107,14 +107,12 @@ if (api_is_allowed_to_edit(null, true) ||
     if (!$is_locked_attendance || api_is_platform_admin()) {
 
         $actionsLeft = '<a style="float:left;" href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">'.
-            Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
+            Display::return_icon('attendance_calendar.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
         $actionsLeft .= '<a id="pdf_export" style="float:left;"  href="index.php?'.api_get_cidreq().'&action=attendance_sheet_export_to_pdf&attendance_id='.$attendance_id.'&filter='.$default_filter.'&group_id='.$groupId.'">'.
-            Display::return_icon('pdf.png',get_lang('ExportToPDF'),'',ICON_SIZE_MEDIUM).'</a>';
-        //if (count($users_in_course) > 0) {
-        $actionsRight = $form->returnForm();
-        //}
+            Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>';
 
-        $toolbar = Display::toolbarAction('toolbar-attendance', array(0 => $actionsLeft, 1 => $actionsRight), 2 , false);
+        $actionsRight = $form->returnForm();
+        $toolbar = Display::toolbarAction('toolbar-attendance', array($actionsLeft, $actionsRight), 2, false);
         echo $toolbar;
     }
 
@@ -207,7 +205,6 @@ if (api_is_allowed_to_edit(null, true) ||
         </script>
 
         <form method="post" action="index.php?action=attendance_sheet_add&<?php echo api_get_cidreq().$param_filter ?>&attendance_id=<?php echo $attendance_id?>" >
-
             <div class="attendance-sheet-content" style="width:100%;background-color:#E1E1E1;margin-top:20px;">
                 <div class="divTableWithFloatingHeader attendance-users-table" style="width:45%;float:left;margin:0px;padding:0px;">
                     <table class="tableWithFloatingHeader data_table" width="100%">
@@ -264,15 +261,19 @@ if (api_is_allowed_to_edit(null, true) ||
                 echo '<table class="tableWithFloatingHeader data_table" width="100%">';
                 echo '<thead>';
                 $result = null;
-                if (count($attendant_calendar) > 0 ) {
+                if (count($attendant_calendar) > 0) {
                     foreach ($attendant_calendar as $calendar) {
                         $date = $calendar['date'];
                         $time = $calendar['time'];
                         $datetime = '<div class="grey">'. $date . ' - ' . $time . '</div>';
 
-                        $img_lock = Display::return_icon('lock-closed.png',get_lang('DateUnLock'),array('class'=>'img_lock','id'=>'datetime_column_'.$calendar['id']));
+                        $img_lock = Display::return_icon(
+                            'lock-closed.png',
+                            get_lang('DateUnLock'),
+                            array('class' => 'img_lock', 'id' => 'datetime_column_'.$calendar['id'])
+                        );
 
-                        if (!empty($calendar['done_attendance'])){
+                        if (!empty($calendar['done_attendance'])) {
                             $datetime = '<div class="blue">' . $date . ' - ' . $time . '</div>';
                         }
                         $disabled_check = 'disabled = "true"';
@@ -319,7 +320,7 @@ if (api_is_allowed_to_edit(null, true) ||
                     }
                     echo '<tr class="'.$class.'">';
 
-                    if (count($attendant_calendar) > 0 ) {
+                    if (count($attendant_calendar) > 0) {
                         foreach ($attendant_calendar as $calendar) {
                             $checked = 'checked';
                             $presence = -1;
@@ -343,10 +344,11 @@ if (api_is_allowed_to_edit(null, true) ||
                             $style_td = '';
 
                             if ($next_attendance_calendar_id == $calendar['id']) {
-                                if ($i%2==0)
+                                if ($i % 2 == 0) {
                                     $style_td = 'background-color:#eee;';
-                                else
+                                } else {
                                     $style_td = 'background-color:#dcdcdc;';
+                                }
                                 $disabled = '';
                             }
 
@@ -363,10 +365,10 @@ if (api_is_allowed_to_edit(null, true) ||
                             } else {
                                 switch ($presence) {
                                     case 1:
-                                        echo Display::return_icon('accept.png',get_lang('Attended'));
+                                        echo Display::return_icon('accept.png', get_lang('Attended'));
                                         break;
                                     case 0:
-                                        echo Display::return_icon('exclamation.png',get_lang('NotAttended'));
+                                        echo Display::return_icon('exclamation.png', get_lang('NotAttended'));
                                         break;
                                     case -1:
                                         //echo Display::return_icon('warning.png',get_lang('NotAttended'));
@@ -397,18 +399,21 @@ if (api_is_allowed_to_edit(null, true) ||
 
                 <div class="row">
                     <div class="col-md-12">
-                <?php if (!$is_locked_attendance || api_is_platform_admin()) {
-                    if (api_is_allowed_to_edit(null, true)) {
-                        ?>
-                        <button type="submit" class="btn btn-primary"><?php echo get_lang('Save') ?></button>
-                    <?php }
-                }
-                ?>  </div>
+                    <?php if (!$is_locked_attendance || api_is_platform_admin()) {
+                        if (api_is_allowed_to_edit(null, true)) { ?>
+                            <button type="submit" class="btn btn-primary"><?php echo get_lang('Save') ?></button>
+                        <?php }
+                    } ?>
+                    </div>
                 </div>
         </form>
     <?php
     } else {
-        echo Display::display_warning_message('<a href="'.api_get_path(WEB_CODE_PATH).'user/user.php?'.api_get_cidreq().'">'.get_lang('ThereAreNoRegisteredLearnersInsidetheCourse').'</a>', false);
+        echo Display::display_warning_message(
+            '<a href="'.api_get_path(WEB_CODE_PATH).'user/user.php?'.api_get_cidreq().'">'.
+            get_lang('ThereAreNoRegisteredLearnersInsidetheCourse').'</a>',
+            false
+        );
     }
 } else {
     echo Display::page_header(get_lang('AttendanceSheetReport'));

+ 10 - 8
main/calendar/agenda.php

@@ -92,7 +92,7 @@ if (api_is_allowed_to_edit(false, true) ||
     (api_get_course_setting('allow_user_edit_agenda') &&
     !api_is_anonymous() &&
     api_is_allowed_to_session_edit(false, true)) ||
-    GroupManager::user_has_access(api_get_user_id(), $group_id,  GroupManager::GROUP_TOOL_CALENDAR) &&
+    GroupManager::user_has_access(api_get_user_id(), $group_id, GroupManager::GROUP_TOOL_CALENDAR) &&
     GroupManager::is_tutor_of_group(api_get_user_id(), $group_id)
 ) {
     switch ($action) {
@@ -169,7 +169,7 @@ if (api_is_allowed_to_edit(false, true) ||
                 $allDay = isset($values['all_day']) ? 'true' : 'false';
                 $startDate = $values['date_range_start'];
                 $endDate = $values['date_range_end'];
-
+                $sendEmail = isset($values['add_announcement']) ? true : false;
                 $sendAttachment = isset($_FILES['user_upload']) ? true : false;
                 $attachment = $sendAttachment ? $_FILES['user_upload'] : null;
                 $attachmentComment = isset($values['file_comment']) ? $values['file_comment'] : null;
@@ -178,7 +178,7 @@ if (api_is_allowed_to_edit(false, true) ||
                 // This is a sub event. Delete the current and create another BT#7803
 
                 if (!empty($event['parent_event_id'])) {
-                    $agenda->delete_event($eventId);
+                    $agenda->deleteEvent($eventId);
 
                     $eventId = $agenda->addEvent(
                         $startDate,
@@ -211,7 +211,9 @@ if (api_is_allowed_to_edit(false, true) ||
                     $values['users_to_send'],
                     $attachment,
                     $attachmentComment,
-                    $comment
+                    $comment,
+                    '',
+                    $sendEmail
                 );
 
                 if (!empty($values['repeat']) && !empty($eventId)) {
@@ -245,7 +247,7 @@ if (api_is_allowed_to_edit(false, true) ||
         case 'importical':
             $actionName = get_lang('Import');
             $form = $agenda->getImportCalendarForm();
-            $content = $form->return_form();
+            $content = $form->returnForm();
 
             if ($form->validate()) {
                 $ical_name = $_FILES['ical_import']['name'];
@@ -274,7 +276,7 @@ if (api_is_allowed_to_edit(false, true) ||
         case "delete":
             if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $eventId) )) {
                 // a coach can only delete an element belonging to his session
-                $content = $agenda->delete_event($eventId);
+                $content = $agenda->deleteEvent($eventId);
             }
             break;
     }
@@ -283,11 +285,11 @@ if (api_is_allowed_to_edit(false, true) ||
 if (!empty($group_id)) {
     $group_properties = GroupManager :: get_group_properties($group_id);
     $interbreadcrumb[] = array(
-        "url" => api_get_path(WEB_CODE_PATH)."group/group.php",
+        "url" => api_get_path(WEB_CODE_PATH)."group/group.php?".api_get_cidreq(),
         "name" => get_lang('Groups')
     );
     $interbreadcrumb[] = array(
-        "url" => api_get_path(WEB_CODE_PATH)."group/group_space.php?gidReq=".$group_id,
+        "url" => api_get_path(WEB_CODE_PATH)."group/group_space.php?".api_get_cidreq(),
         "name" => get_lang('GroupSpace').' '.$group_properties['name']
     );
 }

+ 1 - 1
main/course_home/3column.php

@@ -60,7 +60,7 @@ if (api_is_allowed_to_edit(null, true)) {
         if ($tool['img'] != 'external.gif') {
             $tool['link'] = api_get_path(WEB_CODE_PATH).$tool['link'];
         }
-        $tool['image'] = api_get_path(WEB_IMG_PATH).$tool['image'];
+        $tool['image'] = Display::returnIconPath($tool['image']);
 
         echo "<br /><br /><br />\n";
         echo "<table class=\"message\" width=\"70%\" align=\"center\">\n",

+ 43 - 36
main/document/create_paint.php

@@ -1,5 +1,6 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
  *	This file allows creating audio files from a text.
  *
@@ -10,7 +11,6 @@
  * @todo clean all file
 */
 
-/*	INIT SECTION */
 require_once '../inc/global.inc.php';
 $_SESSION['whereami'] = 'document/createpaint';
 $this_section = SECTION_COURSES;
@@ -19,31 +19,33 @@ $nameTools = get_lang('PhotoRetouching');
 
 api_protect_course_script();
 api_block_anonymous_users();
+$_course = api_get_course_info();
+
 if (api_get_setting('enabled_support_paint') == 'false') {
-	api_not_allowed(true);
+    api_not_allowed(true);
 }
 
 $document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true);
 if (empty($document_data)) {
     if (api_is_in_group()) {
-        $group_properties   = GroupManager::get_group_properties(api_get_group_id());
-        $document_id        = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
-        $document_data      = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
+        $group_properties = GroupManager::get_group_properties(api_get_group_id());
+        $document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
+        $document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
     }
 }
 
 $document_id = $document_data['id'];
-$dir         = $document_data['path'];
+$dir = $document_data['path'];
 
 //$dir = isset($_GET['dir']) ? Security::remove_XSS($_GET['dir']) : Security::remove_XSS($_POST['dir']);
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
 
 //path for pixlr save
-$_SESSION['paint_dir']=Security::remove_XSS($dir);
-if ($_SESSION['paint_dir']=='/'){
-	$_SESSION['paint_dir']='';
+$_SESSION['paint_dir'] = Security::remove_XSS($dir);
+if ($_SESSION['paint_dir'] == '/') {
+    $_SESSION['paint_dir'] = '';
 }
-$_SESSION['paint_file']=get_lang('NewImage');
+$_SESSION['paint_file'] = get_lang('NewImage');
 
 // Please, do not modify this dirname formatting
 
@@ -73,56 +75,63 @@ if (!is_dir($filepath)) {
 $groupId = api_get_group_id();
 
 if (!empty($groupId)) {
-	$interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace'));
-	$noPHP_SELF = true;
-	$group = GroupManager::get_group_properties($groupId);
-	$path = explode('/', $dir);
-	if ('/'.$path[1] != $group['directory']) {
-		api_not_allowed(true);
-	}
+    $interbreadcrumb[] = array(
+        "url" => api_get_path(WEB_CODE_PATH)."group/group_space.php?".api_get_cidreq(),
+        "name" => get_lang('GroupSpace'),
+    );
+    $noPHP_SELF = true;
+    $group = GroupManager::get_group_properties($groupId);
+    $path = explode('/', $dir);
+    if ('/'.$path[1] != $group['directory']) {
+        api_not_allowed(true);
+    }
 }
 
-$interbreadcrumb[] = array ("url" => "./document.php?curdirpath=".urlencode($dir)."&".api_get_cidreq(), "name" => get_lang('Documents'));
+$interbreadcrumb[] = array(
+    "url" => "./document.php?curdirpath=".urlencode($dir)."&".api_get_cidreq(),
+    "name" => get_lang('Documents'),
+);
 
 if (!$is_allowed_in_course) {
-	api_not_allowed(true);
+    api_not_allowed(true);
 }
 
 if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] ||
-	DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir),api_get_session_id()))) {
-	api_not_allowed(true);
+	DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir), api_get_session_id()))
+) {
+    api_not_allowed(true);
 }
 
 /*	Header */
 Event::event_access_tool(TOOL_DOCUMENT);
 $display_dir = $dir;
 if (isset ($group)) {
-	$display_dir = explode('/', $dir);
-	unset ($display_dir[0]);
-	unset ($display_dir[1]);
-	$display_dir = implode('/', $display_dir);
+    $display_dir = explode('/', $dir);
+    unset ($display_dir[0]);
+    unset ($display_dir[1]);
+    $display_dir = implode('/', $display_dir);
 }
 
 // Interbreadcrumb for the current directory root path
 if (empty($document_data['parents'])) {
 	$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
 } else {
-	foreach($document_data['parents'] as $document_sub_data) {
-		$interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
-	}
+    foreach ($document_data['parents'] as $document_sub_data) {
+        $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
+    }
 }
 Display :: display_header($nameTools, 'Doc');
 
 echo '<div class="actions">';
 echo '<a href="document.php?id='.$document_id.'">'.
-    Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
+    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
 echo '</div>';
 
-///pixlr
+// pixlr
 // max size 1 Mb ??
 $title = urlencode(utf8_encode(get_lang('NewImage')));//TODO:check
 //
-$image = api_get_path(WEB_IMG_PATH) . 'canvas1024x768.png';
+$image = Display::returnIconPath('canvas1024x768.png');
 //
 $pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
 $langpixlr  = api_get_language_isocode();
@@ -149,13 +158,13 @@ if ($_SERVER['HTTP_HOST']=="localhost") {
 			</cross-domain-policy>';//more open domain="*"
 		@file_put_contents($path_and_file, $crossdomain);
 	}
-	$credentials="true";
+    $credentials = "true";
 } else {
-	$credentials="false";
+    $credentials = "false";
 }
 $pixlr_url = api_get_protocol().'://pixlr.com/editor/?title='.$title.'&image='.$image.'&loc='.$loc.'&referrer='.$referrer.'&target='.$target.'&exit='.$exit_path.'&locktarget='.$locktarget.'&locktitle='.$locktitle.'&credentials='.$credentials;
 ?>
-<script type="text/javascript">
+<script>
 
 document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo  $pixlr_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe></div>');
 function resizeIframe() {
@@ -168,9 +177,7 @@ function resizeIframe() {
 };
 document.getElementById('frame').onload = resizeIframe;
 window.onresize = resizeIframe;
-
 </script>
-
 <?php
 
 echo '<noscript>';

+ 9 - 9
main/document/slideshow.php

@@ -87,7 +87,8 @@ if ($slide_id != 'all') {
 		if ($slide > 0) {
 			echo '<a href="slideshow.php?slide_id='.$previous_slide.'&curdirpath='.$pathurl.'">';
 		}
-		echo '<img src="'.api_get_path(WEB_IMG_PATH).$imgp.'" title="'.get_lang('Previous').'" alt="'.get_lang('Previous').'">';
+
+        echo Display::return_icon($imgp, get_lang('Previous'));
 		if ($slide > 0) {
 			echo '</a>';
 		}
@@ -101,12 +102,14 @@ if ($slide_id != 'all') {
 		}
 		if ($slide == $total_slides - 1) {
 			$imgn = 'action_next_na.png';
-			$last = '<img src="'.api_get_path(WEB_IMG_PATH).'action_last_na.png" title="'.get_lang('LastSlide').'" alt="'.get_lang('LastSlide').'">';
+            $last = Display::return_icon('action_last_na.png', get_lang('LastSlide'));
 		} else {
 			$imgn = 'action_next.png';
-			$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'"><img src="'.api_get_path(WEB_IMG_PATH).'action_last.png" title="'.get_lang('LastSlide').'" alt="'.get_lang('LastSlide').'"></a>';
+			$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'">
+			        '.Display::return_icon('action_last.png', get_lang('LastSlide')).'
+                </a>';
 		}
-		echo '<img src="'.api_get_path(WEB_IMG_PATH).$imgn.'" title="'.get_lang('Next').'" alt="'.get_lang('Next').'">';
+        echo Display::return_icon($imgn, get_lang('Next'));
 		if ($slide > 0) {
 			echo '</a>';
 		}
@@ -130,12 +133,9 @@ if ($slide_id != 'all') {
 }
 // Slideshow options
 echo '<a href="slideshowoptions.php?curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
-    Display::return_icon('settings.png',get_lang('SetSlideshowOptions'),'',ICON_SIZE_MEDIUM).'</a>';
-
-?>
-</div>
+    Display::return_icon('settings.png', get_lang('SetSlideshowOptions'),'',ICON_SIZE_MEDIUM).'</a>';
 
-<?php
+echo '</div>';
 echo '<br />';
 
 /*	TREATING THE POST DATA FROM SLIDESHOW OPTIONS */

+ 2 - 2
main/inc/ajax/agenda.ajax.php

@@ -70,7 +70,7 @@ switch ($action) {
         $id_list = explode('_', $_REQUEST['id']);
         $id = $id_list[1];
         $deleteAllEventsFromSerie = isset($_REQUEST['delete_all_events']) ? true : false;
-        $agenda->delete_event($id, $deleteAllEventsFromSerie);
+        $agenda->deleteEvent($id, $deleteAllEventsFromSerie);
         break;
     case 'resize_event':
         if (!api_is_allowed_to_edit(null, true) && $type == 'course') {
@@ -80,7 +80,7 @@ switch ($action) {
         $minute_delta = $_REQUEST['minute_delta'];
         $id = explode('_', $_REQUEST['id']);
         $id = $id[1];
-        $agenda->resize_event($id, $day_delta, $minute_delta);
+        $agenda->resizeEvent($id, $day_delta, $minute_delta);
         break;
     case 'move_event':
         if (!api_is_allowed_to_edit(null, true) && $type == 'course') {

+ 14 - 1
main/inc/ajax/model.ajax.php

@@ -767,7 +767,20 @@ switch ($action) {
             'actions'
         );
 
-        $result = AnnouncementManager::getAnnouncements(null, null, false, $start, $limit, $sidx, $sord);
+        $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':

+ 39 - 19
main/inc/lib/AnnouncementManager.php

@@ -1388,10 +1388,22 @@ class AnnouncementManager
      * @param null $limit
      * @param string $sidx
      * @param string $sord
+     * @param string $titleToSearch
+     * @param int $userIdToSearch
+     *
      * @return array
      */
-    public static function getAnnouncements($stok, $announcement_number, $getCount = false, $start = null, $limit = null, $sidx = '', $sord = '')
-    {
+    public static function getAnnouncements(
+        $stok,
+        $announcement_number,
+        $getCount = false,
+        $start = null,
+        $limit = null,
+        $sidx = '',
+        $sord = '',
+        $titleToSearch = '',
+        $userIdToSearch = 0
+    ) {
         $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT);
         $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
 
@@ -1410,6 +1422,17 @@ class AnnouncementManager
             $select = ' COUNT(announcement.iid) count';
         }
 
+        $searchCondition = '';
+        if (!empty($titleToSearch)) {
+            $titleToSearch = Database::escape_string($titleToSearch);
+            $searchCondition .= " AND (title LIKE '%$titleToSearch%')";
+        }
+
+        if (!empty($userIdToSearch)) {
+            $userIdToSearch = intval($userIdToSearch);
+            $searchCondition .= " AND (ip.insert_user_id = $userIdToSearch)";
+        }
+
         if (api_is_allowed_to_edit(false, true) ||
             ($allowUserEditSetting && !api_is_anonymous())
         ) {
@@ -1433,6 +1456,7 @@ class AnnouncementManager
                                 ) AND
                                 ip.visibility IN ('1', '0')
                                 $condition_session
+                                $searchCondition
                             ORDER BY display_order DESC";
                 } else {
                     $sql = "SELECT $select
@@ -1445,6 +1469,7 @@ class AnnouncementManager
                                 (ip.to_user_id = $user_id OR ip.to_group_id='0' OR ip.to_group_id IS NULL) AND
                                 ip.visibility IN ('1', '0')
                             $condition_session
+                            $searchCondition
                             ORDER BY display_order DESC";
                 }
             } elseif ($group_id != 0) {
@@ -1459,7 +1484,7 @@ class AnnouncementManager
                             ip.visibility<>'2' AND
                             (ip.to_group_id = $group_id OR ip.to_group_id='0' OR ip.to_group_id IS NULL)
                             $condition_session
-
+                            $searchCondition
                         ORDER BY display_order DESC";
                 //GROUP BY ip.ref
             } else {
@@ -1477,6 +1502,7 @@ class AnnouncementManager
                             ip.tool='announcement' AND
                             ip.visibility='1'
                             $condition_session
+                            $searchCondition
                         ORDER BY display_order DESC";
 
                     //GROUP BY ip.ref
@@ -1491,6 +1517,7 @@ class AnnouncementManager
                                 ip.c_id = $course_id  AND
                                 (ip.visibility='0' or ip.visibility='1')
                                 $condition_session
+                                $searchCondition
                             ORDER BY display_order DESC";
                     //GROUP BY ip.ref
                 }
@@ -1533,8 +1560,9 @@ class AnnouncementManager
                             announcement.id = ip.ref
                             AND ip.tool='announcement'
                             $cond_user_id
-                            $condition_session AND
-                            ip.visibility='1'
+                            $condition_session
+                            $searchCondition
+                            AND ip.visibility='1'
                         ORDER BY display_order DESC";
             } else {
                 if ($user_id) {
@@ -1556,6 +1584,7 @@ class AnnouncementManager
     						ip.tool='announcement'
     						$cond_user_id
     						$condition_session
+    						$searchCondition
     						AND ip.visibility='1'
     						AND announcement.session_id IN(0, ".api_get_session_id().")
 						ORDER BY display_order DESC";
@@ -1577,17 +1606,21 @@ class AnnouncementManager
                             announcement.id = ip.ref AND
                             ip.tool='announcement'
                             $cond_user_id
-                            $condition_session AND
+                            $condition_session
+                            $searchCondition
+                            AND
                             ip.visibility='1' AND
                             announcement.session_id IN ( 0,".api_get_session_id().")";
                 }
             }
         }
+
         if (!is_null($start) && !is_null($limit)) {
             $start = intval($start);
             $limit = intval($limit);
             $sql .= " LIMIT $start, $limit";
         }
+
         $result = Database::query($sql);
         if ($getCount) {
             $result = Database::fetch_array($result, 'ASSOC');
@@ -1599,12 +1632,6 @@ class AnnouncementManager
         $bottomAnnouncement = $announcement_number;
         $origin = null;
 
-        /*if (api_is_allowed_to_edit(false,true) OR (api_is_course_coach() &&
-            api_is_element_in_the_session(TOOL_ANNOUNCEMENT, $myrow['id']))
-            OR (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous())) {
-            $ths .= Display::tag('th', get_lang('Modify'));
-        }*/
-
         $displayed = [];
         $results = [];
         $actionUrl = api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq();
@@ -1620,13 +1647,6 @@ class AnnouncementManager
                 $item_visibility = api_get_item_visibility($_course, TOOL_ANNOUNCEMENT, $myrow['id'], $session_id);
                 $myrow['visibility'] = $item_visibility;
 
-                // the styles
-                if ($myrow['visibility'] == '0') {
-                    $style='invisible';
-                } else {
-                    $style = '';
-                }
-
                 // show attachment list
                 $attachment_list = AnnouncementManager::get_attachment($myrow['id']);
 

+ 13 - 14
main/inc/lib/agenda.lib.php

@@ -289,7 +289,7 @@ class Agenda
 
                     // Add announcement.
                     if ($addAsAnnouncement) {
-                        $this->store_agenda_item_as_announcement($id, $usersToSend);
+                        $this->storeAgendaEventAsAnnouncement($id, $usersToSend);
                     }
 
                     // Add attachment.
@@ -507,7 +507,7 @@ class Agenda
      * @param array $sentTo
      * @return int
      */
-    public function store_agenda_item_as_announcement($item_id, $sentTo = array())
+    public function storeAgendaEventAsAnnouncement($item_id, $sentTo = array())
     {
         $table_agenda = Database::get_course_table(TABLE_AGENDA);
         $course_id = api_get_course_int_id();
@@ -554,11 +554,11 @@ class Agenda
      * @param string $title
      * @param string $content
      * @param array $usersToSend
-     * @param int $editRepeatType
      * @param array $attachmentArray
      * @param string $attachmentComment
      * @param string $comment
      * @param string $color
+     * @param bool $addAnnouncement
      *
      * @return bool
      */
@@ -573,7 +573,8 @@ class Agenda
         $attachmentArray = array(),
         $attachmentComment = '',
         $comment = '',
-        $color = ''
+        $color = '',
+        $addAnnouncement = false
     ) {
         $start = api_get_utc_datetime($start);
         $end = api_get_utc_datetime($end);
@@ -774,9 +775,9 @@ class Agenda
                     }
 
                     // Add announcement.
-                    /*if (isset($addAsAnnouncement) && !empty($addAsAnnouncement)) {
-                        $this->store_agenda_item_as_announcement($id);
-                    }*/
+                    if (isset($addAnnouncement) && !empty($addAnnouncement)) {
+                        $this->storeAgendaEventAsAnnouncement($id, $usersToSend);
+                    }
 
                     // Add attachment.
                     if (isset($attachmentArray) && !empty($attachmentArray)) {
@@ -813,7 +814,7 @@ class Agenda
      * @param int $id
      * @param bool $deleteAllItemsFromSerie
      */
-    public function delete_event($id, $deleteAllItemsFromSerie = false)
+    public function deleteEvent($id, $deleteAllItemsFromSerie = false)
     {
         switch ($this->type) {
             case 'personal':
@@ -838,23 +839,22 @@ class Agenda
                             $events = $this->getAllRepeatEvents($eventInfo['parent_event_id']);
                             if (!empty($events)) {
                                 foreach ($events as $event) {
-                                    $this->delete_event($event['id']);
+                                    $this->deleteEvent($event['id']);
                                 }
                             }
                             // Removing parent.
-                            $this->delete_event($eventInfo['parent_event_id']);
+                            $this->deleteEvent($eventInfo['parent_event_id']);
                         } else {
                             // This is the father looking for the children.
                             $events = $this->getAllRepeatEvents($id);
                             if (!empty($events)) {
                                 foreach ($events as $event) {
-                                    $this->delete_event($event['id']);
+                                    $this->deleteEvent($event['id']);
                                 }
                             }
                         }
                     }
 
-
                     // Removing from events.
                     Database::delete(
                         $this->tbl_course_agenda,
@@ -936,7 +936,6 @@ class Agenda
                         $this->eventOtherSessionColor
                     );
                 } else {
-
                     $this->getCourseEvents(
                         $start,
                         $end,
@@ -1078,7 +1077,7 @@ class Agenda
      * @param int $minute_delta
      * @return int
      */
-    public function resize_event($id, $day_delta, $minute_delta)
+    public function resizeEvent($id, $day_delta, $minute_delta)
     {
         // we convert the hour delta into minutes and add the minute delta
         $delta = ($day_delta * 60 * 24) + $minute_delta;

+ 8 - 3
main/inc/lib/course_home.lib.php

@@ -119,7 +119,9 @@ class CourseHome
                 }
             }
 
-            if (api_get_session_id() != 0 && in_array($tool['name'], array('course_maintenance', 'course_setting'))) {
+            if (api_get_session_id() != 0 &&
+                in_array($tool['name'], array('course_maintenance', 'course_setting'))
+            ) {
                 continue;
             }
 
@@ -143,10 +145,13 @@ class CourseHome
             }
 
             // Setting the actual image url
-            $tool['img'] = api_get_path(WEB_IMG_PATH).$tool['img'];
+            $tool['img'] = Display::returnIconPath($tool['img']);
 
             // VISIBLE
-            if (($tool['visibility'] || ((api_is_coach() || api_is_course_tutor()) && $tool['name'] == TOOL_TRACKING)) || $cat == 'courseAdmin' || $cat == 'platformAdmin') {
+            if (($tool['visibility'] ||
+                ((api_is_coach() || api_is_course_tutor()) && $tool['name'] == TOOL_TRACKING)) ||
+                $cat == 'courseAdmin' || $cat == 'platformAdmin'
+            ) {
                 if (strpos($tool['name'], 'visio_') !== false) {
                     $cell_content .= '<a  href="javascript: void(0);" onclick="javascript: window.open(\''.$tool['link'].$link_annex.'\',\'window_visio'.$_SESSION['_cid'].'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$tool['target'].'"><img src="'.$tool['img'].'" title="'.$tool_name.'" alt="'.$tool_name.'" align="absmiddle" border="0">'.$tool_name.'</a>';
                 } elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) {

+ 2 - 2
main/inc/lib/display.lib.php

@@ -698,7 +698,7 @@ class Display
 
     /**
      * Gets the path of an icon
-     * 
+     *
      * @param string $icon
      * @return string
      */
@@ -2208,7 +2208,7 @@ class Display
                 if ( $col == 2 && $i == 1 ) {
                     if ($right === true) {
                         $html .= '<div class="pull-right">';
-                        $html .= (isset($content[$i])?$content[$i]:'');
+                        $html .= (isset($content[$i]) ? $content[$i] : '');
                         $html .= '</div>';
                     } else {
                         $html .= $content[$i];

+ 8 - 13
main/inc/lib/document.lib.php

@@ -3480,7 +3480,6 @@ class DocumentManager
         );
 
         $return .= $write_result;
-        $img_path = api_get_path(WEB_IMG_PATH);
         if ($lp_id == false) {
             $url = api_get_path(WEB_AJAX_PATH).'lp.ajax.php?a=get_documents&url='.$overwrite_url.'&lp_id='.$lp_id.'&cidReq='.$course_info['code'];
             $return .= "<script>
@@ -3526,12 +3525,12 @@ class DocumentManager
 
                 if (image.hasClass('open')) {
                     image.removeClass('open');
-                    image.attr('src', '" . $img_path . "nolines_plus.gif');
+                    image.attr('src', '" . Display::returnIconPath('nolines_plus.gif')."');
                     $('#'+id).show();
                     $('#'+tempId).hide();
                 } else {
                     image.addClass('open');
-                    image.attr('src', '" . $img_path . "nolines_minus.gif');
+                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif') . "');
                     $('#'+id).hide();
                     $('#'+tempId).show();
 
@@ -3578,7 +3577,6 @@ class DocumentManager
         $target,
         $overwrite_url
     ) {
-        $img_path = api_get_path(WEB_IMG_PATH);
         $img_sys_path = api_get_path(SYS_CODE_PATH) . 'img/';
         $web_code_path = api_get_path(WEB_CODE_PATH);
 
@@ -3605,7 +3603,7 @@ class DocumentManager
 
         // Show the "image name" not the filename of the image.
         if ($lp_id) {
-            //LP URL
+            // LP URL
             $url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type=' . TOOL_DOCUMENT . '&amp;file=' . $documentId . '&amp;lp_id=' . $lp_id;
             if (!empty($overwrite_url)) {
                 $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId.'';
@@ -3618,9 +3616,9 @@ class DocumentManager
             }
         }
 
-        $img = $img_path . $icon;
+        $img = Display::returnIconPath($icon);
         if (!file_exists($img_sys_path . $icon)) {
-            $img = $img_path . 'icons/16/default_small.gif';
+            $img = Display::returnIconPath('default_small.gif');
         }
 
         $link = Display::url(
@@ -3672,8 +3670,6 @@ class DocumentManager
         $title = isset($resource['title']) ? $resource['title'] : null;
         $path = isset($resource['path']) ? $resource['path'] : null;
 
-        $img_path = api_get_path(WEB_IMG_PATH);
-
         if (empty($path)) {
             $num = 0;
         } else {
@@ -3725,13 +3721,12 @@ class DocumentManager
 
         $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_' . $resource['id'] . '"  style="margin-left:' . ($num * 18) . 'px; ">';
 
-        $image = $img_path.'nolines_plus.gif';
+        $image = Display::returnIconPath('nolines_plus.gif');
         if (empty($path)) {
-            $image = $img_path.'nolines_minus.gif';
+            $image = Display::returnIconPath('nolines_minus.gif');
         }
         $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'] . '" '.$onclick.'>';
-
-        $return .= '<img alt="" src="' . $img_path . 'lp_folder.gif" title="" align="absmiddle" />&nbsp;';
+        $return .= Display::returnIconPath('lp_folder.gif').'&nbsp;';
         $return .= '<span '.$onclick.' style="cursor: pointer;" >'.$title.'</span>';
         $return .= '</li>';
 

+ 4 - 5
main/inc/lib/formvalidator/FormValidator.class.php

@@ -873,19 +873,18 @@ EOT;
         $xajax_upload = new xajax(api_get_path(WEB_LIBRARY_PATH) . 'upload.xajax.php');
 
         $xajax_upload->registerFunction('updateProgress');
-
-
         // IMPORTANT : must be the first element of the form
         $el = $this->insertElementBefore(FormValidator::createElement('html', '<input type="hidden" name="UPLOAD_IDENTIFIER" value="' . $upload_id . '" />'), $element_after);
 
         $this->addElement('html', '<br />');
 
         // Add div-element where the progress bar is to be displayed
-        $this->addElement('html', '
-            <div id="dynamic_div_container" style="display:none">
+        $this->addElement(
+            'html',
+            '<div id="dynamic_div_container" style="display:none">
                 <div id="dynamic_div_label">' . get_lang('UploadFile') . '</div>
                 <div id="dynamic_div_frame" style="width:214px; height:12px; border:1px solid grey; background-image:url(' . Display::returnIconPath('real_upload_frame.gif').');">
-                    <div id="dynamic_div_filled" style="width:0%;height:100%;background-image:url(' . api_get_path(WEB_IMG_PATH) . 'real_upload_step.gif);background-repeat:repeat-x;background-position:center;"></div>
+                    <div id="dynamic_div_filled" style="width:0%;height:100%;background-image:url(' . Display::returnIconPath('real_upload_step.gif').');background-repeat:repeat-x;background-position:center;"></div>
                 </div>
             </div>'
         );

+ 5 - 4
main/inc/lib/tracking.lib.php

@@ -6384,15 +6384,16 @@ class TrackingCourseLog
                 $user['survey'] = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0) .' / '.$total_surveys;
             }
 
-    		$user['link'] = '<center><a href="../mySpace/myStudents.php?student='.$user['user_id'].'&details=true&course='.$course_code.'&origin=tracking_course&id_session='.$session_id.'"><img src="'.api_get_path(WEB_IMG_PATH).'icons/22/2rightarrow.png" border="0" /></a></center>';
+    		$user['link'] = '<center>
+                             <a href="../mySpace/myStudents.php?student='.$user['user_id'].'&details=true&course='.$course_code.'&origin=tracking_course&id_session='.$session_id.'">
+    		                 '.Display::return_icon('2rightarrow.png').'
+    		                 </a>
+                         </center>';
 
     		// store columns in array $users
-
     		$is_western_name_order = api_is_western_name_order();
             $user_row = array();
-
             $user_row[]= $user['official_code']; //0
-
             if ($is_western_name_order) {
                 $user_row[]= $user['firstname'];
                 $user_row[]= $user['lastname'];