Browse Source

Minor - format code, remove unused script code.

jmontoyaa 7 years ago
parent
commit
15a5074e3d

+ 24 - 24
main/messages/download.php

@@ -2,13 +2,13 @@
 /* For licensing terms, see /license.txt */
 
 /**
-*	This file is responsible for  passing requested file attachments from messages
-*	Html files are parsed to fix a few problems with URLs,
-*	but this code will hopefully be replaced soon by an Apache URL
-*	rewrite mechanism.
-*
-*	@package chamilo.messages
-*/
+ * This file is responsible for  passing requested file attachments from messages
+ * Html files are parsed to fix a few problems with URLs,
+ * but this code will hopefully be replaced soon by an Apache URL
+ * rewrite mechanism.
+ *
+ * @package chamilo.messages
+ */
 
 session_cache_limiter('public');
 
@@ -32,7 +32,7 @@ $tbl_messsage_attachment = Database::get_main_table(TABLE_MESSAGE_ATTACHMENT);
 $file_url = Database::escape_string($file_url);
 $sql = "SELECT filename, message_id
         FROM $tbl_messsage_attachment
-		WHERE path LIKE BINARY '$file_url'";
+        WHERE path LIKE BINARY '$file_url'";
 
 $result = Database::query($sql);
 $row = Database::fetch_array($result, 'ASSOC');
@@ -41,7 +41,7 @@ $message_id = $row['message_id'];
 
 // allow download only for user sender and user receiver
 $sql = "SELECT user_sender_id, user_receiver_id, group_id
-		FROM $tbl_messsage WHERE id = '$message_id'";
+        FROM $tbl_messsage WHERE id = '$message_id'";
 $rs = Database::query($sql);
 $row_users = Database::fetch_array($rs, 'ASSOC');
 $current_uid = api_get_user_id();
@@ -50,11 +50,11 @@ $current_uid = api_get_user_id();
 $message_uid = '';
 $message_type = array('inbox', 'outbox');
 if (in_array($_GET['type'], $message_type)) {
-	if ($_GET['type'] == 'inbox') {
-		$message_uid = $row_users['user_receiver_id'];
-	} else {
-		$message_uid = $row_users['user_sender_id'];
-	}
+    if ($_GET['type'] == 'inbox') {
+        $message_uid = $row_users['user_receiver_id'];
+    } else {
+        $message_uid = $row_users['user_sender_id'];
+    }
 }
 
 // allow to the correct user for download this file
@@ -62,19 +62,19 @@ $not_allowed_to_edit = false;
 $userGroup = new UserGroup();
 
 if (!empty($row_users['group_id'])) {
-	$users_group = $userGroup->get_all_users_by_group($row_users['group_id']);
-	if (!in_array($current_uid, array_keys($users_group))) {
-		$not_allowed_to_edit = true;
-	}
+    $users_group = $userGroup->get_all_users_by_group($row_users['group_id']);
+    if (!in_array($current_uid, array_keys($users_group))) {
+        $not_allowed_to_edit = true;
+    }
 } else {
-	if ($current_uid != $message_uid) {
-		$not_allowed_to_edit = true;
-	}
+    if ($current_uid != $message_uid) {
+        $not_allowed_to_edit = true;
+    }
 }
 
 if ($not_allowed_to_edit) {
-	api_not_allowed(true);
-	exit;
+    api_not_allowed(true);
+    exit;
 }
 
 // set the path directory file
@@ -85,7 +85,7 @@ if (!empty($row_users['group_id'])) {
         true
     );
 } else {
-	$path_user_info['dir'] = UserManager::getUserPathById($message_uid, 'system');
+    $path_user_info['dir'] = UserManager::getUserPathById($message_uid, 'system');
 }
 
 $full_file_name = $path_user_info['dir'].'message_attachments/'.$file_url;

+ 1 - 18
main/messages/inbox.php

@@ -24,23 +24,6 @@ if (api_get_setting('allow_message_tool') != 'true') {
     api_not_allowed();
 }
 
-$htmlHeadXtra[] = '<script>
-
-function show_icon_edit(element_html) {
-	ident="#edit_image";
-	$(ident).show();
-}
-
-function hide_icon_edit(element_html)  {
-	ident="#edit_image";
-	$(ident).hide();
-}
-
-</script>';
-
-/*
-  MAIN CODE
- */
 $nameTools = get_lang('Messages');
 $request = api_is_xml_http_request();
 $show_message = null;
