Removing PHP notices/warnings

skala
Julio Montoya 13 years ago
parent f278113d88
commit e125039337
  1. 35
      main/inc/lib/message.lib.php
  2. 4
      main/messages/inbox.php
  3. 9
      main/messages/view_message.php
  4. 18
      main/social/group_add.php

@ -166,12 +166,12 @@ class MessageManager
$class = 'class = "read"';
}
$link = '';
if ($_GET['f']=='social') {
if (isset($_GET['f']) && $_GET['f'] =='social') {
$link = '&f=social';
}
$message[1] = '<a '.$class.' href="view_message.php?id='.$result[0].$link.'">'.$result[2].'</a><br />'.GetFullUserName(($result[1]));
$message[3] = '<a href="new_message.php?re_id='.$result[0].'&f='.Security::remove_XSS($_GET['f']).'">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).'</a>'.
'&nbsp;&nbsp;<a onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;" href="inbox.php?action=deleteone&id='.$result[0].'&f='.Security::remove_XSS($_GET['f']).'">'.Display::return_icon('delete.png',get_lang('DeleteMessage')).'</a>';
$message[3] = '<a href="new_message.php?re_id='.$result[0].$link.'">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).'</a>'.
'&nbsp;&nbsp;<a onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;" href="inbox.php?action=deleteone&id='.$result[0].$link.'">'.Display::return_icon('delete.png',get_lang('DeleteMessage')).'</a>';
$message[2] = api_convert_and_format_date($result[3], DATE_TIME_FORMAT_LONG); //date stays the same
foreach($message as $key => $value) {
@ -775,7 +775,7 @@ class MessageManager
<div id="message-attach">'.(!empty($files_attachments)?implode('<br />',$files_attachments):'').'</div>
<div style="padding: 15px 0px 5px 0px">';
$social_link = '';
if ($_GET['f'] == 'social') {
if (isset($_GET['f']) && $_GET['f'] == 'social') {
$social_link = 'f=social';
}
if ($source == 'outbox') {
@ -1271,7 +1271,7 @@ class MessageManager
$table->set_header(2,api_xml_http_response_encode(get_lang('Date')),true, array('style' => 'width:180px;'));
$table->set_header(3,$action,false,array ('style' => 'width:70px;'));
if ($_REQUEST['f']=='social') {
if (isset($_REQUEST['f']) && $_REQUEST['f']=='social') {
$parameters['f'] = 'social';
$table->set_additional_parameters($parameters);
}
@ -1282,16 +1282,14 @@ class MessageManager
static function outbox_display() {
$request=api_is_xml_http_request();
global $charset;
$social_link = false;
if ($_REQUEST['f']=='social') {
if (isset($_REQUEST['f']) && $_REQUEST['f']=='social') {
$social_link ='f=social';
}
$success = get_lang('SelectedMessagesDeleted').'&nbsp</b><br /><a href="outbox.php?'.$social_link.'">'.get_lang('BackToOutbox').'</a>';
if (isset ($_REQUEST['action'])) {
if (isset($_REQUEST['action'])) {
switch ($_REQUEST['action']) {
case 'delete' :
$number_of_selected_messages = count($_POST['id']);
@ -1324,27 +1322,12 @@ class MessageManager
$table->set_header(2, api_xml_http_response_encode(get_lang('Date')),true,array ('style' => 'width:160px;'));
$table->set_header(3,$action, false,array ('style' => 'width:70px;'));
if ($request===true) {
$html .= '<form name="form_send_out" id="form_send_out" action="" method="post">';
$html .= '<input type="hidden" name="action" value="delete" />';
$html .= $table->return_table();
$html .= '</form>';
if (get_number_of_messages_send_mask() > 0) {
$html .= '<a href="javascript:void(0)" onclick="selectall_cheks()">'.api_xml_http_response_encode(get_lang('SelectAll')).'</a>&nbsp;&nbsp;&nbsp;';
$html .= '<a href="javascript:void(0)" onclick="unselectall_cheks()">'.api_xml_http_response_encode(get_lang('UnSelectAll')).'</a>&nbsp;&nbsp;&nbsp;';
$html .= '<button class="save" name="delete" type="button" value="'.api_xml_http_response_encode(get_lang('DeleteSelectedMessages')).'" onclick="submit_form(\'outbox\')">'.api_xml_http_response_encode(get_lang('DeleteSelectedMessages')).'</button>';
}
} else {
$table->set_form_actions(array ('delete' => get_lang('DeleteSelectedMessages')));
$html .= $table->return_table();
}
$table->set_form_actions(array ('delete' => get_lang('DeleteSelectedMessages')));
$html .= $table->return_table();
return $html;
}
}
function get_number_of_messages_mask() {
return MessageManager::get_number_of_messages();
}

@ -101,7 +101,7 @@ if (isset($_GET['form_reply']) || isset($_GET['form_delete'])) {
}
}
if ($_GET['f']=='social') {
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('SocialNetwork'));
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Inbox'));
@ -112,7 +112,7 @@ if ($_GET['f']=='social') {
$social_parameter = '';
if ($_GET['f']=='social' || api_get_setting('allow_social_tool') == 'true') {
if (isset($_GET['f']) && $_GET['f'] == 'social' || api_get_setting('allow_social_tool') == 'true') {
$social_parameter = '?f=social';
} else {

@ -16,7 +16,7 @@ if (api_get_setting('allow_message_tool')!='true') {
/* HEADER */
if ($_REQUEST['f']=='social') {
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'));
@ -25,7 +25,9 @@ if ($_REQUEST['f']=='social') {
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
}
if ($_GET['f']=='social') {
$social_right_content = null;
if (isset($_GET['f']) && $_GET['f']=='social') {
$social_parameter = '?f=social';
} else {
if (api_get_setting('extended_profile') == 'true') {
@ -79,7 +81,6 @@ if (!empty($message)) {
$tpl = new Template(get_lang('View'));
if (api_get_setting('allow_social_tool') == 'true') {
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);
@ -87,7 +88,7 @@ if (api_get_setting('allow_social_tool') == 'true') {
$content = $social_right_content;
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('message', $message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
}

@ -49,7 +49,7 @@ $form->applyFilter('name', 'trim');
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
// Description
$form->addElement('textarea', 'description', get_lang('Description'), array('class'=>'span5', 'cols'=>58, onKeyDown => "text_longitud()", onKeyUp => "text_longitud()"));
$form->addElement('textarea', 'description', get_lang('Description'), array('class'=>'span5', 'cols'=>58, 'onKeyDown' => "text_longitud()", 'onKeyUp' => "text_longitud()"));
$form->applyFilter('description', 'html_filter');
$form->applyFilter('description', 'trim');
@ -72,7 +72,7 @@ $form->addElement('select', 'visibility', get_lang('GroupPermissions'), $status)
$form->addElement('style_submit_button','add_group', get_lang('AddGroup'),'class="save"');
$form->setRequiredNote(api_xml_http_response_encode('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>'));
$form->setDefaults($default);
if ($form->validate()) {
$values = $form->exportValues();
@ -102,22 +102,16 @@ $this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social'));
$interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
$interbreadcrumb[]= array ('url' =>'#','name' => $nameTools);
//Display :: display_header($tool_name, 'Groups');
$social_left_content = SocialManager::show_social_menu('group_add');
$social_right_content .= $form->return_form();
$social_right_content = $form->return_form();
$tpl = new Template($tool_name);
$tpl = new Template();
$tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content);
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
//$tpl->assign('actions', $actions);
//$tpl->assign('message', $show_message);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

Loading…
Cancel
Save