|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Photos.php'; 00028 00032 require_once 'Zend/Gdata/Feed.php'; 00033 00037 require_once 'Zend/Gdata/Photos/PhotoEntry.php'; 00038 00052 class Zend_Gdata_Photos_PhotoFeed extends Zend_Gdata_Feed 00053 { 00054 00060 protected $_gphotoId = null; 00061 00067 protected $_gphotoAlbumId = null; 00068 00074 protected $_gphotoVersion = null; 00075 00081 protected $_gphotoWidth = null; 00082 00088 protected $_gphotoHeight = null; 00089 00095 protected $_gphotoSize = null; 00096 00102 protected $_gphotoClient = null; 00103 00109 protected $_gphotoChecksum = null; 00110 00116 protected $_gphotoTimestamp = null; 00117 00123 protected $_gphotoCommentCount = null; 00124 00130 protected $_gphotoCommentingEnabled = null; 00131 00137 protected $_mediaGroup = null; 00138 00139 protected $_entryClassName = 'Zend_Gdata_Photos_PhotoEntry'; 00140 protected $_feedClassName = 'Zend_Gdata_Photos_PhotoFeed'; 00141 00142 protected $_entryKindClassMapping = array( 00143 'http://schemas.google.com/photos/2007#comment' => 'Zend_Gdata_Photos_CommentEntry', 00144 'http://schemas.google.com/photos/2007#tag' => 'Zend_Gdata_Photos_TagEntry' 00145 ); 00146 00147 public function __construct($element = null) 00148 { 00149 $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); 00150 parent::__construct($element); 00151 } 00152 00153 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00154 { 00155 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00156 if ($this->_gphotoId != null) { 00157 $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument)); 00158 } 00159 if ($this->_gphotoVersion != null) { 00160 $element->appendChild($this->_gphotoVersion->getDOM($element->ownerDocument)); 00161 } 00162 if ($this->_gphotoWidth != null) { 00163 $element->appendChild($this->_gphotoWidth->getDOM($element->ownerDocument)); 00164 } 00165 if ($this->_gphotoHeight != null) { 00166 $element->appendChild($this->_gphotoHeight->getDOM($element->ownerDocument)); 00167 } 00168 if ($this->_gphotoSize != null) { 00169 $element->appendChild($this->_gphotoSize->getDOM($element->ownerDocument)); 00170 } 00171 if ($this->_gphotoClient != null) { 00172 $element->appendChild($this->_gphotoClient->getDOM($element->ownerDocument)); 00173 } 00174 if ($this->_gphotoChecksum != null) { 00175 $element->appendChild($this->_gphotoChecksum->getDOM($element->ownerDocument)); 00176 } 00177 if ($this->_gphotoTimestamp != null) { 00178 $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument)); 00179 } 00180 if ($this->_gphotoCommentingEnabled != null) { 00181 $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument)); 00182 } 00183 if ($this->_gphotoCommentCount != null) { 00184 $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument)); 00185 } 00186 if ($this->_mediaGroup != null) { 00187 $element->appendChild($this->_mediaGroup->getDOM($element->ownerDocument)); 00188 } 00189 00190 return $element; 00191 } 00192 00193 protected function takeChildFromDOM($child) 00194 { 00195 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 00196 00197 switch ($absoluteNodeName) { 00198 case $this->lookupNamespace('gphoto') . ':' . 'id'; 00199 $id = new Zend_Gdata_Photos_Extension_Id(); 00200 $id->transferFromDOM($child); 00201 $this->_gphotoId = $id; 00202 break; 00203 case $this->lookupNamespace('gphoto') . ':' . 'version'; 00204 $version = new Zend_Gdata_Photos_Extension_Version(); 00205 $version->transferFromDOM($child); 00206 $this->_gphotoVersion = $version; 00207 break; 00208 case $this->lookupNamespace('gphoto') . ':' . 'albumid'; 00209 $albumid = new Zend_Gdata_Photos_Extension_AlbumId(); 00210 $albumid->transferFromDOM($child); 00211 $this->_gphotoAlbumId = $albumid; 00212 break; 00213 case $this->lookupNamespace('gphoto') . ':' . 'width'; 00214 $width = new Zend_Gdata_Photos_Extension_Width(); 00215 $width->transferFromDOM($child); 00216 $this->_gphotoWidth = $width; 00217 break; 00218 case $this->lookupNamespace('gphoto') . ':' . 'height'; 00219 $height = new Zend_Gdata_Photos_Extension_Height(); 00220 $height->transferFromDOM($child); 00221 $this->_gphotoHeight = $height; 00222 break; 00223 case $this->lookupNamespace('gphoto') . ':' . 'size'; 00224 $size = new Zend_Gdata_Photos_Extension_Size(); 00225 $size->transferFromDOM($child); 00226 $this->_gphotoSize = $size; 00227 break; 00228 case $this->lookupNamespace('gphoto') . ':' . 'client'; 00229 $client = new Zend_Gdata_Photos_Extension_Client(); 00230 $client->transferFromDOM($child); 00231 $this->_gphotoClient = $client; 00232 break; 00233 case $this->lookupNamespace('gphoto') . ':' . 'checksum'; 00234 $checksum = new Zend_Gdata_Photos_Extension_Checksum(); 00235 $checksum->transferFromDOM($child); 00236 $this->_gphotoChecksum = $checksum; 00237 break; 00238 case $this->lookupNamespace('gphoto') . ':' . 'timestamp'; 00239 $timestamp = new Zend_Gdata_Photos_Extension_Timestamp(); 00240 $timestamp->transferFromDOM($child); 00241 $this->_gphotoTimestamp = $timestamp; 00242 break; 00243 case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled'; 00244 $commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled(); 00245 $commentingEnabled->transferFromDOM($child); 00246 $this->_gphotoCommentingEnabled = $commentingEnabled; 00247 break; 00248 case $this->lookupNamespace('gphoto') . ':' . 'commentCount'; 00249 $commentCount = new Zend_Gdata_Photos_Extension_CommentCount(); 00250 $commentCount->transferFromDOM($child); 00251 $this->_gphotoCommentCount = $commentCount; 00252 break; 00253 case $this->lookupNamespace('media') . ':' . 'group'; 00254 $mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup(); 00255 $mediaGroup->transferFromDOM($child); 00256 $this->_mediaGroup = $mediaGroup; 00257 break; 00258 case $this->lookupNamespace('atom') . ':' . 'entry': 00259 $entryClassName = $this->_entryClassName; 00260 $tmpEntry = new Zend_Gdata_App_Entry($child); 00261 $categories = $tmpEntry->getCategory(); 00262 foreach ($categories as $category) { 00263 if ($category->scheme == Zend_Gdata_Photos::KIND_PATH && 00264 $this->_entryKindClassMapping[$category->term] != "") { 00265 $entryClassName = $this->_entryKindClassMapping[$category->term]; 00266 break; 00267 } else { 00268 require_once 'Zend/Gdata/App/Exception.php'; 00269 throw new Zend_Gdata_App_Exception('Entry is missing kind declaration.'); 00270 } 00271 } 00272 00273 $newEntry = new $entryClassName($child); 00274 $newEntry->setHttpClient($this->getHttpClient()); 00275 $this->_entry[] = $newEntry; 00276 break; 00277 default: 00278 parent::takeChildFromDOM($child); 00279 break; 00280 } 00281 } 00282 00289 public function getGphotoId() 00290 { 00291 return $this->_gphotoId; 00292 } 00293 00300 public function setGphotoId($value) 00301 { 00302 $this->_gphotoId = $value; 00303 return $this; 00304 } 00305 00312 public function getGphotoVersion() 00313 { 00314 return $this->_gphotoVersion; 00315 } 00316 00323 public function setGphotoVersion($value) 00324 { 00325 $this->_gphotoVersion = $value; 00326 return $this; 00327 } 00328 00335 public function getGphotoAlbumId() 00336 { 00337 return $this->_gphotoAlbumId; 00338 } 00339 00346 public function setGphotoAlbumId($value) 00347 { 00348 $this->_gphotoAlbumId = $value; 00349 return $this; 00350 } 00351 00358 public function getGphotoWidth() 00359 { 00360 return $this->_gphotoWidth; 00361 } 00362 00369 public function setGphotoWidth($value) 00370 { 00371 $this->_gphotoWidth = $value; 00372 return $this; 00373 } 00374 00381 public function getGphotoHeight() 00382 { 00383 return $this->_gphotoHeight; 00384 } 00385 00392 public function setGphotoHeight($value) 00393 { 00394 $this->_gphotoHeight = $value; 00395 return $this; 00396 } 00397 00404 public function getGphotoSize() 00405 { 00406 return $this->_gphotoSize; 00407 } 00408 00415 public function setGphotoSize($value) 00416 { 00417 $this->_gphotoSize = $value; 00418 return $this; 00419 } 00420 00427 public function getGphotoClient() 00428 { 00429 return $this->_gphotoClient; 00430 } 00431 00438 public function setGphotoClient($value) 00439 { 00440 $this->_gphotoClient = $value; 00441 return $this; 00442 } 00443 00450 public function getGphotoChecksum() 00451 { 00452 return $this->_gphotoChecksum; 00453 } 00454 00461 public function setGphotoChecksum($value) 00462 { 00463 $this->_gphotoChecksum = $value; 00464 return $this; 00465 } 00466 00473 public function getGphotoTimestamp() 00474 { 00475 return $this->_gphotoTimestamp; 00476 } 00477 00484 public function setGphotoTimestamp($value) 00485 { 00486 $this->_gphotoTimestamp = $value; 00487 return $this; 00488 } 00489 00496 public function getGphotoCommentCount() 00497 { 00498 return $this->_gphotoCommentCount; 00499 } 00500 00507 public function setGphotoCommentCount($value) 00508 { 00509 $this->_gphotoCommentCount = $value; 00510 return $this; 00511 } 00512 00519 public function getGphotoCommentingEnabled() 00520 { 00521 return $this->_gphotoCommentingEnabled; 00522 } 00523 00530 public function setGphotoCommentingEnabled($value) 00531 { 00532 $this->_gphotoCommentingEnabled = $value; 00533 return $this; 00534 } 00535 00542 public function getMediaGroup() 00543 { 00544 return $this->_mediaGroup; 00545 } 00546 00553 public function setMediaGroup($value) 00554 { 00555 $this->_mediaGroup = $value; 00556 return $this; 00557 } 00558 00559 }