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 f6b57bae2ebe4b931925c555bc7cbc21095bed96 (commit)
via f78147fdb3ada4810eeaf4831b2c4c876a014090 (commit)
from 8cf706993a19a8e6a68278ef85ab26dc05f9c2d5 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=f6b57bae2ebe4b931925c555bc7cbc21095bed96
commit f6b57bae2ebe4b931925c555bc7cbc21095bed96
Author: Franck Villaume <[email protected]>
Date: Tue Sep 5 16:47:37 2017 +0000
improve snippet code. add markdown support in description. fix [#865]
diff --git a/src/CHANGES b/src/CHANGES
index 2597d3c..c3b2eeb 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -29,6 +29,7 @@ FusionForge 6.X:
* Search: provide language-specific settings for better indexation/search
(Roland Mas)
* Site Admin: add paging system in userlist page [#799] (TrivialDev)
* Site Admin: support widgets for forge home page (TrivialDev)
+* Snippet: markdown support & fix code syntax highlight [#865] (TrivialDev)
* Soap: getArtifacts tracker function: support changed_from parameter
(TrivialDev)
* Soap: getFlattedArtifacts function: to return as CSV export. All data in 1
call (TrivialDev)
* Spellcheck (Anders Jonsson)
diff --git a/src/etc/config.ini.d/defaults.ini
b/src/etc/config.ini.d/defaults.ini
index 886bf82..c08660d 100644
--- a/src/etc/config.ini.d/defaults.ini
+++ b/src/etc/config.ini.d/defaults.ini
@@ -97,8 +97,9 @@ use_tracker_widget_display = no
use_docman_review = no
session_expire = 3600
use_artefacts_dependencies = no
-;Uncomment the following line to use markdown syntax in tracker
+;Uncomment the following line to use markdown syntax
;tracker_parser_type = 'markdown'
+;snipper_parser_type = 'markdown'
scm_single_host = yes
system_user=fusionforge
diff --git a/src/www/snippet/browse.php b/src/www/snippet/browse.php
index b6dc59c..78dbc75 100644
--- a/src/www/snippet/browse.php
+++ b/src/www/snippet/browse.php
@@ -3,7 +3,7 @@
* Code Snippets Repository
*
* Copyright 1999-2001 (c) VA Linux Systems
- * Copyright 2013, Franck Villaume - TrivialDev
+ * Copyright 2013,2017, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -52,7 +52,7 @@ snippet_header(array('title'=>_('Snippet Library')));
$by = getStringFromRequest('by');
-$qpa = db_construct_qpa(array(), 'SELECT
users.realname,users.user_name,snippet.description,snippet.snippet_id,snippet.name
FROM snippet,users WHERE users.user_id=snippet.created_by ') ;
+$qpa = db_construct_qpa(array(), 'SELECT users.realname,users.user_name,
users.user_id, snippet.description,snippet.snippet_id,snippet.name FROM
snippet,users WHERE users.user_id=snippet.created_by ') ;
$qpa2 = db_construct_qpa(array(), 'SELECT
users.realname,users.user_name,users.user_id,snippet_package.description,snippet_package.snippet_package_id,snippet_package.name
FROM snippet_package,users WHERE users.user_id=snippet_package.created_by ') ;
if ($by=='lang') {
@@ -83,7 +83,7 @@ if ((!$result || $rows < 1) && (!$result2 || $rows2 < 1)) {
} else {
$title_arr=array();
- $title_arr[]= _('Snippet ID');
+ $title_arr[]= _('ID');
$title_arr[]= _('Title');
$title_arr[]= _('Creator');
@@ -92,33 +92,53 @@ if ((!$result || $rows < 1) && (!$result2 || $rows2 < 1)) {
// List packages if there are any
if ($rows2 > 0) {
echo '
- <tr class="tableheading"><td colspan="3">' ._('Packages
Of Snippets').'<td>';
+ <tr class="tableheading"><td colspan="3">' ._('Packages
Of Snippets').'</td></tr>';
}
for ($i=0; $i<$rows2; $i++) {
echo '
<tr><td rowspan="2">'.
- util_make_link
('/snippet/detail.php?type=package&id='.db_result($result2,$i,'snippet_package_id'),'<strong>'.db_result($result2,$i,'snippet_package_id').'</strong>').'</td><td><strong>'.
- db_result($result2,$i,'name').'</td><td>'.
- util_make_link_u (db_result($result2, $i, 'user_name'),
db_result($result2, $i, 'user_id'), db_result($result2, $i,
'realname')).'</td></tr>';
+
util_make_link('/snippet/detail.php?type=package&id='.db_result($result2,$i,'snippet_package_id'),'<strong>'.db_result($result2,$i,'snippet_package_id').'</strong>').'</td><td>'.
+
util_make_link('/snippet/detail.php?type=package&id='.db_result($result2,$i,'snippet_package_id'),
'<strong>'.db_result($result2,$i,'name').'</strong>').'</td><td>'.
+ util_display_user(db_result($result2, $i, 'user_name'),
db_result($result2, $i, 'user_id'), db_result($result2, $i,
'realname')).'</td></tr>';
+ $parsertype = forge_get_config('snippet_parser_type');
+ switch ($parsertype) {
+ case 'markdown':
+ require_once 'markdown.php';
+ $result_html = Markdown(db_result($result2 ,$i
,'description'));
+ break;
+ default:
+ $result_html =
util_make_links(nl2br(db_result($result2, $i ,'description')));
+ }
+
echo '
- <tr><td
colspan="2">'.util_make_links(nl2br(db_result($result2,$i,'description'))).'</td></tr>';
+ <tr><td colspan="2">'.$result_html.'</td></tr>';
}
// List snippets if there are any
if ($rows > 0) {
echo '
- <tr class="tableheading"><td colspan="3">'
._('Snippets').'</td>';
+ <tr class="tableheading"><td colspan="3">'
._('Snippets').'</td></tr>';
}
for ($i=0; $i<$rows; $i++) {
echo '
<tr><td rowspan="2">'.
- util_make_link
('/snippet/detail.php?type=snippet&id='.db_result($result,$i,'snippet_id'),'<strong>'.db_result($result,$i,'snippet_id').'</strong>').
- '</td><td><strong>'.
- util_make_link
('/snippet/detail.php?type=snippet&id='.db_result($result,$i,'snippet_id'),db_result($result,$i,'name')).
- '</strong></td><td>'.
- util_make_link_u (db_result($result, $i, 'user_name'),
db_result($result, $i, 'user_id'), db_result($result, $i,
'realname')).'</td></tr>';
+
util_make_link('/snippet/detail.php?type=snippet&id='.db_result($result,$i,'snippet_id'),'<strong>'.db_result($result,$i,'snippet_id').'</strong>').
+ '</td><td>'.
+
util_make_link('/snippet/detail.php?type=snippet&id='.db_result($result,$i,'snippet_id'),'<strong>'.db_result($result,$i,'name').'</strong>').
+ '</td><td>'.
+ util_display_user(db_result($result, $i, 'user_name'),
db_result($result, $i, 'user_id'), db_result($result, $i,
'realname')).'</td></tr>';
+ $parsertype = forge_get_config('snippet_parser_type');
+ switch ($parsertype) {
+ case 'markdown':
+ require_once 'markdown.php';
+ $result_html = Markdown(db_result($result ,$i
,'description'));
+ break;
+ default:
+ $result_html =
util_make_links(nl2br(db_result($result, $i ,'description')));
+ }
+
echo '
- <tr><td
colspan="2">'.util_make_links(nl2br(db_result($result,$i,'description'))).'</td></tr>';
+ <tr><td colspan="2">'.$result_html.'</td></tr>';
}
echo $HTML->listTableBottom();
}
diff --git a/src/www/snippet/detail.php b/src/www/snippet/detail.php
index b07ce14..193aae3 100644
--- a/src/www/snippet/detail.php
+++ b/src/www/snippet/detail.php
@@ -4,7 +4,7 @@
*
* Copyright 1999-2001 (c) VA Linux Systems
* Copyright 2013, French Ministry of National Education
- * Copyright 2014,2016, Franck Villaume - TrivialDev
+ * Copyright 2014,2016-2017, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -57,24 +57,22 @@ if ($type=='snippet') {
$rows=db_numrows($result);
if (!$result || $rows < 1) {
- echo $HTML->error_msg(_('Error: no versions found'));
+ echo $HTML->error_msg(_('Error')._(': ')._('no versions
found'));
} else {
- echo '
- <h3>' ._('Versions Of This Snippet:').'</h3>
- <p>';
- $title_arr=array();
- $title_arr[]= _('Snippet ID');
- $title_arr[]= _('Download Version');
- $title_arr[]= _('Date Posted');
- $title_arr[]= _('Author');
- $title_arr[]= _('Delete');
+ echo html_e('h3', array(), _('Versions Of This
Snippet')._(':'));
+ $title_arr = array();
+ $title_arr[] = _('Snippet ID');
+ $title_arr[] = _('Download Version');
+ $title_arr[] = _('Date Posted');
+ $title_arr[] = _('Author');
+ $title_arr[] = _('Delete');
echo $HTML->listTableTop($title_arr);
/*
get the newest version of this snippet, so we can
display its code
*/
- $newest_version=db_result($result,0,'snippet_version_id');
+ $newest_version = db_result($result,0,'snippet_version_id');
for ($i=0; $i<$rows; $i++) {
echo '
@@ -94,29 +92,24 @@ if ($type=='snippet') {
echo $HTML->listTableBottom();
- echo '
- </p><p>'._('Download a raw-text version of this code by
clicking on “Download Version”').'
- </p>';
+ echo html_e('p', array(), _('Download a raw-text version of
this code by clicking on “Download Version”'));
/*
show the latest version of this snippet's code
*/
$result=db_query_params ('SELECT code,version FROM snippet_version
WHERE snippet_version_id=$1',
array($newest_version));
+ echo html_e('hr').html_e('h2', array(), _('Latest Snippet
Version')._(': ').db_result($result,0,'version'));
echo '
- <p> </p>
- <hr />
- <h2>'._('Latest Snippet Version:
').db_result($result,0,'version').'</h2>
<p>
- <span class="snippet-detail">'. db_result($result,0,'code') .'
- </span>
+ <span class="snippet-detail"><pre>'.
db_result($result,0,'code') .'
+ </pre></span>
</p>';
/*
Show a link so you can add a new version of this snippet
*/
- echo '
-
<h3>'.util_make_link('/snippet/addversion.php?type=snippet&id='.htmlspecialchars($id),
_('Add a new version')).'</h3>
- <p>' ._('You can submit a new version of this snippet if you have
modified it and you feel it is appropriate to share with others.').'.</p>';
+ echo html_e('h3', array(),
util_make_link('/snippet/addversion.php?type=snippet&id='.htmlspecialchars($id),
_('Add a new version'))).
+ html_e('p', array(), _('You can submit a new version of this
snippet if you have modified it and you feel it is appropriate to share with
others.'));
}
snippet_footer();
diff --git a/src/www/snippet/package.php b/src/www/snippet/package.php
index 0ae50e9..68b18a8 100644
--- a/src/www/snippet/package.php
+++ b/src/www/snippet/package.php
@@ -3,7 +3,7 @@
* Code Snippets Repository
*
* Copyright 1999-2001 (c) VA Linux Systems
- * Copyright 2016, Franck Villaume - TrivialDev
+ * Copyright 2016-2017, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -47,8 +47,8 @@ if (session_loggedin()) {
/*
Create the new package
*/
- $result = db_query_params ('INSERT INTO snippet_package
(category,created_by,name,description,language) VALUES ($1,$2,$3,$4,$5)',
- array ($category,
+ $result = db_query_params('INSERT INTO snippet_package
(category,created_by,name,description,language) VALUES ($1,$2,$3,$4,$5)',
+ array($category,
user_getid(),
htmlspecialchars($name),
htmlspecialchars($description),
@@ -66,8 +66,8 @@ if (session_loggedin()) {
/*
create the snippet package version
*/
- $result = db_query_params ('INSERT INTO
snippet_package_version
(snippet_package_id,changes,version,submitted_by,post_date) VALUES
($1,$2,$3,$4,$5)',
- array
($snippet_package_id,
+ $result = db_query_params('INSERT INTO
snippet_package_version
(snippet_package_id,changes,version,submitted_by,post_date) VALUES
($1,$2,$3,$4,$5)',
+
array($snippet_package_id,
htmlspecialchars($changes),
htmlspecialchars($version),
user_getid(),
@@ -84,8 +84,7 @@ if (session_loggedin()) {
$feedback .= _('Snippet Package Version
Added Successfully.');
//id for this snippet_package_version
- $snippet_package_version_id=
-
db_insertid($result,'snippet_package_version','snippet_package_version_id');
+ $snippet_package_version_id =
db_insertid($result,'snippet_package_version','snippet_package_version_id');
snippet_header(array('title'=>_('Add
snippets to package')));
/*
@@ -138,48 +137,42 @@ function show_add_snippet_box() {
</ol>
<p><?php echo _('<span class="important">Note:</span> You can submit a
new version of an existing package by browsing the library and using the link
on the existing package. You should only use this page if you are submitting an
entirely new package.'); ?>
</p>
- <?php echo $HTML->openForm(array('action' =>
getStringFromServer('PHP_SELF'), 'method' => 'post')); ?>
- <input type="hidden" name="form_key" value="<?php echo
form_generate_key(); ?>"/>
- <input type="hidden" name="post_changes" value="y" />
- <input type="hidden" name="changes" value="<?php echo _('First Posted
Version') ?>" />
+ <?php
+ echo $HTML->openForm(array('action' => getStringFromServer('PHP_SELF'),
'method' => 'post'));
+ echo $HTML->html_input('form_key', '', '', 'hidden',
form_generate_key());
+ echo $HTML->html_input('post_changes', '', '', 'hidden', 'y');
+ echo $HTML->html_input('changes', '', '', 'hidden', _('First Posted
Version'));
+ ?>
<table>
<tr>
<td colspan="2">
- <label for="name"><strong><?php echo
_('Title').utils_requiredField()._(':'); ?></strong></label>
- <br />
- <input id="name" type="text" required="required" name="name"
size="45" maxlength="60" />
+ <?php echo $HTML->html_input('name', '',
_('Title').utils_requiredField()._(': '), 'text', '', array('size' => '45',
'maxlength' => '60', 'required' => 'required')); ?>
</td>
</tr>
<tr>
<td colspan="2">
- <label for="description"><strong><?php echo
_('Description').utils_requiredField()._(':'); ?></strong></label>
- <br />
- <textarea id="description" name="description"
required="required" rows="5" cols="45"></textarea>
+ <?php echo $HTML->html_textarea('description', '',
_('Description').utils_requiredField()._(': '), '', array('rows' => '5', 'cols'
=> '45', 'required' => 'required')); ?>
</td>
</tr>
<tr>
- <td><strong><?php echo _('Language').utils_requiredField()._(':');
?></strong><br />
- <?php echo html_build_select_box_from_array
($SCRIPT_LANGUAGE,'language'); ?>
- <br />
+ <td>
+ <?php echo $HTML->html_select($SCRIPT_LANGUAGE, 'language',
_('Language').utils_requiredField()._(': ')); ?>
<!--<?php echo util_make_link
('/support/?func=addsupport&group_id=1',_('Suggest a Language')); ?>-->
</td>
- <td><strong><?php echo _('Category') ?></strong><?php echo
utils_requiredField(); ?><br />
- <?php echo html_build_select_box_from_array
($SCRIPT_CATEGORY,'category'); ?>
- <br />
+ <td>
+ <?php echo $HTML->html_select($SCRIPT_CATEGORY, 'category',
_('Category').utils_requiredField()._(': ')); ?>
<!--<?php echo util_make_link
('/support/?func=addsupport&group_id=1',_('Suggest a Category')); ?>-->
</td>
</tr>
<tr>
<td colspan="2">
- <label for="version"><strong><?php echo
_('Version').utils_requiredField()._(':'); ?></strong></label>
- <br />
- <input id="version" type="text" required="required"
name="version" size="10" maxlength="15" />
+ <?php echo $HTML->html_input('version', '',
_('Version').utils_requiredField()._(': '), 'text', '', array('size' => '10',
'maxlength' => '15', 'required' => 'required')); ?>
</td>
</tr>
diff --git a/src/www/snippet/snippet_utils.php
b/src/www/snippet/snippet_utils.php
index 21ef86e..4d788f7 100644
--- a/src/www/snippet/snippet_utils.php
+++ b/src/www/snippet/snippet_utils.php
@@ -4,7 +4,7 @@
*
* Copyright 1999-2001 (c) VA Linux Systems - Tim Perdue
* Copyright 2012, Jean-Christophe Masson - French National Education
Department
- * Copyright 2012-2015, Franck Villaume - TrivialDev
+ * Copyright 2012-2015,2017, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -133,29 +133,28 @@ function snippet_footer($params = array()) {
function snippet_show_package_snippets($version) {
global $HTML;
//show the latest version
- $result=db_query_params("SELECT
users.realname,users.user_id,snippet_package_item.snippet_version_id,
snippet_version.version,snippet.name,users.user_name
+ $result = db_query_params('SELECT
users.realname,users.user_id,snippet_package_item.snippet_version_id,
snippet_version.version,snippet.name,users.user_name
FROM
snippet,snippet_version,snippet_package_item,users
WHERE
snippet.snippet_id=snippet_version.snippet_id
AND users.user_id=snippet_version.submitted_by
AND
snippet_version.snippet_version_id=snippet_package_item.snippet_version_id
- AND
snippet_package_item.snippet_package_version_id=$1", array($version));
+ AND
snippet_package_item.snippet_package_version_id=$1', array($version));
- $rows=db_numrows($result);
- echo '<h3>' ._('Snippets In This Package').'</h3>';
-
- $title_arr=array();
- $title_arr[]= _('Snippet ID');
- $title_arr[]= _('Download Version');
- $title_arr[]= _('Title');
- $title_arr[]= _('Author');
+ $rows = db_numrows($result);
+ echo html_e('h3', array(), _('Snippets In This Package'));
if (!$result || $rows < 1) {
echo db_error();
echo $HTML->warning_msg(_('No Snippets Are In This Package
Yet'));
} else {
+ $title_arr = array();
+ $title_arr[] = _('Snippet ID');
+ $title_arr[] = _('Download Version');
+ $title_arr[] = _('Title');
+ $title_arr[] = _('Author');
echo $HTML->listTableTop($title_arr);
//get the newest version, so we can display it's code
- $newest_version=db_result($result,0,'snippet_version_id');
+ $newest_version = db_result($result, 0, 'snippet_version_id');
for ($i=0; $i<$rows; $i++) {
echo '
@@ -173,10 +172,9 @@ function snippet_show_package_snippets($version) {
function snippet_show_package_details($id) {
global $SCRIPT_CATEGORY,$SCRIPT_LANGUAGE;
- $result=db_query_params("SELECT * FROM snippet_package WHERE
snippet_package_id=$1", array($id));
+ $result = db_query_params("SELECT * FROM snippet_package WHERE
snippet_package_id=$1", array($id));
echo '
- <p>
<table class="fullwidth" cellspacing="1" cellpadding="2">
<tr><td colspan="2">
@@ -193,11 +191,21 @@ function snippet_show_package_details($id) {
</td>
</tr>
- <tr><td colspan="2"><br
/><strong>'._('Description')._(':').'</strong><br />
- '. util_make_links(nl2br(db_result($result,0,'description'))).'
+ <tr><td colspan="2"><br />
+ <strong>'._('Description')._(':').'</strong><br />';
+ $parsertype = forge_get_config('snippet_parser_type');
+ switch ($parsertype) {
+ case 'markdown':
+ require_once 'markdown.php';
+ $result_html = Markdown(db_result($result, 0,
'description'));
+ break;
+ default:
+ $result_html = util_make_links(nl2br(db_result($result,
0, 'description')));
+ }
+ echo $result_html.'
</td></tr>
- </table></p>';
+ </table>';
}
@@ -207,7 +215,6 @@ function snippet_show_snippet_details($id) {
$result=db_query_params("SELECT * FROM snippet WHERE snippet_id=$1",
array($id));
echo '
- <p>
<table class="fullwidth" cellspacing="1" cellpadding="2">
<tr><td colspan="2">
@@ -227,11 +234,20 @@ function snippet_show_snippet_details($id) {
</td></tr>
<tr><td colspan="2"><br />
- <strong>'._('Description')._(':').'</strong><br />
- '. util_make_links(nl2br(db_result($result,0,'description'))).'
+ <strong>'._('Description')._(':').'</strong><br />';
+ $parsertype = forge_get_config('snippet_parser_type');
+ switch ($parsertype) {
+ case 'markdown':
+ require_once 'markdown.php';
+ $result_html =
Markdown(db_result($result,0,'description'));
+ break;
+ default:
+ $result_html =
util_make_links(nl2br(db_result($result,0,'description')));
+ }
+ echo $result_html.'
</td></tr>
- </table></p>';
+ </table>';
}
// Local Variables:
diff --git a/src/www/snippet/submit.php b/src/www/snippet/submit.php
index 52c75ba..c224f4d 100644
--- a/src/www/snippet/submit.php
+++ b/src/www/snippet/submit.php
@@ -3,7 +3,7 @@
* Code Snippets Repository
*
* Copyright 1999-2001 (c) VA Linux Systems
- * Copyright 2014,2016, Franck Villaume - TrivialDev
+ * Copyright 2014,2016-2017, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -97,7 +97,7 @@ if (session_loggedin()) {
echo $HTML->openForm(array('action' => getStringFromServer('PHP_SELF'),
'method' => 'post', 'id' => 'snippet_submit'));
echo $HTML->html_input('form_key', '', '', 'hidden',
form_generate_key());
echo $HTML->html_input('post_changes', '', '', 'hidden', 'y');
- echo $HTML->html_input('changes', '', '', 'hidden', 'First Posted
Version');
+ echo $HTML->html_input('changes', '', '', 'hidden', _('First Posted
Version'));
?>
<table>
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=f78147fdb3ada4810eeaf4831b2c4c876a014090
commit f78147fdb3ada4810eeaf4831b2c4c876a014090
Author: Franck Villaume <[email protected]>
Date: Tue Sep 5 09:36:27 2017 +0000
clean html, use html helpers
diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php
index 48d167f..69dbab6 100644
--- a/src/www/include/Layout.class.php
+++ b/src/www/include/Layout.class.php
@@ -781,27 +781,25 @@ abstract class Layout extends FFError {
if (!$id) {
$id = $name;
}
- $return = '<div class="field-holder">
- ';
+ $return = html_ao('div', array('class' => 'field-holder'));
if ($label) {
- $return .= '<label for="' . $id . '">' . $label .
'</label>
- ';
+ $return .= html_e('label', array('for' => $id), $label);
}
- $return .= '<input id="' . $id . '" type="' . $type . '"';
+ $attrs = array('id' => $id, 'type' => $type);
//if input is a submit then name is not present
if ($name) {
- $return .= ' name="' . $name . '"';
+ $attrs['name'] = $name;
}
if ($value) {
- $return .= ' value="' . $value . '"';
+ $attrs['value'] = $value;
}
if (is_array($extra_params)) {
foreach ($extra_params as $key => $extra_params_value) {
- $return .= $key . '="' . $extra_params_value .
'" ';
+ $attrs[$key] = $extra_params_value;
}
}
- $return .= '/>
- </div>';
+ $return .= html_e('input', $attrs);
+ $return .= html_ac(html_ap() -1);
return $return;
}
@@ -840,8 +838,7 @@ abstract class Layout extends FFError {
$return = '<div class="field-holder">
';
if ($label) {
- $return .= '<label for="' . $id . '">' . $label .
'</label>
- ';
+ $return .= html_e('label', array('for' => $id), $label);
}
$return .= '<input id="' . $id . '" type="text" name="' . $name
. '"';
if ($value) {
@@ -871,8 +868,7 @@ abstract class Layout extends FFError {
$return = '<div class="field-holder">
';
if ($label) {
- $return .= '<label for="' . $id . '">' . $label .
'</label>
- ';
+ $return .= html_e('label', array('for' => $id), $label);
}
$return .= '<select name="' . $name . '" id="' . $id . '" ';
if (is_array($extra_params)) {
@@ -908,24 +904,18 @@ abstract class Layout extends FFError {
if (!$id) {
$id = $name;
}
- $return = '<div class="field-holder">
- ';
+ $return = html_ao('div', array('class' => 'field-holder'));
if ($label) {
- $return .= '<label for="' . $id . '">' . $label .
'</label>
- ';
+ $return .= html_e('label', array('for' => $id), $label);
}
- $return .= '<textarea id="' . $id . '" name="' . $name . '" ';
+ $attrs = array('id' => $id, 'name' => $name);
if (is_array($extra_params)) {
foreach ($extra_params as $key => $extra_params_value) {
- $return .= $key . '="' . $extra_params_value .
'" ';
+ $attrs[$key] = $extra_params_value;
}
}
- $return .= '>';
- if ($value) {
- $return .= $value;
- }
- $return .= '</textarea>
- </div>';
+ $return .= html_e('textarea', $attrs, $value, false);
+ $return .= html_ac(html_ap() -1);
return $return;
}
diff --git a/src/www/snippet/submit.php b/src/www/snippet/submit.php
index 5ca3c64..52c75ba 100644
--- a/src/www/snippet/submit.php
+++ b/src/www/snippet/submit.php
@@ -123,13 +123,11 @@ if (session_loggedin()) {
<tr>
<td>
<?php echo $HTML->html_select($SCRIPT_LANGUAGE, 'language',
_('Language').utils_requiredField()._(': ')); ?>
- <br />
<!-- FIXME: Where should this link go to? <?php echo
util_make_link ('/support/?func=addsupport&group_id=1',_('Suggest a
Language')); ?> -->
</td>
<td>
<?php echo $HTML->html_select($SCRIPT_CATEGORY, 'category',
_('Category').utils_requiredField()._(': ')); ?>
- <br />
<!-- FIXME: Where should this link go to? <?php echo
util_make_link ('/support/?func=addsupport&group_id=1',_('Suggest a
Category')); ?> -->
</td>
</tr>
-----------------------------------------------------------------------
Summary of changes:
src/CHANGES | 1 +
src/etc/config.ini.d/defaults.ini | 3 +-
src/www/include/Layout.class.php | 42 +++++++++++-----------------
src/www/snippet/browse.php | 50 +++++++++++++++++++++++----------
src/www/snippet/detail.php | 39 +++++++++++---------------
src/www/snippet/package.php | 45 +++++++++++++-----------------
src/www/snippet/snippet_utils.php | 58 +++++++++++++++++++++++++--------------
src/www/snippet/submit.php | 6 ++--
8 files changed, 128 insertions(+), 116 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits