[Fusionforge-commits] r11273 - trunk/src/common/docman/views

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Sat Oct 30 00:16:00 CEST 2010


Author: nerville
Date: 2010-10-30 00:16:00 +0200 (Sat, 30 Oct 2010)
New Revision: 11273

Modified:
   trunk/src/common/docman/views/listfile.php
   trunk/src/common/docman/views/menu.php
Log:
small UI improvements & cleanup

Modified: trunk/src/common/docman/views/listfile.php
===================================================================
--- trunk/src/common/docman/views/listfile.php	2010-10-29 20:44:44 UTC (rev 11272)
+++ trunk/src/common/docman/views/listfile.php	2010-10-29 22:16:00 UTC (rev 11273)
@@ -90,14 +90,16 @@
 <?php
 echo '<h3 class="docman_h3" >Directory : <i>'.$DocGroupName.'</i>&nbsp;';
 if (forge_check_perm ('docman', $group_id, 'approve')) {
-	echo '<a href="#" onclick="javascript:displayEditDocGroup()" >'. html_image('docman/configure-directory.png',22,22,array('alt'=>'edit')). '</a>';
-	echo '<a href="#" onclick="javascript:displaySubGroup()" >'. html_image('docman/insert-directory.png',22,22,array('alt'=>'addsubdir')). '</a>';
+	echo '<a href="#" title="'._('Edit this directory').'" onclick="javascript:displayEditDocGroup()" >'. html_image('docman/configure-directory.png',22,22,array('alt'=>'edit')). '</a>';
+	echo '<a href="#" title="'._('Add a new subdirectory').'" onclick="javascript:displaySubGroup()" >'. html_image('docman/insert-directory.png',22,22,array('alt'=>'addsubdir')). '</a>';
 	//echo '<a href="?group_id='.$group_id.'&action=trashdir&dirid='.$dirid.'">'. html_image('docman/trash-empty.png',22,22,array('alt'=>'trashdir')). '</a>';
 	if (!isset($nested_docs[$dirid]) && !isset($nested_groups[$dirid]))
-		echo '<a href="?group_id='.$group_id.'&action=deldir&dirid='.$dirid.'">'. html_image('docman/delete-directory.png',22,22,array('alt'=>'deldir')). '</a>';
+		echo '<a href="?group_id='.$group_id.'&action=deldir&dirid='.$dirid.'" title="'._('Permanently delete this directory').'" >'. html_image('docman/delete-directory.png',22,22,array('alt'=>'deldir')). '</a>';
 }
 
-echo '<a href="#" onclick="javascript:displayAddFile()" >'. html_image('docman/insert-file.png',22,22,array('alt'=>'addfile')). '</a>';
+if (forge_check_perm ('docman', $group_id, 'submit')) {
+	echo '<a href="#" onclick="javascript:displayAddFile()" title="'._('Add a new file').'" >'. html_image('docman/insert-file.png',22,22,array('alt'=>'addfile')). '</a>';
+}
 
 echo '</h3>';
 
@@ -131,7 +133,7 @@
 		default:
 			$docurl=util_make_url ('/docman/view.php/'.$group_id.'/'.$d->getID().'/'.urlencode($d->getFileName()));
 		}
