00001 <?php 00026 require_once "UiWidget.php"; 00027 00037 abstract class ZendX_JQuery_View_Helper_UiWidgetPane extends ZendX_JQuery_View_Helper_UiWidget 00038 { 00044 protected $_captureLock = array(); 00045 00051 protected $_captureInfo = array(); 00052 00061 public function captureStart($id, $name, array $options=array()) 00062 { 00063 if (array_key_exists($id, $this->_captureLock)) { 00064 require_once 'ZendX/JQuery/View/Exception.php'; 00065 throw new ZendX_JQuery_View_Exception(sprintf('Lock already exists for id "%s"', $id)); 00066 } 00067 00068 $this->_captureLock[$id] = true; 00069 $this->_captureInfo[$id] = array( 00070 'name' => $name, 00071 'options' => $options, 00072 ); 00073 00074 return ob_start(); 00075 } 00076 00083 public function captureEnd($id) 00084 { 00085 if (!array_key_exists($id, $this->_captureLock)) { 00086 require_once 'ZendX/JQuery/View/Exception.php'; 00087 throw new ZendX_JQuery_View_Exception(sprintf('No capture lock exists for id "%s"; nothing to capture', $id)); 00088 } 00089 00090 $content = ob_get_clean(); 00091 extract($this->_captureInfo[$id]); 00092 unset($this->_captureLock[$id], $this->_captureInfo[$id]); 00093 return $this->_addPane($id, $name, $content, $options); 00094 } 00095 00104 abstract protected function _addPane($id, $name, $content, array $options=array()); 00105 }