本文整理汇总了PHP中Zend_Gdata_Calendar类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_Calendar类的具体用法?PHP Zend_Gdata_Calendar怎么用?PHP Zend_Gdata_Calendar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Gdata_Calendar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testNormalWebContentShouldHaveNoExtensionElements
public function testNormalWebContentShouldHaveNoExtensionElements()
{
$this->webContent->url = "http://nowhere.invalid/";
$this->webContent->height = "100";
$this->webContent->width = "200";
$this->assertEquals($this->webContent->url, "http://nowhere.invalid/");
$this->assertEquals($this->webContent->height, "100");
$this->assertEquals($this->webContent->width, "200");
$this->assertEquals(count($this->webContent->extensionElements), 0);
$newWebContent = new Zend_Gdata_Calendar_Extension_WebContent();
$newWebContent->transferFromXML($this->webContent->saveXML());
$this->assertEquals(count($newWebContent->extensionElements), 0);
$newWebContent->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
$this->assertEquals(count($newWebContent->extensionElements), 1);
$this->assertEquals($newWebContent->url, "http://nowhere.invalid/");
$this->assertEquals($newWebContent->height, "100");
$this->assertEquals($newWebContent->width, "200");
/* try constructing using magic factory */
$cal = new Zend_Gdata_Calendar();
$newWebContent2 = $cal->newWebContent();
$newWebContent2->transferFromXML($newWebContent->saveXML());
$this->assertEquals(count($newWebContent2->extensionElements), 1);
$this->assertEquals($newWebContent2->url, "http://nowhere.invalid/");
$this->assertEquals($newWebContent2->height, "100");
$this->assertEquals($newWebContent2->width, "200");
}
示例2: getFeeds
function getFeeds($startdate, $enddate)
{
global $dayinseconds;
$feeds = array();
$calendars = array('facultyadmin@communityhigh.net', 'en.usa%23holiday@group.v.calendar.google.com', 'communityhigh.net_cqt4f59nci2gvtftuqseal396o%40group.calendar.google.com', 'communityhigh.net_5d3b9b97gj76hqmk9ir4s2usm8%40group.calendar.google.com');
foreach ($calendars as $user) {
/* @var $service Zend_Gdata_Calendar */
$service = new Zend_Gdata_Calendar();
/* @var $query Zend_Gdata_Calendar_EventQuery */
$query = $service->newEventQuery();
$query->setUser($user);
$query->setOrderby('starttime');
$query->setSortOrder('ascending');
$query->setMaxResults(100000);
//get days events: event: name, description
$query->setStartMin(date(DATE_RFC3339, $startdate));
$query->setStartMax(date(DATE_RFC3339, $enddate + 6 * $dayinseconds));
try {
$feeds[] = $service->getCalendarEventFeed($query);
//foreach($eventFeed as $event)
// var_dump($event->when);
} catch (Zend_Gdata_App_Exception $e) {
echo "Error: " . $e->getMessage();
}
}
return $feeds;
}
示例3: outputCalendarList
/**
* Outputs an HTML unordered list (ul), with each list item representing a
* calendar in the authenticated user's calendar list.
*
* @param Zend_Http_Client $client The authenticated client object
* @return void
*/
function outputCalendarList($client)
{
$gdataCal = new Zend_Gdata_Calendar($client);
$calFeed = $gdataCal->getCalendarListFeed();
echo "<h1>" . $calFeed->title->text . "</h1>\n";
echo "<ul>\n";
foreach ($calFeed as $calendar) {
echo "\t<li>" . $calendar->title->text . "</li>\n";
}
echo "</ul>\n";
}
示例4: addEvent
function addEvent($title = 'Новый заказ', $desc = 'Описание заказа', $where = 'интернет-магазин', $startDate, $endDate, $sms_reminder)
{
try {
set_include_path('.' . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] . '/modules/gcalendar/' . PATH_SEPARATOR . get_include_path());
include_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_HttpClient');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
$client = Zend_Gdata_ClientLogin::getHttpClient($this->_user, $this->_pass, "cl");
$gdataCal = new Zend_Gdata_Calendar($client);
$newEvent = $gdataCal->newEventEntry();
$newEvent->title = $gdataCal->newTitle($title);
$newEvent->where = array($gdataCal->newWhere($where));
$newEvent->content = $gdataCal->newContent($desc);
$when = $gdataCal->newWhen();
$when->startTime = $startDate;
$when->endTime = $endDate;
if (intval($sms_reminder)) {
$reminder = $gdataCal->newReminder();
$reminder->method = "sms";
$reminder->minutes = "0";
$when->reminders = array($reminder);
}
$newEvent->when = array($when);
$createdEvent = $gdataCal->insertEvent($newEvent);
return $createdEvent->id->text;
} catch (Exception $ex) {
// Report the exception to the user
}
}
示例5: setPlanning
public function setPlanning($startDate, $endDate, $title, $content)
{
// Parameters for ClientAuth authentication
ProjectConfiguration::registerZend();
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$user = sfConfig::get('app_gmail_user');
$pass = sfConfig::get('app_gmail_pwd');
// Create an authenticated HTTP client
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
// Create an instance of the Calendar service
$service = new Zend_Gdata_Calendar($client);
// Create a new entry using the calendar service's magic factory method
$event = $service->newEventEntry();
// Populate the event with the desired information
// Note that each attribute is crated as an instance of a matching class
$event->title = $service->newTitle($title);
$event->where = array($service->newWhere("Paris, France"));
$event->content = $service->newContent($content);
// Set the date using RFC 3339 format.
$tzOffset = "+02";
$when = $service->newWhen();
//$when->startTime = "{$start_date}.000{$tzOffset}:00";
//$when->endTime = "{$end_date}.000{$tzOffset}:00";
$when->startTime = "{$startDate}:00.000{$tzOffset}:00";
$when->endTime = "{$endDate}:00.000{$tzOffset}:00";
$event->when = array($when);
// Upload the event to the calendar server
// A copy of the event as it is recorded on the server is returned
$newEvent = $service->insertEvent($event);
}
示例6: testNormalQuickAddShouldHaveNoExtensionElements
public function testNormalQuickAddShouldHaveNoExtensionElements()
{
$this->quickAdd->value = false;
$this->assertEquals($this->quickAdd->value, false);
$this->assertEquals(count($this->quickAdd->extensionElements), 0);
$newQuickAdd = new Zend_Gdata_Calendar_Extension_QuickAdd();
$newQuickAdd->transferFromXML($this->quickAdd->saveXML());
$this->assertEquals(count($newQuickAdd->extensionElements), 0);
$newQuickAdd->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
$this->assertEquals(count($newQuickAdd->extensionElements), 1);
$this->assertEquals($newQuickAdd->value, false);
/* try constructing using magic factory */
$cal = new Zend_Gdata_Calendar();
$newQuickAdd2 = $cal->newQuickAdd();
$newQuickAdd2->transferFromXML($newQuickAdd->saveXML());
$this->assertEquals(count($newQuickAdd2->extensionElements), 1);
$this->assertEquals($newQuickAdd2->value, false);
}
示例7: testNormalSendEventNotificationsShouldHaveNoExtensionElements
public function testNormalSendEventNotificationsShouldHaveNoExtensionElements()
{
$this->sendEventNotifications->value = true;
$this->assertEquals($this->sendEventNotifications->value, true);
$this->assertEquals(count($this->sendEventNotifications->extensionElements), 0);
$newSendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications();
$newSendEventNotifications->transferFromXML($this->sendEventNotifications->saveXML());
$this->assertEquals(count($newSendEventNotifications->extensionElements), 0);
$newSendEventNotifications->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
$this->assertEquals(count($newSendEventNotifications->extensionElements), 1);
$this->assertEquals($newSendEventNotifications->value, true);
/* try constructing using magic factory */
$cal = new Zend_Gdata_Calendar();
$newSendEventNotifications2 = $cal->newSendEventNotifications();
$newSendEventNotifications2->transferFromXML($newSendEventNotifications->saveXML());
$this->assertEquals(count($newSendEventNotifications2->extensionElements), 1);
$this->assertEquals($newSendEventNotifications2->value, true);
}
示例8: testNormalColorShouldHaveNoExtensionElements
public function testNormalColorShouldHaveNoExtensionElements()
{
$this->color->value = '#abcdef';
$this->assertEquals($this->color->value, '#abcdef');
$this->assertEquals(count($this->color->extensionElements), 0);
$newColor = new Zend_Gdata_Calendar_Extension_Color();
$newColor->transferFromXML($this->color->saveXML());
$this->assertEquals(count($newColor->extensionElements), 0);
$newColor->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
$this->assertEquals(count($newColor->extensionElements), 1);
$this->assertEquals($newColor->value, '#abcdef');
/* try constructing using magic factory */
$cal = new Zend_Gdata_Calendar();
$newColor2 = $cal->newColor();
$newColor2->transferFromXML($newColor->saveXML());
$this->assertEquals(count($newColor2->extensionElements), 1);
$this->assertEquals($newColor2->value, '#abcdef');
}
示例9: testNormalTimezoneShouldHaveNoExtensionElements
public function testNormalTimezoneShouldHaveNoExtensionElements()
{
$this->timezone->value = "America/Chicago";
$this->assertEquals($this->timezone->value, "America/Chicago");
$this->assertEquals(count($this->timezone->extensionElements), 0);
$newTimezone = new Zend_Gdata_Calendar_Extension_Timezone();
$newTimezone->transferFromXML($this->timezone->saveXML());
$this->assertEquals(count($newTimezone->extensionElements), 0);
$newTimezone->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
$this->assertEquals(count($newTimezone->extensionElements), 1);
$this->assertEquals($newTimezone->value, "America/Chicago");
/* try constructing using magic factory */
$cal = new Zend_Gdata_Calendar();
$newTimezone2 = $cal->newTimezone();
$newTimezone2->transferFromXML($newTimezone->saveXML());
$this->assertEquals(count($newTimezone2->extensionElements), 1);
$this->assertEquals($newTimezone2->value, "America/Chicago");
}
示例10: testNormalAccessLevelShouldHaveNoExtensionElements
public function testNormalAccessLevelShouldHaveNoExtensionElements()
{
$this->accessLevel->value = 'freebusy';
$this->assertEquals($this->accessLevel->value, 'freebusy');
$this->assertEquals(count($this->accessLevel->extensionElements), 0);
$newAccessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
$newAccessLevel->transferFromXML($this->accessLevel->saveXML());
$this->assertEquals(count($newAccessLevel->extensionElements), 0);
$newAccessLevel->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
$this->assertEquals(count($newAccessLevel->extensionElements), 1);
$this->assertEquals($newAccessLevel->value, 'freebusy');
/* try constructing using magic factory */
$cal = new Zend_Gdata_Calendar();
$newAccessLevel2 = $cal->newAccessLevel();
$newAccessLevel2->transferFromXML($newAccessLevel->saveXML());
$this->assertEquals(count($newAccessLevel2->extensionElements), 1);
$this->assertEquals($newAccessLevel2->value, 'freebusy');
}
示例11: testNormalLinkShouldHaveNoExtensionElements
public function testNormalLinkShouldHaveNoExtensionElements()
{
$this->link->rel = "http://nowhere.invalid/";
$this->link->title = "Somewhere";
$this->link->href = "http://somewhere.invalid/";
$this->link->type = "text/plain";
$this->link->webContent = new Zend_Gdata_Calendar_Extension_WebContent("a", "1", "2");
$this->assertEquals($this->link->rel, "http://nowhere.invalid/");
$this->assertEquals($this->link->title, "Somewhere");
$this->assertEquals($this->link->href, "http://somewhere.invalid/");
$this->assertEquals($this->link->type, "text/plain");
$this->assertEquals($this->link->webcontent->url, "a");
$this->assertEquals($this->link->webcontent->height, "1");
$this->assertEquals($this->link->webcontent->width, "2");
$this->assertEquals(count($this->link->extensionElements), 0);
$newLink = new Zend_Gdata_Calendar_Extension_Link();
$newLink->transferFromXML($this->link->saveXML());
$this->assertEquals(count($newLink->extensionElements), 0);
$newLink->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
$this->assertEquals(count($newLink->extensionElements), 1);
$this->assertEquals($this->link->rel, "http://nowhere.invalid/");
$this->assertEquals($this->link->title, "Somewhere");
$this->assertEquals($this->link->href, "http://somewhere.invalid/");
$this->assertEquals($this->link->type, "text/plain");
$this->assertEquals($this->link->webcontent->url, "a");
$this->assertEquals($this->link->webcontent->height, "1");
$this->assertEquals($this->link->webcontent->width, "2");
/* try constructing using magic factory */
$cal = new Zend_Gdata_Calendar();
$newLink2 = $cal->newLink();
$newLink2->transferFromXML($newLink->saveXML());
$this->assertEquals(count($newLink2->extensionElements), 1);
$this->assertEquals($this->link->rel, "http://nowhere.invalid/");
$this->assertEquals($this->link->title, "Somewhere");
$this->assertEquals($this->link->href, "http://somewhere.invalid/");
$this->assertEquals($this->link->type, "text/plain");
$this->assertEquals($this->link->webcontent->url, "a");
$this->assertEquals($this->link->webcontent->height, "1");
$this->assertEquals($this->link->webcontent->width, "2");
}
示例12: createEvent
/**
* Creates an event on the authenticated user's default calendar with the
* specified event details.
*
* @param Zend_Http_Client $client The authenticated client object
* @param string $title The event title
* @param string $desc The detailed description of the event
* @param string $where
* @param string $startDate The start date of the event in YYYY-MM-DD format
* @param string $startTime The start time of the event in HH:MM 24hr format
* @param string $endDate The end date of the event in YYYY-MM-DD format
* @param string $endTime The end time of the event in HH:MM 24hr format
* @param string $tzOffset The offset from GMT/UTC in [+-]DD format (eg -08)
* @return string The ID URL for the event.
*/
function createEvent($client, $title = 'Tennis with Beth', $desc = 'Meet for a quick lesson', $where = 'On the courts', $startDate = '2008-01-20', $startTime = '10:00', $endDate = '2008-01-20', $endTime = '11:00', $tzOffset = '-08')
{
$gc = new Zend_Gdata_Calendar($client);
$newEntry = $gc->newEventEntry();
$newEntry->title = $gc->newTitle(trim($title));
$newEntry->where = array($gc->newWhere($where));
$newEntry->content = $gc->newContent($desc);
$newEntry->content->type = 'text';
$when = $gc->newWhen();
$when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
$newEntry->when = array($when);
$createdEntry = $gc->insertEvent($newEntry);
return $createdEntry->id->text;
}
示例13: createEvent
function createEvent($client, $title = 'Tennis with Beth', $desc = 'Meet for a quick lesson', $startDate = '2012-01-20', $endDate = '2012-01-20')
{
$gdataCal = new Zend_Gdata_Calendar($client);
$newEvent = $gdataCal->newEventEntry();
$newEvent->title = $gdataCal->newTitle($title);
//$newEvent->where = array($gdataCal->newWhere($where));
$newEvent->content = $gdataCal->newContent("{$desc}");
$when = $gdataCal->newWhen();
$when->startTime = "{$startDate}";
$when->endTime = "{$endDate}";
$newEvent->when = array($when);
// Upload the event to the calendar server
// A copy of the event as it is recorded on the server is returned
$createdEvent = $gdataCal->insertEvent($newEvent);
return $createdEvent->id->text;
}
示例14: updateEvent
function updateEvent($recordid, $eventOld, $Data, $tzOffset = '+00:00')
{
set_include_path($this->root_directory . "modules/Calendar4You/");
$startDate = $Data["date_start"];
$endDate = $Data["due_date"];
$startTime = $Data["time_start"];
$endTime = $Data["time_end"];
$GCalClass = new Zend_Gdata_Calendar($this->gClient);
$eventOld->title = $GCalClass->newTitle(trim($Data["subject"]));
$eventOld->where = array($GCalClass->newWhere(trim($Data["location"])));
$eventOld->content = $GCalClass->newContent($Data["description"]);
$when = $GCalClass->newWhen();
$when->startTime = $startDate . 'T' . $this->removeLastColon($startTime) . ':00.000' . $tzOffset;
$when->endTime = $endDate . 'T' . $this->removeLastColon($endTime) . ':00.000' . $tzOffset;
$eventOld->when = array($when);
$whos = $this->getInvitedUsersEmails($GCalClass, $recordid);
if (count($whos) > 0) {
$eventOld->setWho($whos);
}
try {
$eventOld->save();
$status = true;
} catch (Zend_Gdata_App_Exception $e) {
$status = null;
}
set_include_path($this->root_directory);
return $status;
}
示例15: isset
// various copy includes
require_once "../../config.gen.inc.php";
require_once "data/data.inc.php";
// records stats
require_once "../page_builder/page_header.php";
// sets up google calendar classes
require_once "lib/google_calendar.init.php";
// libs
require_once "lib/calendar.lib.php";
require_once "lib/textformat.lib.php";
$search_terms = $_REQUEST['filter'];
$search_options = SearchOptions::get_options();
$timeframe = isset($_REQUEST['timeframe']) ? $_REQUEST['timeframe'] : 0;
$dates = SearchOptions::search_dates($timeframe);
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
// predefined service name for calendar
$client = Zend_Gdata_ClientLogin::getHttpClient($username . '@gmail.com', $password, $service);
$gdataCal = new Zend_Gdata_Calendar($client);
$query = $gdataCal->newEventQuery();
$query->setUser($calendars['all']['user']);
$query->setVisibility('private');
$query->setProjection('full');
$query->setOrderby('starttime');
$query->setSortorder('a');
$query->setStartMin($dates['start']);
$query->setStartMax($dates['end']);
$query->setmaxresults('50');
$query->setQuery($search_terms);
$eventFeed = $gdataCal->getCalendarEventFeed($query);
require "templates/{$prefix}/search.html";
$page->output();