@@ -167,7 +150,7 @@ if (!isset($_GET['del_msg'])) {
     $num_msg = intval($_POST['total']);
     for ($i = 0; $i < $num_msg; $i++) {
         if ($_POST[$i]) {
-            //the user_id was necesarry to delete a message??
+            //the user_id was necessary to delete a message??
             $show_message .= MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_POST['_'.$i]);
         }
     }

+ 4 - 4
main/messages/index.php

@@ -1,12 +1,12 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
-*	@package chamilo.messages
-*/
+ * @package chamilo.messages
+ */
 require_once __DIR__.'/../inc/global.inc.php';
 if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
-	header('Location:inbox.php?f=social');
+    header('Location:inbox.php?f=social');
 } elseif (api_get_setting('allow_message_tool') == 'true') {
-	header('Location:inbox.php');
+    header('Location:inbox.php');
 }
 exit;

+ 63 - 63
main/messages/new_message.php

@@ -1,7 +1,7 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
-*	@package chamilo.messages
+ * @package chamilo.messages
 */
 
 /**
@@ -27,11 +27,11 @@ $nameTools = api_xml_http_response_encode(get_lang('Messages'));
 $htmlHeadXtra[] = '
 <script>
 function validate(form, list) {
-	if(list.selectedIndex<0) {
-    	alert("Please select someone to send the message to.")
-    	return false
-	} else {
-    	return true
+    if(list.selectedIndex<0) {
+        alert("Please select someone to send the message to.")
+        return false
+    } else {
+        return true
     }
 }
 
@@ -40,25 +40,25 @@ function validate(form, list) {
 $htmlHeadXtra[] = '<script>
 var counter_image = 1;
 function add_image_form() {
-	// Multiple filepaths for image form
-	var filepaths = document.getElementById("file_uploads");
-	if (document.getElementById("filepath_"+counter_image)) {
-		counter_image = counter_image + 1;
-	}  else {
-		counter_image = counter_image;
-	}
-	var elem1 = document.createElement("div");
-	elem1.setAttribute("id","filepath_"+counter_image);
-	filepaths.appendChild(elem1);
-	id_elem1 = "filepath_"+counter_image;
-	id_elem1 = "\'"+id_elem1+"\'";
-	document.getElementById("filepath_"+counter_image).innerHTML = "<div class=\"form-group\" ><label class=\"col-sm-4\">'.get_lang('FilesAttachment').'</label><input class=\"col-sm-8\" type=\"file\" name=\"attach_"+counter_image+"\" /></div><div class=\"form-group\" ><label class=\"col-sm-4\">'.get_lang('Description').'</label><div class=\"col-sm-8\"><input style=\"width:100%\" type=\"text\" name=\"legend[]\" /></div></div>";
-	if (filepaths.childNodes.length == 6) {
-		var link_attach = document.getElementById("link-more-attach");
-		if (link_attach) {
-			link_attach.innerHTML="";
-		}
-	}
+    // Multiple filepaths for image form
+    var filepaths = document.getElementById("file_uploads");
+    if (document.getElementById("filepath_"+counter_image)) {
+        counter_image = counter_image + 1;
+    }  else {
+        counter_image = counter_image;
+    }
+    var elem1 = document.createElement("div");
+    elem1.setAttribute("id","filepath_"+counter_image);
+    filepaths.appendChild(elem1);
+    id_elem1 = "filepath_"+counter_image;
+    id_elem1 = "\'"+id_elem1+"\'";
+    document.getElementById("filepath_"+counter_image).innerHTML = "<div class=\"form-group\" ><label class=\"col-sm-4\">'.get_lang('FilesAttachment').'</label><input class=\"col-sm-8\" type=\"file\" name=\"attach_"+counter_image+"\" /></div><div class=\"form-group\" ><label class=\"col-sm-4\">'.get_lang('Description').'</label><div class=\"col-sm-8\"><input style=\"width:100%\" type=\"text\" name=\"legend[]\" /></div></div>";
+    if (filepaths.childNodes.length == 6) {
+        var link_attach = document.getElementById("link-more-attach");
+        if (link_attach) {
+            link_attach.innerHTML="";
+        }
+    }
 }
 </script>';
 $nameTools = get_lang('ComposeMessage');
@@ -77,20 +77,20 @@ function show_compose_to_any($user_id)
 
 function show_compose_reply_to_message($message_id, $receiver_id)
 {
-	$table_message = Database::get_main_table(TABLE_MESSAGE);
-	$query = "SELECT user_sender_id
+    $table_message = Database::get_main_table(TABLE_MESSAGE);
+    $query = "SELECT user_sender_id
               FROM $table_message
-			  WHERE user_receiver_id = ".intval($receiver_id)." AND id='".intval($message_id)."';";
-	$result = Database::query($query);
-	$row = Database::fetch_array($result, 'ASSOC');
-	if (!isset($row['user_sender_id'])) {
-		$html = get_lang('InvalidMessageId');
-
-		return $html;
-	}
-	$userInfo = api_get_user_info($row['user_sender_id']);
-	$default['users'] = array($row['user_sender_id']);
-	$html = manage_form($default, null, $userInfo['complete_name']);
+              WHERE user_receiver_id = ".intval($receiver_id)." AND id='".intval($message_id)."';";
+    $result = Database::query($query);
+    $row = Database::fetch_array($result, 'ASSOC');
+    if (!isset($row['user_sender_id'])) {
+        $html = get_lang('InvalidMessageId');
+
+        return $html;
+    }
+    $userInfo = api_get_user_info($row['user_sender_id']);
+    $default['users'] = array($row['user_sender_id']);
+    $html = manage_form($default, null, $userInfo['complete_name']);
 
     return $html;
 }
@@ -98,10 +98,10 @@ function show_compose_reply_to_message($message_id, $receiver_id)
 function show_compose_to_user($receiver_id)
 {
     $userInfo = api_get_user_info($receiver_id);
-	$html = get_lang('To').':&nbsp;<strong>'.$userInfo['complete_name'].'</strong>';
-	$default['title'] = api_xml_http_response_encode(get_lang('EnterTitle'));
-	$default['users'] = array($receiver_id);
-	$html .= manage_form($default);
+    $html = get_lang('To').':&nbsp;<strong>'.$userInfo['complete_name'].'</strong>';
+    $default['title'] = api_xml_http_response_encode(get_lang('EnterTitle'));
+    $default['users'] = array($receiver_id);
+    $html .= manage_form($default);
 
     return $html;
 }
@@ -273,13 +273,13 @@ $socialToolIsActive = isset($_GET['f']) && $_GET['f'] == 'social';
 
 /* MAIN SECTION */
 if ($socialToolIsActive) {
-	$this_section = SECTION_SOCIAL;
+    $this_section = SECTION_SOCIAL;
     $interbreadcrumb[] = array(
         'url' => api_get_path(WEB_PATH).'main/social/home.php',
         'name' => get_lang('SocialNetwork')
     );
 } else {
-	$this_section = SECTION_MYPROFILE;
+    $this_section = SECTION_MYPROFILE;
     $interbreadcrumb[] = array(
         'url' => api_get_path(WEB_PATH).'main/auth/profile.php',
         'name' => get_lang('Profile')
@@ -289,30 +289,30 @@ if ($socialToolIsActive) {
 $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null;
 $social_right_content = null;
 if ($group_id != 0) {
-	$social_right_content .= '<div class=actions>';
-	$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'.
-		Display::return_icon('back.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>';
-	$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'.
-		Display::return_icon('message_new.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>';
-	$social_right_content .= '</div>';
+    $social_right_content .= '<div class=actions>';
+    $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'.
+        Display::return_icon('back.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>';
+    $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'.
+        Display::return_icon('message_new.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>';
+    $social_right_content .= '</div>';
 } else {
-	if ($socialToolIsActive) {
-	} else {
-		$social_right_content .= '<div class=actions>';
-		if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') {
-			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
+    if ($socialToolIsActive) {
+    } else {
+        $social_right_content .= '<div class=actions>';
+        if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') {
+            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
                 Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
-		}
-		if (api_get_setting('allow_message_tool') === 'true') {
-			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
+        }
+        if (api_get_setting('allow_message_tool') === 'true') {
+            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
                 Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>';
-			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
+            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
                 Display::return_icon('inbox.png', get_lang('Inbox')).'</a>';
             $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
                 Display::return_icon('outbox.png', get_lang('Outbox')).'</a>';
-		}
-		$social_right_content .= '</div>';
-	}
+        }
+        $social_right_content .= '</div>';
+    }
 }
 
 // LEFT COLUMN
@@ -367,7 +367,7 @@ if (!isset($_POST['compose'])) {
                 $default['group_id'] = $_POST['group_id'];
             }
             if (isset($_POST['hidden_user'])) {
-                $default['users']	 = array($_POST['hidden_user']);
+                $default['users'] = array($_POST['hidden_user']);
             }
             $social_right_content .= manage_form($default);
         } else {

+ 46 - 37
main/messages/outbox.php

@@ -1,62 +1,63 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-*	@package chamilo.messages
+ * @package chamilo.messages
 */
+
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
 api_block_anonymous_users();
 
+if (api_get_setting('allow_message_tool') != 'true') {
+    api_not_allowed(true);
+}
+
 if (isset($_GET['messages_page_nr'])) {
-	if (api_get_setting('allow_social_tool') == 'true' &&
+    if (api_get_setting('allow_social_tool') == 'true' &&
         api_get_setting('allow_message_tool') == 'true'
     ) {
-		$social_link = '';
-		if ($_REQUEST['f'] == 'social') {
-			$social_link = '&f=social';
-		}
-		header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.'');
-		exit;
-	}
-}
-
-if (api_get_setting('allow_message_tool') != 'true') {
-	api_not_allowed();
+        $social_link = '';
+        if ($_REQUEST['f'] == 'social') {
+            $social_link = '&f=social';
+        }
+        header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.'');
+        exit;
+    }
 }
-//jquery thickbox already called from main/inc/header.inc.php
 
 $htmlHeadXtra[] = '<script>
 function enviar(miforma) {
-	if(confirm("'.get_lang('SureYouWantToDeleteSelectedMessages', '').'"))
-		miforma.submit();
+    if(confirm("'.get_lang('SureYouWantToDeleteSelectedMessages', '').'"))
+        miforma.submit();
 }
 function select_all(formita) {
    for (i=0;i<formita.elements.length;i++)
-	{
-      		if(formita.elements[i].type == "checkbox")
-				formita.elements[i].checked=1
-	}
+    {
+            if(formita.elements[i].type == "checkbox")
+                formita.elements[i].checked=1
+    }
 }
 function deselect_all(formita) {
    for (i=0;i<formita.elements.length;i++) {
         if(formita.elements[i].type == "checkbox")
             formita.elements[i].checked=0
-	}
+    }
 }
 </script>';
 
 /*
-		MAIN CODE
+        MAIN CODE
 */
 if (isset($_GET['f']) && $_GET['f'] === 'social') {
-	$this_section = SECTION_SOCIAL;
-	$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social'));
-	$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox'));
+    $this_section = SECTION_SOCIAL;
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social'));
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox'));
 } else {
-	$this_section = SECTION_MYPROFILE;
-	$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile'));
-	$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox'));
+    $this_section = SECTION_MYPROFILE;
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile'));
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox'));
 }
 
 $actions = '';
@@ -76,21 +77,26 @@ if (api_get_setting('extended_profile') == 'true') {
     }
 }
 
-
 $info_delete_outbox = array();
 $info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',', $_GET['form_delete_outbox']) : '';
 $count_delete_outbox = count($info_delete_outbox) - 1;
 
 if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0]) == 'delete') {
     for ($i = 1; $i <= $count_delete_outbox; $i++) {
-		MessageManager::delete_message_by_user_sender(api_get_user_id(), $info_delete_outbox[$i]);
-	}
+        MessageManager::delete_message_by_user_sender(api_get_user_id(), $info_delete_outbox[$i]);
+    }
     $message_box = get_lang('SelectedMessagesDeleted').
         '&nbsp
         <br><a href="../social/index.php?#remote-tab-3">'.
         get_lang('BackToOutbox').
         '</a>';