-		echo '<td><a href="'.$docurl.'">';
+		echo '<td><a href="'.$docurl.'" title="'._('View this file').'" >';
 		switch ($d->getFileType()) {
 			case "image/png":
 			case "image/jpeg":
@@ -188,7 +190,7 @@
 		echo '</td>';
         echo '<td>';
         if ($d->getReserved()) {
-            echo html_image('docman/document-reserved.png',22,22,array('alt'=>_('Reserved Document')));
+            echo html_image('docman/document-reserved.png',22,22,array('alt'=>_('Reserved Document'),'title'=>_('Reserved Document')));
         } else {
             echo $d->getStateName().'</td>';
         }
@@ -223,22 +225,18 @@
                 }
             }
             if (!$d->getLocked() && !$d->getReserved()) {
-			    echo '<a href="?group_id='.$group_id.'&action=trashfile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'">'.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Trash this file'))). '</a>';
-			    echo '<a href="#" onclick="javascript:displayEditFile(\''.$d->getID().'\')" >'.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this file'))). '</a>';
-			        echo '<a href="?group_id='.$group_id.'&action=reservefile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'">'.html_image('docman/reserve-document.png',22,22,array('alt'=>_('Reserve this document'))). '</a>';
+			    echo '<a href="?group_id='.$group_id.'&action=trashfile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" title="'. _('Move this file to trash') .'" >'.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Trash this file'))). '</a>';
+			    echo '<a href="#" onclick="javascript:displayEditFile(\''.$d->getID().'\')" title="'. _('Edit this file') .'" >'.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this file'))). '</a>';
+			        echo '<a href="?group_id='.$group_id.'&action=reservefile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" title="'. _('Reserve this file for later edition') .'" >'.html_image('docman/reserve-document.png',22,22,array('alt'=>_('Reserve this document'))). '</a>';
             } else {
                 if ($d->getReservedBy() != $LUSER->getID()) {
-                    echo html_image('docman/trash-forbidden.png',22,22,array('alt'=>_('Trash forbidden')));
-                    echo html_image('docman/edit-forbidden.png',22,22,array('alt'=>_('Edition forbidden')));
                     if (forge_check_perm ('docman', $group_id, 'admin')) {
-                        echo '<a href="?group_id='.$group_id.'&action=enforcereserve&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'">'.html_image('docman/enforce-document.png',22,22,array('alt'=>'Enforce reservation'));
-                    } else {
-                        echo html_image('docman/document-reserved.png',22,22,array('alt',_('Document reserved by')));
+                        echo '<a href="?group_id='.$group_id.'&action=enforcereserve&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" title="'. _('Enforce reservation') .'" >'.html_image('docman/enforce-document.png',22,22,array('alt'=>_('Enforce reservation')));
                     }
                 } else {
-			        echo '<a href="?group_id='.$group_id.'&action=trashfile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'">'.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Trash this file'))). '</a>';
-			        echo '<a href="#" onclick="javascript:displayEditFile(\''.$d->getID().'\')" >'.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this file'))). '</a>';
-			        echo '<a href="?group_id='.$group_id.'&action=releasefile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'">'.html_image('docman/release-document.png',22,22,array('alt'=>_('Release this document'))). '</a>';
+			        echo '<a href="?group_id='.$group_id.'&action=trashfile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" title="'. _('Move this file to trash') .'" >'.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Trash this file'))). '</a>';
+			        echo '<a href="#" onclick="javascript:displayEditFile(\''.$d->getID().'\')" title="'. _('Edit this file') .'" >'.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this file'))). '</a>';
+			        echo '<a href="?group_id='.$group_id.'&action=releasefile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" title="'. _('Release reservation') .'" >'.html_image('docman/release-document.png',22,22,array('alt'=>_('Release reservation'))). '</a>';
                 }
             }
 			echo '</td>';

Modified: trunk/src/common/docman/views/menu.php
===================================================================
--- trunk/src/common/docman/views/menu.php	2010-10-29 20:44:44 UTC (rev 11272)
+++ trunk/src/common/docman/views/menu.php	2010-10-29 22:16:00 UTC (rev 11273)
@@ -36,11 +36,16 @@
 $menu_text=array();
 $menu_links=array();
 
-$menu_text[]=_('Submit new documentation');
-$menu_links[]='/docman/?group_id='.$group_id.'&view=addfile';
+if (forge_check_perm ('docman', $group_id, 'submit')) {
+	$menu_text[]=_('Submit new documentation');
+	$menu_links[]='/docman/?group_id='.$group_id.'&view=addfile';
+}
+
 if (session_loggedin()) {
-	$menu_text[]=_('Add new documentation group');
-	$menu_links[]='/docman/?group_id='.$group_id.'&view=addsubdocgroup';
+	if (forge_check_perm ('docman', $group_id, 'approve')) {
+		$menu_text[]=_('Add new documentation directory');
+		$menu_links[]='/docman/?group_id='.$group_id.'&view=addsubdocgroup';
+	}
 }
 
 if ($g->useDocmanSearch()) {
@@ -50,7 +55,7 @@
 	}
 }
 
-if (forge_check_perm ('docman', $group_id, 'approve')) {
+if (forge_check_perm ('docman', $group_id, 'admin')) {
 	$menu_text[]=_('Admin');
 	$menu_links[]='/docman/?group_id='.$group_id.'&view=admin';
 }




More information about the Fusionforge-commits mailing list