Commit 3180401e authored by David Johnson's avatar David Johnson

Make these work under both php4 and 5 (reserved word and case-insensitive

classnames).
parent 54a55729
......@@ -135,7 +135,7 @@ class Project
function approved() { return $this->field("approved"); }
function inactive() { return $this->field("inactive"); }
function date_inactive() { return $this->field("date_inactive"); }
function public() { return $this->field("public"); }
function ispublic() { return $this->field("public"); }
function public_whynot() { return $this->field("public_whynot"); }
function expt_count() { return $this->field("expt_count"); }
function expt_last() { return $this->field("expt_last"); }
......@@ -594,7 +594,7 @@ class Project
$proj_created = $this->created();
$proj_name = $this->name();
$proj_URL = $this->URL();
$proj_public = YesNo($this->public());
$proj_public = YesNo($this->ispublic());
$proj_funders = $this->funders();
$proj_head_idx = $this->head_idx();
$proj_members = $this->num_members();
......
......@@ -165,38 +165,53 @@ function CreateURL($page_id)
#
$val = $key;
#
# In the cases, use both the lowercased version of the classname
# and the real classname so this works under php4 and php5.
#
switch (get_class($key)) {
case "user":
case "User":
$key = URLARG_UID;
break;
case "project":
case "Project":
$key = URLARG_PID;
break;
case "group":
case "Group":
$key = URLARG_GID;
break;
case "experiment":
case "Experiment":
$key = URLARG_EID;
break;
case "node":
case "Node":
$key = URLARG_NODEID;
break;
case "image":
case "Image":
$key = URLARG_IMAGEID;
break;
case "osinfo":
case "OSinfo":
$key = URLARG_OSID;
break;
case "template":
case "Template":
$key = URLARG_TEMPLATE;
break;
case "templateinstance":
case "TemplateInstance":
$key = URLARG_INSTANCE;
break;
case "templatemetadata":
case "TemplateMetadata":
$key = URLARG_METADATA;
break;
case "logfile":
case "Logfile":
$key = URLARG_LOGFILE;
break;
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment