fix toggledesc in PlFilterOrder. Fixes all order bugs in PlSets
[platal.git] / classes / plflagset.php
index 1971751..e18adcf 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
- * Copyright (C) 2003-2008 Polytechnique.org
+ * Copyright (C) 2003-2010 Polytechnique.org
  * http://opensource.polytechnique.org/
  *
  * This program is free software; you can redistribute it and/or modify
@@ -45,12 +45,13 @@ class PlFlagSet
 
 
     /** add flag
-     * @param $flag XXX
+     * @param $flag name of the flag
+     * @param $cond if true, add the flag (default is true), else, ignore.
      * @return VOID
      */
-    public function addFlag($flag)
+    public function addFlag($flag, $cond = true)
     {
-        if (empty($flag)) {
+        if (empty($flag) || !$cond) {
             return;
         }
         $this->values[$flag] = true;