<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Forum</name><description>Add a discussion forum</description><help>			
		With the Forum Block, visitors can discuss and add questions to your Website. &lt;br&gt; This block may be resized automatically according to the number of messages it contains. In this case you should not put any other module below it. &lt;br&gt; To add a topic or post a message, visitors have to register to your website. They will be automatically connected for further posting. </help><api_version>1.0</api_version><size height='350' width='600' /><server>local://ForumCptServer</server><blog en='202' fr='201' /><max bg='0' fg='1' url='1' /></metadata><view><content>&lt;div class=uif_header&gt;
&lt;a href=&quot;#&quot; class=uif_all_topics&gt;All topics&lt;/a&gt;&lt;a href=&quot;#&quot; class=uif_new_topic&gt;New topic&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;uif_page uif_post_form_top&quot;&gt;
	&lt;div uitype=&quot;member&quot;&gt;&lt;/div&gt;
	&lt;div class=uif_data&gt;
	&lt;div class=uif_subject_field&gt;&lt;input type=text name=&quot;topic_subject&quot; value=&quot;&quot; placeholder=&quot;Topic title&quot;/&gt;&lt;/div&gt;
		&lt;textarea class=&quot;uif_post_body&quot; name=&quot;post_body&quot; placeholder=&quot;Message to post&quot;&gt;&lt;/textarea&gt;
		&lt;div style=&quot;text-align:center&quot;&gt;&lt;input class=uif_add_post type=submit value=&quot;Post a new message&quot;/&gt;&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;uif_topics uif_page&quot;&gt;
	&lt;div class=uif_topic_list&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;uif_posts uif_page&quot;&gt;
	&lt;div class=uif_post_list&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=uif_footer&gt;
&lt;a href=&quot;#&quot; class=uif_all_topics&gt;All topics&lt;/a&gt;&lt;a href=&quot;#&quot; class=uif_new_topic&gt;New topic&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;uif_post_form_bottom uif_page&quot;&gt;
	&lt;div uitype=&quot;member&quot;&gt;&lt;/div&gt;
	&lt;div class=uif_data&gt;
	&lt;div class=uif_subject_field&gt;&lt;input type=text name=&quot;topic_subject&quot; value=&quot;&quot; placeholder=&quot;Topic title&quot;/&gt;&lt;/div&gt;
		&lt;textarea class=&quot;uif_post_body&quot; name=&quot;post_body&quot; placeholder=&quot;Message to post&quot;&gt;&lt;/textarea&gt;
		&lt;div style=&quot;text-align:center&quot;&gt;&lt;input class=uif_add_post type=submit value=&quot;Post a new message&quot;/&gt;&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;</content><properties><checkbox default='true' help='If checked, the height of the block will automatically be adapted to the number of messages, possibly hiding blocks below it. Otherwise, a scrollbar will appear.' name='auto_size' value='Auto-Size' /><number default='20' help='This parameter allows you to manage the number of topics shown on each page.' minimum='1' name='topic_nbr_per_page' title='Topics per page' /><number default='20' help='This parameter allows you to manage the number of posts shown on each page.' minimum='1' name='post_nbr_per_page' title='Posts per page' /><checkbox default='true' help='If checked, you will receive an email each time a visitor posts a message or a new topic on the forum. You can configure the email notification address by going to the &lt;i&gt;My account&lt;/i&gt; and &lt;i&gt;My emails&lt;/i&gt; pages.' name='notification' value='New post notification' /><checkbox default='false' help='If checked, when a visitor posts a message or a new topic on the forum, the message will not be shown on your website until you publish it. This allows you to filter the sent messages.' name='validation' value='New post validation' /><option default='&apos;bottom&apos;' display='Top|Bottom' help='Select where to display the post form.' name='form_position' title='Form position' values='top|bottom' /></properties></view><script>UI_Forum={forums:{}};
