本文整理汇总了PHP中Zend_Gdata_Calendar::newWebContent方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_Calendar::newWebContent方法的具体用法?PHP Zend_Gdata_Calendar::newWebContent怎么用?PHP Zend_Gdata_Calendar::newWebContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Gdata_Calendar
的用法示例。
在下文中一共展示了Zend_Gdata_Calendar::newWebContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: createWebContentEvent
/**
* Creates a new web content event on the authenticated user's default
* calendar with the specified event details. For simplicity, the event
* is created as an all day event and does not include a description.
*
* @param Zend_Http_Client $client The authenticated client object
* @param string $title The event title
* @param string $startDate The start date of the event in YYYY-MM-DD format
* @param string $endDate The end time of the event in HH:MM 24hr format
* @param string $icon URL pointing to a 16x16 px icon representing the event.
* @param string $url The URL containing the web content for the event.
* @param string $height The desired height of the web content pane.
* @param string $width The desired width of the web content pane.
* @param string $type The MIME type of the web content.
* @return string The ID URL for the event.
*/
function createWebContentEvent($client, $title = 'World Cup 2006', $startDate = '2006-06-09', $endDate = '2006-06-09', $icon = 'http://www.google.com/calendar/images/google-holiday.gif', $url = 'http://www.google.com/logos/worldcup06.gif', $height = '120', $width = '276', $type = 'image/gif')
{
$gc = new Zend_Gdata_Calendar($client);
$newEntry = $gc->newEventEntry();
$newEntry->title = $gc->newTitle(trim($title));
$when = $gc->newWhen();
$when->startTime = $startDate;
$when->endTime = $endDate;
$newEntry->when = array($when);
$wc = $gc->newWebContent();
$wc->url = $url;
$wc->height = $height;
$wc->width = $width;
$wcLink = $gc->newLink();
$wcLink->rel = "http://schemas.google.com/gCal/2005/webContent";
$wcLink->title = $title;
$wcLink->type = $type;
$wcLink->href = $icon;
$wcLink->webContent = $wc;
$newEntry->link = array($wcLink);
$createdEntry = $gc->insertEvent($newEntry);
return $createdEntry->id->text;
}