Revision 13780
Added by Aaron Marcuse-Kubitza over 10 years ago
index.php | ||
---|---|---|
5 | 5 |
|
6 | 6 |
function to_dir($path) { return dirname($path.'_'/*in case no filename*/); } |
7 | 7 |
|
8 |
function by_prefix($url, $main_url=null) |
|
9 |
{ |
|
10 |
if (!isset($main_url)) $main_url = $url; |
|
11 |
|
|
12 |
return function($path) use($url, $main_url) |
|
13 |
{ |
|
14 |
return $path ? $url.$path : $main_url; |
|
15 |
}; |
|
16 |
} |
|
17 |
|
|
18 | 8 |
$h_level = 5; |
19 | 9 |
$root = $_SERVER["SERVER_NAME"].rm_suffix("/", $self_dir)."?"; |
20 |
# instead of PATH_INFO, to support the Apache ErrorDocument directive |
|
21 |
$rel_fs_path = rm_prefix($self_dir, $_SERVER["REQUEST_URI"]); |
|
22 |
$path = parse_dot_path($rel_fs_path); |
|
23 |
$ns = strtolower($path->head); |
|
24 | 10 |
|
25 |
function add_ns($name, $path_pat, $url_func)
|
|
11 |
function add_ns($name, $path_pat) |
|
26 | 12 |
{ |
27 |
global $root, $h_level, $path, $ns; |
|
28 |
if (is_string($url_func)) $url_func = by_prefix($url_func); |
|
13 |
global $root, $h_level, $path; |
|
29 | 14 |
|
30 | 15 |
print("<h".$h_level.' id="'.$name.'">'.$root.'<big><a href="http://'.$root |
31 | 16 |
.$name.'">'.$name."</a></big><i>".$path_pat."</i></h".$h_level.">\n"); |
32 |
if ($ns === strtolower($name)) # found match, so redirect |
|
33 |
{ |
|
34 |
header("Location: ".strip_url($url_func($path->tail))); |
|
35 |
ob_end_flush(); |
|
36 |
exit; |
|
37 |
} |
|
38 | 17 |
} |
39 | 18 |
|
40 | 19 |
function custom_separator($url, $sep, $main_url=null) |
... | ... | |
145 | 124 |
print("<h3>Exchange schemas</h3>"); |
146 | 125 |
{ |
147 | 126 |
print("<blockquote>\n"); |
148 |
add_ns("VegCore", ".term", "https://projects.nceas.ucsb.edu/nceas/projects/bien/wiki/VegCore#");
|
|
149 |
add_ns("DwC", ".term", "http://rs.tdwg.org/dwc/terms/#");
|
|
127 |
add_ns("VegCore", ".term"); |
|
128 |
add_ns("DwC", ".term"); |
|
150 | 129 |
{ |
151 | 130 |
print("<blockquote>\n"); $h_level++; |
152 |
add_ns("DwC.history", ".term", "http://rs.tdwg.org/dwc/terms/history/#");
|
|
131 |
add_ns("DwC.history", ".term"); |
|
153 | 132 |
print("</blockquote>\n"); $h_level--; |
154 | 133 |
} |
155 |
add_ns("TCS", "#/XPath", "http://www.tdwg.org/standards/117/download/#/v101.xsd");
|
|
156 |
add_ns("VegX", "#/XPath", "http://wiki.tdwg.org/twiki/pub/Vegetation/WebHome/VegX_Schema_1.5.3_proposed.zip#/veg.xsd");
|
|
134 |
add_ns("TCS", "#/XPath"); |
|
135 |
add_ns("VegX", "#/XPath"); |
|
157 | 136 |
print("</blockquote>\n"); |
158 | 137 |
} |
159 | 138 |
print("<h3>Aggregators</h3>"); |
160 | 139 |
{ |
161 | 140 |
print("<blockquote>\n"); |
162 |
add_ns("TNRS", ".term", fragment_override("http://tnrs.iplantcollaborative.org/instructions.html", "download_results"));
|
|
141 |
add_ns("TNRS", ".term"); |
|
163 | 142 |
add_ns("VegBank", ".table.column", custom_separator("http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&entity=dba_tabledescription&where=where_tablename&wparam=", |
164 | 143 |
"#", "http://vegbank.org/get/index/dba_tabledescription")); |
165 |
add_ns("SALVIAS", ".table.column", by_prefix($SALVIAS."#Plot_", $SALVIAS));
|
|
144 |
add_ns("SALVIAS", ".table.column"); |
|
166 | 145 |
{ |
167 | 146 |
print("<blockquote>\n"); $h_level++; |
168 |
add_ns("SALVIAS.db", ".table.column", nimoy_db("salvias_plots"));
|
|
169 |
add_ns("SALVIAS.users", ".table.column", nimoy_db("salvias_users"));
|
|
147 |
add_ns("SALVIAS.db", ".table.column"); |
|
148 |
add_ns("SALVIAS.users", ".table.column"); |
|
170 | 149 |
print("</blockquote>\n"); $h_level--; |
171 | 150 |
} |
172 |
add_ns("VegBIEN", ".table.column", phpPgAdmin("http://vegbiendev.nceas.ucsb.edu/phppgadmin/redirect.php?server=localhost%3A5432%3Aallow&database=vegbien&schema=public"));
|
|
173 |
add_ns("BIEN2", "", $nimoy."?target=server_databases.php");
|
|
151 |
add_ns("VegBIEN", ".table.column"); |
|
152 |
add_ns("BIEN2", ""); |
|
174 | 153 |
{ |
175 | 154 |
print("<blockquote>\n"); $h_level++; |
176 |
add_ns("BIEN2.web", ".table.column", nimoy_db("bien_web"));
|
|
177 |
add_ns("BIEN2.core", ".table.column", nimoy_db("bien2"));
|
|
178 |
add_ns("BIEN2.geoscrub", ".table.column", nimoy_db("geoscrub"));
|
|
179 |
add_ns("BIEN2.staging", ".table.column", nimoy_db("bien2_staging"));
|
|
155 |
add_ns("BIEN2.web", ".table.column"); |
|
156 |
add_ns("BIEN2.core", ".table.column"); |
|
157 |
add_ns("BIEN2.geoscrub", ".table.column"); |
|
158 |
add_ns("BIEN2.staging", ".table.column"); |
|
180 | 159 |
print("</blockquote>\n"); $h_level--; |
181 | 160 |
} |
182 | 161 |
print("</blockquote>\n"); |
... | ... | |
184 | 163 |
print("<h3>Primary databases</h3>"); |
185 | 164 |
{ |
186 | 165 |
print("<blockquote>\n"); |
187 |
add_ns("CTFS", "", $Redmine."/wiki/CTFS");
|
|
166 |
add_ns("CTFS", ""); |
|
188 | 167 |
{ |
189 | 168 |
print("<blockquote>\n"); $h_level++; |
190 |
add_ns("CTFS.schema", ".table.column", $Redmine_svn."/inputs/CTFS/_archive/DBv5.txt#");
|
|
191 |
add_ns("CTFS.tables", ".table", fragment_override($Redmine."/wiki/CTFS", "Tables"));
|
|
192 |
add_ns("CTFS.terms", ".term", $Redmine_svn."/inputs/CTFS/_src/ctfs-comments_worksheet.xls#");
|
|
169 |
add_ns("CTFS.schema", ".table.column"); |
|
170 |
add_ns("CTFS.tables", ".table"); |
|
171 |
add_ns("CTFS.terms", ".term"); |
|
193 | 172 |
print("</blockquote>\n"); $h_level--; |
194 | 173 |
} |
195 |
add_ns("IH.db", ".term", $IH_db);
|
|
174 |
add_ns("IH.db", ".term"); |
|
196 | 175 |
print("</blockquote>\n"); |
197 | 176 |
} |
198 | 177 |
print("<h3>People</h3>"); |
199 | 178 |
{ |
200 | 179 |
print("<blockquote>\n"); |
201 |
add_ns("Brad", "", "mailto:bboyleATemail.arizona.edu");
|
|
180 |
add_ns("Brad", ""); |
|
202 | 181 |
{ |
203 | 182 |
print("<blockquote>\n"); $h_level++; |
204 | 183 |
$Brad_Boyle_VegCore = $Redmine_svn."/exchange_schemas/VegCore/Brad_Boyle"; |
205 |
add_ns("Brad.provenance", ".term", $Brad_Boyle_VegCore."/BIEN%20database%20entities%20related%20to%20data%20provenance%20and%20ownership.docx#");
|
|
206 |
add_ns("Brad.identifiers", ".term", $Brad_Boyle_VegCore."/vegbien_identifiers.xlsx#");
|
|
207 |
add_ns("Brad.identifier_examples", ".term", $Brad_Boyle_VegCore."/vegbien_identifier_examples.xlsx#");
|
|
184 |
add_ns("Brad.provenance", ".term"); |
|
185 |
add_ns("Brad.identifiers", ".term"); |
|
186 |
add_ns("Brad.identifier_examples", ".term"); |
|
208 | 187 |
print("</blockquote>\n"); $h_level--; |
209 | 188 |
} |
210 | 189 |
print("</blockquote>\n"); |
Also available in: Unified diff
web/index.php: removed no longer used PHP redirects. these are now handled by Apache .htaccess files instead.