Index: plugins/widgets/index.php
===================================================================
--- plugins/widgets/index.php	(revision 2448)
+++ plugins/widgets/index.php	(revision 2495)
@@ -53,5 +53,5 @@
 		}
 	}
-		
+
 	# Append 1 widget
 	$wid = false;
@@ -60,5 +60,5 @@
 		$wid = $wid[0];
 	}
-	
+
 	# Append widgets
 	if (!empty($addw))
@@ -73,5 +73,5 @@
 			$widgets_custom = new dcWidgets();
 		}
-		
+
 		foreach ($addw as $k => $v)
 		{
@@ -91,5 +91,5 @@
 			}
 		}
-		
+
 		try {
 			$core->blog->settings->addNamespace('widgets');
@@ -151,5 +151,5 @@
 		$_POST['w'] = array();
 	}
-	
+
 	try
 	{
@@ -163,5 +163,5 @@
 			}
 		}
-		
+
 		if (!isset($_POST['w']['nav'])) {
 			$_POST['w']['nav'] = array();
@@ -173,9 +173,9 @@
 			$_POST['w']['custom'] = array();
 		}
-		
+
 		$widgets_nav = dcWidgets::loadArray($_POST['w']['nav'],$__widgets);
 		$widgets_extra = dcWidgets::loadArray($_POST['w']['extra'],$__widgets);
 		$widgets_custom = dcWidgets::loadArray($_POST['w']['custom'],$__widgets);
-		
+
 		$core->blog->settings->addNamespace('widgets');
 		$core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store());
@@ -183,5 +183,5 @@
 		$core->blog->settings->widgets->put('widgets_custom',$widgets_custom->store());
 		$core->blog->triggerBlog();
-		
+
 		http::redirect($p_url);
 	}
@@ -200,5 +200,5 @@
 		$core->blog->settings->widgets->put('widgets_custom','');
 		$core->blog->triggerBlog();
-		
+
 		http::redirect($p_url);
 	}
@@ -212,12 +212,15 @@
 <head>
   <title><?php echo __('Widgets'); ?></title>
-  <link type="text/css" rel="stylesheet" href="index.php?pf=widgets/style.css"/>
+  <style type="text/css">
+  <?php echo file_get_contents(dirname(__FILE__).'/style.css'); ?>
+  </style>
   <?php
 		echo
 			dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
+			dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').
 			dcPage::jsLoad('index.php?pf=widgets/widgets.js');
   ?>
-  <?php 
-	$core->auth->user_prefs->addWorkspace('accessibility'); 
+  <?php
+	$core->auth->user_prefs->addWorkspace('accessibility');
 	$user_dm_nodragdrop = $core->auth->user_prefs->accessibility->nodragdrop;
   ?>
@@ -265,5 +268,5 @@
 echo
 '</ul>'.
-'<p>'.$core->formNonce().'</p>'.
+$core->formNonce().
 '<p class="remove-if-drag"><input type="submit" name="append" value="'.__('Add widgets to sidebars').'" /></p>'.
 '</form>';
@@ -296,5 +299,24 @@
 
 $widget_elements = new stdClass;
