[Fusionforge-commits] FusionForge branch master updated. cb1abbc3b57a02cbf4682ff90f7ebf5294272dbd

Franck Villaume nerville at fusionforge.org
Thu Jun 26 14:32:32 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  cb1abbc3b57a02cbf4682ff90f7ebf5294272dbd (commit)
      from  fb49e468234a3e2ce6be16ec01d3af2db6d56530 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cb1abbc3b57a02cbf4682ff90f7ebf5294272dbd
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Jun 26 14:30:03 2014 +0200

    use HTML helpers

diff --git a/src/common/widget/Widget_MyMonitoredDocuments.class.php b/src/common/widget/Widget_MyMonitoredDocuments.class.php
index 4d60b1e..823e997 100644
--- a/src/common/widget/Widget_MyMonitoredDocuments.class.php
+++ b/src/common/widget/Widget_MyMonitoredDocuments.class.php
@@ -2,7 +2,7 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  * Copyright 2010, Franck Villaume - Capgemini
- * Copyright 2011-2013, Franck Villaume - TrivialDev
+ * Copyright 2011-2014, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is a part of FusionForge.
@@ -45,10 +45,10 @@ class Widget_MyMonitoredDocuments extends Widget {
 		$result=db_query_params('select DISTINCT groups.group_name, docdata_vw.group_id from groups, docdata_vw, docdata_monitored_docman where docdata_monitored_docman.doc_id = docdata_vw.docid and groups.group_id = docdata_vw.group_id and docdata_monitored_docman.user_id = $1',array(user_getid()));
 		$rows=db_numrows($result);
 		if (!$result || $rows < 1) {
-			$html_my_monitored_documents .= $HTML->warning_msg(_('You are not monitoring any documents.')).'<p>' . _("If you monitor documents, you will be sent new update in the form of an email.") . '</p><p>' . _("You can monitor documents by clicking on the appropriate icon action in the directory itself.") . '</p>';
+			$html_my_monitored_documents .= $HTML->warning_msg(_('You are not monitoring any documents.')).html_e('p', array(), _("If you monitor documents, you will be sent new update in the form of an email.")).html_e('p', array(), _("You can monitor documents by clicking on the appropriate icon action in the directory itself."));
 		} else {
 			$request =& HTTPRequest::instance();
-			$html_my_monitored_documents .= '<table style="width:100%">';
+			$html_my_monitored_documents .= $HTML->listTableTop();
 			$vItemId = new Valid_UInt('hide_item_id');
 			$vItemId->required();
 			if($request->valid($vItemId)) {
@@ -87,14 +87,15 @@ class Widget_MyMonitoredDocuments extends Widget {
 							util_make_link('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$doc_group, stripslashes(db_result($result2,$i,'filename'))).'</td>'.
 							'<td class="align-center">'.
 							util_make_link('/docman/?group_id='.$group_id.'&action=monitorfile&option=remove&view=listfile&dirid='.$doc_group.'&fileid='.$docid,
-							'<img src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16" "alt="'._("Stop Monitoring").'" />', array('onClick' => 'return confirm("'._("Stop monitoring this document?").'")')).'</td></tr>';
+								$HTML->getDeletePic(_('Stop Monitoring'), _('Stop Monitoring'), array('onClick' => 'return confirm("'._('Stop monitoring this document?').'")')))
+							.'</td></tr>';
 					}
 				}
 
 				$html_hdr .= '['.$rows2.($count_new ? ", <b>".sprintf(_('%s new'), $count_new)."</b>]" : ']').'</td></tr>';
 				$html_my_monitored_documents .= $html_hdr.$html;
 			}
-			$html_my_monitored_documents .= '</table>';
+			$html_my_monitored_documents .= $HTML->listTableBottom();
 		}
 		return $html_my_monitored_documents;
 	}
