Index: inc/admin/lib.pager.php
===================================================================
--- inc/admin/lib.pager.php	(revision 0)
+++ inc/admin/lib.pager.php	(revision 437)
@@ -12,4 +12,81 @@
 if (!defined('DC_RC_PATH')) { return; }
 
+class adminGenericColumn
+{
+	protected $core;
+	protected $rs;
+	protected $id;
+	protected $title;
+	protected $callback;
+	protected $html;
+	protected $visibility;
+	
+	public function __construct($id,$title,$callback,$html = null,$can_hide = true)
+	{
+		if (!is_string($id) || $id === '') {
+			throw new Exception(__('Invalid column ID'));
+		}
+		
+		if (!is_string($title)) {
+			throw new Exception(__('Invalid column title'));
+		}
+		
+		if (is_null($html) || !is_string($html)) {
+			$html = '';
+		}
+		if (!empty($html)) {
+			$html = ' '.$html;
+		}
+		
+		if (!is_bool($can_hide)) {
+			$can_hide = true;
+		}
+		
+		try {
+			if (!is_array($callback) || count($callback) < 2) {
+				throw new Exception(__('Callback parameter should be an array'));
+			}
+			$r = new ReflectionClass($callback[0]);
+			$f = $r->getMethod($callback[1]);
+			$p = $r->getParentClass();
+			if (!$p || $p->name != 'adminGenericList') {
+				throw new Exception(__('Callback class should be inherited of adminGenericList class'));
+			}
+		}
+		catch (Exception $e) {
+			throw new Exception(sprintf(__('Invalid column callback: %s'),$e->getMessage()));
+		}
+		
+		$this->id = $id;
+		$this->title = $title;
+		$this->callback = $callback;
+		$this->html = $html;
+		$this->can_hide = $can_hide;
+		$this->visibility = true;
+	}
+	
+	public function getInfo($k)
+	{
+		return property_exists(get_class($this),$k) ? $this->{$k} : null;
+	}
+	
+	public function setVisibility($visibility)
+	{
+		if (is_bool($visibility)) {
+			$this->visibility = $visibility;
+		}
+	}
+	
+	public function isVisible()
+	{
+		return $this->visibility;
+	}
+	
+	public function canHide()
+	{
+		return $this->can_hide;
+	}
+}
+
 class adminGenericList
 {
@@ -17,4 +94,5 @@
 	protected $rs;
 	protected $rs_count;
+	protected $columns;
 	
 	public function __construct($core,$rs,$rs_count)
@@ -23,11 +101,112 @@
 		$this->rs =& $rs;
 		$this->rs_count = $rs_count;
+		$this->context = get_class($this);
+		$this->columns = array();
+		$this->form_prefix = 'col_%s';
+		$this->form_trigger = 'add_filter';
+		
 		$this->html_prev = __('&#171;prev.');
 		$this->html_next = __('next&#187;');
-	}
-}
-
-class adminPostList extends adminGenericList
-{
+		
+		# Post columns
+		$this->addColumn('adminPostList','title',__('Title'),array('adminPostList','getTitle'),' class="maximal"',false);
+		$this->addColumn('adminPostList','date',__('Date'),array('adminPostList','getDate'));
+		$this->addColumn('adminPostList','datetime',__('Date and time'),array('adminPostList','getDateTime'));
+		$this->addColumn('adminPostList','category',__('Category'),array('adminPostList','getCategory'));
+		$this->addColumn('adminPostList','author',__('Author'),array('adminPostList','getAuthor'));
+		$this->addColumn('adminPostList','comment',__('Comments'),array('adminPostList','getComments'));
+		$this->addColumn('adminPostList','trackback',__('Trackbacks'),array('adminPostList','getTrackbacks'));
+		$this->addColumn('adminPostList','status',__('Status'),array('adminPostList','getStatus'));
+		
+		# Post (mini list) columns
+		$this->addColumn('adminPostMiniList','title',__('Title'),array('adminPostList','getTitle'),' class="maximal"',false);
+		$this->addColumn('adminPostMiniList','date',__('Date'),array('adminPostList','getDate'));
+		$this->addColumn('adminPostMiniList','author',__('Author'),array('adminPostList','getAuthor'));
+		$this->addColumn('adminPostMiniList','status',__('Status'),array('adminPostList','getStatus'));
+		
+		# Comment columns
+		$this->addColumn('adminCommentList','title',__('Title'),array('adminCommentList','getTitle'),' class="maximal"',false);
+		$this->addColumn('adminCommentList','date',__('Date'),array('adminCommentList','getDate'));
+		$this->addColumn('adminCommentList','author',__('Author'),array('adminCommentList','getAuthor'));
+		$this->addColumn('adminCommentList','type',__('Type'),array('adminCommentList','getType'));
+		$this->addColumn('adminCommentList','status',__('Status'),array('adminCommentList','getStatus'));
+		$this->addColumn('adminCommentList','edit','',array('adminCommentList','getEdit'));
+		
+		# User columns
+		$this->addColumn('adminUserList','username',__('Username'),array('adminUserList','getUserName'),' class="maximal"',false);
+		$this->addColumn('adminUserList','firstname',__('First name'),array('adminUserList','getFirstName'));
+		$this->addColumn('adminUserList','lastname',__('Last name'),array('adminUserList','getLastName'));
+		$this->addColumn('adminUserList','displayname',__('Display name'),array('adminUserList','getDisplayName'));
+		$this->addColumn('adminUserList','entries',__('Entries'),array('adminUserList','getEntries'));
+		
+		$core->callBehavior('adminGenericListConstruct',$this);
+		
+		$this->setColumnsVisibility();
+	}
+	
+	public function addColumn($context,$id,$title,$callback,$html = null,$can_hide = true)
+	{
+		try {
+			if (!array_key_exists($context,$this->columns)) {
+				$this->columns[$context] = array();
+			}
+			
+			$c = new adminGenericColumn($id,$title,$callback,$html,$can_hide);
+			$this->columns[$context][$c->getInfo('id')] = $c;
+		}
+		catch (Exception $e) {
+			if (DC_DEBUG) {
+				$this->core->error->add($e->getMessage());
+			}
+		}
+	}
+	
+	public function setColumnsVisibility()
+	{
+		$ws = $this->core->auth->user_prefs->addWorkspace('lists');
+		
+		$user_pref = !is_null($ws->{$this->context}) ? unserialize($ws->{$this->context}) : array();
+		
+		foreach ($this->columns[$this->context] as $k => $v) {
+			$visibility =  array_key_exists($k,$user_pref) ? $user_pref[$k] : true;
+			if (array_key_exists($this->form_trigger,$_REQUEST)) {
+				$key = sprintf($this->form_prefix,$k);
+				$visibility = !array_key_exists($key,$_REQUEST) ? false : true;
+			}
+			if (!$v->canHide()) {
+				$visibility = true;
+			}
+			$v->setVisibility($visibility);
+			$user_pref[$k] = $visibility;
+		}
+		
+		if (array_key_exists($this->form_trigger,$_REQUEST)) {
+			$this->core->auth->user_prefs->lists->put($this->context,serialize($user_pref),'string');
+		}
+	}
+	
+	public function getColumnsForm()
+	{
+		$block = 
+		'<h3>'.__('Displayed information').'</h3>'.
+		'<ul>%s</ul>';
+		
+		$list = array();
+		
+		foreach ($this->columns[$this->context] as $k => $v) {
+			$col_id = sprintf($this->form_prefix,$k);
+			$col_label = sprintf('<label for="%s">%s</label>',$col_id,$v->getInfo('title'));
+			$col_html = sprintf('<li class="line">%s</li>',$col_label.form::checkbox($col_id,1,$v->isVisible(),null,null,!$v->canHide()));
+			
+			array_push($list,$col_html);
+		}
+		
+		$nb_per_page = isset($_GET['nb']) ? $_GET['nb'] : 10;
+		
+		array_push($list,'<label for="nb" class="classic">'.__('Items per page:').'</label>&nbsp;'.form::field('nb',3,3,$nb_per_page));
+		
+		return sprintf($block,implode('',$list));
+	}
+	
 	public function display($page,$nb_per_page,$enclose_block='')
 	{
@@ -44,13 +223,19 @@
 			
 			$html_block =
-			'<table class="clear"><tr>'.
-			'<th colspan="2">'.__('Title').'</th>'.
-			'<th>'.__('Date').'</th>'.
-			'<th>'.__('Category').'</th>'.
-			'<th>'.__('Author').'</th>'.
-			'<th>'.__('Comments').'</th>'.
-			'<th>'.__('Trackbacks').'</th>'.
-			'<th>'.__('Status').'</th>'.
-			'</tr>%s</table>';
+			'<table class="maximal clear">'.
+			$this->getCaption($page).
+			'<thead><tr>';
+			
+			foreach ($this->columns[$this->context] as $k => $v) {
+				if ($v->isVisible()) {
+					$html_extra = $v->getInfo('html') != '' ? ' '.$v->getInfo('html') : '';
+					$html_block .= sprintf('<th scope="col"%s>%s</th>',$html_extra,$v->getInfo('title'));
+				}
+			}
+			
+			$html_block .=
+			'</tr></thead>'.
+			'<tbody>%s</tbody>'.
+			'</table>';
 			
 			if ($enclose_block) {
@@ -66,5 +251,5 @@
 			while ($this->rs->fetch())
 			{
-				echo $this->postLine();
+				echo $this->displayLine();
 			}
 			
@@ -75,5 +260,78 @@
 	}
 	
-	private function postLine()
+	private function displayLine()
+	{
+		$res = '';
+		
+		foreach ($this->columns[$this->context] as $k => $v) {
+			if ($v->isVisible()) {
+				$c = $v->getInfo('callback');
+				$func = $c[1];
+				$res .= $this->{$c[1]}();
+			}
+		}
+		
+		return sprintf($this->getDefaultLine(),$res);
+	}
+	
+	private function getCaption($page)
+	{
+		$caption = $this->getDefaultCaption();
+		
+		if (!empty($caption)) {
+			$caption = sprintf(
+				'<caption>%s - %s</caption>',
+				$caption,sprintf(__('Page %s'),$page)
+			);
+		}
+		
+		return $caption;
+	}
+	
+	protected function getDefaultCaption()
+	{
+		return;
+	}
+	
+	protected function getDefaultLine()
+	{
+		return '<tr class="line">%s</tr>';
+	}
+}
+
+class adminPostList extends adminGenericList
+{
+	protected function getDefaultCaption()
+	{
+		return __('Entries list');
+	}
+	
+	protected function getDefaultLine()
+	{
+		return
+		'<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'.
+		' id="p'.$this->rs->post_id.'">%s</tr>';
+	}
+	
+	protected function getTitle()
+	{
+		return
+		'<th scope="row" class="maximal">'.
+		form::checkbox(array('entries[]'),$this->rs->post_id,'','','',!$this->rs->isEditable()).'&nbsp;'.
+		'<a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'.
+		html::escapeHTML($this->rs->post_title).'</a></th>';
+	}
+	
+	protected function getDate()
+	{
+		return '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d'),$this->rs->post_dt).'</td>';
+	}
+	
+	protected function getDateTime()
+	{
+		return '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>';
+	}
+	
+	protected function getCategory()
 	{
 		if ($this->core->auth->check('categories',$this->core->blog->id)) {
@@ -90,4 +348,24 @@
 		}
 		
+		return '<td class="nowrap">'.$cat_title.'</td>';
+	}
+	
+	protected function getAuthor()
+	{
+		return '<td class="nowrap">'.$this->rs->user_id.'</td>';
+	}
+	
+	protected function getComments()
+	{
+		return '<td class="nowrap">'.$this->rs->nb_comment.'</td>';
+	}
+	
+	protected function getTrackbacks()
+	{
+		return '<td class="nowrap">'.$this->rs->nb_trackback.'</td>';
+	}
+	
+	protected function getStatus()
+	{
 		$img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
 		switch ($this->rs->post_status) {
@@ -123,116 +401,18 @@
 		}
 		
-		$res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'.
-		' id="p'.$this->rs->post_id.'">';
-		
-		$res .=
-		'<td class="nowrap">'.
-		form::checkbox(array('entries[]'),$this->rs->post_id,'','','',!$this->rs->isEditable()).'</td>'.
-		'<td class="maximal"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'.
-		html::escapeHTML($this->rs->post_title).'</a></td>'.
-		'<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'.
-		'<td class="nowrap">'.$cat_title.'</td>'.
-		'<td class="nowrap">'.$this->rs->user_id.'</td>'.
-		'<td class="nowrap">'.$this->rs->nb_comment.'</td>'.
-		'<td class="nowrap">'.$this->rs->nb_trackback.'</td>'.
-		'<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'.
-		'</tr>';
-		
-		return $res;
+		return '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>';
 	}
 }
 
