Index: admin/index.php
===================================================================
--- admin/index.php	(revision 3)
+++ admin/index.php	(revision 13)
@@ -43,4 +43,25 @@
 $plugins_install = $core->plugins->installModules();
 
+# Check dashboard module prefs
+$core->auth->user_prefs->addWorkspace('dashboard');
+if (!$core->auth->user_prefs->dashboard->prefExists('doclinks')) {
+	if (!$core->auth->user_prefs->dashboard->prefExists('doclinks',true)) {
+		$core->auth->user_prefs->dashboard->put('doclinks',true,'boolean','',null,true);
+	}
+	$core->auth->user_prefs->dashboard->put('doclinks',true,'boolean');
+}
+if (!$core->auth->user_prefs->dashboard->prefExists('dcnews')) {
+	if (!$core->auth->user_prefs->dashboard->prefExists('dcnews',true)) {
+		$core->auth->user_prefs->dashboard->put('dcnews',true,'boolean','',null,true);
+	}
+	$core->auth->user_prefs->dashboard->put('dcnews',true,'boolean');
+}
+if (!$core->auth->user_prefs->dashboard->prefExists('quickentry')) {
+	if (!$core->auth->user_prefs->dashboard->prefExists('quickentry',true)) {
+		$core->auth->user_prefs->dashboard->put('quickentry',true,'boolean','',null,true);
+	}
+	$core->auth->user_prefs->dashboard->put('quickentry',true,'boolean');
+}
+
 # Dashboard icons
 $__dashboard_icons = new ArrayObject();
@@ -91,53 +112,60 @@
 
 # Documentation links
-if (!empty($__resources['doc']))
-{
-	$doc_links = '<h3>'.__('Documentation').'</h3><ul>';
-	
-	foreach ($__resources['doc'] as $k => $v) {
-		$doc_links .= '<li><a href="'.$v.'">'.$k.'</a></li>';
-	}
-	
-	$doc_links .= '</ul>';
-	$__dashboard_items[0][] = $doc_links;
-}
-
-try
-{
-	if (empty($__resources['rss_news'])) {
-		throw new Exception();
-	}
-	
-	$feed_reader = new feedReader;
-	$feed_reader->setCacheDir(DC_TPL_CACHE);
-	$feed_reader->setTimeout(2);
-	$feed_reader->setUserAgent('Dotclear - http://www.dotclear.org/');
-	$feed = $feed_reader->parse($__resources['rss_news']);
-	if ($feed)
+$dashboardItem = 0;
+if ($core->auth->user_prefs->dashboard->doclinks) {
+	if (!empty($__resources['doc']))
 	{
-		$latest_news = '<h3>'.__('Latest news').'</h3><dl id="news">';
-		$i = 1;
-		foreach ($feed->items as $item)
+		$doc_links = '<h3>'.__('Documentation').'</h3><ul>';
+	
+		foreach ($__resources['doc'] as $k => $v) {
+			$doc_links .= '<li><a href="'.$v.'">'.$k.'</a></li>';
+		}
+	
+		$doc_links .= '</ul>';
+		$__dashboard_items[$dashboardItem][] = $doc_links;
+		$dashboardItem++;
+	}
+}
+
+if ($core->auth->user_prefs->dashboard->dcnews) {
+	try
+	{
+		if (empty($__resources['rss_news'])) {
+			throw new Exception();
+		}
+	
+		$feed_reader = new feedReader;
+		$feed_reader->setCacheDir(DC_TPL_CACHE);
+		$feed_reader->setTimeout(2);
+		$feed_reader->setUserAgent('Dotclear - http://www.dotclear.org/');
+		$feed = $feed_reader->parse($__resources['rss_news']);
+		if ($feed)
 		{
-			$dt = isset($item->link) ? '<a href="'.$item->link.'">'.$item->title.'</a>' : $item->title;
+			$latest_news = '<h3>'.__('Latest news').'</h3><dl id="news">';
+			$i = 1;
+			foreach ($feed->items as $item)
+			{
+				$dt = isset($item->link) ? '<a href="'.$item->link.'">'.$item->title.'</a>' : $item->title;
 			
-			if ($i < 3) {
-				$latest_news .=
-				'<dt>'.$dt.'</dt>'.
-				'<dd><p><strong>'.dt::dt2str('%d %B %Y',$item->pubdate,'Europe/Paris').'</strong>: '.
-				'<em>'.text::cutString(html::clean($item->content),120).'...</em></p></dd>';
-			} else {
-				$latest_news .=
-				'<dt>'.$dt.'</dt>'.
-				'<dd>'.dt::dt2str('%d %B %Y',$item->pubdate,'Europe/Paris').'</dd>';
+				if ($i < 3) {
+					$latest_news .=
+					'<dt>'.$dt.'</dt>'.
+					'<dd><p><strong>'.dt::dt2str('%d %B %Y',$item->pubdate,'Europe/Paris').'</strong>: '.
+					'<em>'.text::cutString(html::clean($item->content),120).'...</em></p></dd>';
+				} else {
+					$latest_news .=
+					'<dt>'.$dt.'</dt>'.
+					'<dd>'.dt::dt2str('%d %B %Y',$item->pubdate,'Europe/Paris').'</dd>';
+				}
+				$i++;
+				if ($i > 3) { break; }
 			}
-			$i++;
-			if ($i > 3) { break; }
-		}
-		$latest_news .= '</dl>';
-		$__dashboard_items[1][] = $latest_news;
-	}
-}
-catch (Exception $e) {}
+			$latest_news .= '</dl>';
+			$__dashboard_items[$dashboardItem][] = $latest_news;
+			$dashboardItem++;
+		}
+	}
+	catch (Exception $e) {}
+}
 
 $core->callBehavior('adminDashboardItems', $core, $__dashboard_items);
