Merge remote branch 'origin/platal-1.0.0'
[platal.git] / include / common.inc.php
index 54802e7..1634dc7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -23,18 +23,26 @@ function __autoload($cls)
 {
     if (!pl_autoload($cls)) {
         $cls = strtolower($cls);
-        if (substr($cls, 0, 4) == 'ufc_' || substr($cls, 0, 4) == 'ufo_') {
+        if (substr($cls, 0, 4) == 'ufc_' || substr($cls, 0, 4) == 'ufo_' || $cls == 'profilefilter') {
             __autoload('userfilter');
             return;
+        } else if (substr($cls, 0, 4) == 'pfc_'
+                || substr($cls, 0, 4) == 'pfo_'
+                || substr($cls, 0, 8) == 'plfilter') {
+            __autoload('plfilter');
+            return;
+        } else if (substr($cls, 0, 3) == 'de_') {
+            __autoload('direnum');
+            return;
         } else if (substr($cls, -3, 3) == 'req') {
-            @include 'validations.inc.php';
+            include 'validations.inc.php';
             return;
         } else if (substr($cls, 0, 6) == 'banana') {
-            require_once 'banana/banana.inc.php';
+            require_once 'banana/hooks.inc.php';
             Banana::load(substr($cls, 6));
             return;
         }
-        @include "$cls.inc.php";
+        include "$cls.inc.php";
     }
 }