[Fusionforge-commits] r10562 - in trunk/plugins: coclico/forumml/include coclico/hudson/include coclico/mailman/include templates/helloworld/include

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Mon Sep 20 22:31:15 CEST 2010


Author: aljeux
Date: 2010-09-20 22:31:15 +0200 (Mon, 20 Sep 2010)
New Revision: 10562

Modified:
   trunk/plugins/coclico/forumml/include/forummlPlugin.class.php
   trunk/plugins/coclico/hudson/include/hudsonPlugin.class.php
   trunk/plugins/coclico/mailman/include/mailmanPlugin.class.php
   trunk/plugins/templates/helloworld/include/helloworldPlugin.class.php
Log:
Less is better: Code moved in the parent Plugin class.

Modified: trunk/plugins/coclico/forumml/include/forummlPlugin.class.php
===================================================================
--- trunk/plugins/coclico/forumml/include/forummlPlugin.class.php	2010-09-20 20:18:55 UTC (rev 10561)
+++ trunk/plugins/coclico/forumml/include/forummlPlugin.class.php	2010-09-20 20:31:15 UTC (rev 10562)
@@ -88,39 +88,6 @@
 			} else {
 				$group->setPluginUse ( $this->name, false );
 			}
-		} elseif ($hookname == "userisactivecheckbox") {
-			//check if user is active
-			// this code creates the checkbox in the user account manteinance page to activate/deactivate the plugin
-			$user = $params['user'];
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="CHECKBOX" name="use_forummlplugin" value="1" ';
-			// CHECKED OR UNCHECKED?
-			if ( $user->usesPlugin ( $this->name ) ) {
-				echo "CHECKED";
-			}
-			echo ">    Use ".$this->text." Plugin";
-			echo "</td>";
-			echo "</tr>";
-		} elseif ($hookname == "userisactivecheckboxpost") {
-			// this code actually activates/deactivates the plugin after the form was submitted in the user account manteinance page
-			$user = $params['user'];
-			$use_mailmanplugin = getStringFromRequest('use_forummlplugin');
-			if ( $use_mailmanplugin == 1 ) {
-				$user->setPluginUse ( $this->name );
-			} else {
-				$user->setPluginUse ( $this->name, false );
-			}
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="CHECKBOX" name="use_forummlplugin" value="1" ';
-			// CHECKED OR UNCHECKED?
-			if ( $user->usesPlugin ( $this->name ) ) {
-				echo "CHECKED";
-			}
-			echo ">    Use ".$this->text." Plugin";
-			echo "</td>";
-			echo "</tr>";
 		} elseif ($hookname == 'search_engines') {
 			$myfile=fopen('/tmp/hook','a');
 			require_once('ForumMLSearchEngine.class.php');

Modified: trunk/plugins/coclico/hudson/include/hudsonPlugin.class.php
===================================================================
--- trunk/plugins/coclico/hudson/include/hudsonPlugin.class.php	2010-09-20 20:18:55 UTC (rev 10561)
+++ trunk/plugins/coclico/hudson/include/hudsonPlugin.class.php	2010-09-20 20:31:15 UTC (rev 10562)
@@ -96,39 +96,6 @@
 			} else {
 				$group->setPluginUse ( $this->name, false );
 			}
-		} elseif ($hookname == "userisactivecheckbox") {
-			//check if user is active
-			// this code creates the checkbox in the user account manteinance page to activate/deactivate the plugin
-			$user = $params['user'];
-			echo "<tr>";
-			echo "<td>";
-			echo '<input type="checkbox" name="use_hudsonplugin" value="1" ';
-			// checked or unchecked?
-			if ( $user->usesPlugin ( $this->name ) ) {
-				echo 'checked="checked"';
-			}
-			echo " />Use ".$this->text." Plugin";
-			echo "</td>";
-			echo "</tr>";
-		} elseif ($hookname == "userisactivecheckboxpost") {
-			// this code actually activates/deactivates the plugin after the form was submitted in the user account maintenance page
-			$user = $params['user'];
-			$use_hudsonplugin = getStringFromRequest('use_hudsonplugin');
-			if ( $use_hudsonplugin == 1 ) {
-				$user->setPluginUse ( $this->name );
-			} else {
-				$user->setPluginUse ( $this->name, false );
-			}
-			echo "<tr>";
-			echo "<td>";
-			echo '<input type="checkbox" name="use_hudsonplugin" value="1" ';
-			// checked or unchecked?
-			if ( $user->usesPlugin ( $this->name ) ) {
-				echo 'checked="checked"';
-			}
-			echo " />Use ".$this->text." Plugin";
-			echo "</td>";
-			echo "</tr>";
 		} elseif ($hookname == "cssfile") {
 			$this->cssFile($params);
 		} elseif ($hookname == "javascript_file") {

Modified: trunk/plugins/coclico/mailman/include/mailmanPlugin.class.php
===================================================================
--- trunk/plugins/coclico/mailman/include/mailmanPlugin.class.php	2010-09-20 20:18:55 UTC (rev 10561)
+++ trunk/plugins/coclico/mailman/include/mailmanPlugin.class.php	2010-09-20 20:31:15 UTC (rev 10562)
@@ -125,39 +125,6 @@
 			} else {
 				$group->setPluginUse ( $this->name, false );
 			}
