Minor - flint fixes

pull/2744/head
Julio Montoya 7 years ago
parent f2a4134b76
commit d712b93585
  1. 33
      main/inc/lib/message.lib.php
  2. 10
      main/inc/lib/sortable_table.class.php
  3. 3
      main/messages/inbox.php
  4. 4
      main/messages/new_message.php
  5. 22
      main/messages/outbox.php
  6. 5
      main/messages/view_message.php
  7. 12
      src/CoreBundle/Component/Utils/ChamiloApi.php

@ -1213,8 +1213,8 @@ class MessageManager
user_sender_id
FROM $table
WHERE
user_sender_id = " . api_get_user_id() . " AND
msg_status = " . MESSAGE_STATUS_OUTBOX . "
user_sender_id = ".api_get_user_id()." AND
msg_status = ".MESSAGE_STATUS_OUTBOX."
$keywordCondition
ORDER BY col$column $direction
LIMIT $from, $number_of_items";
@ -1229,7 +1229,7 @@ class MessageManager
$senderId = $row['user_sender_id'];
if ($request === true) {
$message[0] = '<input type="checkbox" value=' . $messageId . ' name="out[]">';
$message[0] = '<input type="checkbox" value='.$messageId.' name="out[]">';
} else {
$message[0] = $messageId;
}
@ -1238,29 +1238,29 @@ class MessageManager
$title = Security::remove_XSS($title);
$userInfo = api_get_user_info($senderId);
if ($request === true) {
$message[1] = '<a onclick="show_sent_message(' . $messageId . ')" href="javascript:void(0)">' . $userInfo['complete_name_with_username'] . '</a>';
$message[2] = '<a onclick="show_sent_message(' . $messageId . ')" href="javascript:void(0)">' . str_replace(
$message[1] = '<a onclick="show_sent_message('.$messageId.')" href="javascript:void(0)">'.$userInfo['complete_name_with_username'].'</a>';
$message[2] = '<a onclick="show_sent_message('.$messageId.')" href="javascript:void(0)">'.str_replace(
"\\",
"",
$title
) . '</a>';
).'</a>';
//date stays the same
$message[3] = api_convert_and_format_date($sendDate, DATE_TIME_FORMAT_LONG);
$message[4] = '<a class="btn btn-outline-secondary btn-sm" title="' . addslashes(
$message[4] = '<a class="btn btn-outline-secondary btn-sm" title="'.addslashes(
get_lang('DeleteMessage')
) . '" onclick="delete_one_message_outbox(' . $messageId . ')" href="javascript:void(0)" >' .
Display::returnFontAwesomeIcon('trash', 2) . '</a>';
).'" onclick="delete_one_message_outbox('.$messageId.')" href="javascript:void(0)" >'.
Display::returnFontAwesomeIcon('trash', 2).'</a>';
} else {
$message[1] = '<img class="rounded-circle mr-2" src="'.$userInfo['avatar_small'].'"/>';
$message[1].= $userInfo['complete_name_with_username'];
$message[2] = '<a ' . $class . ' onclick="show_sent_message(' . $messageId . ')" href="../messages/view_message.php?id_send=' . $messageId . '">' . $title . '</a>';
$message[1] .= $userInfo['complete_name_with_username'];
$message[2] = '<a '.$class.' onclick="show_sent_message('.$messageId.')" href="../messages/view_message.php?id_send='.$messageId.'">'.$title.'</a>';
$message[3] = api_convert_and_format_date($sendDate, DATE_TIME_FORMAT_LONG);
$message[4] = '<a class="btn btn-outline-secondary btn-sm" title="' . addslashes(
$message[4] = '<a class="btn btn-outline-secondary btn-sm" title="'.addslashes(
get_lang('DeleteMessage')
) . '" href="outbox.php?action=deleteone&id=' . $messageId . '" onclick="javascript:if(!confirm(' . "'" . addslashes(
).'" href="outbox.php?action=deleteone&id='.$messageId.'" onclick="javascript:if(!confirm('."'".addslashes(
api_htmlentities(get_lang('ConfirmDeleteMessage'))
) . "'" . ')) return false;" >' .
Display::returnFontAwesomeIcon('trash', 'fa-sm') . '</a>';
)."'".')) return false;" >'.
Display::returnFontAwesomeIcon('trash', 'fa-sm').'</a>';
}
$message_list[] = $message;
@ -2166,7 +2166,8 @@ class MessageManager
2,
20,
'DESC',
null,'table-custom'
null,
'table-custom'
);
$table->set_header(0, '', false, ['style' => 'width:15px;']);
$table->set_header(1, get_lang('Messages'), false);

