[Fusionforge-commits] r9490 - in trunk/gforge: . docs/docbook/docbook/user_guide/introduction docs/docbook/docbook/user_guide/project_functions plugins plugins/blocks plugins/blocks/common plugins/blocks/db plugins/blocks/etc plugins/blocks/etc/plugins plugins/blocks/etc/plugins/blocks plugins/blocks/www www/docman/include www/forum www/forum/admin www/forum/include www/frs www/include www/mail www/news www/pm www/pm/include www/project www/scm www/survey

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Wed Apr 14 21:49:57 CEST 2010


Author: aljeux
Date: 2010-04-14 21:49:57 +0200 (Wed, 14 Apr 2010)
New Revision: 9490

Added:
   trunk/gforge/docs/docbook/docbook/user_guide/project_functions/blocks.xml
   trunk/gforge/plugins/blocks/
   trunk/gforge/plugins/blocks/common/
   trunk/gforge/plugins/blocks/common/blocks-init.php
   trunk/gforge/plugins/blocks/common/blocksPlugin.class.php
   trunk/gforge/plugins/blocks/db/
   trunk/gforge/plugins/blocks/db/blocks-init.sql
   trunk/gforge/plugins/blocks/etc/
   trunk/gforge/plugins/blocks/etc/plugins/
   trunk/gforge/plugins/blocks/etc/plugins/blocks/
   trunk/gforge/plugins/blocks/etc/plugins/blocks/config.php
   trunk/gforge/plugins/blocks/www/
   trunk/gforge/plugins/blocks/www/index.php
Modified:
   trunk/gforge/CHANGES
   trunk/gforge/docs/docbook/docbook/user_guide/introduction/introduction.xml
   trunk/gforge/fusionforge-install-2.php
   trunk/gforge/www/docman/include/doc_utils.php
   trunk/gforge/www/forum/admin/index.php
   trunk/gforge/www/forum/include/ForumHTML.class.php
   trunk/gforge/www/forum/index.php
   trunk/gforge/www/frs/index.php
   trunk/gforge/www/include/project_home.php
   trunk/gforge/www/mail/index.php
   trunk/gforge/www/news/index.php
   trunk/gforge/www/pm/include/ProjectGroupHTML.class.php
   trunk/gforge/www/pm/index.php
   trunk/gforge/www/project/request.php
   trunk/gforge/www/scm/index.php
   trunk/gforge/www/survey/index.php
   trunk/gforge/www/survey/survey.php
Log:
New blocks plugin to add HTML blocks on pages

