|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/App/Extension.php'; 00028 00032 require_once 'Zend/Gdata/App/Extension/Draft.php'; 00033 00043 class Zend_Gdata_App_Extension_Control extends Zend_Gdata_App_Extension 00044 { 00045 00046 protected $_rootNamespace = 'app'; 00047 protected $_rootElement = 'control'; 00048 protected $_draft = null; 00049 00050 public function __construct($draft = null) 00051 { 00052 parent::__construct(); 00053 $this->_draft = $draft; 00054 } 00055 00056 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00057 { 00058 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00059 if ($this->_draft != null) { 00060 $element->appendChild($this->_draft->getDOM($element->ownerDocument)); 00061 } 00062 return $element; 00063 } 00064 00065 protected function takeChildFromDOM($child) 00066 { 00067 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 00068 switch ($absoluteNodeName) { 00069 case $this->lookupNamespace('app') . ':' . 'draft': 00070 $draft = new Zend_Gdata_App_Extension_Draft(); 00071 $draft->transferFromDOM($child); 00072 $this->_draft = $draft; 00073 break; 00074 default: 00075 parent::takeChildFromDOM($child); 00076 break; 00077 } 00078 } 00079 00083 public function getDraft() 00084 { 00085 return $this->_draft; 00086 } 00087 00092 public function setDraft($value) 00093 { 00094 $this->_draft = $value; 00095 return $this; 00096 } 00097 00098 }