Fixing group topics layout

skala
Julio Montoya 14 years ago
parent 8746ab6362
commit 4a2d11e4c4
  1. 4
      main/css/base.css
  2. 29
      main/inc/lib/message.lib.php
  3. 48
      main/social/group_topics.php
  4. 2
      main/social/groups.php
  5. 31
      main/social/message_for_group_form.inc.php

@ -1070,9 +1070,9 @@ div.attendance-calendar-add div.row div.formw,div.attendance-calendar-edit div.r
margin: 5px 0px 8px 0px;
}
.message-group-date {
color:#666;
color:#999;
width:100%;
text-align:right;
font-size:98%;
}
.view-message-content {
line-height:150%;

@ -769,7 +769,7 @@ class MessageManager
</table>
<br />
<hr style="color:#ddd" />
<table height=209 width="100%">
<table height="209px" width="100%">
<tr>
<td valign=top class="view-message-content">'.str_replace("\\","",$row[6]).'</td>
</tr>
@ -847,14 +847,14 @@ class MessageManager
</TR>
</TABLE>
<br />
<TABLE height=209 width="100%" bgColor=#ffffff>
<TABLE height="209px" width="100%" bgColor=#ffffff>
<TBODY>
<TR>
<TD vAlign=top>'.str_replace("\\","",api_xml_http_response_encode($row[6])).'</TD>
</TR>
</TBODY>
</TABLE>
<div id="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>
<div id="message-attach">'.(!empty($files_attachments)?implode('<br />',$files_attachments):'').'</div>
<DIV class=HT style="PADDING-BOTTOM: 5px"> </DIV></TD>
<TD width=10>&nbsp;</TD>
</TR>
@ -960,8 +960,9 @@ class MessageManager
$existing_image = $image_path['file'];
$user = '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$topic['user_sender_id'].'">'.$name.'&nbsp;</a>';
$user_image = '<div class="clear"></div><div class="message-group-author"><img src="'.$image_repository.$existing_image.'" alt="'.$name.'" width="32" height="32" title="'.$name.'" /></div>';
$user = '<div class="message-group-author">'.$user.'</div>';
$html .= Display::div($title.cut($topic['content'], 350).$user_image.$user.$date.$link, array('class'=>'group_discussions_info')).'</td></table>';
$user = '<div class="message-group-author">'.$user.'</div>';
//$date.
$html .= Display::div($title.cut($topic['content'], 350).$user_image.$user.$link, array('class'=>'group_discussions_info')).'</td></table>';
$html .= '</div>'; //rounded_div
@ -987,7 +988,7 @@ class MessageManager
$rows = self::get_messages_by_group_by_message($group_id, $message_id);
$rows = self::calculate_children($rows, $message_id);
$current_user_id = api_get_user_id();
$current_user_id = api_get_user_id();
$topics_per_page = 5;
$items_per_page = 100;
$count_items = 0;
@ -1001,7 +1002,7 @@ class MessageManager
$links = '';
$main_content = '';
echo Display::tag('h2', $main_message['title']);
echo Display::tag('h1', $main_message['title']);
$user_sender_info = UserManager::get_user_info_by_id($main_message['user_sender_id']);
$files_attachments = self::get_links_message_attachment_files($main_message['id']);
$name = api_get_person_name($user_sender_info['firstname'], $user_sender_info['lastname']);
@ -1027,7 +1028,7 @@ class MessageManager
} else {
$date = '<div class="message-group-date"> '.get_lang('Created').' '.date_to_str_ago($main_message['send_date']).'</div>';
}
$attachment = '<div class="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>';
$attachment = '<div class="message-attach">'.(!empty($files_attachments)?implode('<br />',$files_attachments):'').'</div>';
$main_content.= '<div class="message-group-content">'.$links.$user_link.' '.$date.$main_message['content'].$attachment.'</div>';
$html = '';
@ -1073,17 +1074,17 @@ class MessageManager
} else {
$date = '<div class="message-group-date"> '.get_lang('Created').' '.date_to_str_ago($topic['send_date']).'</div>';
}
$attachment = '<div class="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>';
$attachment = '<div class="message-attach">'.(!empty($files_attachments)?implode('<br />',$files_attachments):'').'</div>';
$html_items.= '<div class="message-group-content">'.$links.$user_link.' '.$date.$topic['content'].$attachment.'</div>';
$base_padding = 20;
if ($topic['indent_cnt'] == 0 || $topic['indent_cnt'] == 1) {
$indent = 0;
if ($topic['indent_cnt'] == 0) {
$indent = $base_padding;
} else {
$indent = intval($topic['indent_cnt'])*20;
$indent = intval($topic['indent_cnt'])*$base_padding + $base_padding;
}
//var_dump($topic); 'style'=>'margin-left:'.$indent.'px'
$html_items = Display::div($html_items, array('class' => 'group_social_sub_item'));
$html_items = Display::div($html_items, array('class' => '', 'style'=>'margin-left:'.$indent.'px'));
$array_html_items[] = array($html_items);
@ -1171,7 +1172,7 @@ class MessageManager
$rs_file = Database::query($sql);
if (Database::num_rows($rs_file) > 0) {
$attach_icon = Display::return_icon('attachment.gif');
$attach_icon = Display::return_icon('attachment.gif', '');
$archiveURL=api_get_path(WEB_CODE_PATH).'messages/download.php?type='.$type.'&file=';
while ($row_file = Database::fetch_array($rs_file)) {
$archiveFile= $row_file['path'];

@ -5,9 +5,9 @@
* @author Julio Montoya <gugli100@gmail.com>
*/
$language_file = array('userInfo');
$language_file = array('userInfo', 'forum');
$cidReset = true;
require '../inc/global.inc.php';
require_once '../inc/global.inc.php';
api_block_anonymous_users();
if (api_get_setting('allow_social_tool') !='true') {
@ -19,8 +19,44 @@ require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
//jquery thickbox already called from main/inc/header.inc.php
$htmlHeadXtra[] = '<script type="text/javascript">
$htmlHeadXtra[] = '<script type="text/javascript">
var counter_image = 1;
function remove_image_form(id_elem1) {
var elem1 = document.getElementById(id_elem1);
elem1.parentNode.removeChild(elem1);
counter_image--;
var filepaths = document.getElementById("filepaths");
if (filepaths.childNodes.length < 3) {
var link_attach = document.getElementById("link-more-attach");
if (link_attach) {
link_attach.innerHTML=\'<a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a>\';
}
}
}
function add_image_form() {
// Multiple filepaths for image form
var filepaths = document.getElementById("filepaths");
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 = "<input type=\"file\" name=\"attach_"+counter_image+"\" size=\"20\" />&nbsp;<a href=\"javascript:remove_image_form("+id_elem1+")\"><img src=\"'.api_get_path(WEB_CODE_PATH).'img/delete.gif\"></a>";
if (filepaths.childNodes.length == 3) {
var link_attach = document.getElementById("link-more-attach");
if (link_attach) {
link_attach.innerHTML="";
}
}
}
function show_icon_edit(element_html) {
ident="#edit_image";
@ -37,7 +73,7 @@ function hide_icon_edit(element_html) {
$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' => get_lang('MemberList'));
$interbreadcrumb[] = array('url' => '#','name' => get_lang('Thread'));
api_block_anonymous_users();
$group_id = intval($_GET['id']);
@ -121,7 +157,7 @@ echo '<div id="social-content">';
SocialManager::show_social_menu('member_list', $group_id);
echo '</div>';
echo '<div id="social-content-right">';
echo '<h1><a href="groups.php?id='.$group_id.'">'.$group_info['name'].'</a></h1>';
//echo '<h4><a href="groups.php?id='.$group_id.'">'.$group_info['name'].'</a></h4>';
if (!empty($show_message)){
Display::display_confirmation_message($show_message);
}

@ -47,7 +47,7 @@ function remove_image_form(id_elem1) {
if (filepaths.childNodes.length < 3) {
var link_attach = document.getElementById("link-more-attach");
if (link_attach) {
link_attach.innerHTML=\'<a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a>&nbsp;('.get_lang('MaximunFileSizeXMB').')\';
link_attach.innerHTML=\'<a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a>\';
}
}
}

@ -76,29 +76,38 @@ $page_topic = !empty($_GET['topics_page_nr'])?intval($_GET['topics_page_nr']):1
<div id="id_content_panel_init">
<dl>
<?php
if (api_get_setting('allow_message_tool')=='true') {
if (api_get_setting('allow_message_tool')=='true') {
//normal message
$user_info=api_get_user_info($userfriend_id);
$user_info = api_get_user_info($userfriend_id);
//echo api_xml_http_response_encode(get_lang('To')).":&nbsp;&nbsp;".api_xml_http_response_encode($to_group);
$height = 180;
if ($allowed_action == 'add_message_group') {
echo '<span style="color:red">*</span> '.api_xml_http_response_encode(get_lang('Subject')).' :<br />';
echo '<input id="txt_subject_id" name="title" type="text" style="width:450px;" value="'.$subject.'"><br /><br /><br />';
$height = 140;
echo '<span style="color:red">*</span> '.api_xml_http_response_encode(get_lang('Title')).' :<br />';
echo '<input id="txt_subject_id" name="title" type="text" style="width:450px;" value="'.$subject.'"><br /><br />';
}
echo api_xml_http_response_encode(get_lang('Message')).' :<br />';
//echo api_xml_http_response_encode(get_lang('Description')).' :<br />';
$oFCKeditor = new FCKeditor('content') ;
$oFCKeditor->ToolbarSet = 'messages';
$oFCKeditor->Width = '100%';
$oFCKeditor->Height = '130';
$oFCKeditor->Height = $height;
$oFCKeditor->Value = $message;
$return = $oFCKeditor->CreateHtml();
echo $return;
?>
<div><span style="color:red"> * </span><?php echo get_lang('FieldRequired') ?></div>
<br /><?php echo api_xml_http_response_encode(get_lang('AttachmentFiles')); ?> :<br />
if ($allowed_action == 'add_message_group') {
echo '<div><span style="color:red"> * </span>'.get_lang('FieldRequired').'</div>';
}
?>
<br /><br />
<?php echo api_xml_http_response_encode(get_lang('AttachmentFiles')); ?> :<br />
<span id="filepaths"><div id="filepath_1"><input type="file" name="attach_1" size="20" /></div></span>
<div id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">
<?php echo get_lang('AddOneMoreFile') ?></a>&nbsp;(<?php echo api_xml_http_response_encode(sprintf(get_lang('MaximunFileSizeX'),format_file_size(api_get_setting('message_max_upload_filesize')))) ?>)</div>
<div id="link-more-attach">
<a href="javascript://" onclick="return add_image_form()">
<?php echo get_lang('AddOneMoreFile') ?></a>
</div>
(<?php echo api_xml_http_response_encode(sprintf(get_lang('MaximunFileSizeX'),format_file_size(api_get_setting('message_max_upload_filesize')))) ?>)
<br />
<br />
<button class="save" onclick="if(validate_text_empty(this.form.title.value,'<?php echo get_lang('YouShouldWriteASubject')?>')){return false;}" type="submit" value="<?php echo api_xml_http_response_encode(get_lang('SendMessage')); ?>"><?php echo api_xml_http_response_encode(get_lang('SendMessage')) ?></button>

Loading…
Cancel
Save