@ -104,16 +104,16 @@ class SortableTable extends HTML_Table
/**
* Create a new SortableTable.
*
* @param string $table_name A name for the table (default = 'table')
* @param string $table_name A name for the table (default = 'table')
* @param string $get_total_number_function A user defined function to get
* the total number of items in the table
* @param string $get_data_function A function to get the data to display on
* @param string $get_data_function A function to get the data to display on
* the current page
* @param int $default_column The default column on which the data should be
* @param int $default_column The default column on which the data should be
* sorted
* @param int $default_items_per_page The default number of items to show
* @param int $default_items_per_page The default number of items to show
* on one page
* @param string $default_order_direction The default order direction;
* @param string $default_order_direction The default order direction;
* either the constant 'ASC' or 'DESC'
* @param string $table_id
* @param string $style

@ -112,7 +112,7 @@ $keyword = '';
// Comes from normal profile
if ($allowMessage) {
$actionsLeft = '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
Display::return_icon('new-message.png', get_lang('ComposeMessage'),null,ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('new-message.png', get_lang('ComposeMessage'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
Display::return_icon('inbox.png', get_lang('Inbox'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
@ -174,4 +174,3 @@ $content = $tpl->fetch($social_layout);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -343,10 +343,9 @@ $message_content = null;
$actions = null;
if ($group_id != 0) {
$actions .= '<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')),null, ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', api_xml_http_response_encode(get_lang('ComposeMessage')), null, ICON_SIZE_MEDIUM).'</a>';
$actions .= '<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')), null, ICON_SIZE_MEDIUM).'</a>';
} else {
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
Display::return_icon('back.png', get_lang('Back'), null, ICON_SIZE_MEDIUM).'</a>';
@ -419,4 +418,3 @@ $social_layout = $tpl->get_template('message/inbox.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -42,16 +42,16 @@ $interbreadcrumb[] = [
$actions = null;
if ($allowMessage) {
$actionsLeft = '<a href="' . api_get_path(WEB_PATH) . 'main/messages/inbox.php">' .
Display::return_icon('back.png', get_lang('Back'), null, ICON_SIZE_MEDIUM) . '</a>';
$actionsLeft .= '<a href="' . api_get_path(WEB_PATH) . 'main/messages/new_message.php">' .
Display::return_icon('new-message.png', get_lang('ComposeMessage'), null, ICON_SIZE_MEDIUM) . '</a>';
$actionsLeft .= '<a href="' . api_get_path(WEB_PATH) . 'main/messages/inbox.php">' .
Display::return_icon('inbox.png', get_lang('Inbox'), null, ICON_SIZE_MEDIUM) . '</a>';
$actionsLeft .= '<a href="' . api_get_path(WEB_PATH) . 'main/messages/outbox.php">' .
Display::return_icon('outbox.png', get_lang('Outbox'), null, ICON_SIZE_MEDIUM) . '</a>';
$form = MessageManager::getSearchForm(api_get_path(WEB_PATH) . 'main/messages/outbox.php');
$actionsLeft = '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
Display::return_icon('back.png', get_lang('Back'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
Display::return_icon('new-message.png', get_lang('ComposeMessage'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
Display::return_icon('inbox.png', get_lang('Inbox'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
Display::return_icon('outbox.png', get_lang('Outbox'), null, ICON_SIZE_MEDIUM).'</a>';
$form = MessageManager::getSearchForm(api_get_path(WEB_PATH).'main/messages/outbox.php');
if ($form->validate()) {
$values = $form->getSubmitValues();
$keyword = $values['keyword'];
@ -68,7 +68,6 @@ if (isset($_REQUEST['action'])) {
$keyword = '';
$message_content = null;
$actions .= Display::toolbarAction(
'toolbar',
[$actionsLeft, $actionsRight]
@ -117,4 +116,3 @@ $content = $tpl->fetch($social_layout);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -28,14 +28,13 @@ $actions = null;
if (api_get_setting('allow_message_tool') === 'true') {
$actionsLeft = '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
Display::return_icon('new-message.png', get_lang('ComposeMessage'), null,ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('new-message.png', get_lang('ComposeMessage'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
Display::return_icon('inbox.png', get_lang('Inbox'), null, ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
Display::return_icon('outbox.png', get_lang('Outbox'), null, ICON_SIZE_MEDIUM).'</a>';
}
$actions .= Display::toolbarAction(
'toolbar',
[$actionsLeft]
@ -51,7 +50,6 @@ if (empty($_GET['id'])) {
$show_menu = 'messages_inbox';
}
// MAIN CONTENT
$message_content = MessageManager::showMessageBox($messageId, $source);
@ -73,4 +71,3 @@ $social_layout = $tpl->get_template('message/inbox.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -289,12 +289,15 @@ class ChamiloApi
return api_get_path(WEB_CSS_PATH).'editor_content.css';
}
/**
* Get a list of colors from the palette at main/palette/pchart/default.color
* and return it as an array of strings
* and return it as an array of strings.
*
* @param bool $decimalOpacity Whether to return the opacity as 0..100 or 0..1
* @param bool $wrapInRGBA Whether to return it as 1,1,1,100 or rgba(1,1,1,100)
* @param int $fillUpTo If the number of colors is smaller than this number, generate more colors
* @param bool $wrapInRGBA Whether to return it as 1,1,1,100 or rgba(1,1,1,100)
* @param int $fillUpTo If the number of colors is smaller than this number, generate more colors
*
* @return array An array of string colors
*/
public static function getColorPalette(
@ -324,9 +327,10 @@ class ChamiloApi
$count = count($palette);
if (isset($fillUpTo) && $fillUpTo > $count) {
for ($i = $count; $i < $fillUpTo; $i++) {
$palette[$i] = $palette[$i%$count];
$palette[$i] = $palette[$i % $count];
}
}
return $palette;
}
}

Loading…
Cancel
Save