-class adminPostMiniList extends adminGenericList
+class adminPostMiniList extends adminPostList
 {
-	public function display($page,$nb_per_page,$enclose_block='')
-	{
-		if ($this->rs->isEmpty())
-		{
-			echo '<p><strong>'.__('No entry').'</strong></p>';
-		}
-		else
-		{
-			$pager = new pager($page,$this->rs_count,$nb_per_page,10);
-			$pager->html_prev = $this->html_prev;
-			$pager->html_next = $this->html_next;
-			$pager->var_page = 'page';
-			
-			$html_block =
-			'<table class="clear"><tr>'.
-			'<th>'.__('Title').'</th>'.
-			'<th>'.__('Date').'</th>'.
-			'<th>'.__('Author').'</th>'.
-			'<th>'.__('Status').'</th>'.
-			'</tr>%s</table>';
-			
-			if ($enclose_block) {
-				$html_block = sprintf($enclose_block,$html_block);
-			}
-			
-			echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>';
-			
-			$blocks = explode('%s',$html_block);
-			
-			echo $blocks[0];
-			
-			while ($this->rs->fetch())
-			{
-				echo $this->postLine();
-			}
-			
-			echo $blocks[1];
-			
-			echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>';
-		}
-	}
-	
-	private function postLine()
-	{
-		$img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
-		switch ($this->rs->post_status) {
-			case 1:
-				$img_status = sprintf($img,__('published'),'check-on.png');
-				break;
-			case 0:
-				$img_status = sprintf($img,__('unpublished'),'check-off.png');
-				break;
-			case -1:
-				$img_status = sprintf($img,__('scheduled'),'scheduled.png');
-				break;
-			case -2:
-				$img_status = sprintf($img,__('pending'),'check-wrn.png');
-				break;
-		}
-		
-		$protected = '';
-		if ($this->rs->post_password) {
-			$protected = sprintf($img,__('protected'),'locker.png');
-		}
-		
-		$selected = '';
-		if ($this->rs->post_selected) {
-			$selected = sprintf($img,__('selected'),'selected.png');
-		}
-		
-		$attach = '';
-		$nb_media = $this->rs->countMedia();
-		if ($nb_media > 0) {
-			$attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments');
-			$attach = sprintf($img,sprintf($attach_str,$nb_media),'attach.png');
-		}
-		
-		$res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'.
-		' id="p'.$this->rs->post_id.'">';
-		
-		$res .=
-		'<td class="maximal"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'" '.
+	protected function getTitle() 
+	{
+		return
+		'<th scope="row" class="maximal">'.
+		form::checkbox(array('entries[]'),$this->rs->post_id,'','','',!$this->rs->isEditable()).'&nbsp;'.
+		'<a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'" '.
 		'title="'.html::escapeHTML($this->rs->getURL()).'">'.
-		html::escapeHTML($this->rs->post_title).'</a></td>'.
-		'<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'.
-		'<td class="nowrap">'.$this->rs->user_id.'</td>'.
-		'<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'.
-		'</tr>';
-		
-		return $res;
+		html::escapeHTML($this->rs->post_title).'</a></td>';
 	}
 }
@@ -240,49 +420,34 @@
 class adminCommentList extends adminGenericList
 {
-	public function display($page,$nb_per_page,$enclose_block='')
-	{
-		if ($this->rs->isEmpty())
-		{
-			echo '<p><strong>'.__('No comment').'</strong></p>';
-		}
-		else
-		{
-			$pager = new pager($page,$this->rs_count,$nb_per_page,10);
-			$pager->html_prev = $this->html_prev;
-			$pager->html_next = $this->html_next;
-			$pager->var_page = 'page';
-			
-			$html_block =
-			'<table><tr>'.
-			'<th colspan="2">'.__('Title').'</th>'.
-			'<th>'.__('Date').'</th>'.
-			'<th>'.__('Author').'</th>'.
-			'<th>'.__('Type').'</th>'.
-			'<th>'.__('Status').'</th>'.
-			'<th>&nbsp;</th>'.
-			'</tr>%s</table>';
-			
-			if ($enclose_block) {
-				$html_block = sprintf($enclose_block,$html_block);
-			}
-			
-			echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>';
-			
-			$blocks = explode('%s',$html_block);
-			
-			echo $blocks[0];
-			
-			while ($this->rs->fetch())
-			{
-				echo $this->commentLine();
-			}
-			
-			echo $blocks[1];
-			
-			echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>';
-		}
-	}
-	
-	private function commentLine()
+	protected function getDefaultCaption()
+	{
+		return __('Comments list');
+	}
+	
+	protected function getDefaultLine()
+	{
+		return
+		'<tr class="line'.($this->rs->comment_status != 1 ? ' offline' : '').'"'.
+		' id="c'.$this->rs->comment_id.'">%s</tr>';
+	}
+	
+	protected function getTitle()
+	{
+		$post_url = $this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id);
+		
+		return
+		'<th scope="row" class="maximal">'.
+		form::checkbox(array('comments[]'),$this->rs->comment_id,'','','',0).'&nbsp;'.
+		'<a href="'.$post_url.'">'.
+		html::escapeHTML($this->rs->post_title).'</a>'.
+		($this->rs->post_type != 'post' ? ' ('.html::escapeHTML($this->rs->post_type).')' : '').'</th>';
+	}
+	
+	protected function getDate()
+	{
+		return '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->comment_dt).'</td>';
+	}
+	
+	protected function getAuthor()
 	{
 		global $author, $status, $sortby, $order, $nb_per_page;
@@ -295,12 +460,19 @@
 		'&amp;author='.rawurlencode($this->rs->comment_author);
 		
-		$post_url = $this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id);
-		
-		$comment_url = 'comment.php?id='.$this->rs->comment_id;
-		
-		$comment_dt =
-		dt::dt2str($this->core->blog->settings->system->date_format.' - '.
-		$this->core->blog->settings->system->time_format,$this->rs->comment_dt);
-		
+		$comment_author = html::escapeHTML($this->rs->comment_author);
+		if (mb_strlen($comment_author) > 20) {
+			$comment_author = mb_strcut($comment_author,0,17).'...';
+		}
+		
+		return '<td class="nowrap"><a href="'.$author_url.'">'.$comment_author.'</a></td>';
+	}
+	
+	protected function getType()
+	{
+		return '<td class="nowrap">'.($this->rs->comment_trackback ? __('trackback') : __('comment')).'</td>';
+	}
+	
+	protected function getStatus()
+	{
 		$img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
 		switch ($this->rs->comment_status) {
@@ -319,28 +491,14 @@
 		}
 		
-		$comment_author = html::escapeHTML($this->rs->comment_author);
-		if (mb_strlen($comment_author) > 20) {
-			$comment_author = mb_strcut($comment_author,0,17).'...';
-		}
-		
-		$res = '<tr class="line'.($this->rs->comment_status != 1 ? ' offline' : '').'"'.
-		' id="c'.$this->rs->comment_id.'">';
-		
-		$res .=
-		'<td class="nowrap">'.
-		form::checkbox(array('comments[]'),$this->rs->comment_id,'','','',0).'</td>'.
-		'<td class="maximal"><a href="'.$post_url.'">'.
-		html::escapeHTML($this->rs->post_title).'</a>'.
-		($this->rs->post_type != 'post' ? ' ('.html::escapeHTML($this->rs->post_type).')' : '').'</td>'.
-		'<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->comment_dt).'</td>'.
-		'<td class="nowrap"><a href="'.$author_url.'">'.$comment_author.'</a></td>'.
-		'<td class="nowrap">'.($this->rs->comment_trackback ? __('trackback') : __('comment')).'</td>'.
-		'<td class="nowrap status">'.$img_status.'</td>'.
+		return '<td class="nowrap status">'.$img_status.'</td>';
+	}
+	
+	protected function getEdit()
+	{
+		$comment_url = 'comment.php?id='.$this->rs->comment_id;
+		
+		return
 		'<td class="nowrap status"><a href="'.$comment_url.'">'.
 		'<img src="images/edit-mini.png" alt="" title="'.__('Edit this comment').'" /></a></td>';
-		
-		$res .= '</tr>';
-		
-		return $res;
 	}
 }
