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 0be07847f379e2279389eeeea71fdf5939bf6cd3 (commit)
from 25dbe4f182ac3f20eb047789dc5dbbeb74842f5a (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 0be07847f379e2279389eeeea71fdf5939bf6cd3
Author: Franck Villaume <[email protected]>
Date: Fri Jun 27 11:08:08 2014 +0200
use HTML helpers
diff --git a/src/common/widget/Widget.class.php
b/src/common/widget/Widget.class.php
index 29f1811..0af5e18 100644
--- a/src/common/widget/Widget.class.php
+++ b/src/common/widget/Widget.class.php
@@ -1,7 +1,7 @@
<?php
/**
* Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights
reserved
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012,2014, Franck Villaume - TrivialDev
*
* This file is a part of Fusionforge.
*
@@ -95,15 +95,15 @@ require_once
'common/widget/Widget_MyMonitoredDocuments.class.php';
return '';
}
function getPreferencesForm($layout_id, $owner_id, $owner_type) {
- $prefs = '';
- $prefs .= '<form method="post"
action="'.util_make_uri('/widgets/widget.php?owner='. $owner_type.$owner_id
.'&action=update&name['. $this->id .']='. $this->getInstanceId()
.'&content_id='. $this->getInstanceId() .'&layout_id='. $layout_id).'">';
- $prefs .= '<fieldset><legend>'. _("Preferences") .'</legend>';
+ global $HTML;
+ $prefs = $HTML->openForm(array('method' => 'post', 'action' =>
util_make_uri('/widgets/widget.php?owner='. $owner_type.$owner_id
.'&action=update&name['. $this->id .']='. $this->getInstanceId()
.'&content_id='. $this->getInstanceId() .'&layout_id='. $layout_id)));
+ $prefs .= html_ao('fieldset').html_e('legend', array(),
_('Preferences'));
$prefs .= $this->getPreferences();
- $prefs .= '<br />';
- $prefs .= '<input type="submit" name="cancel" value="'.
_("Cancel") .'" /> ';
- $prefs .= '<input type="submit" value="'. _("Submit") .'" />';
- $prefs .= '</fieldset>';
- $prefs .= '</form>';
+ $prefs .= html_e('br');
+ $prefs .= html_e('input', array('type' => 'submit', 'name' =>
'cancel', 'value' => _('Cancel')));
+ $prefs .= html_e('input', array('type' => 'submit', 'value' =>
_('Submit')));
+ $prefs .= html_ac(html_ap() - 1);
+ $prefs .= $HTML->closeForm();
return $prefs;
}
function getInstallPreferences() {
diff --git a/src/common/widget/Widget_MyAdmin.class.php
b/src/common/widget/Widget_MyAdmin.class.php
index 925c30f..2cb4808 100644
--- a/src/common/widget/Widget_MyAdmin.class.php
+++ b/src/common/widget/Widget_MyAdmin.class.php
@@ -35,10 +35,11 @@ class Widget_MyAdmin extends Widget {
return _('Pending administrative tasks');
}
function getContent() {
+ global $HTML;
$i = 0;
- $html_my_admin = '<table class="fullwidth">';
+ $html_my_admin = $HTML->listTableTop();
- if (forge_check_global_perm ('forge_admin')) {
+ if (forge_check_global_perm('forge_admin')) {
$res = db_query_params("SELECT count(*) AS count FROM
users WHERE status='P' OR status='V' OR status='W'",array());
$row = db_fetch_array($res);
$pending_users = $row['count'];
@@ -48,13 +49,13 @@ class Widget_MyAdmin extends Widget {
$html_my_admin .= $this->_get_admin_row(
$i++,
- vsprintf(_('Users in <a
href="%s"><strong>P</strong> (pending) Status</a>'),
array("/admin/userlist.php?status=P")),
+ vsprintf(_('Users in <a
href="%s"><strong>P</strong> (pending) Status</a>'),
array(util_make_uri('/admin/userlist.php?status=P'))),
$pending_users,
$this->_get_color($pending_users)
);
}
- if (forge_check_global_perm ('approve_projects')) {
+ if (forge_check_global_perm('approve_projects')) {
$res = db_query_params('SELECT count(*) AS count FROM
groups
WHERE group_id > 4
AND status = $1
@@ -66,13 +67,13 @@ class Widget_MyAdmin extends Widget {
$html_my_admin .= $this->_get_admin_row(
$i++,
- vsprintf(_('Groups in <a
href="%s"><strong>P</strong> (pending) Status</a>'),
array("/admin/approve-pending.php")),
+ vsprintf(_('Groups in <a
href="%s"><strong>P</strong> (pending) Status</a>'),
array(util_make_uri('/admin/approve-pending.php'))),
$pending_projects,
$this->_get_color($pending_projects)
);
}
- if (forge_check_global_perm ('approve_news')) {
+ if (forge_check_global_perm('approve_news')) {
$old_date = time()-60*60*24*30;
$res = db_query_params('SELECT
groups.group_id,id,post_date,summary,
group_name,unix_group_name
@@ -92,7 +93,7 @@ class Widget_MyAdmin extends Widget {
$this->_get_color($pending_news)
);
}
- $html_my_admin .= '</table>';
+ $html_my_admin .= $HTML->listTableBottom();
return $html_my_admin;
}
@@ -100,7 +101,11 @@ class Widget_MyAdmin extends Widget {
return $nb == 0 ? 'green' : 'orange';
}
function _get_admin_row($i, $text, $value, $bgcolor, $textcolor =
'white') {
+ global $HTML;
$i=$i++;
- return '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i)
.'><td>'. $text .'</td><td style="white-space:nowrap; width:20%; background:'.
$bgcolor .'; color:'. $textcolor .'; padding: 2px 8px; font-weight:bold;
text-align:center;">'. $value .'</td></tr>';
+ $cells = array();
+ $cells[][] = $text;
+ $cells[] = array($value, 'style' => 'white-space:nowrap;
width:20%; background:'. $bgcolor .'; color:'. $textcolor .'; padding: 2px 8px;
font-weight:bold; text-align:center;');
+ return $HTML->multiTableRow(array('class' =>
$HTML->boxGetAltRowStyle($i, true)), $cells);
}
}
diff --git a/src/common/widget/Widget_MyBookmarks.class.php
b/src/common/widget/Widget_MyBookmarks.class.php
index 1917577..0a21ce9 100644
--- a/src/common/widget/Widget_MyBookmarks.class.php
+++ b/src/common/widget/Widget_MyBookmarks.class.php
@@ -41,26 +41,25 @@ class Widget_MyBookmarks extends Widget {
global $HTML;
$html_my_bookmarks = '';
$result = db_query_params("SELECT bookmark_url, bookmark_title,
bookmark_id from user_bookmarks where ".
- "user_id=$1 ORDER BY
bookmark_title",array( user_getid() ));
+ "user_id=$1 ORDER BY
bookmark_title",array(user_getid()));
$rows = db_numrows($result);
if (!$result || $rows < 1) {
$html_my_bookmarks .= $HTML->warning_msg(_('You
currently do not have any bookmarks saved'));
$html_my_bookmarks .= db_error();
} else {
- $html_my_bookmarks .= '<table class="fullwidth">';
+ $html_my_bookmarks .= $HTML->listTableTop();
for ($i=0; $i<$rows; $i++) {
- $html_my_bookmarks .= '<tr '.
$HTML->boxGetAltRowStyle($i) .'><td>';
- $html_my_bookmarks .=
util_make_link(db_result($result,$i,'bookmark_url'),
db_result($result,$i,'bookmark_title'), array(), true);
- $html_my_bookmarks .=
'<small>'.util_make_link('/my/bookmark_edit.php?bookmark_id='.db_result($result,$i,'bookmark_id'),
'['._('Edit').']').'</small></td>';
- $html_my_bookmarks .= '<td
style="text-align:right">';
- $html_my_bookmarks .=
util_make_link('/my/bookmark_delete.php?bookmark_id='.db_result($result,$i,'bookmark_id'),
- '<img
src="'.$HTML->imgroot.'ic/trash.png" height="16" width="16"
alt="'._('Delete').'" />',
- array('onClick'
=> 'return confirm("'._("Delete this bookmark?").'")'));
- $html_my_bookmarks .= '</td></tr>';
+ $cells = array();
+ $cells[][] =
util_make_link(db_result($result,$i,'bookmark_url'),
db_result($result,$i,'bookmark_title'), array(), true).
+ html_e('small', array(),
util_make_link('/my/bookmark_edit.php?bookmark_id='.db_result($result,$i,'bookmark_id'),
'['._('Edit').']'));
+ $cells[] =
array(util_make_link('/my/bookmark_delete.php?bookmark_id='.db_result($result,$i,'bookmark_id'),
+
$HTML->getDeletePic(_('Delete'), _('Delete'), array('onClick' => 'return
confirm("'._('Delete this bookmark?').'")'))),
+ 'style' => 'text-align:right');
+ $html_my_bookmarks .=
$HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($i, true)),
$cells);
}
- $html_my_bookmarks .= '</table>';
+ $html_my_bookmarks .= $HTML->listTableBottom();
}
- $html_my_bookmarks .= '<div style="text-align:center;
font-size:0.8em;">'.util_make_link('/my/bookmark_add.php', '['._('Add a
bookmark').']').'</div>';
+ $html_my_bookmarks .= html_e('div', array('style' =>
'text-align:center; font-size:0.8em;'), util_make_link('/my/bookmark_add.php',
'['._('Add a bookmark').']'));
return $html_my_bookmarks;
}
diff --git a/src/common/widget/Widget_MyMonitoredDocuments.class.php
b/src/common/widget/Widget_MyMonitoredDocuments.class.php
index 823e997..3549112 100644
--- a/src/common/widget/Widget_MyMonitoredDocuments.class.php
+++ b/src/common/widget/Widget_MyMonitoredDocuments.class.php
@@ -71,28 +71,27 @@ class Widget_MyMonitoredDocuments extends Widget {
}
list($hide_now,$count_diff,$hide_url) =
my_hide_url('document',$group_id,$hide_item_id,$rows2,$hide_document);
-
- $html_hdr = '<tr class="boxitem"><td
colspan="2">'.
-
$hide_url.util_make_link('/docman/?group_id='.$group_id,
db_result($result,$j,'group_name')).' ';
-
- $html = '';
$count_new = max(0, $count_diff);
+ $cells = array();
+ $cells[] =
array($hide_url.util_make_link('/docman/?group_id='.$group_id,
db_result($result,$j,'group_name')).' '.
+ '['.$rows2.($count_new ? ',
'.html_e('b', array(), sprintf(_('%s new'), $count_new).']') : ']'), 'colspan'
=> 2);
+ $html_hdr = $HTML->multiTableRow(array('class'
=> 'boxitem'), $cells);
+ $html = '';
for ($i = 0; $i < $rows2; $i++) {
if (!$hide_now) {
+ $cells = array();
$doc_group =
db_result($result2,$i,'doc_group');
$docid =
db_result($result2,$i,'docid');
- $html .= '
- <tr '.
$HTML->boxGetAltRowStyle($i) .'><td style="width:99%">'.
-
' - '.
-
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,
-
$HTML->getDeletePic(_('Stop Monitoring'), _('Stop Monitoring'), array('onClick'
=> 'return confirm("'._('Stop monitoring this document?').'")')))
- .'</td></tr>';
+ $cells[] =
array(' - '.util_make_link('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$doc_group,
stripslashes(db_result($result2,$i,'filename'))), 'style' => 'width:99%');
+ $cells[] =
array(util_make_link('/docman/?group_id='.$group_id.'&action=monitorfile&option=stop&view=listfile&dirid='.$doc_group.'&fileid='.$docid,
+
$HTML->getDeletePic(_('Stop Monitoring'), _('Stop Monitoring'), array('onClick'
=> 'return confirm("'._('Stop monitoring this document?').'")'))),
+ 'class' =>
'align-center');
+ $html .=
$HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($i, true)),
$cells);
+
}
}
- $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 .=
$HTML->listTableBottom();
-----------------------------------------------------------------------
Summary of changes:
src/common/widget/Widget.class.php | 18 ++++++-------
src/common/widget/Widget_MyAdmin.class.php | 21 +++++++++------
src/common/widget/Widget_MyBookmarks.class.php | 23 ++++++++---------
.../widget/Widget_MyMonitoredDocuments.class.php | 27 ++++++++++----------
4 files changed, 46 insertions(+), 43 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits