<?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
/** 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;