@@ -348,48 +506,10 @@
 class adminUserList extends adminGenericList
 {
-	public function display($page,$nb_per_page,$enclose_block='')
-	{
-		if ($this->rs->isEmpty())
-		{
-			echo '<p><strong>'.__('No user').'</strong></p>';
-		}
-		else
-		{
-			$pager = new pager($page,$this->rs_count,$nb_per_page,10);
-			$pager->html_prev = $this->html_prev;
-			$pager->html_next = $this->html_next;
-			$pager->var_page = 'page';
-			
-			$html_block =
-			'<table class="clear"><tr>'.
-			'<th colspan="2">'.__('Username').'</th>'.
-			'<th>'.__('First Name').'</th>'.
-			'<th>'.__('Last Name').'</th>'.
-			'<th>'.__('Display name').'</th>'.
-			'<th class="nowrap">'.__('Entries').'</th>'.
-			'</tr>%s</table>';
-			
-			if ($enclose_block) {
-				$html_block = sprintf($enclose_block,$html_block);
-			}
-			
-			echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>';
-			
-			$blocks = explode('%s',$html_block);
-			
-			echo $blocks[0];
-			
-			while ($this->rs->fetch())
-			{
-				echo $this->userLine();
-			}
-			
-			echo $blocks[1];
-			
-			echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>';
-		}
-	}
-	
-	private function userLine()
+	protected function getDefaultCaption()
+	{
+		return __('Users list');
+	}
+	
+	protected function getUserName()
 	{
 		$img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
@@ -404,17 +524,34 @@
 			$img_status = sprintf($img,__('superadmin'),'superadmin.png');
 		}
-		return
-		'<tr class="line">'.
-		'<td class="nowrap">'.form::hidden(array('nb_post[]'),(integer) $this->rs->nb_post).
-		form::checkbox(array('user_id[]'),$this->rs->user_id).'</td>'.
-		'<td class="maximal"><a href="user.php?id='.$this->rs->user_id.'">'.
-		$this->rs->user_id.'</a>&nbsp;'.$img_status.'</td>'.
-		'<td class="nowrap">'.$this->rs->user_firstname.'</td>'.
-		'<td class="nowrap">'.$this->rs->user_name.'</td>'.
-		'<td class="nowrap">'.$this->rs->user_displayname.'</td>'.
+		
+		return
+		'<th scope="row" class="maximal">'.form::hidden(array('nb_post[]'),(integer) $this->rs->nb_post).
+		form::checkbox(array('user_id[]'),$this->rs->user_id).'&nbsp;'.
+		'<a href="user.php?id='.$this->rs->user_id.'">'.
+		$this->rs->user_id.'</a>&nbsp;'.$img_status.'</th>';
+	}
+	
+	protected function getFirstName()
+	{
+		return '<td class="nowrap">'.$this->rs->user_firstname.'</td>';
+	}
+	
+	protected function getLastName()
+	{
+		return '<td class="nowrap">'.$this->rs->user_name.'</td>';
+	}
+	
+	protected function getDisplayName()
+	{
+		return '<td class="nowrap">'.$this->rs->user_displayname.'</td>';
+	}
+	
+	protected function getEntries()
+	{
+		return
 		'<td class="nowrap"><a href="posts.php?user_id='.$this->rs->user_id.'">'.
-		$this->rs->nb_post.'</a></td>'.
-		'</tr>';
+		$this->rs->nb_post.'</a></td>';
 	}
 }
+
 ?>
