2010-08-12 15:30:20 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
function showForm(id){
|
|
|
|
hideAllForms();
|
|
|
|
form=document.getElementById('settingsContent_'+id);
|
|
|
|
form.setAttribute('class','settingsContent');
|
|
|
|
}
|
|
|
|
|
2010-09-04 21:30:49 +00:00
|
|
|
function showFormInit(){
|
|
|
|
var loc=document.location.toString();
|
|
|
|
if(loc.indexOf('#')!=-1){
|
|
|
|
var id=loc.substring(loc.indexOf('#')+1);
|
|
|
|
showForm(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-12 15:30:20 +00:00
|
|
|
function hideAllForms(){
|
|
|
|
forms=document.getElementById('settingsHolder').childNodes;
|
|
|
|
for(var i=0;i<forms.length;i++){
|
|
|
|
form=forms.item(i);
|
|
|
|
if(form.nodeType==1 && (form.tagName=='div' || form.tagName=='DIV')){
|
|
|
|
form.setAttribute('class','settingsContent hidden');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<div id='settingsNav'>
|
|
|
|
<ul>
|
|
|
|
<?php
|
2010-09-04 17:28:04 +00:00
|
|
|
global $WEBROOT;
|
2010-08-12 15:30:20 +00:00
|
|
|
foreach(OC_CONFIG::$forms as $name=>$url){
|
|
|
|
$clean=strtolower(str_replace(' ','_',$name));
|
2010-09-04 17:28:04 +00:00
|
|
|
echo("<li><a onclick='showForm(\"$clean\")' href='{$WEBROOT}/settings/#$clean'>$name</a></li>\n");
|
2010-08-12 15:30:20 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id='settingsHolder'>
|
|
|
|
<div class='settingsContent'>Settings</div>
|
|
|
|
<?php
|
|
|
|
foreach(OC_CONFIG::$forms as $name=>$url){
|
|
|
|
$clean=strtolower(str_replace(' ','_',$name));
|
|
|
|
echo("<div id='settingsContent_$clean' class='settingsContent hidden'>\n");
|
|
|
|
oc_include($url);
|
|
|
|
echo("</div>\n");
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
2010-09-04 21:30:49 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
OC_onload.add(showFormInit());
|
|
|
|
</script>
|