From 991c3cc257d13f30bd27648145ce0cb3b4e5c603 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 8 Jun 2011 11:05:06 +0200 Subject: [PATCH] Cleaning code --- main/calendar/myagenda.php | 1 - main/inc/lib/message.lib.php | 24 ++++-------------------- main/inc/lib/pear/HTML/Table.php | 10 +++++----- main/inc/lib/social.lib.php | 2 +- main/messages/outbox.php | 11 ++++++++--- main/social/home.php | 12 ++++++------ 6 files changed, 24 insertions(+), 36 deletions(-) diff --git a/main/calendar/myagenda.php b/main/calendar/myagenda.php index a486c164d0..0b76cb331f 100755 --- a/main/calendar/myagenda.php +++ b/main/calendar/myagenda.php @@ -144,7 +144,6 @@ if (isset($_user['user_id'])) { //$courses_dbs = get_all_courses_of_user(); $my_course_list = CourseManager::get_courses_list_by_user_id(api_get_user_id(), true); - print_r($course_list); if (!is_array($my_course_list)) { // this is for the special case if the user has no courses (otherwise you get an error) $my_course_list = array(); diff --git a/main/inc/lib/message.lib.php b/main/inc/lib/message.lib.php index 54807773b9..4f3719c8a1 100755 --- a/main/inc/lib/message.lib.php +++ b/main/inc/lib/message.lib.php @@ -1207,18 +1207,9 @@ class MessageManager function inbox_display() { global $charset; -// $charset = api_get_system_encoding(); $table_message = Database::get_main_table(TABLE_MESSAGE); - //$request=api_is_xml_http_request(); - if ($_SESSION['social_exist']===true) { - if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true') { - $success= get_lang('SelectedMessagesDeleted'); - } else { - $success= get_lang('SelectedMessagesDeleted'); - } - } else { - $success= get_lang('SelectedMessagesDeleted'); - } + $success = get_lang('SelectedMessagesDeleted'); + if (isset ($_REQUEST['action'])) { switch ($_REQUEST['action']) { case 'delete' : @@ -1275,15 +1266,8 @@ function outbox_display() { if ($_REQUEST['f']=='social') { $social_link ='f=social'; } - if ($_SESSION['social_exist']===true) { - if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true') { - $success= get_lang('SelectedMessagesDeleted')." 
".get_lang('BackToOutbox').""; - }else { - $success=get_lang('SelectedMessagesDeleted')." 
".get_lang('BackToOutbox').""; - } - } else { - $success= get_lang('SelectedMessagesDeleted').' 
'.get_lang('BackToOutbox').''; - } + $success= get_lang('SelectedMessagesDeleted').' 
'.get_lang('BackToOutbox').''; + if (isset ($_REQUEST['action'])) { switch ($_REQUEST['action']) { case 'delete' : diff --git a/main/inc/lib/pear/HTML/Table.php b/main/inc/lib/pear/HTML/Table.php index 28e9976d59..c1db94d280 100755 --- a/main/inc/lib/pear/HTML/Table.php +++ b/main/inc/lib/pear/HTML/Table.php @@ -177,8 +177,8 @@ class HTML_Table extends HTML_Common { $this->_useTGroups = (boolean)$useTGroups; $this->addBody(); if ($this->_useTGroups) { - $this->_thead =& new HTML_Table_Storage($tabOffset, $this->_useTGroups); - $this->_tfoot =& new HTML_Table_Storage($tabOffset, $this->_useTGroups); + $this->_thead = new HTML_Table_Storage($tabOffset, $this->_useTGroups); + $this->_tfoot = new HTML_Table_Storage($tabOffset, $this->_useTGroups); } } @@ -202,7 +202,7 @@ class HTML_Table extends HTML_Common { { if (is_null($this->_thead)) { $this->_useTGroups = true; - $this->_thead =& new HTML_Table_Storage($this->_tabOffset, + $this->_thead = new HTML_Table_Storage($this->_tabOffset, $this->_useTGroups); for ($i = 0; $i < $this->_tbodyCount; $i++) { $this->_tbodies[$i]->setUseTGroups(true); @@ -220,7 +220,7 @@ class HTML_Table extends HTML_Common { { if (is_null($this->_tfoot)) { $this->_useTGroups = true; - $this->_tfoot =& new HTML_Table_Storage($this->_tabOffset, + $this->_tfoot = new HTML_Table_Storage($this->_tabOffset, $this->_useTGroups); for ($i = 0; $i < $this->_tbodyCount; $i++) { $this->_tbodies[$i]->setUseTGroups(true); @@ -264,7 +264,7 @@ class HTML_Table extends HTML_Common { } $body = $this->_tbodyCount++; - $this->_tbodies[$body] =& new HTML_Table_Storage($this->_tabOffset, + $this->_tbodies[$body] = new HTML_Table_Storage($this->_tabOffset, $this->_useTGroups); $this->_tbodies[$body]->setAutoFill($this->_autoFill); $this->_tbodies[$body]->setAttributes($attributes); diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index 3d4d736fef..d7aa69f50a 100755 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -602,7 +602,7 @@ class SocialManager extends UserManager { } else { $img_array = UserManager::get_user_picture_path_by_id($user_id,'web',true,true); $big_image = UserManager::get_picture_user($user_id, $img_array['file'],'', USER_IMAGE_SIZE_BIG); - $big_image = $big_image['file'].$big_image['dir']; + $big_image = $big_image['file']; //--- User image echo '
'; diff --git a/main/messages/outbox.php b/main/messages/outbox.php index f10e6cf201..0e3ff21790 100755 --- a/main/messages/outbox.php +++ b/main/messages/outbox.php @@ -116,7 +116,12 @@ if( trim($info_delete_outbox[0])=='delete' ) { $table_message = Database::get_main_table(TABLE_MESSAGE); -$user_sender_id=api_get_user_id(); +$user_sender_id = api_get_user_id(); + +$action = null; +if (isset($_REQUEST['action'])) { + $action = $_REQUEST['action']; +} echo '
'; $id_content_right = ''; @@ -147,7 +152,7 @@ echo '
'; echo '
'; } //MAIN CONTENT - if ($_REQUEST['action']=='delete') { + if ($action == 'delete') { $delete_list_id=array(); if (isset($_POST['out'])) { $delete_list_id=$_POST['out']; @@ -161,7 +166,7 @@ echo '
'; $delete_list_id=array(); outbox_display(); - } elseif ($_REQUEST['action']=='deleteone') { + } elseif($action =='deleteone') { $delete_list_id=array(); $id=Security::remove_XSS($_GET['id']); MessageManager::delete_message_by_user_sender(api_get_user_id(),$id); diff --git a/main/social/home.php b/main/social/home.php index 53ad01af23..d1498f063e 100755 --- a/main/social/home.php +++ b/main/social/home.php @@ -81,11 +81,11 @@ echo '
'; echo '
'; echo '