-    Display::addFlash(Display::return_message(api_xml_http_response_encode($message_box), 'normal', false));
+    Display::addFlash(
+        Display::return_message(
+            api_xml_http_response_encode($message_box),
+            'normal',
+            false
+        )
+    );
     exit;
 }
 
@@ -113,7 +119,10 @@ if (api_get_setting('allow_social_tool') == 'true') {
         $keyword = $values['keyword'];
     }
     $actionsRight = $form->returnForm();
-    $social_right_content .= Display::toolbarAction('toolbar', [$actionsLeft, $actionsRight]);
+    $social_right_content .= Display::toolbarAction(
+        'toolbar',
+        [$actionsLeft, $actionsRight]
+    );
 }
 //MAIN CONTENT
 if ($action == 'delete') {
@@ -125,7 +134,10 @@ if ($action == 'delete') {
         $delete_list_id = $_POST['id'];
     }
     for ($i = 0; $i < count($delete_list_id); $i++) {
-        MessageManager::delete_message_by_user_sender(api_get_user_id(), $delete_list_id[$i]);
+        MessageManager::delete_message_by_user_sender(
+            api_get_user_id(),
+            $delete_list_id[$i]
+        );
     }
     $delete_list_id = array();
     $social_right_content .= MessageManager::outbox_display($keyword);
@@ -143,21 +155,18 @@ $tpl = new Template(get_lang('ComposeMessage'));
 // Block Social Avatar
 SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'messages');
 if (api_get_setting('allow_social_tool') == 'true') {
-
     $tpl->assign('social_menu_block', $social_menu_block);
     $tpl->assign('social_right_content', $social_right_content);
     $social_layout = $tpl->get_template('social/inbox.tpl');
     $tpl->display($social_layout);
 } else {
     $content = $social_right_content;
-
     if ($actions) {
         $tpl->assign(
             'actions',
             Display::toolbarAction('toolbar', [$actions])
         );
     }
-
     $tpl->assign('content', $content);
     $tpl->display_one_col_template();
 }

