<?php
	function main_menu($db, $params) {
		switch ($params['function']) {
			case 'view':
			case 'abort_view_create':
			case 'commit_view_create':
			case 'abort_view_edit':
			case 'commit_view_edit':
			case 'abort_view_delete':
			case 'commit_view_delete':
				main_menu__view($db);
				break;

			case 'abort_group_create':
			case 'commit_group_create':
			case 'view_group':
				main_menu__view_group($db, $params['view'], $params['id']);
				break;

			case 'view_element':
				main_menu__view_element($db, $params['view'], $params['id']);
				break;

			case 'view_interface':
				main_menu__view_interface($db, $params['view'], $params['id']);
				break;

			case 'view_create':
				main_menu__view_create($db, $params['view'], $params['id']);
				break;

			case 'view_edit':
				main_menu__view_edit($db, $params['view'], $params['id']);
				break;

			case 'view_delete':
				main_menu__view_delete($db, $params['view'], $params['id']);
				break;

			case 'group_create':
				main_menu__group_create($db, $params['view'], $params['id']);
				break;

			default:
				main_menu__default();
		}
	}

   function main_menu__view($db) {
      printf("\n<TABLE>\n");
      printf("\t<TR>\n");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "view_create");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "view_edit");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "view_delete");
      printf("\t</TR>\n");
      printf("</TABLE>\n");
   }

	function main_menu__view_element($db, $view, $element) {
      printf("\n<TABLE>\n");
      printf("\t<TR>\n");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "oid_hide");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "oid_unhide");
		printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "interface_hide");
		printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "interface_unhide");
      printf("\t</TR>\n");
      printf("</TABLE>\n");
	}

	function main_menu__view_group($db, $view, $group) {
      printf("\n<TABLE>\n");
      printf("\t<TR>\n");
		printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "view");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "group_create");
     	printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "group_edit"); 
    	printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "group_remove");
      printf("\t</TR>\n");
      printf("</TABLE>\n");
	}

	function main_menu__view_interface($db, $view, $interface) {
      printf("\n<TABLE>\n");
      printf("\t<TR>\n");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "oid_hide");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "oid_unhide");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "ipaddress_hide");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "ipaddress_unhide");
      printf("\t</TR>\n");
      printf("</TABLE>\n");
	}

	function main_menu__default() {
		printf("\n<TABLE>\n");
		printf("\t<TR>\n");
		printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "view");
		printf("\t</TR>\n");
		printf("</TABLE>\n");
	}

	function main_menu__view_create($db, $view, $interface) {
      printf("\n<TABLE>\n");
      printf("\t<TR>\n");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "commit_view_create");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "abort_view_create");
      printf("\t</TR>\n");
      printf("</TABLE>\n");
	}

	function main_menu__view_edit($db, $view, $interface) {
      printf("\n<TABLE>\n");
      printf("\t<TR>\n");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "commit_view_edit");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "abort_view_edit");
      printf("\t</TR>\n");
      printf("</TABLE>\n");
	}

	function main_menu__view_delete($db, $view, $interface) {
      printf("\n<TABLE>\n");
      printf("\t<TR>\n");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "commit_view_delete");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "abort_view_delete");
      printf("\t</TR>\n");
      printf("</TABLE>\n");
	}

	function main_menu__group_create($db, $view, $interface) {
      printf("\n<TABLE>\n");
      printf("\t<TR>\n");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "commit_group_create");
      printf("\t\t<TD><INPUT TYPE=\"submit\" NAME=\"function\" VALUE=\"%s\"></TD>\n", "abort_group_create");
      printf("\t</TR>\n");
      printf("</TABLE>\n");
	}
?>