Modified: trunk/gforge/CHANGES
===================================================================
--- trunk/gforge/CHANGES	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/CHANGES	2010-04-14 19:49:57 UTC (rev 9490)
@@ -6,6 +6,8 @@
 * [#127] Patch to auto approve projects.
 * scmgit plugin now allows project members to request a personal git
   repository as a clone of the current project's one
+* New blocks plugin, to add free HTML blocks on top of each tools of the project allowing
+  admins to add free descriptions (Alcate-Lucent), (better with fckeditor plugin).
 
 FusionForge-5.0:
 * New projectlabels plugin, to tag projects with snippets of

Modified: trunk/gforge/docs/docbook/docbook/user_guide/introduction/introduction.xml
===================================================================
--- trunk/gforge/docs/docbook/docbook/user_guide/introduction/introduction.xml	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/docs/docbook/docbook/user_guide/introduction/introduction.xml	2010-04-14 19:49:57 UTC (rev 9490)
@@ -81,6 +81,18 @@
                                         <para>This section describes how to publish new releases of your project.</para>
                                 </listitem>
                         </varlistentry>
+          <varlistentry>
+            <term>
+              <link linkend="ug_project_blocks"> Blocks </link>
+            </term>
+            <listitem>
+              <para>
+        This section describes how to use HTML
+        blocks to customize the appearance of
+        project pages.
+       </para>
+            </listitem>
+          </varlistentry>
 		</variablelist>
 	</section>
 	<section>

Added: trunk/gforge/docs/docbook/docbook/user_guide/project_functions/blocks.xml
===================================================================
--- trunk/gforge/docs/docbook/docbook/user_guide/project_functions/blocks.xml	                        (rev 0)
+++ trunk/gforge/docs/docbook/docbook/user_guide/project_functions/blocks.xml	2010-04-14 19:49:57 UTC (rev 9490)
@@ -0,0 +1,123 @@
+<section id="ug_project_blocks">
+    <title>Blocks</title>
+
+    <section id="ug_project_blocks_introduction">
+        <title>Introduction</title>
+
+        <para>
+	    The Blocks plugin allows the project manager to customize the appearance
+            of the project pages.
+        </para>
+        <para>
+            A block is a piece of HTML that will be displayed (if active) on a predefined location.
+            Predefined location includes: project description and a user blocks (right side)
+            at summary page, and headers on top of each tool (trackers, forums, etc.).
+        </para>
+        <para>
+            In case the HTML project description block is activated, it overwrites the short
+	    project description provided in text mode (the short project description is still
+	    used in the project tree).
+        </para>
+        <note>
+            <para>
+                It is not possible to create a new block.
+            </para>
+        </note>
+    </section>
+
+    <section id="ug_project_blocks_activation_modification">
+        <title>Activating and modifying blocks</title>
+
+        <itemizedlist>
+            <listitem><para>The project administrator logs in
+                            and enters his project.</para></listitem>
+            <listitem><para>He clicks on the '<guimenuitem>Admin</guimenuitem>'
+                            link to enter the administration area.</para></listitem>
+            <listitem><para>He clicks on the '<guimenuitem>Blocks admin</guimenuitem>'
+                            link.</para></listitem>
+            <listitem><para>He can then edit a block to change its content and
+                            also activate or deactivate a block.</para></listitem>
+            <listitem><para>Once submitted, the block is changed.</para></listitem>
+        </itemizedlist>
+        <para>
+            To edit the block, the HTML editor or a simple text area (showing the
+            HTML code) will be used, depending whether the HTML editor is activated or not.
+        </para>
+        <para>
+            You might include images in the block as well as text.
+        </para>
+        <para>
+            It is a good idea to first activate the blocks you want to include, and
+            have a look at the corresponding page before modifying them. This allows you
+            check their placement in the page.
+        </para>
+    </section>
+
+    <section id="ug_project_blocks_macros">
+        <title>Macros</title>
+
+        <para>
+            When you activate a block, a predefined content is provided. The content will
+            use macros.
+        </para>
+        <para>
+            For example, you might have :
+        </para>
+        <para>
+		<filename>{boxHeader}Enter your text here{boxFooter}</filename>
+        </para>
+        <para>
+            We recommend that you use these macros. Use of the macros will guarantee a
+            consistent look and feel.
+        </para>
+
+	<para>
+	    You can create boxes like the ones on the right site of summary page,
+	    by inserting the following sentences in the content:
+        </para>
+
+	<itemizedlist>
+             <listitem><para><filename>{boxTop Hello}</filename>:
+	               will create the top part of the box using <emphasis>Hello</emphasis>
+                       as title.</para>
+             </listitem>
+             <listitem><para><filename>{boxMiddle Here}</filename>:
+                       will create a middle part of a box using <emphasis>Here</emphasis>
+                       as title (optional).</para>
+             </listitem>
+             <listitem><para><filename>{boxBottom}</filename>: 
+                       will create the end part of a box.</para>
+             </listitem>
+        </itemizedlist>
+
+        <itemizedlist>
+             <listitem><para><filename>{boxHeader}</filename>:
+                       will create a header before a text.</para>
+             </listitem>
+             <listitem><para><filename>{boxFooter}</filename>: 
+                       will create a footer after a text.</para>
+             </listitem>
+        </itemizedlist>
+
+        <para>
+            You can create as many boxes as you want, but a <filename>boxTop</filename> 
+            has to be closed by a <filename>boxBottom</filename> 
+            and a <filename>boxHeader</filename> has to be closed by 
+            a <filename>boxFooter</filename>.
+        </para>
+    </section>
+    <section id="ug_project_blocks_examples">
+	<title>Examples</title>
+	<para>
+	    You can, for example, use the summary_right block to display your project logo.
+        </para>
+        <para>
+	    You can use the summary_description block to provide a more complete description
+	    of your project and also links to major project resources.
+	</para>
+	<para>
+	HTML blocks for tools can be used to explain purpose and usage of the different
+       	tools (ex: trackers).
+	</para>	
+    </section>
+</section>

Modified: trunk/gforge/fusionforge-install-2.php
===================================================================
--- trunk/gforge/fusionforge-install-2.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/fusionforge-install-2.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -212,6 +212,10 @@
 	{
 		symlink ("../../plugins/fckeditor/www", "fckeditor");
 	}
+	if (!is_dir("blocks"))
+	{
+		symlink ("../../plugins/blocks/www", "blocks");
+	}
 
 	//cd /opt/gforge
 	chdir("/opt/gforge");

Added: trunk/gforge/plugins/blocks/common/blocks-init.php
===================================================================
--- trunk/gforge/plugins/blocks/common/blocks-init.php	                        (rev 0)
+++ trunk/gforge/plugins/blocks/common/blocks-init.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -0,0 +1,58 @@
+<?php
+
+/*
+ * Copyright (C) 2006 Alain Peyrat, Alcatel-Lucent
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+/*
+ * Standard Alcatel-Lucent disclaimer for contributing to open source
+ *
+ * "The provided file ("Contribution") has not been tested and/or
+ * validated for release as or in products, combinations with products or
+ * other commercial use. Any use of the Contribution is entirely made at
+ * the user's own responsibility and the user can not rely on any features,
+ * functionalities or performances Alcatel-Lucent has attributed to the
+ * Contribution.
+ *
+ * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
+ * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
+ * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
+ * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
+ * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
+ * ALONE BASIS."
+ */
+
+global $gfplugins;
+require_once $gfplugins.'blocks/common/blocksPlugin.class.php';
+
+$blocksPluginObject = new blocksPlugin ;
+
+register_plugin ($blocksPluginObject) ;
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Added: trunk/gforge/plugins/blocks/common/blocksPlugin.class.php
===================================================================
--- trunk/gforge/plugins/blocks/common/blocksPlugin.class.php	                        (rev 0)
+++ trunk/gforge/plugins/blocks/common/blocksPlugin.class.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -0,0 +1,156 @@
+<?php
+
+/*
+ * Copyright (C) 2006 Alain Peyrat, Alcatel-Lucent
+ * Copyright (C) 2010 Alain Peyrat <aljeux at free.fr>
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+/*
+ * Standard Alcatel-Lucent disclaimer for contributing to open source
+ *
+ * "The provided file ("Contribution") has not been tested and/or
+ * validated for release as or in products, combinations with products or
+ * other commercial use. Any use of the Contribution is entirely made at
+ * the user's own responsibility and the user can not rely on any features,
+ * functionalities or performances Alcatel-Lucent has attributed to the
+ * Contribution.
+ *
+ * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
+ * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
+ * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
+ * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
+ * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
+ * ALONE BASIS."
+ */
+
+class blocksPlugin extends Plugin {
+	function blocksPlugin () {
+		$this->Plugin() ;
+		$this->name = "blocks" ;
+		$this->text = "Blocks" ; // To show in the tabs, use...
+		$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
+	}
+
+	function CallHook ($hookname, $params) {
+		global $use_blocksplugin,$G_SESSION,$HTML;
+		$group_id=$params['group'];
+		if ($hookname == "groupisactivecheckbox") {
+			//Check if the group is active
+			// this code creates the checkbox in the project edit public info page to activate/deactivate the plugin
+			$group = &group_get_object($group_id);
+			echo "<tr>";
+			echo "<td>";
+			echo ' <input type="checkbox" name="use_blocksplugin" value="1" ';
+			// checked or unchecked?
+			if ( $group->usesPlugin ( $this->name ) ) {
+				echo "checked=\"checked\"";
+			}
+			echo " /><br/>";
+			echo "</td>";
+			echo "<td>";
+			echo "<strong>Use ".$this->text." Plugin</strong>";
+			echo "</td>";
+			echo "</tr>";
+		} elseif ($hookname == "groupisactivecheckboxpost") {
+			// this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page
+			$group = &group_get_object($group_id);
+			$use_blocksplugin = getStringFromRequest('use_blocksplugin');
+			if ( $use_blocksplugin == 1 ) {
+				$group->setPluginUse ( $this->name );
+			} else {
+				$group->setPluginUse ( $this->name, false );
+			}
+		} elseif ($hookname == "project_admin_plugins") {
+			// this displays the link in the project admin options page to it's  blocks administration
+			$group_id = $params['group_id'];
+			$group = &group_get_object($group_id);
+			if ( $group->usesPlugin ( $this->name ) ) {
+				echo '<p><a href="/plugins/blocks/index.php?id=' . $group->getID() . '&amp;type=admin&amp;pluginname=' . $this->name . '">' . _("Blocks Admin") . '</a></p>';
+			}
+		}												    
+		elseif ($hookname == "blocks") {
+			// 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 ) ) {
+				
+				$c =& $this->renderBlock($params);
+				if ($c !== false) {
+					echo $c;
+					return true;
+				}
+			}
+			return false;
+		} 
+	}
+	
+	function renderBlock($name) {
+		$group_id = $GLOBALS['group_id'];
+		$res = db_query_params('SELECT content
+				FROM plugin_blocks
+				WHERE group_id=$1
+				"AND name=$2
+				"AND status=1',
+				array($group_id, $name)); // 1 is for active
+		if (db_numrows($res)== 0) {
+			return false;
+		} else {
+			$content = db_result($res,0,"content");
+			if ($content) {
+				return $this->parseContent($content).'<br />';
+			} else {
+				return "<table width=\"100%\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\">" .
+						"<tr><td align=\"center\">block: $name</td></tr></table><br />";
+			}
+		}
+	}
+	
+	function parseContent($t) {
+		global $HTML;
+
+		$t =& preg_replace('/<p>{boxTop (.*?)}<\/p>/ie', '$HTML->boxTop("$1")', $t);
+		$t =& preg_replace('/{boxTop (.*?)}/ie', '$HTML->boxTop("$1")', $t);
+		$t =& preg_replace('/<p>{boxMiddle (.*?)}<\/p>/ie', '$HTML->boxMiddle("$1")', $t);
+		$t =& preg_replace('/{boxMiddle (.*?)}/ie', '$HTML->boxMiddle("$1")', $t);
+		$t =& preg_replace('/<p>{boxBottom}<\/p>/i', $HTML->boxBottom(), $t);
+		$t =& preg_replace('/{boxBottom}/i', $HTML->boxBottom(), $t);
+
+		$t =& preg_replace('/<p>{boxHeader}/i', '<hr />', $t);
+		$t =& preg_replace('/{boxHeader}/i', '<hr />', $t);
+		$t =& preg_replace('/{boxFooter}<\/p>/i', '<hr />', $t);
+		$t =& preg_replace('/{boxFooter}/i', '<hr />', $t);
+		
+		return $t;
+	}
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Added: trunk/gforge/plugins/blocks/db/blocks-init.sql
===================================================================
--- trunk/gforge/plugins/blocks/db/blocks-init.sql	                        (rev 0)
+++ trunk/gforge/plugins/blocks/db/blocks-init.sql	2010-04-14 19:49:57 UTC (rev 9490)
@@ -0,0 +1,14 @@
+CREATE SEQUENCE plugin_blocks_pk_seq
+    START WITH 1
+    INCREMENT BY 1
+    MAXVALUE 2147483647
+    NO MINVALUE
+    CACHE 1;
+
+CREATE TABLE plugin_blocks (
+	id integer DEFAULT nextval('plugin_blocks_pk_seq'::text) NOT NULL,
+	group_id integer,
+	name text,
+	content text,
+	status integer
+) ;


Property changes on: trunk/gforge/plugins/blocks/db/blocks-init.sql
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/gforge/plugins/blocks/etc/plugins/blocks/config.php
===================================================================
--- trunk/gforge/plugins/blocks/etc/plugins/blocks/config.php	                        (rev 0)
+++ trunk/gforge/plugins/blocks/etc/plugins/blocks/config.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -0,0 +1,51 @@
+<?php
+
+/*
+ * Copyright (C) 2006 Alain Peyrat, Alcatel-Lucent
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+/*
+ * Standard Alcatel-Lucent disclaimer for contributing to open source
+ *
+ * "The provided file ("Contribution") has not been tested and/or
+ * validated for release as or in products, combinations with products or
+ * other commercial use. Any use of the Contribution is entirely made at
+ * the user's own responsibility and the user can not rely on any features,
+ * functionalities or performances Alcatel-Lucent has attributed to the
+ * Contribution.
+ *
+ * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
+ * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
+ * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
+ * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
+ * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
+ * ALONE BASIS."
+ */
+ 
+$plugins_blocks_templates = array(
+	'summary_right' => "{boxTop Project}\nEnter your text here\n{boxBottom}",
+	'summary_description' => "Enter your description here",
+	'*' => "{boxHeader}Enter your text here{boxFooter}");
+	
+?>

Added: trunk/gforge/plugins/blocks/www/index.php
===================================================================
--- trunk/gforge/plugins/blocks/www/index.php	                        (rev 0)
+++ trunk/gforge/plugins/blocks/www/index.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -0,0 +1,418 @@
+<?php
+
+/*
+ * Copyright (C) 2006 Alain Peyrat, Alcatel-Lucent
+ * Copyright (C) 2010 Alain Peyrat <aljeux at free.fr>
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+/*
+ * Standard Alcatel-Lucent disclaimer for contributing to open source
+ *
+ * "The provided file ("Contribution") has not been tested and/or
+ * validated for release as or in products, combinations with products or
+ * other commercial use. Any use of the Contribution is entirely made at
+ * the user's own responsibility and the user can not rely on any features,
+ * functionalities or performances Alcatel-Lucent has attributed to the
+ * Contribution.
+ *
+ * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
+ * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
+ * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
+ * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
+ * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
+ * ALONE BASIS."
+ */
+
+require_once dirname(__FILE__)."/../../env.inc.php";
+require_once $gfwww.'include/pre.php';
+require_once($sys_plugins_path.'blocks/etc/plugins/blocks/config.php');
+
+require_once $gfcommon.'forum/ForumFactory.class.php';
+require_once $gfcommon.'tracker/ArtifactFactory.class.php';
+require_once $gfcommon.'mail/MailingListFactory.class.php';
+require_once $gfcommon.'pm/ProjectGroupFactory.class.php';
+require_once $gfcommon.'survey/SurveyFactory.class.php';
+
+function getAvailableBlocks($group) {
+	$blocks = array(
+		'summary_description' => 
+			_("Block to replace the default project description with an enhanced one."),
+		'summary_right' => 
+			_("Block in the summary page (right)"),
+		'request_join' => 
+			_("Block to list informations requested to ask to join a project"),
+	);
+	
+	if ($group->usesForum()) {
+		// Get the blocks in the forums.
+		$blocks['forum index'] = _("Display block at the top of the listing");
+		$ff = new ForumFactory($group);
+		foreach ( $ff->getForums() as $f) {
+			$blocks['forum_'.$f->getName()] = _("Display block at the top");
+		}
+	}
+	
+	if ($group->usesTracker()) {
+		// Get the blocks in the trackers.
+		$blocks['tracker index'] = _("Display block at the top of the listing");
+		$ff = new ArtifactTypeFactory($group);
+		foreach ( $ff->getArtifactTypes() as $f) {
+			$blocks['tracker_'.$f->getName()] = _("Display block at the top");
+		}
+	}
+
+	if ($group->usesMail()) {
+		// Get the blocks in the mailing lists.
+		$blocks['mail index'] = _("Display block at the top of the listing");
+		$ff = new MailingListFactory($group);
+		foreach ( $ff->getMailingLists() as $f) {
+			$blocks['mail_'.$f->getName()] = _("Display block at the top");
+		}
+	}
+
+	if ($group->usesPM()) {
+		// Get the blocks in the tasks.
+		$blocks['tasks index'] = _("Display block at the top of the listing");
+		$ff = new ProjectGroupFactory($group);
+		foreach ( $ff->getProjectGroups() as $f) {
+			$blocks['tasks_'.$f->getName()] = _("Display block at the top");
+		}
+	}
+
+	if ($group->usesDocman()) {
+		// Get the blocks in the doc.
+		$blocks['doc index'] = _("Display block at the top of the listing");
+	}
+
+	if ($group->usesSurvey()) {
+		// Get the blocks in the survey.
+		$blocks['survey index'] = _("Display block at the top of the listing");
+		$ff = new SurveyFactory($group);
+		foreach ( $ff->getSurveys() as $f) {
+			$blocks['survey_'.$f->getTitle()] = _("Display block at the top");
+		}
+	}
+
+	if ($group->usesNews()) {
+		// Get the blocks in the news.
+		$blocks['news index'] = _("Display block at the top of the listing");
+	}
+
+	if ($group->usesSCM()) {
+		// Get the blocks in the scm.
+		$blocks['scm index'] = _("Display block at the top of the listing");
+	}
+
+	if ($group->usesFRS()) {
+		// Get the blocks in the files.
+		$blocks['files index'] = _("Display block at the top of the listing");
+	}
+
+	return $blocks;
+}
+
+// the header that displays for the user portion of the plugin
+function blocks_Project_Header($params) {                                                                                                                                         
+	global $DOCUMENT_ROOT,$HTML,$id;
+	$params['toptab']='blocks'; 
+	$params['group']=$id;
+	/*                                                                                                                                                              
+		Show horizontal links                                                                                                                                   
+	*/                                                                                                                                                              
+	site_project_header($params);														
+}
+
+$user = session_get_user(); // get the session user
+
+if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
+	exit_error("Invalid User", "Cannot Process your request for this user.");
+}
+
+$type = getStringFromRequest('type');
+$id = getStringFromRequest('id');
+$pluginname = getStringFromRequest('pluginname');
+$name = getStringFromRequest('name');
+$body = getStringFromRequest('body');
+$activate = getArrayFromRequest('activate');
+
+$blocks_text = array(
+	'forum' => _('Forums'),
+	'tracker' => _('Trackers'),
+	'mail' => _('Lists'),
+	'tasks' => _('Tasks'),
+	'doc' => _('Docs'),
+	'survey' => _('Surveys'),
+	'news' => _('News'),
+	'scm' => _('SCM'),
+	'files' => _('Files')
+);
+
+if (!$type) {
+	exit_error("Cannot Process your request","No TYPE specified"); // you can create items in Base.tab and customize this messages
+} elseif (!$id) {
+	exit_error("Cannot Process your request","No ID specified");
+} else {
+	if ($type == 'group') {
+		$group = group_get_object($id);
+		if ( !$group) {
+			exit_error("Invalid Project", "Inexistent Project");
+		}
+		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the blocks plugin active
+			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+		}
+		$userperm = $group->getPermission($user);//we'll check if the user belongs to the group (optional)
+		if ( !$userperm->IsMember()) {
+				exit_error("Access Denied", "You are not a member of this project");
+		}
+		// other perms checks here...
+		blocks_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));    
+		// DO THE STUFF FOR THE PROJECT PART HERE
+		echo "We are in the Project blocks plugin <br />";
+		echo "Greetings from planet " . $world; // $world comes from the config file in /etc
+	} elseif ($type == 'admin') {
+		$group = group_get_object($id);
+		if ( !$group) {
+			exit_error("Invalid Project", "Inexistent Project");
+		}
+		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the blocks plugin active
+			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+		}
+		$userperm = $group->getPermission($user);//we'll check if the user belongs to the group
+		if ( !$userperm->IsMember()) {
+			exit_error("Access Denied", "You are not a member of this project");
+		}
+		//only project admin can access here
+		if ( $userperm->isAdmin() ) {
+			blocks_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));    
+			// DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
+
+			$res = db_query_params('SELECT name, status FROM plugin_blocks WHERE group_id=$1',
+				array($id));
+			while ($row = db_fetch_array($res)) {
+				$status[ $row['name'] ] = $row['status'];
+			}
+
+			print _("Blocks are customizable HTML boxes in the left or right side of the pages the web site. They are created manually.");
+				
+			print "<form 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";
+
+			print "<table class=\"listing\" align=\"center\">";
+			print "<thead><tr><th>".
+				_("Name").
+				"</th>" .
+				"<th>".
+				_("Active").
+				"</th>" .
+				"<th>" .
+				_("Description").
+				"</th>" .
+				"<th>" .
+				_("Operation") .
+				"</th>" .
+				"</tr></thead>";
+			$blocks = getAvailableBlocks($group);
+			foreach ($blocks as $b => $help) {
+				
+				$class = ($class == 'even') ? "odd" : "even";
+				
+				$match = '';
+				if (preg_match('/(.*) index$/', $b, $match)) {
+					print '<tr><td colspan="4"><b>'.$blocks_text[$match[1]].'</b></td></tr>';
+				}
+				
+				$checked = (isset($status[$b]) && $status[$b] == 1) ? ' checked="checked"' : '';
+				
+				print "<tr class=\"$class\"><td>$b</td>\n" .
+						"<td align=\"center\">" .
+						"<input type=\"checkbox\" name=\"activate[$b]\" value=\"1\"$checked /></td>\n" .
+						"<td>$help</td>\n" .
+						"<td><a href=\"/plugins/blocks/index.php?id=$id&amp;type=configure&amp;pluginname=blocks&amp;name=".urlencode($b)."\">configure</a></td>\n</tr>\n";
+			}
+			print "</table>";
+			print "<p align=\"center\"><input type=\"submit\" value=\"" .
+					_("Save Blocks") .
+					"\" /></p>";
+			print "</form><p />";
+		} else {
+			exit_error("Access Denied", "You are not a project Admin");
+		}
+	} elseif ($type == 'admin_post') {
+		$group = group_get_object($id);
+		if ( !$group) {
+			exit_error("Invalid Project", "Inexistent Project");
+		}
+		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the blocks plugin active
+			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+		}
+		$userperm = $group->getPermission($user);//we'll check if the user belongs to the group
+		if ( !$userperm->IsMember()) {
+			exit_error("Access Denied", "You are not a member of this project");
+		}
+		//only project admin can access here
+		if ( $userperm->isAdmin() ) {
+			$res = db_query_params('SELECT name, status FROM plugin_blocks WHERE group_id=$1',
+				array($id));
+			while ($row = db_fetch_array($res)) {
+				$present[ $row['name'] ] = true;
+				$status[ $row['name'] ] = $row['status'];
+			}
+			$blocks = getAvailableBlocks($group);
+			
+			// Workaround when a block has a name with a &amp; inside.
+			// It seems sadly converted by the form (or php?).
+			foreach ($activate as $k => $v) {
+				$nk = str_replace("&","&amp;", $k);
+				if ($nk !== $k) {
+					$activate[$nk] = $v;
+					unset($activate[$k]);
+				}
+			}
+
+			foreach ($blocks as $b => $help) {
+				
+				if (!$activate[$b])
+					$activate[$b] = 0;
+					
+				if ((!isset($status[$b]) && $activate[$b]) ||
+					 (isset($status[$b]) && $activate[$b] !== $status[$b]))
+					 // Must be updated.
+					 if (!isset($present[$b])) {
+						db_query_params('INSERT INTO plugin_blocks (group_id, name, status)
+							VALUES ($1, $2, $3)',
+							array($id, $b, $activate[$b]));
+					 } else {
+						db_query_params('UPDATE plugin_blocks SET status=$1
+							WHERE group_id=$2 AND name=$3',
+							array($activate[$b], $id, $b));
+					 }
+			}
+			header("Location: /plugins/blocks/index.php?id=$id&type=admin&pluginname=blocks");
+			exit;
+		} else {
+			exit_error("Access Denied", "You are not a project Admin");
+		}
+	} elseif ($type == 'configure') {
+		$group = group_get_object($id);
+		if ( !$group) {
+			exit_error("Invalid Project", "Inexistent Project");
+		}
+		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the blocks plugin active
+			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+		}
+		$userperm = $group->getPermission($user);//we'll check if the user belongs to the group
+		if ( !$userperm->IsMember()) {
+			exit_error("Access Denied", "You are not a member of this project");
+		}
+		//only project admin can access here
+		if ( $userperm->isAdmin() ) {
+			blocks_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));    
+			// DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
+			
+			$res = db_query_params('SELECT content FROM plugin_blocks WHERE group_id=$1 AND name=$2',
+						array($id, $name));
+			$body = db_result($res,0,"content");
+			
+			print _("Edit the block as you want. If you activate the HTML editor, you will be able to use WYSIWYG formatting (bold, colors...)");
+				
+			print "<center>";
+			print "<b>$blocks[$name]</b> ($name)";				
+			print "<form 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=\"configure_post\" />\n";
+			print "<input type=\"hidden\" name=\"name\" value=\"$name\" />\n";
+
+			// Get default page from the templates defined in the config file.
+			if (!$body) {
+				if (isset($plugins_blocks_templates[$name])) {
+					$body = $plugins_blocks_templates[$name];
+				} else {
+					$body = $plugins_blocks_templates['*'];
+				}
+			}
+			
+			$params['body'] = $body;
+			$params['width'] = "800";
+			$params['height'] = "500";
+			$params['group'] = $id;
+			plugin_hook("text_editor",$params);
+			if (!$GLOBALS['editor_was_set_up']) {
+				//if we don't have any plugin for text editor, display a simple textarea edit box
+				echo '<textarea name="body"  rows="20" cols="80">' . $body . '</textarea>';
+			}
+			unset($GLOBALS['editor_was_set_up']);
+
+			print "<br /><input type=\"submit\" value=\"" .
+					_("Save") .
+					"\" />";
+			print "</form>";
+			print "</center>";
+
+			print "<fieldset><legend>".
+				_("Tips").
+				"</legend>" .
+				_("<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}: will create the top part of the box using Hello as title.</li><li>{boxMiddle Here}: will create a middle part of a box using Here as title (optional).</li><li>{boxBottom}: will create the end part of a box.</li></ul><p /><ul><li>{boxHeader}: will create a header before a text.</li><li>{boxFooter}: 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>";
+		} else {
+			exit_error("Access Denied", "You are not a project Admin");
+		}
+	} elseif ($type == 'configure_post') {
+		$group = group_get_object($id);
+		if ( !$group) {
+			exit_error("Invalid Project", "Inexistent Project");
+		}
+		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the blocks plugin active
+			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+		}
+		$userperm = $group->getPermission($user);//we'll check if the user belongs to the group
+		if ( !$userperm->IsMember()) {
+			exit_error("Access Denied", "You are not a member of this project");
+		}
+		//only project admin can access here
+		if ( $userperm->isAdmin() ) {
+			$res = db_query_params('SELECT id FROM plugin_blocks WHERE group_id=$1 AND name=$2',
+						array($id,$name));
+			if (db_numrows($res)== 0) {
+				db_query_params('INSERT INTO plugin_blocks (group_id, name, content)
+					VALUES ($1, $2, $3)',
+					array($id, $name, $body));
+			} else {
+				db_query_params('UPDATE plugin_blocks SET content=$1
+					WHERE group_id=$2 AND name=$3',
+					array($body, $id, $name));
+			}
+			header("Location: /plugins/blocks/index.php?id=$id&type=admin&pluginname=blocks");
+			exit;
+		} else {
+			exit_error("Access Denied", "You are not a project Admin");
+		}
+	}
+}	 
+	
+site_project_footer(array());
+
+?>

