}
+
function currentProject($val = false)
{
// we do need the option for me to look at all projects...
-
+ static $currentProject = false;
if ($val !== false) {
// attempt to set it..
$_SESSION[__CLASS__]['active_project_id'] = $val ;
+ $currentProject = false;
+ // reset to ensure not cached..
}
+ if ($currentProject !== false) {
+ return $currentProject;
+ }
+
$p = DB_DataObject::factory('Projects');
$ar = array();
$_SESSION[__CLASS__]['active_project_id'] = $p->id;
return $p->id; // always allowed..
}
+ $currentProject = $_SESSION[__CLASS__]['active_project_id'];
return $_SESSION[__CLASS__]['active_project_id'];