Просмотр исходного кода

[svn r18400] logi changes - allow show and hide the groups, in social tool - (see FS#3628)

Isaac Flores 16 лет назад
Родитель
Сommit
49736e08cf
2 измененных файлов с 29 добавлено и 10 удалено
  1. 9 7
      main/social/group_contact.inc.php
  2. 20 3
      main/social/index.php

+ 9 - 7
main/social/group_contact.inc.php

@@ -24,19 +24,20 @@ $list_groups=UserFriend::show_list_type_friends();
 for ($p=0;$p<count($list_groups);$p++) {
 	$list_path_friends=UserFriend::get_list_path_web_by_user_id ($user_id,$list_groups[$p]['id']);
 ?>
-<div align="center" id="<?php echo 'div_group_'.$list_groups[$p]['id']; ?>" >
 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="social-align-box">
   <tr>
     <td width="100%" height="20" valign="top">
 
         <table width="100%" border="0" cellpadding="0" cellspacing="0" class="social-title">
           <tr>
-            <td width="100%" height="22" valign="top">&nbsp;&nbsp;<?php echo $list_groups[$p]['title']; ?></td>
+            <td width="100%" height="22" valign="top">&nbsp;&nbsp;<?php echo $list_groups[$p]['title']; ?>
+            <img id="<?php echo 'btn_'.$list_groups[$p]['id']; ?>" style="float:right;margin-top:-15px" src="../img/visible.gif" onclick="toogle_function(this)"/><input type="hidden" class="hidden" id="id_hd_dame" name="hd_dame" value="0" /></td>
               </tr>
         </table></td>
         </tr>
       <tr>
 	<td valign="top">
+<div align="center" id="<?php echo 'div_group_'.$list_groups[$p]['id']; ?>" >
 <?php
 $friend_html='';
 $number_of_images=10;
@@ -53,7 +54,7 @@ if (count($list_path_friends)!=0) {
 	$number_friends= count($list_friends_dir);
 	$number_loop   = ($number_friends/$number_of_images);
 	$loop_friends  = ceil($number_loop);
-	$j=0;
+	$j=0;//<div id="div_groupid_"'.$list_groups[$p]['id'].'">
 	$friend_html.= '<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFC" style="border-left:1px #B8C8DC solid;border-bottom:1px #B8C8DC solid;border-right:1px #B8C8DC solid;">';		
 	for ($k=0;$k<$loop_friends;$k++) {
 		$friend_html.='<tr><td valign="top">';
@@ -70,17 +71,18 @@ if (count($list_path_friends)!=0) {
 		}
 		$friend_html.='</td></tr>';
 	}
-	$friend_html.='<br/></table>';
+	$friend_html.='<br/></table>&nbsp;';
 	echo $friend_html; 
 }  else {
 	$friend_html.= '<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFC" style="border-left:1px #B8C8DC solid;border-bottom:1px #B8C8DC solid;border-right:1px #B8C8DC solid;">';		
 	$friend_html.='<tr><td valign="top">&nbsp;&nbsp;&nbsp;'.get_lang('NoHaveContactsInThisGroup');
-	$friend_html.='</td></tr>';
-	$friend_html.='<br/></table>';
+	$friend_html.='<br/><br/></td></tr>';
+	$friend_html.='</table>&nbsp;';//</div>
 	echo $friend_html;
+	echo '</br>';
 }
 ?>
-        </td>
+        </td><br/>
         </tr>
     </table></td>
   </tr>

+ 20 - 3
main/social/index.php

@@ -140,9 +140,26 @@ function search_image_social(element_html)  {
 	});
 }
 function clear_form () {
-$("input[@type=radio]").attr("checked", false);
-$("div#div_qualify_image").html("");
-$("div#div_info_user").html("");
+	$("input[@type=radio]").attr("checked", false);
+	$("div#div_qualify_image").html("");
+	$("div#div_info_user").html("");
+}
+function toogle_function (element_html){
+	elem_id=$(element_html).attr("id");
+	id_elem=elem_id.split("_");
+	ident="div#div_group_"+id_elem[1];
+	id_button="#btn_"+id_elem[1];
+	elem_src=$(id_button).attr("src");
+	image_show=elem_src.split("/");
+	my_image=image_show[2];
+	if (my_image=="visible.gif") {
+		$(ident).hide("slow");	
+		$(id_button).attr("src","../img/invisible_na.gif");
+	} else {
+		$(ident).show("slow");	
+		$(id_button).attr("src","../img/visible.gif");
+	}
+
 }
 </script>';
 $htmlHeadXtra[] = '<link rel="stylesheet" href="../inc/lib/javascript/jquery.tabs.css" type="text/css" media="print, projection, screen">';