[Fusionforge-commits] r15396 - branches/Branch_5_2/src/www/admin

Franck VILLAUME nerville at fusionforge.org
Fri Apr 27 10:54:38 CEST 2012


Author: nerville
Date: 2012-04-27 10:54:37 +0200 (Fri, 27 Apr 2012)
New Revision: 15396

Modified:
   branches/Branch_5_2/src/www/admin/admin_table.php
Log:
complete fix #401: delete theme

Modified: branches/Branch_5_2/src/www/admin/admin_table.php
===================================================================
--- branches/Branch_5_2/src/www/admin/admin_table.php	2012-04-27 08:48:32 UTC (rev 15395)
+++ branches/Branch_5_2/src/www/admin/admin_table.php	2012-04-27 08:54:37 UTC (rev 15396)
@@ -137,6 +137,15 @@
 		}
 	}
 
+	if ($unit == "theme") {
+		$result = db_numrows(db_query_params("SELECT theme_id FROM users WHERE theme_id=$1", array($id)));
+		if ($result > 0) {
+			echo '<div class="warning_msg">'.sprintf(_('You can\'t delete the theme %1$s since it\'s currently referenced in a user profile.'), db_result(db_query_params ('select language from users where language = $1',
+			array($id)), 0, 0)).'</div>';
+			return;
+		}
+	}
+
 	$result = db_query_params("SELECT * FROM $table WHERE $primary_key=$1", array($id));
 
 	if ($result) {




More information about the Fusionforge-commits mailing list