|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
<?php |
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Form for group message |
|
|
|
|
* @package chamilo.social |
|
|
|
@ -68,80 +69,70 @@ if (!empty($group_id) && $allowed_action) { |
|
|
|
|
|
|
|
|
|
$page_item = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; |
|
|
|
|
$param_item_page = isset($_GET['items_page_nr']) && isset($_GET['topic_id']) ? ('&items_' . intval($_GET['topic_id']) . '_page_nr=' . (!empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1)) : ''; |
|
|
|
|
$param_item_page .= '&topic_id=' . intval($_GET['topic_id']); |
|
|
|
|
$param_item_page .= isset($_GET['topic_id']) ? '&topic_id=' . intval($_GET['topic_id']) : null; |
|
|
|
|
$page_topic = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; |
|
|
|
|
$anchor = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topic']) : null; |
|
|
|
|
?> |
|
|
|
|
|
|
|
|
|
<form name="form" |
|
|
|
|
action="group_topics.php?id=<?php echo $group_id ?>&anchor_topic=<?php echo $anchor; ?>&topics_page_nr=<?php echo $page_topic . $param_item_page ?>"
|
|
|
|
|
method="POST" enctype="multipart/form-data"> |
|
|
|
|
<input type="hidden" name="action" value="<?php echo $allowed_action ?>"/>
|
|
|
|
|
<input type="hidden" name="group_id" value="<?php echo $group_id ?>"/>
|
|
|
|
|
<input type="hidden" name="parent_id" value="<?php echo $message_id ?>"/>
|
|
|
|
|
<input type="hidden" name="message_id" value="<?php echo $message_id ?>"/>
|
|
|
|
|
<input type="hidden" name="token" value="<?php echo $tok ?>"/>
|
|
|
|
|
<table width="500px" border="0" height="220px"> |
|
|
|
|
<tr height="180"> |
|
|
|
|
<td align="left"> |
|
|
|
|
<div id="id_content_panel_init"> |
|
|
|
|
<dl> |
|
|
|
|
<?php |
|
|
|
|
if (api_get_setting('allow_message_tool') == 'true') { |
|
|
|
|
//normal message |
|
|
|
|
$user_info = api_get_user_info($userfriend_id); |
|
|
|
|
//echo api_xml_http_response_encode(get_lang('To')).": ".api_xml_http_response_encode($to_group); |
|
|
|
|
$height = 180; |
|
|
|
|
if ($allowed_action == 'add_message_group') { |
|
|
|
|
$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('Description')).' :<br />'; |
|
|
|
|
//@todo use formvalidator |
|
|
|
|
$oFCKeditor = new CKeditor(); |
|
|
|
|
$oFCKeditor->ToolbarSet = 'messages'; |
|
|
|
|
$oFCKeditor->Width = '95%'; |
|
|
|
|
$oFCKeditor->Height = $height; |
|
|
|
|
$oFCKeditor->Value = $message; |
|
|
|
|
|
|
|
|
|
//$return = $oFCKeditor->CreateHtml(); |
|
|
|
|
$return = $oFCKeditor->editor('content'); |
|
|
|
|
echo $return; |
|
|
|
|
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>
|
|
|
|
|
</div> |
|
|
|
|
(<?php echo api_xml_http_response_encode( |
|
|
|
|
sprintf( |
|
|
|
|
get_lang('MaximunFileSizeX'), |
|
|
|
|
format_file_size( |
|
|
|
|
api_get_setting( |
|
|
|
|
'message_max_upload_filesize' |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
) ?>) |
|
|
|
|
<br/> |
|
|
|
|
<br/> |
|
|
|
|
|
|
|
|
|
<?php if ($allowed_action == 'add_message_group') { ?> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form = new FormValidator( |
|
|
|
|
'add_post', |
|
|
|
|
'post', |
|
|
|
|
api_get_path(WEB_CODE_PATH)."social/group_topics.php?id=$group_id&anchor_topic=$anchor&topics_page_nr=$page_topic"."$param_item_page", |
|
|
|
|
null, |
|
|
|
|
array('enctype' => 'multipart/form-data') |
|
|
|
|
); |
|
|
|
|
$form->addHidden('action', $allowed_action); |
|
|
|
|
$form->addHidden('group_id', $group_id); |
|
|
|
|
$form->addHidden('parent_id', $message_id); |
|
|
|
|
$form->addHidden('message_id',$message_id ); |
|
|
|
|
$form->addHidden('token', $tok); |
|
|
|
|
|
|
|
|
|
if (api_get_setting('allow_message_tool') == 'true') { |
|
|
|
|
//normal message |
|
|
|
|
$user_info = api_get_user_info($userfriend_id); |
|
|
|
|
$height = 180; |
|
|
|
|
if ($allowed_action == 'add_message_group') { |
|
|
|
|
$form->add_textfield('title', get_lang('Title')); |
|
|
|
|
$height = 140; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$config = array(); |
|
|
|
|
$config['ToolbarSet'] = 'Messages'; |
|
|
|
|
$form->add_html_editor( |
|
|
|
|
'content', |
|
|
|
|
get_lang('Content'), |
|
|
|
|
false, |
|
|
|
|
false, |
|
|
|
|
$config |
|
|
|
|
); |
|
|
|
|
$form->add_html('<span id="filepaths"><div id="filepath_1">'); |
|
|
|
|
$form->add_file('attach_1', get_lang('AttachmentFiles')); |
|
|
|
|
$form->add_html('</div></span>'); |
|
|
|
|
|
|
|
|
|
$form->add_label(null, |
|
|
|
|
' <div id="link-more-attach"> |
|
|
|
|
<a href="javascript://" onclick="return add_image_form()"> |
|
|
|
|
' . get_lang('AddOneMoreFile') . '</a> |
|
|
|
|
</div>' |
|
|
|
|
); |
|
|
|
|
$form->add_label(null, |
|
|
|
|
api_xml_http_response_encode( |
|
|
|
|
sprintf( |
|
|
|
|
get_lang('MaximunFileSizeX'), |
|
|
|
|
format_file_size( |
|
|
|
|
api_get_setting('message_max_upload_filesize') |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$form->addElement('style_submit_button', 'submit', get_lang('SendMessage')); |
|
|
|
|
Display::display_no_header(); |
|
|
|
|
//Display::display_reduced_header(); |
|
|
|
|
$form->display(); |
|
|
|
|
} |
|
|
|
|
/* |
|
|
|
|
?> |
|
|
|
|
<button class="btn save" |
|
|
|
|
onclick="if(validate_text_empty(this.form.title.value,'<?php echo get_lang( |
|
|
|
|
'YouShouldWriteASubject' |
|
|
|
@ -166,3 +157,4 @@ $anchor = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topi |
|
|
|
|
</div> |
|
|
|
|
</table> |
|
|
|
|
</form> |
|
|
|
|
*/ |
|
|
|
|