diff --git a/src/common/widget/Widget_MyMonitoredForums.class.php b/src/common/widget/Widget_MyMonitoredForums.class.php
index 5bcfd90..144e36f 100644
--- a/src/common/widget/Widget_MyMonitoredForums.class.php
+++ b/src/common/widget/Widget_MyMonitoredForums.class.php
@@ -68,10 +68,10 @@ class Widget_MyMonitoredForums extends Widget {
 		$glist = array_unique($glist);
 		$rows=count($glist);
 		if (!$result || $rows < 1) {
-			$html_my_monitored_forums .= $HTML->warning_msg(_('You are not monitoring any forums.')).'<p>' . _("If you monitor forums, you will be sent new posts in the form of an email, with a link to the new message.") . '</p><p>' . _("You can monitor forums by clicking on the appropriate menu item in the discussion forum itself.") . '</p>';
+			$html_my_monitored_forums .= $HTML->warning_msg(_('You are not monitoring any forums.')).html_e('p', array(), _("If you monitor forums, you will be sent new posts in the form of an email, with a link to the new message.")).html_e('p', array(), _("You can monitor forums by clicking on the appropriate menu item in the discussion forum itself."));
 		} else {
 			$request =& HTTPRequest::instance();
-			$html_my_monitored_forums .= '<table style="width:100%">';
+			$html_my_monitored_forums .= $HTML->listTableTop();
 			foreach ($glist as $group) {
 				list($group_id, $group_name) = unserialize($group);
 
@@ -124,8 +124,7 @@ class Widget_MyMonitoredForums extends Widget {
 					util_make_link('/forum/forum.php?forum_id='.$group_forum_id, $flist[$i]['forum_name']).'</td>'.
 					'<td class="align-center">'.
 					util_make_link('/forum/monitor.php?forum_id='.$group_forum_id.'&group_id='.$group_id.'&stop=1',
-							'<img src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16" alt="'._("Stop Monitoring").'" />',
-							array('onClick' => 'return confirm("'._('Stop monitoring this Forum?').'")')).
+							$HTML->getDeletePic(_('Stop Monitoring'), _('Stop Monitoring'), array('onClick' => 'return confirm("'._('Stop monitoring this forum?').'")'))).
 					'</td></tr>';
 					}
 				}
@@ -133,7 +132,7 @@ class Widget_MyMonitoredForums extends Widget {
 				$html_hdr .= '['.$rows2.($count_new ? ", <b>".sprintf(_('%s new'), $count_new)."</b>]" : ']').'</td></tr>';
 				$html_my_monitored_forums .= $html_hdr.$html;
 			}
-			$html_my_monitored_forums .= '</table>';
+			$html_my_monitored_forums .= $HTML->listTableBottom();
 		}
 		return $html_my_monitored_forums;
 	}
diff --git a/src/common/widget/Widget_MyMonitoredFp.class.php b/src/common/widget/Widget_MyMonitoredFp.class.php
index b780fbb..b55646a 100644
--- a/src/common/widget/Widget_MyMonitoredFp.class.php
+++ b/src/common/widget/Widget_MyMonitoredFp.class.php
@@ -96,7 +96,7 @@ class Widget_MyMonitoredFp extends Widget {
 						$cells = array();
 						$url = '/frs/?group_id='.$group_id.'&package_id='.db_result($result2,$i,'filemodule_id').'&action=monitor&status=0&ajax=0';
 						$title = db_result($result2,$i,'name').' - '._('Stop monitoring this package');
-						$package_monitor = util_make_link($url, $HTML->getDeletePic($title));
+						$package_monitor = util_make_link($url, $HTML->getDeletePic($title, $title, array('onClick' => 'return confirm("'._('Stop monitoring this package?').'")')));
 						$cells[] = array('    - '.util_make_link('/frs/?group_id='.$group_id, db_result($result2,$i,'name')), 'width' => '99%');
 						$cells[][] = $package_monitor;
 						$html .= $HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($i, true)), $cells);
diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php
index 25bfd0b..4fe8cfa 100644
--- a/src/www/include/Layout.class.php
+++ b/src/www/include/Layout.class.php
@@ -1277,15 +1277,17 @@ if (isset($params['group']) && $params['group']) {
 		return $this->getPicto('ic/ftp16b.png', $title, $alt);
 	}
 
-	function getDeletePic($title = '', $alt = '') {
-		return $this->getPicto('ic/delete.png', $title, $alt);
+	function getDeletePic($title = '', $alt = '', $otherAttr = array()) {
+		return $this->getPicto('ic/delete.png', $title, $alt, 20, 20, $otherAttr);
 	}
 
-	function getPicto($url, $title, $alt, $width = '20', $height = '20') {
+	function getPicto($url, $title, $alt, $width = '20', $height = '20', $otherAttr = array()) {
+		$otherAttr['title'] = $title;
 		if (!$alt) {
+			$otherAttr['alt'] = $title;
 			$alt = $title;
 		}
-		return html_image($url, $width, $height, array('title' => $title, 'alt' => $alt));
+		return html_image($url, $width, $height, $otherAttr);
 	}
 
 	/**

-----------------------------------------------------------------------

Summary of changes:
 src/common/widget/Widget_MyMonitoredDocuments.class.php |   11 ++++++-----
 src/common/widget/Widget_MyMonitoredForums.class.php    |    9 ++++-----
 src/common/widget/Widget_MyMonitoredFp.class.php        |    2 +-
 src/www/include/Layout.class.php                        |   10 ++++++----
 4 files changed, 17 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list