added group message pagination with sortable grid - partial CT#190

skala
Cristian Fasanando 16 years ago
parent 99d377f31e
commit a0049fccee
  1. 10
      main/css/blue_lagoon/default.css
  2. 33
      main/inc/lib/display.lib.php
  3. 239
      main/inc/lib/message.lib.php
  4. 48
      main/inc/lib/sortabletable.class.php
  5. 18
      main/social/groups.php
  6. 7
      main/social/message_for_group_form.inc.php

@ -3024,7 +3024,8 @@ a.read {
}
.message-group-date {
color:#666;
float:right;
width:100%;
text-align:right;
}
.view-message-content {
line-height:150%;
@ -3185,6 +3186,13 @@ a.read {
.profile_grid_element_1 { width:170px; float:left; text-align:left; margin-bottom:1px; }
/* pagination grid sortable */
.sub_header {width:100%}
.grid_selectbox {float:left;width:35%}
.grid_title {float:left;width:30%;text-align:center}
.grid_nav {float:left;width:35%;text-align:right}
/* Groups boxes */
.group_invitation_grid_container { width:100%;}

@ -321,10 +321,39 @@ class Display {
if (is_array($query_vars)) {
$table->set_additional_parameters($query_vars);
}
$table->display_simple_grid($vibility_options, $paging_options['hide_navigation']);
echo $table->display_simple_grid($vibility_options, $paging_options['hide_navigation']);
}
/**
* gets a nice grid in html string
* @param string grid name (important to create css)
* @param array header content
* @param array array with the information to show
* @param array $paging_options Keys are:
* 'per_page_default' = items per page when switching from
* full- list to per-page-view
* 'per_page' = number of items to show per page
* 'page_nr' = The page to display
* 'hide_navigation' = true to hide the navigation
* @param array $query_vars Additional variables to add in the query-string
* @param array $form actions Additional variables to add in the query-string
* @param mixed An array with bool values to know which columns show. i.e: $vibility_options= array(true, false) we will only show the first column
* Can be also only a bool value. TRUE: show all columns, FALSE: show nothing
* @param bool true for sorting data or false otherwise
* @return string html grid
*/
public static function return_sortable_grid ($name, $header, $content, $paging_options = array (), $query_vars = null, $form_actions=array(), $vibility_options = true, $sort_data = true) {
global $origin;
$column = 0;
$default_items_per_page = isset ($paging_options['per_page']) ? $paging_options['per_page'] : 20;
$table = new SortableTableFromArray($content, $column, $default_items_per_page, $name);
if (is_array($query_vars)) {
$table->set_additional_parameters($query_vars);
}
//var_dump($table->get_additional_url_paramstring());
return $table->display_simple_grid($vibility_options, $paging_options['hide_navigation'], $paging_options['per_page'], $sort_data);
}
/**
* Display a table with a special configuration

@ -836,9 +836,13 @@ class MessageManager
$rows = self::get_messages_by_group($group_id);
$rows = self::calculate_children($rows);
$group_info = GroupPortalManager::get_group_data($group_id);
$current_user_id = api_get_user_id();
$current_user_id = api_get_user_id();
$topics_per_page = 5;
$items_per_page = 3;
$count_items = 0;
$html = '';
$html_messages = '';
$query_vars = array('id'=>$group_id,'topics_page_nr'=>0);
if (is_array($rows) && count($rows)> 0) {
// prepare array for topics with its items
@ -852,25 +856,12 @@ class MessageManager
$topics[$x]['items'][] = $value;
}
}
uasort($topics,array('MessageManager','order_desc_date'));
// pager
$page = isset($_GET['page_nr'])?intval($_GET['page_nr']):1;
$total_topics = count($topics);
$topics_per_page = 5;
$pager = self::get_pager_for_message_group($group_id,$page,$total_topics,$topics_per_page);
uasort($topics,array('MessageManager','order_desc_date'));
// topics and items
$parents = array_keys(self::get_messages_by_parent(0,$group_id,$page,$topics_per_page));
$html .= '<div class="social-box-main2">';
$html .= ' <div class="pager">
<table width="690px">
<tr><td style="width:25%">&nbsp;</td><td style="text-align:center">'.$pager['details'].'</td><td style="text-align:right;width:25%">'.$pager['links'].'</td></tr></table></div>';
$param_names = array_keys($_GET);
$array_html = array();
foreach ($topics as $index => $topic) {
if (!in_array($index,$parents)) continue;
$html = '';
// topics
$indent = 0;
$user_sender_info = UserManager::get_user_info_by_id($topic['user_sender_id']);
@ -880,179 +871,91 @@ class MessageManager
$html .= '<div class="social-box-container2" >';
$html .= '<div>'.Display::return_icon('content-post-group1.jpg').'</div>';
$html .= '<div class="social-box-content2">';
$html .= '<a href="#" class="head" id="head_'.$topic['id'].'">
<span class="message-group-title-topic">'.((isset($_GET['div_id']) && $_GET['div_id'] == 'content_'.$topic['id'])?Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align: middle')):
Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align: middle'))).'
'.$topic['title'].'</span>';
$html .= '</a>';
$html .= '<a href="#" class="head" id="head_'.$topic['id'].'">';
$html .= '<span class="message-group-title-topic">'.(((isset($_GET['anchor_topic']) && $_GET['anchor_topic'] == 'topic_'.$topic['id']) || in_array('items_'.$topic['id'].'_page_nr',$param_names))?Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align: middle')):
Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align: middle'))).'
'.$topic['title'].'</span>';
$html .= '</a>';
if ($topic['send_date']!=$topic['update_date']) {
if (!empty($topic['update_date']) && $topic['update_date'] != '0000-00-00 00:00:00' ) {
$html .= '<span> ('.get_lang('LastUpdate').' '.date_to_str_ago($topic['update_date']).')</span>';
}
} else {
$html .= '<span> ('.get_lang('Created').' '.date_to_str_ago($topic['send_date']).')</span>';
}
if ($topic['send_date']!=$topic['update_date']) {
if (!empty($topic['update_date']) && $topic['update_date'] != '0000-00-00 00:00:00' ) {
$html .= '<span class="message-group-date" > ('.get_lang('LastUpdate').' '.date_to_str_ago($topic['update_date']).')</span>';
}
} else {
$html .= '<span class="message-group-date" > ('.get_lang('Created').' '.date_to_str_ago($topic['send_date']).')</span>';
}
$html .= '<div id="content_'.$topic['id'].'" >';
$html .= '<a name="content_'.$topic['id'].'"></a>';
$html.= '<div style="margin-bottom:10px">';
$html.= '<div id="message-reply-link" style="margin-right:10px">
<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group&div_id=content_'.$topic['id'].'&page_nr='.Security::remove_XSS($_GET['page_nr']).'&page_item_nr='.Security::remove_XSS($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
if ($topic['user_sender_id'] == $current_user_id) {
$html.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group&div_id=content_'.$topic['id'].'&page_nr='.Security::remove_XSS($_GET['page_nr']).'&page_item_nr='.Security::remove_XSS($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Edit').'">'.Display :: return_icon('edit.gif', get_lang('Edit')).'</a>';
}
$html.= '</div>';
$html.= '<br />';
$html.= '<div class="message-group-author">'.get_lang('From').'&nbsp;<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$topic['user_sender_id'].'">'.$name.'&nbsp;</a></div>';
$html.= '<div class="message-group-content">'.$topic['content'].'</div>';
$html.= '<div class="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>';
$html.= '</div>';
$html .= '<div id="topic_'.$topic['id'].'" >';
$html .= '<a name="topic_'.$topic['id'].'"></a>';
$html.= '<div style="margin-bottom:10px">';
$html.= '<div id="message-reply-link" style="margin-right:10px">
<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group&anchor_topic=topic_'.$topic['id'].'&topics_page_nr='.intval($_GET['topics_page_nr']).'&items_page_nr='.intval($_GET['items_page_nr']).'" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
if ($topic['user_sender_id'] == $current_user_id) {
$html.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group&anchor_topic=topic_'.$topic['id'].'&topics_page_nr='.intval($_GET['topics_page_nr']).'&items_page_nr='.intval($_GET['items_page_nr']).'" class="thickbox" title="'.get_lang('Edit').'">'.Display :: return_icon('edit.gif', get_lang('Edit')).'</a>';
}
$html.= '</div>';
$html.= '<br />';
$html.= '<div class="message-group-author">'.get_lang('From').'&nbsp;<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$topic['user_sender_id'].'">'.$name.'&nbsp;</a></div>';
$html.= '<div class="message-group-content">'.$topic['content'].'</div>';
$html.= '<div class="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>';
$html.= '</div>';
// items
// items
if (is_array($topic['items'])) {
// pager items
$page_item = isset($_GET['page_item_nr'])?intval($_GET['page_item_nr']):1;
$total_items = count($topic['items']);
$items_per_page = 3;
$div_content = 'content_'.$topic['id'];
$pager_items = self::get_pager_for_message_group($group_id,$page_item,$total_items,$items_per_page,true,$div_content);
$html .= ' <div class="pager">
<table width="100%">
<tr><td style="width:25%">&nbsp;</td><td style="text-align:center">'.$pager_items['details'].'</td><td style="text-align:right;width:25%">'.$pager_items['links'].'</td></tr></table></div>';
$topic_slice['items'] = array_slice($topic['items'],($page_item-1)*($items_per_page),$items_per_page);
$count_items = count($topic['items']);
$current_page = $count_items/$items_per_page;
if (is_int($current_page)) {
$page_item_nr = $current_page + 1;
} else {
$page_item_nr = intval($_GET['page_item_nr']);
}
foreach ($topic_slice['items'] as $item) {
$indent = $item['indent_cnt']*'15';
$items_page_nr = intval($_GET['items_'.$topic['id'].'_page_nr']);
$array_html_items = array();
foreach ($topic['items'] as $item) {
$html_items = '';
//$indent = $item['indent_cnt']*'15';
$user_sender_info = UserManager::get_user_info_by_id($item['user_sender_id']);
$files_attachments = self::get_links_message_attachment_files($item['id']);
$name = api_get_person_name($user_sender_info['firstname'], $user_sender_info['lastname']);
//$html.= '<div class="message-item" style="margin-left: '.$indent.'px;">';
$html.= '<div class="social-box-container3" >';
$html .= '<div>'.Display::return_icon('content-post-reply01.jpg').'</div>';
$html .= '<div class="social-box-content3">';
$html.= '<div id="message-reply-link">';
//$html.= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$item['id'].'&action=reply_message_group&div_id=content_'.$topic['id'].'&page_nr='.Security::remove_XSS($_GET['page_nr']).'&page_item_nr='.Security::remove_XSS($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
$html.= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$item['id'].'&action=reply_message_group&div_id=content_'.$topic['id'].'&page_nr='.intval($_GET['page_nr']).'&page_item_nr='.intval($page_item_nr).'" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
$html_items.= '<div class="social-box-container3" >';
$html_items .= '<div>'.Display::return_icon('content-post-reply01.jpg').'</div>';
$html_items .= '<div class="social-box-content3">';
$html_items.= '<div id="message-reply-link">';
$html_items.= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$item['id'].'&action=reply_message_group&anchor_topic=topic_'.$topic['id'].'&topics_page_nr='.intval($_GET['topics_page_nr']).'&items_page_nr='.intval($items_page_nr).'&topic_id='.$topic['id'].'" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
if ($item['user_sender_id'] == $current_user_id) {
$html.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$item['id'].'&action=edit_message_group&div_id=content_'.$topic['id'].'&page_nr='.intval($_GET['page_nr']).'&page_item_nr='.intval($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Edit').'">'.Display :: return_icon('edit.gif', get_lang('Edit')).'</a>';
$html_items.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$item['id'].'&action=edit_message_group&anchor_topic=topic_'.$topic['id'].'&topics_page_nr='.intval($_GET['topics_page_nr']).'&items_page_nr='.intval($items_page_nr).'&topic_id='.$topic['id'].'" class="thickbox" title="'.get_lang('Edit').'">'.Display :: return_icon('edit.gif', get_lang('Edit')).'</a>';
}
$html.= '</div>';
$html.= '<div class="message-group-title">'.$item['title'].'&nbsp;</div>';
$html.= '<div class="message-group-author">'.get_lang('From').'&nbsp;<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$item['user_sender_id'].'">'.$name.'&nbsp;</a></div>';
$html.= '<div class="message-group-content">'.$item['content'].'</div>';
$html_items.= '</div>';
$html_items.= '<div class="message-group-title">'.$item['title'].'&nbsp;</div>';
$html_items.= '<div class="message-group-author">'.get_lang('From').'&nbsp;<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$item['user_sender_id'].'">'.$name.'&nbsp;</a></div>';
$html_items.= '<div class="message-group-content">'.$item['content'].'</div>';
if ($item['send_date'] != $item['update_date']) {
if (!empty($item['update_date']) && $item['update_date'] != '0000-00-00 00:00:00' ) {
$html .= '<span class="message-group-date"> '.get_lang('LastUpdate').' '.date_to_str_ago($item['update_date']).'</span>';
$html_items .= '<div class="message-group-date"> '.get_lang('LastUpdate').' '.date_to_str_ago($item['update_date']).'</div>';
}
} else {
$html .= '<span class="message-group-date"> '.get_lang('Created').' '.date_to_str_ago($item['send_date']).'</span>';
$html_items .= '<div class="message-group-date"> '.get_lang('Created').' '.date_to_str_ago($item['send_date']).'</div>';
}
$html.= '<div class="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>';
$html.= '</div>';
$html.= '</div>';
}
/*
// pager items
$html .= ' <div class="pager">
<table width="100%">
<tr><td style="width:25%">&nbsp;</td><td>&nbsp;</td><td style="text-align:right;width:25%">'.$pager_items['links'].'</td></tr></table></div>';
*/
$html_items.= '<div class="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>';
$html_items.= '</div>';
$html_items.= '</div>';
$array_html_items[] = array($html_items);
}
// grids for items with paginations
$html .= Display::return_sortable_grid('items_'.$topic['id'], array(), $array_html_items, array('hide_navigation'=>false, 'per_page' => $items_per_page), $query_vars, false, array(true, true, true,false), false);
}
$html .= '</div>';
$html .= '</div>';
$html .= '</div>';
$html .= '</div>';
$array_html[] = array($html);
}
$html .= '</div>';
// grids for items and topics with paginations
/*
// pager
$html .= ' <div class="pager">
<table width="700px">
<tr><td style="width:25%">&nbsp;</td><td>&nbsp;</td><td style="text-align:right;width:25%">'.$pager['links'].'</td></tr></table></div>';
*/
}
return $html;
}
/**
* Get pager for messages of group
* @param int group id
* @param int current page
* @param int total rows
* @param int rows per page
* @return array pager with details and links
*/
public static function get_pager_for_message_group($group_id,$page,$num_rows,$rows_per_page,$pager_items = false,$div_content='') {
$link = '';
$details = '';
$pager = array();
$group_id = intval($group_id);
$page = intval($page);
$num_rows = intval($num_rows);
$first_page = 1;
$last_page = ceil($num_rows/$rows_per_page);
// get details
if ($page == $first_page) {
$details = $page.' - '.($page*$rows_per_page).' / '.$num_rows;
} else if ($page > $first_page && $page < $last_page) {
$details = ((($page-1)*$rows_per_page)+1).' - '.($page*$rows_per_page).' / '.$num_rows;
} else {
$details = ((($page-1)*$rows_per_page)+1).' - '.($num_rows).' / '.$num_rows;
}
$pager['details'] = $details;
// get links for pager
$href = api_get_path(WEB_CODE_PATH).'social/groups.php?id='.$group_id;
if ($pager_items) {
$page_topic = isset($_GET['page_nr'])?intval($_GET['page_nr']):1;
$param_name_page_nr = '&page_nr='.$page_topic.'&div_id='.$div_content.'&page_item_nr=';
} else {
$param_name_page_nr = '&page_nr=';
$html_messages .= '<div class="social-box-container2">';
$html_messages .= Display::return_sortable_grid('topics', array(), $array_html, array('hide_navigation'=>false, 'per_page' => $topics_per_page), $query_vars, false, array(true, true, true,false), false);
$html_messages .= '</div>';
}
if ($page > 1) {
$link .= '<a title="'.get_lang('FirstPage').'" href="'.$href.$param_name_page_nr.$first_page.'">';
$link .= Display::return_icon('first.png',get_lang('FirstPage'),array('style'=>'vertical-align: middle'));
$link .= '</a>';
$link .= '<a title="'.get_lang('PreviousPage').'" href="'.$href.$param_name_page_nr.($page-1).'">';
$link .= Display::return_icon('prev.png',get_lang('PreviousPage'),array('style'=>'vertical-align: middle'));
$link .= '</a>';
}
$link .= $page.'/'.$last_page;
if ($page < $last_page) {
$link .= '<a title="'.get_lang('NextPage').'" href="'.$href.$param_name_page_nr.($page+1).'">';
$link .= Display::return_icon('next.png',get_lang('NextPage'),array('style'=>'vertical-align: middle'));
$link .= '</a>';
$link .= '<a title="'.get_lang('LastPage').'" href="'.$href.$param_name_page_nr.$last_page.'">';
$link .= Display::return_icon('last.png',get_lang('PreviousPage'),array('style'=>'vertical-align: middle'));
$link .= '</a>';
}
$pager['links'] = $link;
return $pager;
return $html_messages;
}
/**
* Add children to messages by id is used for nested view messages

@ -429,7 +429,16 @@ class SortableTable extends HTML_Table {
echo $html;
}
public function display_simple_grid($vibility_options, $hide_navigation) {
/**
* This function return the content of a table in a grid
* Should not be use to edit information (edit/delete rows) only.
* @param array options of visibility
* @param bool hide navigation optionally
* @param int content per page when show navigation (optional)
* @param bool sort data optionally
* @return string grid html
*/
public function display_simple_grid($vibility_options, $hide_navigation = true, $per_page = 0, $sort_data = true) {
global $charset;
$empty_table = false;
$html = '';
@ -448,19 +457,21 @@ class SortableTable extends HTML_Table {
if (!$empty_table) {
//if we show the pagination
if ($hide_navigation == false ) {
$form = $this->get_page_select_form();
$nav = $this->get_navigation_html();
if ($hide_navigation == false ) {
$form = '&nbsp;';
if ($per_page > 10) {
$form = $this->get_page_select_form();
}
$nav = $this->get_navigation_html();
//this also must be moved
$html = '<div class="sub-header">';
$html .= '<div class="grid_selectbox">'.$form.'</div>';
$html = '<div class="sub-header" >';
$html .= '<div class="grid_selectbox">'.$form.'</div>';
$html .= '<div class="grid_title">'.$this->get_table_title().'</div>';
$html .= '<div class="grid_nav">'.$nav.'</div>';
$html .= '</div>';
}
//$html .= '<div class="clear"></div>';
$html .= '<div class="clear"></div>';
if (count($this->form_actions) > 0) {
$script= '<script language="javaScript" type="text/javascript">
/*<![CDATA[*/
@ -483,7 +494,7 @@ class SortableTable extends HTML_Table {
$items = $this->table_data; //this is a faster way to get what we want
} else {
//the normal way
$items = $this->get_clean_html(); // getting the items of the table
$items = $this->get_clean_html($sort_data); // getting the items of the table
}
@ -517,7 +528,7 @@ class SortableTable extends HTML_Table {
}
$html.='</div>';
$html .= '<div class="clear"></div>';
echo $html;
return $html;
}
/**
@ -559,14 +570,15 @@ class SortableTable extends HTML_Table {
}
/**
* This function return the items of the table
* @param bool true for sorting table data or false otherwise
* @return array table row items
*/
public function get_clean_html () {
public function get_clean_html ($sort=true) {
$pager = $this->get_pager();
$val = $pager->getOffsetByPageId();
$offset = $pager->getOffsetByPageId();
$from = $offset[0] - 1;
$table_data = $this->get_table_data($from);
$from = $offset[0] - 1;
$table_data = $this->get_table_data($from,$sort);
$new_table_data = array();
if (is_array($table_data)) {
foreach ($table_data as $index => $row) {
@ -844,8 +856,14 @@ class SortableTableFromArray extends SortableTable {
* Get table data to show on current page
* @see SortableTable#get_table_data
*/
public function get_table_data ($from = 1) {
$content = TableSort :: sort_table($this->table_data, $this->column, $this->direction == 'ASC' ? SORT_ASC : SORT_DESC);
public function get_table_data ($from = 1,$sort = true) {
if ($sort) {
$content = TableSort :: sort_table($this->table_data, $this->column, $this->direction == 'ASC' ? SORT_ASC : SORT_DESC);
} else {
$content = $this->table_data;
}
return array_slice($content, $from, $this->per_page);
}
/**

@ -22,6 +22,21 @@ $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqu
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">';
// prepare anchor for message group topic
$anchor = '';
if (isset($_GET['anchor_topic'])) {
$anchor = Security::remove_XSS($_GET['anchor_topic']);
} else {
$match = 0;
$param_names = array_keys($_GET);
foreach ($param_names as $param) {
if (preg_match('/^items_(\d)_page_nr$/', $param, $match)) {
break;
}
}
$anchor = 'topic_'.$match[1];
}
$htmlHeadXtra[] = '<script type="text/javascript">
var counter_image = 1;
@ -71,7 +86,7 @@ function validate_text_empty (str,msg) {
jQuery(document).ready(function() {
var valor = "'.Security::remove_XSS($_GET['div_id']).'";
var valor = "'.$anchor.'";
$(".head").click(function() {
$(this).next().next().slideToggle("fast");
@ -179,7 +194,6 @@ if ($group_id != 0 ) {
}
}
echo '<div id="social-content">';
echo '<div id="social-content-left">';

@ -53,12 +53,11 @@ if (!empty($group_id) && $allowed_action) {
}
}
$page_item = !empty($_GET['page_item_nr'])?intval($_GET['page_item_nr']):1;
$page_topic = !empty($_GET['page_nr'])?intval($_GET['page_nr']):1;
$param_item_page = isset($_GET['items_page_nr']) && isset($_GET['topic_id'])?('&items_'.intval($_GET['topic_id']).'_page_nr='.$_GET['items_page_nr']):'';
$page_topic = !empty($_GET['topics_page_nr'])?intval($_GET['topics_page_nr']):1;
?>
<form name="form" action="groups.php?id=<?php echo $group_id ?>&div_id=<?php echo Security::remove_XSS($_GET['div_id']) ?>&page_nr=<?php echo $page_topic ?>&page_item_nr=<?php echo $page_item ?>" method="POST" enctype="multipart/form-data">
<form name="form" action="groups.php?id=<?php echo $group_id ?>&anchor_topic=<?php echo Security::remove_XSS($_GET['anchor_topic']) ?>&topics_page_nr=<?php echo $page_topic ?><?php echo $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 ?>" />

Loading…
Cancel
Save