-$widget_elements->content = '<dl>';
+$widget_elements->content =
+'<h4>'.__('Use of widgets').'</h4>'.
+'<p>'.__('Widgets may be used to add various blocks of content to be displayed on your public pages. To add a widget, '.
+'drag it from the Available widgets list on the left to one of the sidebars on the right of this page. You can order '.
+'your widgets in a sidebar by dragging them up or down. You must update sidebars to apply your changes.').'</p>'.
+'<p>'.__('Once included in a sidebar, widgets have configuration options that you can reach by clicking on the arrow next '.
+'to their name.').'</p>'.
+'<p>'.__('Reset sidebars to get back to default widgets installation.').'</p>'.
+'<h4>'.__('Widget templates tags').'</h4>'.
+'<div id="widgets-tpl">'.
+'<p>'.__('If you are allowed to edit your theme templates, you can directly add widgets as '.
+'templates tags, with their own configuration.').'</p>'.
+'<p>'.__('To add a widget in your template, you need to write code like this:').'</p>'.
+'<pre>&lt;tpl:Widget id="<strong>'.__('Widget ID').'</strong>"&gt;
+  &lt;setting name="<strong>'.__('Setting name').'</strong>"&gt;<strong>'.__('Setting value').'</strong>&lt;/setting&gt;
+  ...
+&lt;/tpl:Widget&gt;</pre>'.
+'<p>'.__('Here are the following available widgets for your blog:').'</p>';
+
+$widget_elements->content .= '<dl>';
 foreach ($__widgets->elements() as $w)
 {
@@ -304,5 +326,5 @@
 	($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</dt>'.
 	'<dd>';
-	
+
 	$w_settings = $w->settings();
 	if (empty($w_settings))
@@ -329,5 +351,5 @@
 					break;
 			}
-			
+
 			$widget_elements->content .=
 			'<li>'.
@@ -342,29 +364,27 @@
 $widget_elements->content .= '</dl></div>';
 
-dcPage::helpBlock('widgets',$widget_elements);
+dcPage::helpBlock($widget_elements);
 
 function sidebarWidgets($id,$title,$widgets,$pr,$default_widgets,&$j)
 {
 	$res = '<h3>'.$title.'</h3>';
-	
+
 	if (!($widgets instanceof dcWidgets))
 	{
 		$widgets = $default_widgets;
 	}
-	
+
 	$res .= '<ul id="'.$id.'" class="connected">';
-	
-	$res .= '<li class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget as far.').'</li>';
-	
+
+	$res .= '<li class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget for now.').'</li>';
+
 	$i = 0;
 	foreach ($widgets->elements() as $w)
 	{
-		$upDisabled = $i == 0 ? ' disabled" src="images/disabled_' : '" src="images/';
-		$downDisabled = $i == count($widgets->elements())-1 ? ' disabled" src="images/disabled_' : '" src="images/';
-		$altUp = $i == 0 ? ' alt=""' : ' alt="'.__('Up the widget').'"';
-		$altDown = $i == count($widgets->elements())-1 ? ' alt=""' : ' alt="'.__('Down the widget').'"';
-		
+		$upDisabled = $i == 0 ? '" disabled="" src="images/disabled_' : '" src="images/';
+		$downDisabled = $i == count($widgets->elements())-1 ? '" disabled="" src="images/disabled_' : '" src="images/';
+
 		$iname = 'w['.$pr.']['.$i.']';
-		
+
 		$res .=
 		'<li>'.form::hidden(array($iname.'[id]'),html::escapeHTML($w->id())).
@@ -373,21 +393,21 @@
 		($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').
 		'<span class="toolsWidget remove-if-drag">'.
-		'<input type="image" class="upWidget'.$upDisabled.'up.png" name="'.$iname.'[_up]" value="'.__('Up the widget').'"'.$altUp.' /> '.
-		'<input type="image" class="downWidget'.$downDisabled.'down.png" name="'.$iname.'[_down]" value="'.__('Down the widget').'"'.$altDown.' /> '.' '.
-		'<input type="image" class="removeWidget" src="images/trash.png" name="'.$iname.'[_rem]" value="'.__('Remove widget').'" alt="'.__('Remove the widget').'" />'.
+		'<input type="image" class="upWidget'.$upDisabled.'up.png" name="'.$iname.'[_up]" value="'.__('Up the widget').'" />'.
+		'<input type="image" class="downWidget'.$downDisabled.'down.png" name="'.$iname.'[_down]" value="'.__('Down the widget').'" />'.' '.
+		'<input type="image" class="removeWidget" src="images/trash.png" name="'.$iname.'[_rem]" value="'.__('Remove widget').'" />'.
 		'</span>'.
 		'<br class="clear"/></p>'.
 		'<div class="widgetSettings hidden-if-drag">'.$w->formSettings($iname,$j).'</div>'.
 		'</li>';
-		
+
 		$i++;
 		$j++;
 	}
-	
+
 	$res .= '</ul>';
-	
+
 	$res .= '<ul class="sortable-delete"'.($i > 0 ? '':' style="display: none;"').'><li class="sortable-delete-placeholder">'.
 			__('Drag widgets here to remove.').'</li></ul>';
-	
+
 	return $res;
 }
