1: <?php
2:
3: function bright_menu_admin() {
4: if (!current_user_can('manage_options')) {
5: wp_die(bright_message('You do not have sufficient permissions to access this page.'));
6: }
7:
8: $users = get_users();
9: ?>
10: <script type="text/javascript">
11: var users = [
12: <?php
13:
14: for($i = 0; $i < count($users); ++$i) {
15: $user = $users[$i];
16: echo("{\n");
17: echo(" name: '$user->user_email',\n");
18: echo(" role: 'unknown',\n");
19: echo("},\n");
20: }
21:
22: ?>
23: ];
24: </script>
25: <?php
26:
27: global $bright_token;
28: $providers = bright_get_course_providers($bright_token);
29: $current_provider_id = get_user_option('bright_course_provider_id');
30: echo 'Course Provider(s): ';
31: for ($i = 0; $i < count($providers); ++$i) {
32: $provider = $providers[$i];
33: if ($provider->id == $current_provider_id)
34: echo htmlspecialchars($provider->name);
35: else {
36: echo '<a href="/wp-admin/admin.php?page=bright_options_admin&course_provider_id='.
37: htmlspecialchars($provider->id).'">'.
38: htmlspecialchars($provider->name).'</a>';
39: }
40: if ($i < count($providers) - 1)
41: echo " | ";
42: }
43: if (!empty($current_provider_id)) {
44: echo " | ";
45: echo '<a href="/wp-admin/admin.php?page=bright_options_admin&clear_course_provider_id=true">Clear Selected Course Provider</a>';
46: }
47:
48:
49: ?>
50: <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
51: <noscript>
52: <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
53: Your web browser must have JavaScript enabled
54: in order for this application to display correctly.
55: </div>
56: </noscript>
57: <div id="bright-settings"></div>
58: <?php
59: }
60: