forked from pureweber/slimevent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
google.php
80 lines (68 loc) · 2.05 KB
/
google.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
session_start();
include('app/lib/google-api/apiClient.php');
include('app/lib/google-api/contrib/apiCalendarService.php');
$apiClient = new apiClient();
$apiClient->setUseObjects(true);
$service = new apiCalendarService($apiClient);
if (isset($_SESSION['oauth_access_token'])) {
$apiClient->setAccessToken($_SESSION['oauth_access_token']);
} else {
$token = $apiClient->authenticate();
$_SESSION['oauth_access_token'] = $token;
}
$calendarList = $service->calendarList->listCalendarList();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Event@HIT</title>
<link type="text/css" rel="stylesheet" href="static/bootstrap/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="static/css/font-awesome.css" />
</head>
<body style="padding-top:70px;">
<div id="wrap">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://event.pureweber.com">工大事件</a>
<ul class="nav">
<li><a href="http://event.pureweber.com">首页</a></li>
<li><a href="#">发现</a></li>
<li><a href="#">我的事件</a></li>
</ul>
</div>
</div>
</div>
<div class="container">
<article class="event">
<h1>欢迎你</h1>
<div class="btn-group">
<a class="btn btn-large" href="cas.php?logout"><i class="icon-user"></i> 退出登陆</a>
<a class="btn btn-large btn-success" href="#"><i class="icon-plus-sign"></i> 发起一个事件</a>
</div>
<ul>
<?php
while(true) {
foreach ($calendarList->getItems() as $calendarListEntry) {
echo '<li>', $calendarListEntry->getSummary(), '</li>';
}
$pageToken = $calendarList->getNextPageToken();
if ($pageToken) {
$optParams = array('pageToken' => $pageToken);
$calendarList = $service->calendarList->listCalendarList($optParams);
} else {
break;
}
}
?>
</ul>
</article>
<footer id="foot">
<p style="text-align:center;">Copyright © PureWeber.com</p>
</footer>
</div><!-- Container -->
</div>
</body>
</html>