UI_List.UI_Forum={initialize:function(a){this.cpt=a;
this.current_topic=null;
this.current_page=null;
a.setOptions([&quot;locked&quot;])
},onDisplay:function(c){var b=this;
this.newly_created=(this.cpt.newlyCreated);
this.n={main:c};
var a=[&quot;topics&quot;,&quot;topic_list&quot;,&quot;posts&quot;,&quot;post_list&quot;,&quot;add_post&quot;,&quot;page&quot;,&quot;subject_field&quot;,&quot;new_topic&quot;,&quot;all_topics&quot;,&quot;post_body&quot;,&quot;footer&quot;];
a.each(function(d){b.n[d]=$(&quot;.uif_&quot;+d,b.n.main)
});
this.updateForm();
this.size_getter_el=$(&quot;&lt;div&gt;&lt;/div&gt;&quot;).appendTo(this.n.main)[0];
this.displayPage({page:&quot;topics&quot;});
this.n.new_topic.click(function(){b.displayPage({page:&quot;new_topic&quot;});
return false
});
this.n.all_topics.click(function(){b.displayPage({page:&quot;topics&quot;});
return false
});
this.n.add_post.bind(&quot;click&quot;,function(){b.n.add_post.hide();
var d=b.cpt.statusLoading();
var f=$(this).closest(b.n.post_form);
var e={request:&quot;add_post&quot;,post:{},topic_id:b.current_topic};
f.find(&quot;.uif_data input,.uif_data textarea&quot;).each(function(g,h){e.post[h.name]=h.value
});
b.cpt.ask(e,function(g){d.update(100);
if(g.current_topic){b.displayPage({page:&quot;posts&quot;,topic_id:g.current_topic,page_no:-1})
}else{b.displayPage({page:&quot;topics&quot;})
}b.n.post_body.val(&quot;&quot;);
$(&quot;input&quot;,b.n.subject_field).val(&quot;&quot;);
b.n.add_post.show();
alert(&quot;Your message has been posted.&quot;+(!g.published?&quot; It will be published online after validation.&quot;:&quot;&quot;))
},function(g){d.update(100);
b.n.add_post.show();
alert(&quot;Your message has not been posted:\n&quot;+g.join(&quot;\n&quot;))
},f)
});
this.member_controller=new MemberController(this.n.main);
var b=this;
sigCtl.connect(&quot;Theme.changed&quot;,function(){b.updateCptSize()
})
},displayPage:function(c){var a=this;
var b=a.cpt.statusLoading();
this.n.page.hide();
this.current_topic=null;
switch(c.page){case&quot;posts&quot;:this.current_topic=c.topic_id;
a.cpt.ask({request:&quot;display_page&quot;,page:c},function(d){c.page_no=d.page_no;
a.n.post_list.html(d.html);
a.n.subject_field.hide();
a.n.posts.show();
a.n.footer.toggle(a.n.post_list.find(&quot;fieldset&quot;).length&gt;2);
a.member_controller.showForm();
a.n.post_form.show();
a.buildLinks();
a.updateCptSize()
}).always(function(){b.update(100)
});
break;
case&quot;topics&quot;:a.cpt.ask({request:&quot;display_page&quot;,page:c},function(d){c.page_no=d.page_no;
a.n.topic_list.html(d.html);
a.n.topics.show();
a.n.footer.toggle(a.n.topic_list.find(&quot;tr&quot;).length&gt;10);
a.buildLinks();
a.updateCptSize()
}).always(function(){a.n.topics.show();
b.update(100)
});
break;
case&quot;new_topic&quot;:a.member_controller.showForm();
a.n.post_form.filter(&quot;:first&quot;).show();
a.n.footer.hide();
a.n.subject_field.show();
b.update(100);
a.updateCptSize();
break
}this.current_page=c
},buildLinks:function(){var a=this;
var c=function(d){return d.replace(/&lt;br\s*[\/]?&gt;/gi,&quot;\n&quot;)
};
var b=function(d){return d.replace(/\n/g,&quot;&lt;br&gt;&quot;)
};
$(&quot;.uif_a_topic&quot;,this.n.main).addClass(&quot;uif_clickable&quot;).click(function(){a.displayPage({page:&quot;posts&quot;,topic_id:$(this).parents(&quot;tr:first&quot;).attr(&quot;data-topic_id&quot;)})
});
$(&quot;.uif_last_reply:gt(0)&quot;,this.n.main).addClass(&quot;uif_clickable&quot;).click(function(){a.displayPage({page:&quot;posts&quot;,topic_id:$(this).parents(&quot;tr:first&quot;).attr(&quot;data-topic_id&quot;),page_no:-1})
});
$(&quot;.uif_delete_topic&quot;,this.n.main).addClass(&quot;uif_clickable&quot;).click(function(){if(confirm(&quot;Do you really want to delete this topic and associated posts?&quot;)){a.cpt.ask({request:&quot;delete_topic&quot;,topic_id:$(this).parents(&quot;tr:first&quot;).attr(&quot;data-topic_id&quot;)},function(d){statusController.message(&quot;Topic deleted&quot;);
a.displayPage(a.current_page)
},function(){statusController.message(&quot;Unable to delete topic&quot;,&quot;error&quot;)
})
}});
$(&quot;.uif_delete_post&quot;,this.n.main).addClass(&quot;uif_clickable&quot;).click(function(){var d=$(this).attr(&quot;post_id&quot;);
$(&quot;.post_&quot;+d).find(&quot;.uif_body&quot;).css(&quot;background&quot;,&quot;#EFC2C2&quot;);
if(confirm(&quot;Do you really want to delete this post?&quot;)){a.cpt.ask({request:&quot;delete_post&quot;,post_id:d},function(e){statusController.message(&quot;Post deleted&quot;);
if(e.topic_deleted){a.displayPage({page:&quot;topics&quot;})
}else{a.displayPage(a.current_page)
}},function(){statusController.message(&quot;Unable to delete post&quot;,&quot;error&quot;)
})
}else{$(&quot;.post_&quot;+d).find(&quot;.uif_body&quot;).css(&quot;background&quot;,&quot;transparent&quot;)
}});
$(&quot;.uif_hide_post&quot;,this.n.main).unbind(&quot;click&quot;).click(function(){var d=$($(this).parents()[1]).attr(&quot;class&quot;).match(/post_[\d]+/)[0];
var e=$(&quot;.&quot;+d).find(&quot;.uif_body, .uif_margin_left&quot;);
if($(this).text()==&quot;-&quot;){$(this).text(&quot;+&quot;);
e.slideUp(600,function(){$(&quot;.&quot;+d).find(&quot;.uif_header_member&quot;).text($(&quot;.&quot;+d+&quot; .uif_name&quot;).text())
})
}else{$(this).text(&quot;-&quot;);
$(&quot;.&quot;+d).find(&quot;.uif_header_member&quot;).text(&quot;&quot;);
e.slideDown(600)
}});
$(&quot;.uif_edit_post&quot;,this.n.main).unbind(&quot;click&quot;).click(function(){var e=$(this).attr(&quot;post_id&quot;);
var f=$(&quot;.uif_post_holder.post_&quot;+e,a.n.main);
var d=f.find(&quot;.uif_body&quot;).html();
f.find(&quot;.uif_body&quot;).html(&quot;&lt;textarea&gt;&lt;/textarea&gt;&quot;).scrollIntoView();
f.find(&quot;textarea&quot;).val(c(d));
f.find(&quot;.manage_post&quot;).fadeOut(function(){f.find(&quot;.uif_body_edit&quot;).fadeIn()
});
f.find(&quot;.uif_save_edit&quot;).parent().unbind(&quot;click&quot;).click(function(){if(f.find(&quot;textarea&quot;).val()!=&quot;&quot;){a.cpt.ask({request:&quot;update_message&quot;,post_id:e,message:b(f.find(&quot;textarea&quot;).val())},function(g){if(g.success){var h=b(f.find(&quot;textarea&quot;).val());
f.find(&quot;.uif_body&quot;).html(h).css(&quot;background-color&quot;,&quot;#C4F2C8&quot;).scrollIntoView();
f.find(&quot;.uif_body_edit&quot;).fadeOut(function(){f.find(&quot;.manage_post&quot;).fadeIn()
});
a.updateCptSize();
setTimeout(function(){f.find(&quot;.uif_body&quot;).html(h).css(&quot;background-color&quot;,&quot;transparent&quot;)
},1500)
}})
}});
f.find(&quot;.uif_cancel_edit&quot;).parent().unbind(&quot;click&quot;).click(function(){f.find(&quot;.uif_body_edit&quot;).fadeOut(function(){f.find(&quot;.manage_post&quot;).fadeIn()
});
f.find(&quot;.uif_body&quot;).html(d).scrollIntoView()
})
});
$(&quot;.uif_publish_post&quot;,this.n.main).addClass(&quot;uif_clickable&quot;).click(function(){a.cpt.ask({request:&quot;publish_post&quot;,post_id:$(this).attr(&quot;post_id&quot;)},function(d){statusController.message(&quot;Post published&quot;);
a.displayPage(a.current_page)
},function(){statusController.message(&quot;Unable to publish post&quot;,&quot;error&quot;)
})
});
$(&quot;.uif_page_no&quot;,this.n.main).addClass(&quot;uif_clickable&quot;).click(function(){a.displayPage(Object.extend(Object.extend({},a.current_page),{page_no:parseInt($(this).attr(&quot;data-pageno&quot;))}))
});
if(a.current_page.page_no){$(&quot;.uif_page_no[data-pageno=&quot;+(this.current_page.page_no||1)+&quot;]&quot;,this.n.main).removeClass(&quot;uif_clickable&quot;)
}},onShow:function(){this.updateCptSize()
},onSave:function(){if(this.newly_created){this.displayPage(this.current_page)
}this.newly_created=false
},updateCptSize:function(){if(this.cpt.data.auto_size){this.n.main.css(&quot;overflow-y&quot;,&quot;hidden&quot;)
}else{this.n.main.css(&quot;overflow-y&quot;,&quot;auto&quot;)
}if(this.cpt.data.auto_size){this.cpt.setSize({h:10000});
this.cpt.setSize({h:this.size_getter_el.offsetTop})
}},updateForm:function(){var a=this.cpt.data.form_position||&quot;bottom&quot;;
this.n.post_form=$();
if(a.indexOf(&quot;top&quot;)!=-1){this.n.post_form=this.n.post_form.add($(&quot;.uif_post_form_top&quot;,this.n.main))
}if(a.indexOf(&quot;bottom&quot;)!=-1){this.n.post_form=this.n.post_form.add($(&quot;.uif_post_form_bottom&quot;,this.n.main))
}},onPropertyChanged:function(a){if(a.include(&quot;form_position&quot;)){this.updateForm()
}this.displayPage(this.current_page)
},onResizeStop:function(){this.updateCptSize()
},onFontFamilyUpdate:function(){this.updateCptSize()
}};</script><style>div.UI_Forum div.uif_header,div.UI_Forum div.uif_footer{margin-bottom:11px;text-align:right;padding-top:6px}
div.UI_Forum input[type=text],div.UI_Forum input[type=password],div.UI_Forum textarea{background-color:#F8F8F8;border:1px solid #CCC;font-size:12px}
div.UI_Forum textarea{height:300px;width:100%}
div.UI_Forum textarea:focus,div.UI_Forum textarea:active,div.UI_Forum input[type=password]:focus,div.UI_Forum input[type=password]:active,div.UI_Forum input[type=text]:focus,div.UI_Forum input[type=text]:active{background-color:#F9EED4}
div.UI_Forum .uif_post_body{width:98%;height:100px;margin:1%}
div.UI_Forum table{width:100%}
div.UI_Forum div.uif_name{font-weight:700;text-transform:capitalize}
div.UI_Forum div.uif_post_stats{border:1px solid transparent;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;margin:5px;overflow:hidden}
div.UI_Forum div.uif_posts{margin:0}
div.UI_Forum .uif_post_holder{margin:5px;padding:0;border-width:1px;border-style:solid;position:relative}
div.UI_Forum div.uif_body{min-height:140px;padding:5px;margin:5px 0 0 120px;position:relative;text-align:justify;transition:background-color .5s linear;-moz-transition:background-color .5s linear;-o-transition:background-color .5s linear;-webkit-transition:background-color .5s linear}
div.UI_Forum .uif_replies{text-align:center}
div.UI_Forum .uif_last_reply{text-align:right}
div.UI_Forum .uif_topic_creation,div.UI_Forum tbody .uif_last_reply{font-size:.9em;font-style:italic}
.manage_post{float:right;padding:5px;width:100%}
.uif_body_edit{text-align:center;padding:10px 0;display:none}
.manage_post&gt;ul,.uif_body_edit&gt;ul{display:inline;list-style:none outside none}
.uif_body_edit li{display:inline}
.manage_post li{float:right}
.manage_post li,.uif_body_edit li,.uif_add_post{border:1px solid transparent;cursor:pointer;margin:0 3px;padding:4px 10px;transition:background-color .3s linear,color .3s linear,border-color .3s linear;-moz-transition:background-color .5s linear,color .3s linear,border-color .3s linear;-o-transition:background-color .3s linear,color .3s linear,border-color .3s linear;-webkit-transition:background-color .3s linear,color .3s linear,border-color .3s linear}
div.UI_Forum .uif_delete_topic{float:right;background-image:url(/assets/icons/close_dis.png);background-repeat:no-repeat;background-position:2px -2px;background-color:#fff;color:#888;padding-left:20px;cursor:pointer;transition:background-image .5s,color .5s linear;-moz-transition:background-image .5s,color .5s linear;-o-transition:background-image .5s,color .5s linear;-webkit-transition:background-image .5s,color .5s linear}
div.UI_Forum .uif_delete_topic:hover{background-image:url(/assets/icons/close.gif);color:#AA0505}
div.UI_Forum .tpl_table td{padding:5px}
div.UI_Forum .uif_pages_list{text-align:center;margin:5px 0}
div.UI_Forum span.uif_clickable{cursor:pointer;border-bottom:1px dotted}
div.UI_Forum div.uif_margin_left{border-right:1px solid transparent;bottom:0;position:absolute;top:30px;max-width:120px;width:20%;min-width:65px}
div.UI_Forum div.header_post{height:30px;width:100%}
div.UI_Forum span.uif_date{font-size:.9em;font-style:italic;padding-left:10px;line-height:30px}
div.UI_Forum span.uif_header_member{padding-left:10px}
div.UI_Forum .uif_margin_left&gt;table{margin-top:20px;text-align:center}
div.UI_Forum .uif_all_topics,div.UI_Forum .uif_new_topic{border:1px solid;margin:0 3px;padding:3px 8px;text-decoration:none}
div.UI_Forum .uif_hide_post{border:1px solid;float:right;font-family:monospace;font-size:12px;margin-right:7px;margin-top:7px;text-align:center;width:15px;cursor:pointer}
div.UI_Forum .uif_a_topic{padding:1px 0 3px}
div.UI_Forum .uif_subject:hover{text-decoration:underline}</style></uidget>