示例#1
0
function showOrganisationMembersPage($organisations)
{
    $tab_offset = 1;
    $data = array();
    $tabs = array();
    // 		[translate, label, action, type, id, extra GET arguments]
    if (user_access('vals admin register')) {
        $data[] = array(1, t('All Members'), 'showmembers', _ORGANISATION_GROUP, 'all');
        $tabs = array("'mentor_page-{$tab_offset}'");
        $tab_offset++;
    }
    foreach ($organisations as $org) {
        $tabs[] = "'mentor_page-{$tab_offset}'";
        $data[] = array(2, $org->name, 'showmembers', _ORGANISATION_GROUP, $org->org_id);
        $tab_offset++;
    }
    if ($data) {
        $first_tab_group_id = $data[0][4];
        echo renderTabs(--$tab_offset, 'Org', 'mentor_page-', _ORGANISATION_GROUP, $data, null, TRUE, renderUsers(_ORGADMIN_TYPE, '', $first_tab_group_id, _ORGANISATION_GROUP, TRUE) . renderUsers(_MENTOR_TYPE, '', $first_tab_group_id, _ORGANISATION_GROUP, TRUE));
        ?>
		<script type="text/javascript">
			activatetabs('tab_', [<?php 
        echo implode(',', $tabs);
        ?>
]);
		</script>
	<?php 
    } else {
        echo t('You cannot see organisation members at the moment');
    }
}
             echo renderSupervisors($_POST['id']);
         } elseif ($subtype == _INSTADMIN_TYPE) {
             echo renderUsers(_INSTADMIN_TYPE, '', $_POST['id'], _INSTITUTE_GROUP);
         } elseif ($subtype == 'staff') {
             $inst_id = $_POST['id'];
             echo renderUsers(_INSTADMIN_TYPE, '', $inst_id, _INSTITUTE_GROUP, TRUE);
             echo renderUsers(_SUPERVISOR_TYPE, '', $inst_id, _INSTITUTE_GROUP, TRUE);
         } else {
             echo tt('No such type %1$s', $subtype);
         }
     } elseif ($_POST['type'] == _ORGANISATION_GROUP) {
         $organisation_id = altSubValue($_POST, 'id', '');
         if ($organisation_id == 0) {
             $organisation_id = 'all';
         }
         echo renderUsers(_ORGADMIN_TYPE, '', $organisation_id, _ORGANISATION_GROUP, TRUE) . renderUsers(_MENTOR_TYPE, '', $organisation_id, _ORGANISATION_GROUP, TRUE);
     }
     break;
 case 'show':
     $type = altSubValue($_POST, 'type', '');
     $show_action = altSubValue($_POST, 'show_action', 'administer');
     if ($type && in_array($type, array(_INSTITUTE_GROUP, _STUDENT_GROUP))) {
         $derived = deriveTypeAndAction();
         if ($derived['type'] == 'group') {
             $show_action = 'groups';
         }
     }
     $show_last = altSubValue($_POST, 'new_tab', false);
     showRoleDependentAdminPage(getRole(), $show_action, $show_last);
     break;
 case 'view':