diff --git a/main/announcements/announcements.inc.php b/main/announcements/announcements.inc.php index 1c13a7e918..3b9d2b0ba2 100755 --- a/main/announcements/announcements.inc.php +++ b/main/announcements/announcements.inc.php @@ -1,18 +1,13 @@ -\n"; - echo "" . $title . "\n"; - echo "" . get_lang('AnnouncementPublishedOn') . " : " . api_convert_and_format_date($last_post_datetime, null, date_default_timezone_get()) . "\n"; - echo "$content\n"; + echo ""; + echo ""; + echo ""; + echo ""; echo "
" . $title . "
" . get_lang('AnnouncementPublishedOn') . " : " . api_convert_and_format_date($last_post_datetime, null, date_default_timezone_get()) . "
$content
"; } -/*====================================== +/* SHOW_TO_FORM -======================================*/ +*/ /** * this function shows the form for sending a message to a specific group or user. */ -function show_to_form($to_already_selected) -{ +function show_to_form($to_already_selected) { $user_list=get_course_users(); $group_list=get_course_groups(); if ($to_already_selected == "") $to_already_selected = array(); - echo "\n\n"; - echo "\t\n"; + echo "
"; + echo "\t"; // the form containing all the groups and all the users of the course - echo "\t\t\n"; + echo ""; // the buttons for adding or removing groups/users - echo "\n\t\t"; + echo "\n"; - echo "\t\n"; + echo ""; + echo ""; echo "
\n"; + echo ""; echo "".get_lang('Users')."
"; construct_not_selected_select_form($group_list,$user_list,$to_already_selected); - echo "\t\t
\n"; - /*echo "\t\t"; + /*echo "> \">", - "\n\t\t

 

", + "

 

", - "\n\t\t";*/ @@ -108,28 +100,28 @@ function show_to_form($to_already_selected)

\n"; - echo "\n\t\t
\n"; + echo ""; // the form containing the selected groups and users echo "".get_lang('DestinationUsers')."
"; construct_selected_select_form($group_list,$user_list,$to_already_selected); - echo "\t\t
"; } -/*=========================================== +/* CONSTRUCT_NOT_SELECT_SELECT_FORM -===========================================*/ +*/ /** * this function shows the form for sending a message to a specific group or user. */ function construct_not_selected_select_form($group_list=null, $user_list=null,$to_already_selected) { - echo "\t\t"; // adding the groups to the select form if ($group_list) { @@ -139,14 +131,14 @@ function construct_not_selected_select_form($group_list=null, $user_list=null,$t { if (!in_array("GROUP:".$this_group['id'],$to_already_selected)) // $to_already_selected is the array containing the groups (and users) that are already selected { - echo "\t\t\n"; + ""; } } } // a divider - echo "\t\t\n"; + echo ""; } // adding the individual users to the select form if ($user_list) { @@ -155,21 +147,21 @@ function construct_not_selected_select_form($group_list=null, $user_list=null,$t if (is_array($to_already_selected)) { if (!in_array("USER:".$this_user['user_id'],$to_already_selected)) // $to_already_selected is the array containing the users (and groups) that are already selected { - echo "\t\t\n"; + ""; } } } } - echo "\t\t\n"; + echo ""; } -/*========================================== +/* CONSTRUCT_SELECTED_SELECT_FORM -==========================================*/ +*/ /** * this function shows the form for sending a message to a specific group or user. */ @@ -190,20 +182,20 @@ function construct_selected_select_form($group_list=null, $user_list=null,$to_al $ref_array_users=get_course_users(); // we construct the form of the already selected groups / users - echo "\t\t"; if (is_array($to_already_selected)) { foreach($to_already_selected as $groupuser) { list($type,$id)=explode(":",$groupuser); if ($type=="GROUP") { - echo "\t\t"; + echo ""; } else { foreach($ref_array_users as $key=>$value){ if($value['user_id']==$id){ - echo "\t\t"; + echo ""; break; } } @@ -219,9 +211,9 @@ function construct_selected_select_form($group_list=null, $user_list=null,$to_al //api_display_normal_message("group " . $thisGroup[id] . $thisGroup[name]); if (!is_array($to_already_selected) || !in_array("GROUP:".$this_group['id'],$to_already_selected)) // $to_already_selected is the array containing the groups (and users) that are already selected { - echo "\t\t\n"; + ""; } } } @@ -230,14 +222,14 @@ function construct_selected_select_form($group_list=null, $user_list=null,$to_al { if (!is_array($to_already_selected) || !in_array("USER:".$this_user['user_id'],$to_already_selected)) // $to_already_selected is the array containing the users (and groups) that are already selected { - echo "\t\t\n"; + ""; } } } } - echo "\n"; + echo ""; } @@ -247,29 +239,29 @@ function construct_selected_select_form($group_list=null, $user_list=null,$to_al function show_to_form_group($group_id) { - echo "\n\n"; - echo "\t\n"; + echo "
"; + echo ""; - echo "\t\t\n"; + echo ""; // the buttons for adding or removing groups/users - echo "\n\t\t"; + echo "\n"; - echo "\t\n"; + echo ""; + echo ""; echo "
\n"; + echo ""; - echo "\t\t"; $group_users = GroupManager::get_subscribed_users($group_id); foreach ($group_users as $user){ echo ''; } echo ''; - echo "\t\t\n"; - /*echo "\t\t"; + /*echo "> \">", - "\n\t\t

 