+ 19 - 19
main/messages/view_message.php

@@ -1,46 +1,46 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
-*	@package chamilo.messages
-*/
+ * @package chamilo.messages
+ */
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 api_block_anonymous_users();
 if (api_get_setting('allow_message_tool') != 'true') {
-	api_not_allowed();
+    api_not_allowed();
 }
 
 if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') {
-	$this_section = SECTION_SOCIAL;
-	$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social'));
-	$interbreadcrumb[] = array('url' => 'inbox.php?f=social', 'name' => get_lang('Inbox'));
+    $this_section = SECTION_SOCIAL;
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social'));
+    $interbreadcrumb[] = array('url' => 'inbox.php?f=social', 'name' => get_lang('Inbox'));
 } else {
-	$this_section = SECTION_MYPROFILE;
-	$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile'));
+    $this_section = SECTION_MYPROFILE;
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile'));
 }
 
 $social_right_content = '';
 
 if (isset($_GET['f']) && $_GET['f'] == 'social') {
-	$social_parameter = '?f=social';
+    $social_parameter = '?f=social';
 } else {
-	if (api_get_setting('extended_profile') == 'true') {
-		$social_right_content .= '<div class="actions">';
+    if (api_get_setting('extended_profile') == 'true') {
+        $social_right_content .= '<div class="actions">';
 
-		if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') {
-			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
+        if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') {
+            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
                 Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
-		}
-		if (api_get_setting('allow_message_tool') === 'true') {
-		    $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
+        }
+        if (api_get_setting('allow_message_tool') === 'true') {
+            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
                 Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>';
             $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
                 Display::return_icon('inbox.png', get_lang('Inbox')).'</a>';
             $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
                 Display::return_icon('outbox.png', get_lang('Outbox')).'</a>';
-		}
-		$social_right_content .= '</div>';
-	}
+        }
+        $social_right_content .= '</div>';
+    }
 }
 
 if (empty($_GET['id'])) {

+ 0 - 18
main/social/group_topics.php

@@ -147,24 +147,6 @@ function add_image_form() {
 	}
 }
 
-function show_icon_edit(element_html) {
-    ident="#edit_image";
-    $(ident).show();
-}
-
-function hide_icon_edit(element_html)  {
-    ident="#edit_image";
-    $(ident).hide();
-}
-
-function validate_text_empty(str,msg) {
-	var str = str.replace(/^\s*|\s*$/g,"");
-	if (str.length == 0) {
-		alert(msg);
-		return true;
-	}
-}
-
 $(document).ready(function() {
 	if ($("#msg_'.$message_id.'").length) {
 		$("html,body").animate({

+ 0 - 8
main/social/group_view.php

@@ -76,14 +76,6 @@ function add_image_form() {
 	}
 }
 
-function validate_text_empty (str,msg) {
-	var str = str.replace(/^\s*|\s*$/g,"");
-	if (str.length == 0) {
-		alert(msg);
-		return true;
-	}
-}
-
 </script>';
 
 $allowed_views = array('mygroups', 'newest', 'pop');