Modified: trunk/gforge/www/docman/include/doc_utils.php
===================================================================
--- trunk/gforge/www/docman/include/doc_utils.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/docman/include/doc_utils.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -90,6 +90,9 @@
 		$menu_text,
 		$menu_links
 	);
+
+	plugin_hook ("blocks", "doc index");
+
 }
 
 function doc_droplist_count($l_group_id, $language_id, $g) {

Modified: trunk/gforge/www/forum/admin/index.php
===================================================================
--- trunk/gforge/www/forum/admin/index.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/forum/admin/index.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -480,6 +480,10 @@
 			$fa = new ForumAdmin();
 			$fa->PrintAdminOptions();
 		}
+
+		if ($f)
+			plugin_hook ("blocks", "forum index");
+
 		//
 		//	Get existing forums
 		//

Modified: trunk/gforge/www/forum/include/ForumHTML.class.php
===================================================================
--- trunk/gforge/www/forum/include/ForumHTML.class.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/forum/include/ForumHTML.class.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -130,6 +130,10 @@
 			$menu_links
 		);
 	}
+
+	$pluginManager = plugin_manager_get_object();
+	if ($f && $pluginManager->PluginIsInstalled('blocks') && plugin_hook ("blocks", "forum_".$f->getName()))
+		echo '<br />';
 	
 	if (session_loggedin() ) {
 		if ($f) {

Modified: trunk/gforge/www/forum/index.php
===================================================================
--- trunk/gforge/www/forum/index.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/forum/index.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -58,6 +58,9 @@
 //	echo _('<p>Choose a forum and you can browse, search, and post messages.<p>');
 
 	echo $HTML->subMenu(array(_("My Monitored Forums")),array("/forum/myforums.php?group_id=$group_id"));
+
+	plugin_hook ("blocks", "forum index");
+
 	$tablearr=array(_('Forum'),_('Description'),_('Threads'),_('Posts'), _('Last Post'),_('Moderation Level'));
 	echo $HTML->listTableTop($tablearr);
 

Modified: trunk/gforge/www/frs/index.php
===================================================================
--- trunk/gforge/www/frs/index.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/frs/index.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -62,6 +62,9 @@
 
 frs_header(array('title'=>_('Project Filelist'),'group'=>$group_id));
 
+plugin_hook("blocks", "files index");
+
+
 if ( $num_packages < 1) {
 	echo "<h1>"._('No File Packages')."</h1>";
 	echo "<p><strong>"._('There are no file packages defined for this project.')."</strong>";

Modified: trunk/gforge/www/include/project_home.php
===================================================================
--- trunk/gforge/www/include/project_home.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/include/project_home.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -61,15 +61,19 @@
 // print '<span property="coclico:hosted_by">' ...
 //print '<div property="sioc:has_container" xmlns:sioc="http://rdfs.org/sioc/ns#" content="fusionforge:ForgeProjects" xmlns:fusionforge="http://fusionforge.org/fusionforge#">';
 
-$project_description = $project->getDescription();
-if ($project_description) {
-	// need to use a litteral version for content attribute since nl2br is for HTML
-	print "<p>"
-		.'<span property="doap:description" content="'. preg_quote($project_description,'"') .'">'
-		. nl2br($project_description) 
-		.'</span></p>';
-} else {
-	print "<p>" . _('This project has not yet submitted a description.') . '</p>';
+// Try to display the blocks description first if active.
+$pluginManager = plugin_manager_get_object();
+if (! $pluginManager->PluginIsInstalled('blocks') || !plugin_hook ("blocks", "summary_description")) {
+	$project_description = $project->getDescription();
+	if ($project_description) {
+		// need to use a litteral version for content attribute since nl2br is for HTML
+		print "<p>"
+			.'<span property="doap:description" content="'. preg_quote($project_description,'"') .'">'
+			. nl2br($project_description)
+			.'</span></p>';
+	} else {
+		print "<p>" . _('This project has not yet submitted a description.') . '</p>';
+	}
 }
 
 print "<br />\n";
@@ -159,6 +163,9 @@
 // ########################### Developers on this project
 
 echo '<td>' ;
+
+plugin_hook ("blocks", "summary_right") ;
+
 echo $HTML->boxTop(_('Project Members'), 'Project_Members');
 
 $iam_member = false ;

Modified: trunk/gforge/www/mail/index.php
===================================================================
--- trunk/gforge/www/mail/index.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/mail/index.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -35,6 +35,7 @@
 		'title' => sprintf(_('Mailing Lists for %1$s'), $Group->getPublicName())
 	));
 
+	plugin_hook ("blocks", "mail index");
 
 	$mlArray =& $mlFactory->getMailingLists();
 

Modified: trunk/gforge/www/news/index.php
===================================================================
--- trunk/gforge/www/news/index.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/news/index.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -36,6 +36,8 @@
 news_header(array('title'=>_('News')));
 echo '<h1>' . _('News') . '</h1>';
 
+plugin_hook ("blocks", "news index");
+
 echo _('<p>Choose a News item and you can browse, search, and post messages.</p>');
 
 /*

Modified: trunk/gforge/www/pm/include/ProjectGroupHTML.class.php
===================================================================
--- trunk/gforge/www/pm/include/ProjectGroupHTML.class.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/pm/include/ProjectGroupHTML.class.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -82,6 +82,8 @@
 		echo ($HTML->subMenu($labels,$links));
 	}
 
+	if ($pg)
+		plugin_hook ("blocks", "tasks_".$pg->getName());
 }
 
 function pm_footer($params) {

Modified: trunk/gforge/www/pm/index.php
===================================================================
--- trunk/gforge/www/pm/index.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/pm/index.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -46,6 +46,8 @@
 
 pm_header(array('title'=>_('Subprojects and Tasks')));
 
+plugin_hook("blocks", "tasks index");
+
 $perm =& $g->getPermission( session_get_user() );
 if ($perm->isPMAdmin()) {
 	$menu_text=array();

Modified: trunk/gforge/www/project/request.php
===================================================================
--- trunk/gforge/www/project/request.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/project/request.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -55,6 +55,8 @@
 
 echo '<h1>' . _('Request to join project') . '</h1>';
 
+plugin_hook ("blocks", "request_join");
+
 ?>
 <p><?php 
 $nbadmins = count($group->getAdmins());

Modified: trunk/gforge/www/scm/index.php
===================================================================
--- trunk/gforge/www/scm/index.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/scm/index.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -31,6 +31,8 @@
 $group_id = getIntFromRequest("group_id");
 scm_header(array('title'=>_('SCM Repository'),'group'=>$group_id));
 
+plugin_hook ("blocks", "scm index");
+
 $hook_params = array () ;
 $hook_params['group_id'] = $group_id ;
 plugin_hook ("scm_page", $hook_params) ;

Modified: trunk/gforge/www/survey/index.php
===================================================================
--- trunk/gforge/www/survey/index.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/survey/index.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -48,6 +48,8 @@
 $sh->header(array('title'=>$title));
 echo '<h1>' . $title . '</h1>';
 
+plugin_hook ("blocks", "survey index");
+
 /* Show list of Servey */
 $sf = new SurveyFactory($g);
 $ss = & $sf->getSurveys();

Modified: trunk/gforge/www/survey/survey.php
===================================================================
--- trunk/gforge/www/survey/survey.php	2010-04-14 19:41:53 UTC (rev 9489)
+++ trunk/gforge/www/survey/survey.php	2010-04-14 19:49:57 UTC (rev 9490)
@@ -57,6 +57,7 @@
 if (!$survey_id) {
     echo '<div class="error">'._('For some reason, the Group ID or Survey ID did not make it to this page').'</div>';
 } else {
+	plugin_hook ("blocks", "survey_".$s->getTitle());
     echo($sh->ShowSurveyForm($s));
 }
 




More information about the Fusionforge-commits mailing list