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 07ba8bb60e5c19dbaeae0feb3badd75c0deb16db (commit)
via 26bc80c74069655921cd69d357a7ac15c6333f8e (commit)
via 7e7ab47db00f7ccae2e1e22143075b8b78cb5abd (commit)
via 40bffd3f6df52436e61609d866d1fc628fae0f53 (commit)
from 75c404659cb2f540eeb172eb4de78b2fed5d0f44 (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=07ba8bb60e5c19dbaeae0feb3badd75c0deb16db
commit 07ba8bb60e5c19dbaeae0feb3badd75c0deb16db
Author: Franck Villaume <[email protected]>
Date: Sun Jul 2 17:37:19 2017 +0200
adjust tips according to parser type
diff --git a/src/plugins/blocks/www/index.php b/src/plugins/blocks/www/index.php
index 19efc37..8278567 100644
--- a/src/plugins/blocks/www/index.php
+++ b/src/plugins/blocks/www/index.php
@@ -309,9 +309,15 @@ if ($type == 'admin') {
print "</div>";
print "<fieldset><legend>".
- _("Tips").
- "</legend>" .
- "<p>" .
+ _("Tips").
+ "</legend>";
+ $parsertype = forge_get_config('parser_type', 'blocks');
+ switch ($parsertype) {
+ case 'markdown':
+ echo html_e('p', array(), _('You can use markdown
format.'));
+ break;
+ default:
+ echo "<p>" .
_("You can create boxes like the ones on the right site
of summary page, by inserting the following sentences in the content:").
"</p><ul><li>".
"{boxTop Hello}".
@@ -329,8 +335,9 @@ if ($type == 'admin') {
_(": will create a footer after a text.").
"</li></ul><p>".
_("You can create as many boxes as you want, but a
boxTop has to be closed by a boxBottom and a boxHeader has to be closed by a
boxFooter.").
- "</p>".
- "</fieldset>";
+ "</p>";
+ }
+ echo '</fieldset>';
} elseif ($type == 'configure_post') {
$res = db_query_params('SELECT id FROM plugin_blocks WHERE group_id=$1
AND name=$2',
array($id, htmlspecialchars($name)));
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=26bc80c74069655921cd69d357a7ac15c6333f8e
commit 26bc80c74069655921cd69d357a7ac15c6333f8e
Author: Franck Villaume <[email protected]>
Date: Sun Jul 2 17:24:38 2017 +0200
blocks plugin: support markdown syntax
diff --git a/autoinstall/install-src.sh b/autoinstall/install-src.sh
index a3c3149..ec6d24d 100755
--- a/autoinstall/install-src.sh
+++ b/autoinstall/install-src.sh
@@ -35,7 +35,7 @@ if [ -e /etc/debian_version ]; then
apache2 postgresql postgresql-contrib libnss-pgsql2 unscd \
cvs subversion viewvc python-pycurl git xinetd \
python-moinmoin libapache2-mod-wsgi python-psycopg2 \
- unoconv poppler-utils dpkg-dev
+ unoconv poppler-utils dpkg-dev php-markdown
if ! dpkg-vendor --is Ubuntu; then
apt-get install locales-all #
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1394929
fi
@@ -62,7 +62,7 @@ else
cvs subversion viewvc python-pycurl git gitweb xinetd \
moin mod_wsgi python-psycopg2 \
unoconv poppler-utils libreoffice-headless \
- mediawiki
+ mediawiki php-markdown
fi
(
diff --git a/src/CHANGES b/src/CHANGES
index bf81925..54c45aa 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -19,6 +19,7 @@ FusionForge 6.X:
* Layout: new dynamic quickNav menu: based on user activity to select 5 more
visited projects (TrivialDev)
* Plugin AuthBuiltin: add captcha after 3 attempts with the same login [#795]
(TrivialDev)
* Plugin AuthLDAP: support X_FORWARD_USER to delegate authentication and then
retrieve user from LDAP (TrivialDev)
+* Plugin Blocks: support Markdown syntax. (TrivialDev)
* Plugin GlobalActivity: forge-wide aggregation for project activities (Roland
Mas)
* Plugin Mediawiki: support activity for public project (TrivialDev)
* Projects Page: add paging system in full_list and tag_cloud subpages
(TrivialDev)
diff --git a/src/plugins/blocks/common/blocksPlugin.class.php
b/src/plugins/blocks/common/blocksPlugin.class.php
index 6f724ba..c06c83d 100644
--- a/src/plugins/blocks/common/blocksPlugin.class.php
+++ b/src/plugins/blocks/common/blocksPlugin.class.php
@@ -48,16 +48,16 @@ class blocksPlugin extends Plugin {
function __construct() {
parent::__construct();
- $this->name = "blocks";
- $this->text = _("Blocks"); // To show in the tabs, use...
+ $this->name = 'blocks';
+ $this->text = _('Blocks'); // To show in the tabs, use...
$this->pkg_desc =
_("This plugin contains the Blocks subsystem of FusionForge. It allows each
FusionForge project to have its own Blocks, and gives some
control over it to the project's administrator.");
- $this->hooks[] = "groupisactivecheckbox"; // The "use ..."
checkbox in editgroupinfo
- $this->hooks[] = "groupisactivecheckboxpost"; //
- $this->hooks[] = "project_admin_plugins"; // to show up in the
admin page fro group
- $this->hooks[] = "blocks"; // to show up in the admin page fro
group
+ $this->hooks[] = 'groupisactivecheckbox'; // The "use ..."
checkbox in editgroupinfo
+ $this->hooks[] = 'groupisactivecheckboxpost'; //
+ $this->hooks[] = 'project_admin_plugins'; // to show up in the
admin page fro group
+ $this->hooks[] = 'blocks'; // to show up in the admin page fro
group
$this->hooks[] = 'widget_instance';
$this->hooks[] = 'widgets';
}
@@ -74,7 +74,7 @@ control over it to the project's administrator.");
// Check if block is active and if yes, display the block.
// Return true if plugin is active, false otherwise.
$group = group_get_object($GLOBALS['group_id']);
- if ($group && $group->usesPlugin ( $this->name )) {
+ if ($group && $group->usesPlugin($this->name)) {
$content = $this->renderBlock($params);
if ($content !== false) {
echo $content;
@@ -88,14 +88,14 @@ control over it to the project's administrator.");
$group_id = $GLOBALS['group_id'];
$res = db_query_params('SELECT title
FROM plugin_blocks
- WHERE group_id=$1
- AND name=$2
- AND status=1',
+ WHERE group_id = $1
+ AND name = $2
+ AND status = 1',
array($group_id, $name)); // 1 is for active
- if (db_numrows($res)== 0) {
+ if (db_numrows($res) == 0) {
return false;
} else {
- return db_result($res,0,"title");
+ return db_result($res, 0, 'title');
}
}
@@ -103,14 +103,14 @@ control over it to the project's administrator.");
$group_id = $GLOBALS['group_id'];
$res = db_query_params('SELECT content
FROM plugin_blocks
- WHERE group_id=$1
- AND name=$2
- AND status=1',
+ WHERE group_id = $1
+ AND name = $2
+ AND status = 1',
array($group_id, $name)); // 1 is for active
- if (db_numrows($res)== 0) {
+ if (db_numrows($res) == 0) {
return false;
} else {
- return db_result($res,0,"content");
+ return db_result($res, 0, 'content');
}
}
function renderBlock($name) {
@@ -127,18 +127,25 @@ control over it to the project's administrator.");
function parseContent($text) {
global $HTML;
-
- $text = preg_replace_callback('/<p>{boxTop (.*?)}<\/p>/i',
function($m) { return $HTML->boxTop($m[1]); }, $text);
- $text = preg_replace_callback('/{boxTop (.*?)}/i', function($m)
{ $HTML->boxTop($m[1]); }, $text);
- $text = preg_replace_callback('/<p>{boxMiddle (.*?)}<\/p>/i',
function($m) { $HTML->boxMiddle($m[1]); }, $text);
- $text = preg_replace_callback('/{boxMiddle (.*?)}/i',
function($m) { $HTML->boxMiddle($m[1]); }, $text);
- $text = preg_replace('/<p>{boxBottom}<\/p>/i',
$HTML->boxBottom(), $text);
- $text = preg_replace('/{boxBottom}/i', $HTML->boxBottom(),
$text);
-
- $text = preg_replace('/<p>{boxHeader}/i', '<hr />', $text);
- $text = preg_replace('/{boxHeader}/i', '<hr />', $text);
- $text = preg_replace('/{boxFooter}<\/p>/i', '<hr />', $text);
- $text = preg_replace('/{boxFooter}/i', '<hr />', $text);
+ $parsertype = forge_get_config('parser_type', 'blocks');
+ switch ($parsertype) {
+ case 'markdown':
+ require_once 'Michelf/Markdown.inc.php';
+ $text =
\Michelf\Markdown::defaultTransform($text);
+ break;
+ default:
+ $text = preg_replace_callback('/<p>{boxTop
(.*?)}<\/p>/i', function($m) { global $HTML; return $HTML->boxTop($m[1]); },
$text);
+ $text = preg_replace_callback('/{boxTop
(.*?)}/i', function($m) { global $HTML; return $HTML->boxTop($m[1]); }, $text);
+ $text = preg_replace_callback('/<p>{boxMiddle
(.*?)}<\/p>/i', function($m) { global $HTML; return $HTML->boxMiddle($m[1]); },
$text);
+ $text = preg_replace_callback('/{boxMiddle
(.*?)}/i', function($m) { global $HTML; return $HTML->boxMiddle($m[1]); },
$text);
+ $text =
preg_replace_callback('/<p>{boxBottom}<\/p>/i', function($m) { global $HTML;
return $HTML->boxBottom($m[1]); }, $text);
+ $text = preg_replace_callback('/{boxBottom}/i',
function($m) { global $HTML; return $HTML->boxBottom($m[1]); }, $text);
+
+ $text = preg_replace('/<p>{boxHeader}/i', '<hr
/>', $text);
+ $text = preg_replace('/{boxHeader}/i', '<hr
/>', $text);
+ $text = preg_replace('/{boxFooter}<\/p>/i',
'<hr />', $text);
+ $text = preg_replace('/{boxFooter}/i', '<hr
/>', $text);
+ }
return $text;
}
diff --git a/src/plugins/blocks/common/blocks_Widget_HomeSummary.class.php
b/src/plugins/blocks/common/blocks_Widget_HomeSummary.class.php
index 66307ef..76446f5 100644
--- a/src/plugins/blocks/common/blocks_Widget_HomeSummary.class.php
+++ b/src/plugins/blocks/common/blocks_Widget_HomeSummary.class.php
@@ -41,7 +41,7 @@ class blocks_Widget_HomeSummary extends Widget {
}
function getDescription() {
- return _("Add a free block on the forge homepage to allow
giving information.");
+ return _('Add a free block on the forge homepage to allow
giving information.');
}
function isUnique() {
@@ -73,7 +73,7 @@ class blocks_Widget_HomeSummary extends Widget {
}
function getInstallPreferences() {
- return $this->getPartialPreferencesForm(_("Enter title of
block"), '');
+ return $this->getPartialPreferencesForm(_('Enter title of
block'), '');
}
function updatePreferences(&$request) {
$done = false;
@@ -128,7 +128,7 @@ class blocks_Widget_HomeSummary extends Widget {
}
function getContent() {
- return $this->content;
+ return
plugin_get_object('blocks')->parseContent($this->content);
}
function destroy($id) {
diff --git a/src/plugins/blocks/common/blocks_Widget_ProjectSummary.class.php
b/src/plugins/blocks/common/blocks_Widget_ProjectSummary.class.php
index 36432a0..2a6fc5f 100644
--- a/src/plugins/blocks/common/blocks_Widget_ProjectSummary.class.php
+++ b/src/plugins/blocks/common/blocks_Widget_ProjectSummary.class.php
@@ -50,6 +50,7 @@ class blocks_Widget_ProjectSummary extends Widget {
function hasPreferences() {
return true;
}
+
private function getPartialPreferencesForm($title, $content) {
$prefs = '<table>';
$prefs .= '<tr><td>'._('Title')._(':').'</td>';
@@ -67,12 +68,15 @@ class blocks_Widget_ProjectSummary extends Widget {
$prefs .= '</table>';
return $prefs;
}
+
function getPreferences() {
return $this->getPartialPreferencesForm($this->getTitle(),
$this->getContent());
}
+
function getInstallPreferences() {
return $this->getPartialPreferencesForm(_("Enter title of
block"), '');
}
+
function updatePreferences(&$request) {
$done = false;
$vContentId = new Valid_UInt('content_id');
@@ -106,6 +110,7 @@ class blocks_Widget_ProjectSummary extends Widget {
}
return $done;
}
+
function loadContent($id) {
$group = group_get_object($this->group_id);
if ( $group && $group->usesPlugin ('blocks') ) {
@@ -114,6 +119,7 @@ class blocks_Widget_ProjectSummary extends Widget {
$this->content_id = $id;
}
}
+
function create(&$request) {
$title = getStringFromRequest('title');
$content = getStringFromRequest('body');
@@ -125,13 +131,16 @@ class blocks_Widget_ProjectSummary extends Widget {
array('summary_block'.$content_id, $content_id));
return $content_id;
}
+
function getContent() {
- return $this->content;
+ return
plugin_get_object('blocks')->parseContent($this->content);
}
+
function destroy($id) {
$sql = 'DELETE FROM plugin_blocks WHERE id = $1 AND group_id =
$2';
db_query_params($sql,array($id,$this->group_id));
}
+
function isUnique() {
return false;
}
diff --git a/src/plugins/blocks/etc/blocks.ini
b/src/plugins/blocks/etc/blocks.ini
index f4d75e4..d9c018c 100644
--- a/src/plugins/blocks/etc/blocks.ini
+++ b/src/plugins/blocks/etc/blocks.ini
@@ -3,9 +3,13 @@
; Current blocks is valid
; plugin_status is a string.
; valid means : production ready.
-; Any other strings means it's under work or broken and plugin
+; Any other strings means it's under work or broken and plugin
; is available in installation_environment = development only.
plugin_status = valid
summary_description = "Enter your description here"
default = "{boxHeader}Enter your text here{boxFooter}"
+
+; to enable markdown parsing, uncomment the following lines
+;parser_type = 'markdown'
+;default = "Use markdown syntax to enter your text here."
diff --git a/src/plugins/blocks/www/index.php b/src/plugins/blocks/www/index.php
index 0522ed4..19efc37 100644
--- a/src/plugins/blocks/www/index.php
+++ b/src/plugins/blocks/www/index.php
@@ -172,14 +172,14 @@ $group = group_get_object($id);
if ( !$group) {
exit_no_group();
}
-if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the
blocks plugin active
- exit_error(sprintf(_('First activate the %s plugin through the
Project\'s Admin Interface'),$pluginname),'home');
+if (!$group->usesPlugin($pluginname)) {//check if the group has the blocks
plugin active
+ exit_error(sprintf(_('First activate the %s plugin through the
Project\'s Admin Interface'), $pluginname), 'home');
}
session_require_perm ('project_admin', $id) ;
if ($type == 'admin') {
- blocks_Project_Header(array('title' => _('Blocks Administration'),
'pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));
+ blocks_Project_Header(array('title' => _('Blocks Administration'),
'pagename' => $pluginname, 'sectionvals' => array(group_getname($id))));
$res = db_query_params('SELECT name, status FROM plugin_blocks WHERE
group_id=$1',
array($id));
@@ -189,9 +189,9 @@ if ($type == 'admin') {
print _("Blocks are customizable HTML boxes in the left or right side
of the pages the web site. They are created manually.");
echo $HTML->openForm(array('action' => '/plugins/blocks/', 'method' =>
'post'));
- print "<input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
- print "<input type=\"hidden\" name=\"pluginname\" value=\"$pluginname\"
/>\n";
- print "<input type=\"hidden\" name=\"type\" value=\"admin_post\" />\n";
+ echo html_e('input', array('type' => 'hidden', 'name' => 'id', 'value'
=> $id));
+ echo html_e('input', array('type' => 'hidden', 'name' => 'pluginname',
'value' => $pluginname));
+ echo html_e('input', array('type' => 'hidden', 'name' => 'type',
'value' => 'admin_post'));
$thArray = array(_('Name'), _('Active'), _('Description'),
_('Operation'));
echo $HTML->listTableTop($thArray, array(), 'centered listing');
@@ -259,7 +259,7 @@ if ($type == 'admin') {
$feedback = _('Block Saved');
session_redirect('/plugins/blocks/?id='.$id.'&type=admin&pluginname=blocks');
} elseif ($type == 'configure') {
- blocks_Project_Header(array('title'=>_('Edit Block'),
'pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));
+ blocks_Project_Header(array('title'=>_('Edit Block'), 'pagename' =>
$pluginname, 'sectionvals' => array(group_getname($id))));
// DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
$blocks = getAvailableBlocks($group);
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=7e7ab47db00f7ccae2e1e22143075b8b78cb5abd
commit 7e7ab47db00f7ccae2e1e22143075b8b78cb5abd
Author: Franck Villaume <[email protected]>
Date: Sun Jul 2 17:22:37 2017 +0200
use simple quote
diff --git a/src/common/tracker/actions/ind.php
b/src/common/tracker/actions/ind.php
index 37296b2..8908dfe 100644
--- a/src/common/tracker/actions/ind.php
+++ b/src/common/tracker/actions/ind.php
@@ -67,7 +67,7 @@ if ($group->usesPlugin('projects-hierarchy')) {
if (count($at_arr) < 1) {
echo $localInformation;
} else {
- plugin_hook ("blocks", "tracker index");
+ plugin_hook('blocks', 'tracker index');
echo html_e('p', array(), _('Choose a tracker and you can
browse/edit/add items to it.'));
/*
Put the result set (list of trackers for this group) into a
column with folders
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=40bffd3f6df52436e61609d866d1fc628fae0f53
commit 40bffd3f6df52436e61609d866d1fc628fae0f53
Author: Franck Villaume <[email protected]>
Date: Sun Jul 2 17:22:19 2017 +0200
add braces {}
diff --git a/src/common/tracker/include/ArtifactTypeHtml.class.php
b/src/common/tracker/include/ArtifactTypeHtml.class.php
index a6a0e0e..1cd1a93 100644
--- a/src/common/tracker/include/ArtifactTypeHtml.class.php
+++ b/src/common/tracker/include/ArtifactTypeHtml.class.php
@@ -114,9 +114,9 @@ class ArtifactTypeHtml extends ArtifactType {
$params['submenu'] = $HTML->subMenu($labels, $links, $attr);
site_project_header($params);
- if ($this)
- plugin_hook("blocks", "tracker_".$this->getName());
-
+ if ($this) {
+ plugin_hook('blocks', 'tracker_'.$this->getName());
+ }
}
function footer($params = array()) {
-----------------------------------------------------------------------
Summary of changes:
autoinstall/install-src.sh | 4 +-
src/CHANGES | 1 +
src/common/tracker/actions/ind.php | 2 +-
.../tracker/include/ArtifactTypeHtml.class.php | 6 +-
src/plugins/blocks/common/blocksPlugin.class.php | 65 ++++++++++++----------
.../common/blocks_Widget_HomeSummary.class.php | 6 +-
.../common/blocks_Widget_ProjectSummary.class.php | 11 +++-
src/plugins/blocks/etc/blocks.ini | 6 +-
src/plugins/blocks/www/index.php | 31 +++++++----
9 files changed, 80 insertions(+), 52 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits