diff --git a/api.php b/api.php index 1b72969..462849b 100644 --- a/api.php +++ b/api.php @@ -380,41 +380,48 @@ switch($request[0]) { } echo json_encode($ret); - /* APIDOC: zNOTIMPLEMENTED_school/list + /* APIDOC: school/list + notimplemented description(list schools) return(schools array) */ - /* APIDOC: zNOTIMPLEMENTED_account/edit + /* APIDOC: account/edit + notimplemented description(edit account information) post(account array) return(account array) */ - /* APIDOC: zNOTIMPLEMENTED_user/edit + /* APIDOC: user/edit + notimplemented description(edit user information for current conference) post(user array) return(user array) */ - /* APIDOC: zNOTIMPLEMENTED_user/connect_teacher_to_school + /* APIDOC: user/connect_teacher_to_school + notimplemented description(connects the current users teacher role to the specified school usign the schools access code) post(schools_id integer, accesscode varchar(16)) return(school array) */ - /* APIDOC: zNOTIMPLEMENTED_role/list + /* APIDOC: role/list + notimplemented description(list roles and their corresponding registration types) return(roles array) */ - /* APIDOC: zNOTIMPLEMENTED_role/add + /* APIDOC: role/add + notimplemented post(role_id integer, password varchar(64) optional) description(add a role for the user to the current conference. Depending on the registraiton type, an optional password (singlepassword, schoolpassword, etc) can be specified) return(role array) */ - /* APIDOC: zNOTIMPLEMENTED_role/remove + /* APIDOC: role/remove + notimplemented post(role_id integer) description(remove a role from the user for the current conference) return(role array) diff --git a/apidoc.css b/apidoc.css index fa45a45..f3ef635 100644 --- a/apidoc.css +++ b/apidoc.css @@ -3,11 +3,15 @@ body { color: #666666; } h1 { + font-size: 1.5em; + font-weight: bold; +} +h2 { font-size: 1.2em; font-weight: bold; color: black; } -h2 { +h3 { font-size: 1.0em; font-weight: bold; margin-bottom: 0px; diff --git a/apidoc.php b/apidoc.php index b1ed98f..f8bd78a 100644 --- a/apidoc.php +++ b/apidoc.php @@ -6,6 +6,8 @@ Status\n"; +$numi=count($commands); +$numni=count($nicommands); +$total=$numi+$numni; +$percent=round($numi/$total*100); +echo "$numi of $total implemented ($percent%)
\n"; + +echo "

Basics

\n"; +echo "All API commands return \"status\", which is either \"ok\" or \"error\"
\n"; +echo "If status is \"error\", then the return also contains \"error\" which contains the error message
\n"; + +echo "

Implemented API

\n"; + ksort($commands); foreach($commands AS $c=>$com) { - echo "

".htmlspecialchars($c)."

"; + echo "

".htmlspecialchars($c)."

"; echo "
\n"; echo $com['description']; echo "
"; if(count($com['post'])) { - echo "

Post

\n"; + echo "

Post

\n"; echo ""; } if(count($com['return'])) { - echo "

Return

\n"; + echo "

Return

\n"; echo "
"; } + +echo "

Not Implemented API

\n"; + +ksort($nicommands); +foreach($nicommands AS $c=>$com) { + echo "

".htmlspecialchars($c)."

"; + echo "
\n"; + echo $com['description']; + echo "
"; + if(count($com['post'])) { + echo "

Post

\n"; + echo ""; + } + if(count($com['return'])) { + echo "

Return

\n"; + echo ""; + } + echo "
"; + echo "
"; +} + + + ?>