[Fusionforge-commits] r9963 - in trunk/gforge: common/include plugins/blocks/common plugins/blocks/www utils

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Jun 2 13:25:49 CEST 2010


Author: lolando
Date: 2010-06-02 13:25:48 +0200 (Wed, 02 Jun 2010)
New Revision: 9963

Modified:
   trunk/gforge/common/include/config-vars.php
   trunk/gforge/plugins/blocks/common/blocksPlugin.class.php
   trunk/gforge/plugins/blocks/www/index.php
   trunk/gforge/utils/migrate-to-ini-files.sh
Log:
Config API: blocks plugin

Modified: trunk/gforge/common/include/config-vars.php
===================================================================
--- trunk/gforge/common/include/config-vars.php	2010-06-02 10:02:29 UTC (rev 9962)
+++ trunk/gforge/common/include/config-vars.php	2010-06-02 11:25:48 UTC (rev 9963)
@@ -256,6 +256,13 @@
 	forge_define_config_item ('engines', 'externalsearch', json_encode($externalSearchEngines)) ;
 }
 
+// Blocks plugin
+if (file_exists ($gfconfig.'plugins/blocks/config.php')) {
+	require_once $gfconfig.'plugins/blocks/config.php' ;
+	
+	forge_define_config_item ('templates', 'blocks', json_encode($plugins_blocks_templates)) ;
+}
+
 // forge_define_config_item ('', 'core', $GLOBALS['sys_']) ;
 
 /* Long-term:

Modified: trunk/gforge/plugins/blocks/common/blocksPlugin.class.php
===================================================================
--- trunk/gforge/plugins/blocks/common/blocksPlugin.class.php	2010-06-02 10:02:29 UTC (rev 9962)
+++ trunk/gforge/plugins/blocks/common/blocksPlugin.class.php	2010-06-02 11:25:48 UTC (rev 9963)
@@ -44,6 +44,8 @@
  * ALONE BASIS."
  */
 
+forge_define_config_item('templates','blocks','{"summary_right":"{boxTop Project}\nEnter your text here\n{boxBottom}","summary_description":"Enter your description here","*":"{boxHeader}Enter your text here{boxFooter}"}');
+
 class blocksPlugin extends Plugin {
 	function blocksPlugin () {
 		$this->Plugin() ;

Modified: trunk/gforge/plugins/blocks/www/index.php
===================================================================
--- trunk/gforge/plugins/blocks/www/index.php	2010-06-02 10:02:29 UTC (rev 9962)
+++ trunk/gforge/plugins/blocks/www/index.php	2010-06-02 11:25:48 UTC (rev 9963)
@@ -328,11 +328,12 @@
 		print "<input type=\"hidden\" name=\"name\" value=\"$name\" />\n";
 
 		// Get default page from the templates defined in the config file.
+		$templates=json_decode(forge_get_config('templates','blocks')) ;
 		if (!$body) {
-			if (isset($plugins_blocks_templates[$name])) {
-				$body = $plugins_blocks_templates[$name];
+			if (isset($templates[$name])) {
+				$body = $templates[$name];
 			} else {
-				$body = $plugins_blocks_templates['*'];
+				$body = $templates['*'];
 			}
 		}
 			

Modified: trunk/gforge/utils/migrate-to-ini-files.sh
===================================================================
--- trunk/gforge/utils/migrate-to-ini-files.sh	2010-06-02 10:02:29 UTC (rev 9962)
+++ trunk/gforge/utils/migrate-to-ini-files.sh	2010-06-02 11:25:48 UTC (rev 9963)
@@ -141,6 +141,8 @@
 
 add_config externalsearch engines >> $tmp
 
+add_config blocks templates >> $tmp
+
 mv $tmp $config_path/zzz-migrated-old-config
 chmod 644 $config_path/zzz-migrated-old-config
 




More information about the Fusionforge-commits mailing list