", + "

 

", - "\n\t\t";*/ @@ -278,22 +270,20 @@ function show_to_form_group($group_id)

\n"; - echo "\n\t\t
\n"; + echo ""; - echo "\t\t"; echo ''; - echo "\t\t
"; } /* -============================================================================== DATA FUNCTIONS -============================================================================== */ /** @@ -331,9 +321,10 @@ function get_course_groups() return $new_group_list; } -/*====================================== +/* + * LOAD_EDIT_USERS -======================================*/ +*/ /** * This tools loads all the users and all the groups who have received * a specific item (in this case an announcement item) @@ -371,9 +362,9 @@ function load_edit_users($tool, $id) -/*====================================== +/* USER_GROUP_FILTER_JAVASCRIPT -======================================*/ +*/ /** * returns the javascript for setting a filter * this goes into the $htmlHeadXtra[] array @@ -393,9 +384,9 @@ function user_group_filter_javascript() } -/*====================================== +/* TO_JAVASCRIPT -========================================*/ +*/ /** * returns all the javascript that is required for easily * setting the target people/groups @@ -552,9 +543,9 @@ function plus_attachment() { } -/*====================================== +/* SENT_TO_FORM -======================================*/ +*/ /** * constructs the form to display all the groups and users the message has been sent to * input: $sent_to_array is a 2 dimensional array containing the groups and the users @@ -593,14 +584,14 @@ function sent_to_form($sent_to_array) // starting the form if there is more than one user/group if ($total_numbers >1) { - $output=""; $output.=""; // outputting the name of the groups if (is_array($sent_to_array['groups'])) { foreach ($sent_to_array['groups'] as $group_id) { - $output.="\t\n"; + $output.=""; } } @@ -611,13 +602,13 @@ function sent_to_form($sent_to_array) foreach ($sent_to_array['users'] as $user_id) { $user_info = api_get_user_info($user_id); - $output.="\t\n"; + $output.=""; } } } // ending the form - $output.="\n"; + $output.=""; } else // there is only one user/group { @@ -643,9 +634,9 @@ function sent_to_form($sent_to_array) } -/*====================================== +/* SEPARATE_USERS_GROUPS - ======================================*/ +*/ /** * This function separates the users from the groups * users have a value USER:XXX (with XXX the dokeos id @@ -674,9 +665,9 @@ function separate_users_groups($to) -/*====================================== +/* SENT_TO() - ======================================*/ +*/ /** * Returns all the users and all the groups a specific announcement item * has been sent to @@ -776,8 +767,7 @@ function change_visibility_announcement($tool,$id) function store_advalvas_item($emailTitle, $newContent, $order, $to, $file = array(), $file_comment='') { global $_course; - global $nameTools; - global $_user; + global $nameTools; $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY); @@ -809,7 +799,7 @@ function store_advalvas_item($emailTitle, $newContent, $order, $to, $file = arra { foreach ($send_to['groups'] as $group) { - api_item_property_update($_course, TOOL_ANNOUNCEMENT, $last_id, "AnnouncementAdded", $_user['user_id'], $group); + api_item_property_update($_course, TOOL_ANNOUNCEMENT, $last_id, "AnnouncementAdded", api_get_user_id(), $group); } } @@ -818,23 +808,21 @@ function store_advalvas_item($emailTitle, $newContent, $order, $to, $file = arra { foreach ($send_to['users'] as $user) { - api_item_property_update($_course, TOOL_ANNOUNCEMENT, $last_id, "AnnouncementAdded", $_user['user_id'], '', $user); + api_item_property_update($_course, TOOL_ANNOUNCEMENT, $last_id, "AnnouncementAdded", api_get_user_id(), '', $user); } } } else // the message is sent to everyone, so we set the group to 0 { - api_item_property_update($_course, TOOL_ANNOUNCEMENT, $last_id, "AnnouncementAdded", $_user['user_id'], '0'); + api_item_property_update($_course, TOOL_ANNOUNCEMENT, $last_id, "AnnouncementAdded", api_get_user_id(), '0'); } return $last_id; } -function store_advalvas_group_item($emailTitle,$newContent, $order, $to, $to_users, $file = array(), $file_comment='') -{ +function store_advalvas_group_item($emailTitle,$newContent, $order, $to, $to_users, $file = array(), $file_comment='') { global $_course; global $nameTools; - global $_user; // database definitions $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); @@ -868,7 +856,7 @@ function store_advalvas_group_item($emailTitle,$newContent, $order, $to, $to_use { foreach ($send_to['groups'] as $group) { - api_item_property_update($_course, TOOL_ANNOUNCEMENT, $last_id, "AnnouncementAdded", $_user['user_id'], $group); + api_item_property_update($_course, TOOL_ANNOUNCEMENT, $last_id, "AnnouncementAdded", api_get_user_id(), $group); } } } @@ -879,7 +867,7 @@ function store_advalvas_group_item($emailTitle,$newContent, $order, $to, $to_use { foreach ($to_users as $user) { - api_item_property_update($_course, TOOL_ANNOUNCEMENT, $last_id, "AnnouncementAdded", $_user['user_id'], '', $user); + api_item_property_update($_course, TOOL_ANNOUNCEMENT, $last_id, "AnnouncementAdded", api_get_user_id(), '', $user); } } } @@ -901,8 +889,7 @@ function edit_advalvas_item($id,$emailTitle,$newContent,$to,$file = array(), $fi global $_course; global $nameTools; - global $_user; - + global $tbl_announcement; global $tbl_item_property; @@ -940,7 +927,7 @@ function edit_advalvas_item($id,$emailTitle,$newContent,$to,$file = array(), $fi { foreach ($send_to['groups'] as $group) { - api_item_property_update($_course, TOOL_ANNOUNCEMENT, $id, "AnnouncementUpdated", $_user['user_id'], $group); + api_item_property_update($_course, TOOL_ANNOUNCEMENT, $id, "AnnouncementUpdated", api_get_user_id(), $group); } } // storing the selected users @@ -948,21 +935,19 @@ function edit_advalvas_item($id,$emailTitle,$newContent,$to,$file = array(), $fi { foreach ($send_to['users'] as $user) { - api_item_property_update($_course, TOOL_ANNOUNCEMENT, $id, "AnnouncementUpdated", $_user['user_id'], 0, $user); + api_item_property_update($_course, TOOL_ANNOUNCEMENT, $id, "AnnouncementUpdated", api_get_user_id(), 0, $user); } } } else // the message is sent to everyone, so we set the group to 0 { - api_item_property_update($_course, TOOL_ANNOUNCEMENT, $id, "AnnouncementUpdated", $_user['user_id'], '0'); + api_item_property_update($_course, TOOL_ANNOUNCEMENT, $id, "AnnouncementUpdated", api_get_user_id(), '0'); } } /* -============================================================================== MAIL FUNCTIONS -============================================================================== */ /** diff --git a/main/announcements/announcements.php b/main/announcements/announcements.php index dcb27e71d5..634b63e0dd 100755 --- a/main/announcements/announcements.php +++ b/main/announcements/announcements.php @@ -893,8 +893,8 @@ if (!$surveyid) { if (empty($_GET['origin']) OR $_GET['origin'] !== 'learnpath') { echo "\n\n\n"; - echo "\t\n"; - echo "\t\t\n"; + echo "
\n"; + echo "
\n"; } /* @@ -902,12 +902,12 @@ if (empty($_GET['origin']) OR $_GET['origin'] !== 'learnpath') { */ if (!$surveyid) { if ($display_title_list == true) { - echo "\t\t\t\n"; + echo "
\n"; while ($myrow = Database::fetch_array($result)) { $title = $myrow['title']; $title = Security::remove_XSS($title); - echo "\t\t\t\t\n"; - echo "\t\t\t\t\t\n"; + echo "\n\t\t\t\t\n"; + echo Display::return_icon('lp_announcement.png', api_convert_and_format_date($myrow['end_date'], DATE_FORMAT_LONG), array('align' => 'absmiddle', 'Width' => '10', 'Height' => '10'))." " . api_trunc_str($title, $length) . "\n" . $session_img; + echo "\n\n"; } - echo "\t\t\t
\n"; + echo "
\n"; if ($myrow['visibility']==0) { $class="class=\"invisible\""; } else { @@ -916,18 +916,18 @@ if (!$surveyid) { //validation when belongs to a session $session_img = api_get_session_image($myrow['session_id'], $_user['status']); - echo "\t\t\t\t\t\t".Display::return_icon('lp_announcement.png', api_convert_and_format_date($myrow['end_date'], DATE_FORMAT_LONG), array('align' => 'absmiddle', 'Width' => '10', 'Height' => '10'))." " . api_trunc_str($title, $length) . "\n" . $session_img; - echo "\t\t\t\t\t
\n"; + echo "
\n"; } // end $display_title_list == true } if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') { - echo "\t\t\n"; - echo "\t\t \n"; + echo "\n"; + echo " \n"; // START RIGHT PART - echo "\t\t\n"; + echo "\n"; } /* @@ -1310,7 +1310,7 @@ if ($display_announcement_list && !$surveyid) { $iterator = 1; $bottomAnnouncement = $announcement_number; - echo "\t\t\t\n"; + echo "
\n"; $displayed=array(); @@ -1339,46 +1339,46 @@ if ($display_announcement_list && !$surveyid) { $style = ''; } - echo "\t\t\t\t"; + echo ""; /* THE ICONS */ - echo "\t\t\t\t\t\n"; + echo "\n"; /* TITLE */ - echo "\t\t\t\t\t\n"; - echo "\t\t\t\t\t\n"; + echo "\n","\t\t\t\t\n"; - echo "\t\t\t\t\n\t\t\t\t\t"; + echo "\n\n\t\t\t\t\n"; + echo "\n\n"; /* CONTENT */ - echo "\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n"; + echo "\n\n"; /* RESOURCES */ - echo "\n\n\n"; + echo ""; $iterator ++; } else { // end of is_allowed_to_edit diff --git a/main/announcements/download.php b/main/announcements/download.php index 921d53eb79..1ec5e3eb2d 100755 --- a/main/announcements/download.php +++ b/main/announcements/download.php @@ -1,48 +1,25 @@ -
\n"; + echo "\n"; // anchoring echo "\n"; // User or group icon if ($myrow['to_group_id']!== '0' and $myrow['to_group_id']!== 'NULL') { - echo "\t\t\t\t\t\t".Display::return_icon('group.gif', get_lang('AnnounceSentToUserSelection'))."\n"; + echo Display::return_icon('group.gif', get_lang('AnnounceSentToUserSelection'))."\n"; } // the email icon if ($myrow['email_sent'] == '1') { - echo "\t\t\t\t\t\t".Display::return_icon('email.gif', get_lang('AnnounceSentByEmail'))."\n"; + echo Display::return_icon('email.gif', get_lang('AnnounceSentByEmail'))."\n"; } - echo "\t\t\t\t\t".Security::remove_XSS($title)."" . get_lang("SentTo") . " :   "; + echo "".Security::remove_XSS($title)."" . get_lang("SentTo") . " :   "; $sent_to=sent_to("announcement", $myrow['id']); $sent_to_form=sent_to_form($sent_to); $user_info=api_get_user_info($myrow['insert_user_id']); echo '   '.get_lang('By').' :  '.str_replace(' ', ' ', api_get_person_name($user_info['firstName'], $user_info['lastName'])); - echo "\t\t\t\t\t
"; + echo "
"; echo get_lang('AnnouncementPublishedOn')," : ", api_convert_and_format_date($last_post_datetime, DATE_FORMAT_LONG, date_default_timezone_get()); - echo "
\n"; - echo $content."\t\t\t\t\t
\n"; + echo $content."
\n"; + echo "
"; if (check_added_resources("Ad_Valvas", $myrow["id"])) { echo "".get_lang('AddedResources')."
"; @@ -1448,7 +1448,7 @@ if ($display_announcement_list && !$surveyid) { } - echo "