@@ -202,45 +230,47 @@
 echo '</div>';
 
-if ($core->auth->check('usage,contentadmin',$core->blog->id))
-{
-	$categories_combo = array('&nbsp;' => '');
-	try {
-		$categories = $core->blog->getCategories(array('post_type'=>'post'));
-		while ($categories->fetch()) {
-			$categories_combo[] = new formSelectOption(
-				str_repeat('&nbsp;&nbsp;',$categories->level-1).'&bull; '.html::escapeHTML($categories->cat_title),
-				$categories->cat_id
-			);
-		}
-	} catch (Exception $e) { }
-	
-	echo
-	'<div id="quick">'.
-	'<h3>'.__('Quick entry').'</h3>'.
-	'<form id="quick-entry" action="post.php" method="post">'.
-	'<fieldset>'.
-	'<p class="col"><label class="required" title="'.__('Required field').'">'.__('Title:').
-	form::field('post_title',20,255,'','maximal',2).
-	'</label></p>'.
-	'<p class="area"><label class="required" title="'.__('Required field').'" '.
-	'for="post_content">'.__('Content:').'</label> '.
-	form::textarea('post_content',50,7,'','',2).
-	'</p>'.
-	'<p><label class="classic">'.__('Category:').' '.
-	form::combo('cat_id',$categories_combo,'','',2).'</label></p>'.
-	'<p><input type="submit" value="'.__('save').'" name="save" tabindex="3" /> '.
-	($core->auth->check('publish',$core->blog->id)
-		? '<input type="hidden" value="'.__('save and publish').'" name="save-publish" />'
-		: '').
-	$core->formNonce().
-	form::hidden('post_status',-2).
-	form::hidden('post_format',$core->auth->getOption('post_format')).
-	form::hidden('post_excerpt','').
-	form::hidden('post_lang',$core->auth->getInfo('user_lang')).
-	form::hidden('post_notes','').
-	'</p>'.
-	'</fieldset>'.
-	'</form>'.
-	'</div>';
+if ($core->auth->user_prefs->dashboard->quickentry) {
+	if ($core->auth->check('usage,contentadmin',$core->blog->id))
+	{
+		$categories_combo = array('&nbsp;' => '');
+		try {
+			$categories = $core->blog->getCategories(array('post_type'=>'post'));
+			while ($categories->fetch()) {
+				$categories_combo[] = new formSelectOption(
+					str_repeat('&nbsp;&nbsp;',$categories->level-1).'&bull; '.html::escapeHTML($categories->cat_title),
+					$categories->cat_id
+				);
+			}
+		} catch (Exception $e) { }
+	
+		echo
+		'<div id="quick">'.
+		'<h3>'.__('Quick entry').'</h3>'.
+		'<form id="quick-entry" action="post.php" method="post">'.
+		'<fieldset>'.
+		'<p class="col"><label class="required" title="'.__('Required field').'">'.__('Title:').
+		form::field('post_title',20,255,'','maximal',2).
+		'</label></p>'.
+		'<p class="area"><label class="required" title="'.__('Required field').'" '.
+		'for="post_content">'.__('Content:').'</label> '.
+		form::textarea('post_content',50,7,'','',2).
+		'</p>'.
+		'<p><label class="classic">'.__('Category:').' '.
+		form::combo('cat_id',$categories_combo,'','',2).'</label></p>'.
+		'<p><input type="submit" value="'.__('save').'" name="save" tabindex="3" /> '.
+		($core->auth->check('publish',$core->blog->id)
+			? '<input type="hidden" value="'.__('save and publish').'" name="save-publish" />'
+			: '').
+		$core->formNonce().
+		form::hidden('post_status',-2).
+		form::hidden('post_format',$core->auth->getOption('post_format')).
+		form::hidden('post_excerpt','').
+		form::hidden('post_lang',$core->auth->getInfo('user_lang')).
+		form::hidden('post_notes','').
+		'</p>'.
+		'</fieldset>'.
+		'</form>'.
+		'</div>';
+	}
 }
 
