|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Extension.php'; 00028 00038 class Zend_Gdata_Calendar_Extension_WebContent extends Zend_Gdata_App_Extension 00039 { 00040 00041 protected $_rootNamespace = 'gCal'; 00042 protected $_rootElement = 'webContent'; 00043 protected $_url = null; 00044 protected $_height = null; 00045 protected $_width = null; 00046 00053 public function __construct($url = null, $height = null, $width = null) 00054 { 00055 $this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces); 00056 parent::__construct(); 00057 $this->_url = $url; 00058 $this->_height = $height; 00059 $this->_width = $width; 00060 } 00061 00072 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00073 { 00074 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00075 if ($this->url != null) { 00076 $element->setAttribute('url', $this->_url); 00077 } 00078 if ($this->height != null) { 00079 $element->setAttribute('height', $this->_height); 00080 } 00081 if ($this->width != null) { 00082 $element->setAttribute('width', $this->_width); 00083 } 00084 return $element; 00085 } 00086 00094 protected function takeAttributeFromDOM($attribute) 00095 { 00096 switch ($attribute->localName) { 00097 case 'url': 00098 $this->_url = $attribute->nodeValue; 00099 break; 00100 case 'height': 00101 $this->_height = $attribute->nodeValue; 00102 break; 00103 case 'width': 00104 $this->_width = $attribute->nodeValue; 00105 break; 00106 default: 00107 parent::takeAttributeFromDOM($attribute); 00108 } 00109 } 00110 00116 public function getURL() 00117 { 00118 return $this->_url; 00119 } 00120 00127 public function setURL($value) 00128 { 00129 $this->_url = $value; 00130 return $this; 00131 } 00132 00138 public function getHeight() 00139 { 00140 return $this->_height; 00141 } 00142 00149 public function setHeight($value) 00150 { 00151 $this->_height = $value; 00152 return $this; 00153 } 00154 00160 public function getWidth() 00161 { 00162 return $this->_width; 00163 } 00164 00171 public function setWidth($value) 00172 { 00173 $this->_width = $value; 00174 return $this; 00175 } 00176 00177 }