-		} elseif ($hookname == "userisactivecheckbox") {
-			//check if user is active
-			// this code creates the checkbox in the user account manteinance page to activate/deactivate the plugin
-			$user = $params['user'];
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="CHECKBOX" name="use_mailmanplugin" value="1" ';
-			// CHECKED OR UNCHECKED?
-			if ( $user->usesPlugin ( $this->name ) ) {
-				echo "CHECKED";
-			}
-			echo ">    Use ".$this->text." Plugin";
-			echo "</td>";
-			echo "</tr>";
-		} elseif ($hookname == "userisactivecheckboxpost") {
-			// this code actually activates/deactivates the plugin after the form was submitted in the user account manteinance page
-			$user = $params['user'];
-			$use_mailmanplugin = getStringFromRequest('use_mailmanplugin');
-			if ( $use_mailmanplugin == 1 ) {
-				$user->setPluginUse ( $this->name );
-			} else {
-				$user->setPluginUse ( $this->name, false );
-			}
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="CHECKBOX" name="use_mailmanplugin" value="1" ';
-			// CHECKED OR UNCHECKED?
-			if ( $user->usesPlugin ( $this->name ) ) {
-				echo "CHECKED";
-			}
-			echo ">    Use ".$this->text." Plugin";
-			echo "</td>";
-			echo "</tr>";
 		} elseif ($hookname == "user_personal_links") {
 			// this displays the link in the user�s profile page to it�s personal mailman (if you want other sto access it, youll have to change the permissions in the index.php
 			$userid = $params['user_id'];

Modified: trunk/plugins/templates/helloworld/include/helloworldPlugin.class.php
===================================================================
--- trunk/plugins/templates/helloworld/include/helloworldPlugin.class.php	2010-09-20 20:18:55 UTC (rev 10561)
+++ trunk/plugins/templates/helloworld/include/helloworldPlugin.class.php	2010-09-20 20:31:15 UTC (rev 10562)
@@ -93,39 +93,6 @@
 			} else {
 				$group->setPluginUse ( $this->name, false );
 			}
-		} elseif ($hookname == "userisactivecheckbox") {
-			//check if user is active
-			// this code creates the checkbox in the user account manteinance page to activate/deactivate the plugin
-			$user = $params['user'];
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="checkbox" name="use_helloworldplugin" value="1" ';
-			// checked or unchecked?
-			if ( $user->usesPlugin ( $this->name ) ) {
-				echo "checked";
- 			}
-			echo " />    Use ".$this->text." Plugin";
-			echo "</td>";
-			echo "</tr>";
-		} elseif ($hookname == "userisactivecheckboxpost") {
-			// this code actually activates/deactivates the plugin after the form was submitted in the user account manteinance page
-			$user = $params['user'];
-			$use_helloworldplugin = getStringFromRequest('use_helloworldplugin');
-			if ( $use_helloworldplugin == 1 ) {
-				$user->setPluginUse ( $this->name );
-			} else {
-				$user->setPluginUse ( $this->name, false );
-			}
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="checkbox" name="use_helloworldplugin" value="1" ';
-			// checked or unchecked?
-			if ( $user->usesPlugin ( $this->name ) ) {
-				echo "checked";
-			}
-			echo " />    Use ".$this->text." Plugin";
-			echo "</td>";
-			echo "</tr>";
 		} elseif ($hookname == "user_personal_links") {
 			// this displays the link in the user's profile page to it's personal HelloWorld (if you want other sto access it, youll have to change the permissions in the index.php
 			$userid = $params['user_id'];




More information about the Fusionforge-commits mailing list